|
@@ -34,31 +34,31 @@
|
|
|
</a-col>
|
|
|
<!--试验类型-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-type')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-type')" required>
|
|
|
<a-select v-model="editParam.testType" :options="testTypeList" :filter-option="handleFilterDataList" allowClear :placeholder="$t('plan.dvp.please_select-test-type')"></a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--试验来源-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-source')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-source')" required>
|
|
|
<a-select v-model="editParam.testSource" :options="testSourceList" :filter-option="handleFilterDataList" allowClear :placeholder="$t('global-btn.please-select') + $t('plan.dvp.test-source')"></a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--试验项目-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-project')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-project')" required>
|
|
|
<a-input v-model.trim="editParam.testProject" :maxLength='128' allowClear :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-project')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--开发目标要求-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('base.info.development-objective-requirements')">
|
|
|
+ <a-form-item :label="$t('base.info.development-objective-requirements')" required>
|
|
|
<a-input v-model.trim="editParam.targetRequire" :maxLength='500' allowClear :placeholder="$t('global-btn.please-enter') + $t('base.info.development-objective-requirements')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--试验标准-->
|
|
|
- <a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('base.info.Test-standards')">
|
|
|
+ <a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24" >
|
|
|
+ <a-form-item :label="$t('base.info.Test-standards')" required>
|
|
|
<a-input v-model.trim="editParam.testStandard" :maxLength='50' allowClear :placeholder="$t('global-btn.please-enter') + $t('base.info.Test-standards')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -78,64 +78,64 @@
|
|
|
<span v-if="editParam.isEquivalent === 0">
|
|
|
<!--测试地点-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-site')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-site')" required>
|
|
|
<a-input v-model.trim="editParam.testSite" :maxLength='50' allowClear :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-site')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--测试负责人-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-user')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-user')" required>
|
|
|
<a-select v-model="editParam.testOwner" :options="testOwnerList" :filter-option="handleFilterDataList" allowClear :placeholder="$t('global-btn.please-select') + $t('plan.dvp.test-user')"></a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--测试阶段-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-step')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-step')" required>
|
|
|
<a-input v-model.trim="editParam.testStep" :maxLength='50' allowClear :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-step')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--测试次数-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.test-count')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.test-count')" required>
|
|
|
<a-input-number v-model.number="editParam.testFrequency" :defaultValue="0" :min="1" :max="999" :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.test-count')" style="width: 100%"></a-input-number>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--样本数量-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.number-of-samples')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.number-of-samples')" required>
|
|
|
<a-input-number v-model.number="editParam.sampleNumber" :defaultValue="0" :min="1" :max="999" :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.number-of-samples')" style="width: 100%"></a-input-number>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--样件类型-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.sample-type')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.sample-type')" required>
|
|
|
<a-input v-model.trim="editParam.sampleType" :maxLength='50' allowClear :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.sample-type')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--计划开始时间-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.scheduled-start-time')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.scheduled-start-time')" required>
|
|
|
<a-date-picker v-model="editParam.planStartTime" :disabled-date="disabledStartDate" @change="handleEditStartTime" allowClear valueFormat="YYYY/MM/DD" style="width: 100%" :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.scheduled-start-time')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!--计划结束时间-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.scheduled-end-time')">
|
|
|
- <a-date-picker v-model="editParam.planEndTime" :disabled-date="disabledEndDate" @change="handleEditEndTime" allowClear valueFormat="YYYY/MM/DD" style="width: 100%" :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.scheduled-end-time')"/>
|
|
|
+ <a-form-item :label="$t('plan.dvp.scheduled-end-time')" required>
|
|
|
+ <a-date-picker v-model="editParam.planEndTime" :disabled-date="disabledEndDate" @change="handleEditEndTime" allowClear valueFormat="YYYY/MM/DD" style="width: 100%" :placeholder="$t('global-btn.please-select') + $t('plan.dvp.scheduled-end-time')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</span>
|
|
|
<span v-else>
|
|
|
<!--等效实验报告编号-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.equivalent-experiment-report-number')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.equivalent-experiment-report-number')" required>
|
|
|
<a-select v-model="editParam.equivalentId" :options="equivalentList" :filter-option="handleFilterDataList" allowClear :placeholder="$t('global-btn.please-select') + $t('plan.dvp.equivalent-experiment-report-number')"></a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</span>
|
|
|
<!--材料清单编号-->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
- <a-form-item :label="$t('plan.dvp.material-number')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.material-number')" required>
|
|
|
<a-input v-model.trim="editParam.materialInventoryCode" :maxLength='50' allowClear :placeholder="$t('global-btn.please-enter') + $t('plan.dvp.material-number')"/>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -150,7 +150,7 @@
|
|
|
<!--上传材料清单 -->
|
|
|
<a-col :lg="16" :md="24" :sm="24" :xl="12" :xs="24">
|
|
|
<a-row>
|
|
|
- <a-form-item :label="$t('plan.dvp.upload-material-list')">
|
|
|
+ <a-form-item :label="$t('plan.dvp.upload-material-list')" required>
|
|
|
<a-upload-dragger
|
|
|
name="file"
|
|
|
:multiple="false"
|
|
@@ -339,10 +339,99 @@ export default {
|
|
|
|
|
|
},
|
|
|
|
|
|
+ /**
|
|
|
+ * 非空校验 判断是否为空
|
|
|
+ * @returns {boolean}
|
|
|
+ */
|
|
|
+ isNull() {
|
|
|
+ let _that = this;
|
|
|
+ let message = [];
|
|
|
+ // 试验类型
|
|
|
+ if (!_that.editParam.testType) {
|
|
|
+ message.push(_that.$t('plan.dvp.please_select-test-type'));
|
|
|
+ }
|
|
|
+ // 试验来源
|
|
|
+ if (!_that.editParam.testSource) {
|
|
|
+ message.push(_that.$t('global-btn.please-select') + _that.$t('plan.dvp.test-source'));
|
|
|
+ }
|
|
|
+ // 试验项目
|
|
|
+ if (!_that.editParam.testProject) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.test-project'));
|
|
|
+ }
|
|
|
+ // 开发目标要求
|
|
|
+ if (!_that.editParam.targetRequire) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('base.info.development-objective-requirements'));
|
|
|
+ }
|
|
|
+ // 试验标准
|
|
|
+ if (!_that.editParam.testStandard) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('base.info.Test-standards'));
|
|
|
+ }
|
|
|
+ // 非等效试验时校验以下数据
|
|
|
+ if (_that.editParam.isEquivalent === 0) {
|
|
|
+ // 测试地点
|
|
|
+ if (!_that.editParam.testSite) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.test-site'));
|
|
|
+ }
|
|
|
+ // 测试负责人
|
|
|
+ if (!_that.editParam.testOwner) {
|
|
|
+ message.push(_that.$t('global-btn.please-select') + _that.$t('plan.dvp.test-user'));
|
|
|
+ }
|
|
|
+ // 测试阶段
|
|
|
+ if (!_that.editParam.testStep) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.test-step'));
|
|
|
+ }
|
|
|
+ // 测试次数
|
|
|
+ if (!_that.editParam.testFrequency) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.test-count'));
|
|
|
+ }
|
|
|
+ // 样本数量
|
|
|
+ if (!_that.editParam.sampleNumber) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.number-of-samples'));
|
|
|
+ }
|
|
|
+ // 样件类型
|
|
|
+ if (!_that.editParam.sampleType) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.sample-type'));
|
|
|
+ }
|
|
|
+ // 计划开始时间
|
|
|
+ if (!_that.editParam.planStartTime) {
|
|
|
+ message.push(_that.$t('global-btn.please-select') + _that.$t('plan.dvp.scheduled-start-time'));
|
|
|
+ }
|
|
|
+ // 计划结束时间
|
|
|
+ if (!_that.editParam.planEndTime) {
|
|
|
+ message.push(_that.$t('global-btn.please-select') + _that.$t('plan.dvp.scheduled-end-time'));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 等效实现时校验
|
|
|
+ // 等效试验报告编号
|
|
|
+ if (!_that.editParam.equivalentId) {
|
|
|
+ message.push(_that.$t('global-btn.please-select') + _that.$t('plan.dvp.equivalent-experiment-report-number'));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 材料清单编号
|
|
|
+ if (!_that.editParam.materialInventoryCode) {
|
|
|
+ message.push(_that.$t('global-btn.please-enter') + _that.$t('plan.dvp.material-number'));
|
|
|
+ }
|
|
|
+ // 材料清单附件
|
|
|
+ if (_that.fileList.length == 0) {
|
|
|
+ message.push(_that.$t('global-message.warn..message.warn.select-file'));
|
|
|
+ }
|
|
|
+ if (message && message.length > 0) {
|
|
|
+ for (let i = 0; i < message.length; i++) {
|
|
|
+ _that.$notification.warning({message: message[i]});
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ },
|
|
|
+
|
|
|
/**
|
|
|
* 确认按钮
|
|
|
*/
|
|
|
save() {
|
|
|
+ // 非空校验
|
|
|
+ if (!this.isNull()) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
let data = {
|
|
|
dvpId: this.$store.getters.dvpId,
|
|
|
testId: this.editParam.testId,
|