From 4f0cb97a09ee88f106c4b8b0875ae611bae4b9a2 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期五, 01 三月 2024 16:02:42 +0800 Subject: [PATCH] 开启支持清除功能 --- src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue | 129 +++++++++++++++++++++++++++++++++---------- 1 files changed, 99 insertions(+), 30 deletions(-) diff --git a/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue b/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue index bacf158..5e9f9f4 100644 --- a/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue +++ b/src/views/eam/modules/dailyMaintenanceOrder/DailyMaintenanceOrderExeDrawer.vue @@ -107,9 +107,9 @@ </a-col> </a-row> <a-row :gutter="24"> - <a-col :span="24"> + <a-col :span="17"> <a-form-item - label="闂鍙婂鐞嗘帾鏂芥弿杩�" + label="闂/澶勭悊鎺柦" :labelCol="{span:3}" :wrapperCol="{span:18}" class="hightColor" @@ -119,6 +119,21 @@ :disabled="this.model.status!='4'" :placeholder="'璇疯緭鍏ラ棶棰樺強澶勭悊鎺柦鎻忚堪'" v-model="model.description" + /> + </a-form-item> + </a-col> + <a-col :span="7"> + <a-form-item + label="鎶ュ伐浜�" + :labelCol="{span:4}" + :wrapperCol="{span:17}" + class="hightColor" + > + <a-input + :disabled="this.model.status!='4'" + allow-clear + placeholder="璇疯緭鍏ユ姤宸ヤ汉" + v-model="model.maintenanceUserId" /> </a-form-item> </a-col> @@ -197,12 +212,22 @@ v-if="col.dataIndex == 'maintenanceOrderDetailUda1'" @change="(e)=>handleChange(e, record.key, col, index)" placeholder="璇疯緭鍏ヤ繚鍏讳汉" + :disabled="record.disabled" /> - <a-input + <!-- <a-input :value="text" v-if="col.dataIndex == 'maintenanceOrderDetailUda2'" @change="(e)=>handleChange(e, record.key, col, index)" placeholder="璇疯緭鍏ユ墽琛屾儏鍐�" + /> --> + <a-textarea + :value="text" + v-if="col.dataIndex == 'maintenanceOrderDetailUda2'" + :maxLength="500" + auto-size + placeholder="璇疯緭鍏ユ墽琛屾儏鍐�" + @change="(e)=>handleChange(e, record.key, col, index)" + :disabled="record.disabled" /> </div> </template> @@ -228,7 +253,7 @@ </div> </a-tab-pane> - <a-tab-pane + <!-- <a-tab-pane tab='璁″垝鐢ㄦ枡' key="2" > @@ -275,7 +300,7 @@ :equipmentId="this.model.equipmentId" ></actual-material-edit-table> </div> - </a-tab-pane> + </a-tab-pane>--> <a-tab-pane tab='瀹為檯宸ユ椂' key="6" @@ -376,6 +401,18 @@ xs: { span: 24 }, sm: { span: 18 }, }, + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 99, + pageSizeOptions: ['99'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, validatorRules: { // description: { // rules: [ @@ -395,29 +432,29 @@ } }, - { - title: '閮ㄤ綅', - align: 'center', - dataIndex: 'location', - }, + // { + // title: '閮ㄤ綅', + // align: 'center', + // dataIndex: 'location', + // }, + // class: "notshow" + // { + // title: '绀烘剰鍥�', + // align: 'center', + // dataIndex: 'photo', + // scopedSlots: { customRender: 'photo' }, + // }, // class: "notshow" { - title: '绀烘剰鍥�', - align: 'center', - dataIndex: 'photo', - scopedSlots: { customRender: 'photo' }, - }, - // class: "notshow" - { - title: '淇濆吇椤圭洰', + title: '淇濆吇鍐呭', align: 'center', dataIndex: 'maintenanceProjectNum', }, - { - title: '淇濆吇鏍囧噯', - align: 'center', - dataIndex: 'standard', - }, + // { + // title: '淇濆吇鏍囧噯', + // align: 'center', + // dataIndex: 'standard', + // }, // { // title: '鏂规硶', // align: 'center', @@ -510,11 +547,11 @@ // } //update-begin---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ this.dataSource = res.result.records || res.result; - if (res.result.total) { - this.ipagination.total = res.result.total; - } else { - this.ipagination.total = 0; - } + // if (res.result.total) { + // this.ipagination.total = res.result.total; + // } else { + // this.ipagination.total = 0; + // } //update-end---author:zhangyafei Date:20201118 for锛氶�傞厤涓嶅垎椤电殑鏁版嵁鍒楄〃------------ } else { this.$message.warning(res.message) @@ -562,6 +599,7 @@ that.buttonDistable = false that.revocationDistable = true that.SWbuttonDistable = true + that.loadData1(1) } else { that.$message.warning("宸ュ崟寮�宸ュけ璐ワ紒") } @@ -576,13 +614,31 @@ handleReport() { const that = this; that.confirmLoading = true; + for (let i = 0; i < that.dataSource.length; i++) { + let o = this.dataSource[i] + if (o.maintenanceOrderDetailUda2 == null || o.maintenanceOrderDetailUda2 == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "鎵ц鎯呭喌锛�"); + that.confirmLoading = false; + return + } + if (o.maintenanceOrderDetailUda1 == null || o.maintenanceOrderDetailUda1 == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "淇濆吇浜猴紒"); + that.confirmLoading = false; + return + } + } + if (that.model.maintenanceUserId == null || that.model.maintenanceUserId == "") { + that.$message.warning("璇峰~鍐欐姤宸ヤ汉锛�"); + that.confirmLoading = false; + return + } this.$confirm({ title: '淇濆吇宸ュ崟鎶ュ伐', content: '鎻愮ず锛氭姤宸ュ悗淇濆吇瀹屽伐锛岃璋ㄦ厧鎿嶄綔锛�', okText: '纭', cancelText: '鍙栨秷', onOk() { - requestPut(that.url.report, { id: that.model.id, status: '5', description: that.model.description }).then((res) => { + requestPut(that.url.report, { id: that.model.id, status: '5', description: that.model.description, dailyMaintenanceOrderDetails: that.dataSource, maintenanceUserId: that.model.maintenanceUserId }).then((res) => { if (res.success) { that.model.status = '5' that.$message.success(res.message) @@ -619,6 +675,7 @@ that.buttonDistable = false that.revocationDistable = true that.SWbuttonDistable = true + that.loadData1(1) } else { that.$message.warning(res.message) } @@ -633,6 +690,19 @@ handleOk() { const that = this this.loading = true; + for (let i = 0; i < that.dataSource.length; i++) { + let o = this.dataSource[i] + if (o.maintenanceOrderDetailUda2 == null || o.maintenanceOrderDetailUda2 == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "鎵ц鎯呭喌锛�"); + that.loading = false; + return + } + if (o.maintenanceOrderDetailUda1 == null || o.maintenanceOrderDetailUda1 == '') { + that.$message.warning("璇峰~鍐欑" + (i + 1) + "淇濆吇浜猴紒"); + that.loading = false; + return + } + } this.form.validateFields((err, values) => { if (!err) { that.confirmLoading = true @@ -657,7 +727,6 @@ handleChange(value, key, column, index) { - debugger let that = this; const temp = [...that.dataSource]; const target = temp[index]; -- Gitblit v1.9.3