From 5cbba170e270e6f1c99a91e27dbb7951a27d596a Mon Sep 17 00:00:00 2001 From: “linengliang” <vanSuperEnergy@163.com> Date: 星期五, 24 十一月 2023 16:41:32 +0800 Subject: [PATCH] 故障报修验收 --- src/views/eam/modules/inspectionProject/InspectionProjectModel.vue | 302 ++++++++++++++++++++++++++------------------------ 1 files changed, 156 insertions(+), 146 deletions(-) diff --git a/src/views/eam/modules/inspectionProject/InspectionProjectModel.vue b/src/views/eam/modules/inspectionProject/InspectionProjectModel.vue index b397106..196cf8c 100644 --- a/src/views/eam/modules/inspectionProject/InspectionProjectModel.vue +++ b/src/views/eam/modules/inspectionProject/InspectionProjectModel.vue @@ -29,7 +29,7 @@ /> </a-form-item> </a-col> - </a-row> + <!-- </a-row> <a-row :gutter="24"> <a-col :span="12"> <a-form-item @@ -39,12 +39,12 @@ > <a-input allow-clear - :disabled="codeDisable" + :disabled="disableSubmit" :placeholder="disableSubmit?'':'璇疯緭鍏ョ偣妫�椤圭洰缂栧彿'" v-decorator="['num', validatorRules.num ]" /> </a-form-item> - </a-col> + </a-col> --> <a-col :span="12"> <a-form-item label="鐐规椤圭洰鍚嶇О" @@ -61,23 +61,8 @@ </a-col> </a-row> <a-row :gutter="24"> - <a-col :span="12"> - <a-form-item - label="璁¢噺鍗曚綅" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <j-dict-select-tag - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇烽�夋嫨璁¢噺鍗曚綅'" - :triggerChange="true" - dictCode="mom_base_unit,name,id,status!='0' and del_flag!='1'" - v-decorator="['unitId', validatorRules.unitId]" - /> - </a-form-item> - </a-col> - <a-col :span="12"> + + <!-- <a-col :span="12"> <a-form-item label="妫�楠屽�肩被鍨�" :labelCol="labelCol" @@ -91,6 +76,21 @@ dictCode="test_value_type" v-decorator="['testValueType', validatorRules.testValueType]" @change="(e)=>handleChange(e)" + /> + </a-form-item> + </a-col> --> + <a-col :span="12"> + <!-- v-if="testValueType == '2'" --> + <a-form-item + label="妫�娴嬫爣鍑�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="disableSubmit" + :placeholder="disableSubmit?'':'璇疯緭鍏ユ娴嬫爣鍑�'" + v-decorator="['detectionStandard', validatorRules.detectionStandard ]" /> </a-form-item> </a-col> @@ -113,24 +113,8 @@ /> </a-form-item> </a-col> --> - <a-col - v-if="testValueType == '2'" - :span="12" - > - <a-form-item - label="寰呭畾" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - > - <a-input - allow-clear - :disabled="disableSubmit" - :placeholder="disableSubmit?'':'璇疯緭鍏ュ緟瀹氬��'" - v-decorator="['surfaceValue1', validatorRules.surfaceValue1 ]" - /> - </a-form-item> - </a-col> - <a-col + + <!-- <a-col v-if="testValueType == '1'" :span="12" > @@ -147,9 +131,9 @@ v-decorator="['surfaceValue', validatorRules.surfaceValue ]" /> </a-form-item> - </a-col> + </a-col> --> </a-row> - <a-row + <!-- <a-row v-if="testValueType == '1'" :gutter="24" > @@ -183,8 +167,8 @@ /> </a-form-item> </a-col> - </a-row> - <a-row :gutter="24"> + </a-row> --> + <!-- <a-row :gutter="24"> <a-col :span="12"> <a-form-item label="鐐规鏂规硶" @@ -203,6 +187,22 @@ </a-col> <a-col :span="12"> <a-form-item + label="璁¢噺鍗曚綅" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <j-dict-select-tag + allow-clear + :disabled="disableSubmit" + :placeholder="disableSubmit?'':'璇烽�夋嫨璁¢噺鍗曚綅'" + :triggerChange="true" + dictCode="mom_base_unit,name,id,status!='0' and del_flag!='1'" + v-decorator="['unitId', validatorRules.unitId]" + /> + </a-form-item> + </a-col> --> + <!-- <a-col :span="12"> + <a-form-item label="鐐规宸ュ叿" :labelCol="labelCol" :wrapperCol="wrapperCol" @@ -214,8 +214,8 @@ v-decorator="['inspectionTool', validatorRules.inspectionTool ]" /> </a-form-item> - </a-col> - </a-row> + </a-col> --> + <!-- </a-row> --> <a-row :gutter="24"> <a-col :span="24"> @@ -244,13 +244,13 @@ > 鍏抽棴 </a-button> - <a-button + <!-- <a-button v-if="!this.model.id" :disabled="disableSubmit || confirmLoading" :loading="confirmLoading" @click="handleOkAndAdd" type="primary" - >淇濆瓨骞剁户缁柊澧�</a-button> + >淇濆瓨骞剁户缁柊澧�</a-button> --> <a-button :disabled="disableSubmit || confirmLoading" :loading="confirmLoading" @@ -309,6 +309,12 @@ // { required: true, message: '璇烽�夋嫨鍒嗘瀽鏂规硶!' }, // ] // }, + detectionStandard: { + rules: [ + { required: true, message: '璇疯緭鍏ユ娴嬫爣鍑�!' }, + // { validator: this.validateSurfaceValue }, + ] + }, surfaceValue: { rules: [ { required: true, message: '璇疯緭鍏ュ悕涔夊��!' }, @@ -353,20 +359,24 @@ this.model = Object.assign({}, record); this.visible = true; this.disableSubmit = false; - this.testValueType = record.testValueType + // this.testValueType = record.testValueType this.$nextTick(() => { this.form.setFieldsValue(pick(this.model, 'inspectionProjectCategoryNumName', - 'num', 'name', 'unitId', 'testValueType', 'inspectionMethod', 'inspectionTool', 'remark')) + 'name', 'detectionStandard', 'remark')) }); - if (record.testValueType == '1') { - this.$nextTick(() => { - this.form.setFieldsValue(pick(this.model, 'surfaceValue', 'upValue', 'downValue')) - }); - } + // if (record.testValueType == '1') { + // this.$nextTick(() => { + // this.form.setFieldsValue(pick(this.model, 'surfaceValue', 'upValue', 'downValue')) + // }); + // } if (record.id) { this.codeDisable = true; } else { this.codeDisable = false; + // this.$nextTick(() => { + // this.form.setFieldsValue({ "testValueType": '2' }) + // this.testValueType = '2' + // }); } }, @@ -378,32 +388,32 @@ //淇濆瓨骞舵柊澧炴寜閽Е鍙� - handleOkAndAdd() { - const that = this - // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.form.validateFields((err, values) => { - if (!err) { - that.confirmLoading = true; - let formData = Object.assign(this.model, values); - formData.inspectionProjectCategoryId = this.inspectionProjectCategoryId - postAction(this.url.add, formData).then((res) => { - if (res.success) { - that.$message.success(res.message); - that.$emit('ok'); - that.alterFlag = new Date(); - } else { - that.$message.warning(res.message); - } - }).finally(() => { - this.confirmLoading = false - this.form.setFieldsValue(pick(this.model, 'inspectionProjectCategoryNumName')) - this.form.setFieldsValue({ "inspectionContent": null, "inspectionRequire": null, "inspectionMethod": null, "inspectionTool": null, "num": null, "name": null, "remark": null }) - }) - } else { - return false - } - }) - }, + // handleOkAndAdd() { + // const that = this + // // 瑙﹀彂琛ㄥ崟楠岃瘉 + // this.form.validateFields((err, values) => { + // if (!err) { + // that.confirmLoading = true; + // let formData = Object.assign(this.model, values); + // formData.inspectionProjectCategoryId = this.inspectionProjectCategoryId + // postAction(this.url.add, formData).then((res) => { + // if (res.success) { + // that.$message.success(res.message); + // that.$emit('ok'); + // that.alterFlag = new Date(); + // } else { + // that.$message.warning(res.message); + // } + // }).finally(() => { + // this.confirmLoading = false + // this.form.setFieldsValue(pick(this.model, 'inspectionProjectCategoryNumName')) + // this.form.setFieldsValue({ "inspectionContent": null, "inspectionRequire": null, "inspectionMethod": null, "inspectionTool": null, "num": null, "name": null, "remark": null }) + // }) + // } else { + // return false + // } + // }) + // }, handleOk() { const that = this; @@ -439,79 +449,79 @@ this.close() }, - handleChange(val) { - this.testValueType = val - }, + // handleChange(val) { + // this.testValueType = val + // }, - validateDownValue(rule, value, callback) { - let data = this.form.getFieldsValue(['surfaceValue']); - if (data.surfaceValue == null || data.surfaceValue == "") { - callback('鍚嶄箟鍊间笉鑳戒负绌猴紒') - } else { - if (value > data.surfaceValue) { - callback('涓嬪亸宸�间笉鑳藉ぇ浜庡悕涔夊�硷紒') - } else { - callback() - } - } - }, + // validateDownValue(rule, value, callback) { + // let data = this.form.getFieldsValue(['surfaceValue']); + // if (data.surfaceValue == null || data.surfaceValue == "") { + // callback('鍚嶄箟鍊间笉鑳戒负绌猴紒') + // } else { + // if (value > data.surfaceValue) { + // callback('涓嬪亸宸�间笉鑳藉ぇ浜庡悕涔夊�硷紒') + // } else { + // callback() + // } + // } + // }, - validateSurfaceValue(rule, value, callback) { - this.form.setFieldsValue({ "upValue": null, "downValue": null }) - // let data = this.form.getFieldsValue(['surfaceValue']); - // if (value > data.surfaceValue) { - // callback('涓嶅悎鏍兼暟閲忓簲灏忎簬妫�楠屾暟閲忥紒') - // } else { - // callback() - // } - }, + // validateSurfaceValue(rule, value, callback) { + // this.form.setFieldsValue({ "upValue": null, "downValue": null }) + // // let data = this.form.getFieldsValue(['surfaceValue']); + // // if (value > data.surfaceValue) { + // // callback('涓嶅悎鏍兼暟閲忓簲灏忎簬妫�楠屾暟閲忥紒') + // // } else { + // // callback() + // // } + // }, - validateAnalysisMethod(rule, value, callback) { - let data = this.form.getFieldsValue(['surfaceValue']); - if (value > data.surfaceValue) { - callback('涓嶅悎鏍兼暟閲忓簲灏忎簬妫�楠屾暟閲忥紒') - } else { - callback() - } - }, + // validateAnalysisMethod(rule, value, callback) { + // let data = this.form.getFieldsValue(['surfaceValue']); + // if (value > data.surfaceValue) { + // callback('涓嶅悎鏍兼暟閲忓簲灏忎簬妫�楠屾暟閲忥紒') + // } else { + // callback() + // } + // }, //楠岃瘉 缂栧彿 - validateNum(rule, value, callback) { - var params = { - tableName: 'mom_eam_inspection_project', - fieldName: 'num', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - duplicateCheck(params).then((res) => { - if (res.success) { - callback(); - } else { - callback("缂栧彿宸插瓨鍦�!"); - } - }) - }, + // validateNum(rule, value, callback) { + // var params = { + // tableName: 'mom_eam_inspection_project', + // fieldName: 'num', + // fieldVal: value, + // dataId: this.model.id, + // //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + // delFlag: '0', + // }; + // duplicateCheck(params).then((res) => { + // if (res.success) { + // callback(); + // } else { + // callback("缂栧彿宸插瓨鍦�!"); + // } + // }) + // }, - //楠岃瘉 鍚嶇О - validateName(rule, value, callback) { - var params = { - tableName: 'mom_eam_inspection_project', - fieldName: 'name', - fieldVal: value, - dataId: this.model.id, - //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true - delFlag: '0', - }; - duplicateCheck(params).then((res) => { - if (res.success) { - callback(); - } else { - callback("鍚嶇О宸插瓨鍦�!"); - } - }) - }, + // //楠岃瘉 鍚嶇О + // validateName(rule, value, callback) { + // var params = { + // tableName: 'mom_eam_inspection_project', + // fieldName: 'name', + // fieldVal: value, + // dataId: this.model.id, + // //鏁版嵁搴撲腑瀛樺湪瀛楁del_flag骞朵娇鐢ㄨ瀛楁浣滀负鏈垹闄ょ瓥鐣ワ紝鐪熷垹闄わ細false 鍋囧垹闄わ細true + // delFlag: '0', + // }; + // duplicateCheck(params).then((res) => { + // if (res.success) { + // callback(); + // } else { + // callback("鍚嶇О宸插瓨鍦�!"); + // } + // }) + // }, }, watch: { -- Gitblit v1.9.3