| | |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24" v-if="selectedCount > 1" style="margin-bottom: 10px;"> |
| | | <a-col :span="24"> |
| | | <a-button type="primary" @click="batchSetNormal">批量点检正常</a-button> |
| | | </a-col> |
| | | </a-row> |
| | | <a-row :gutter="24"> |
| | | <vxe-table |
| | | ref="table" |
| | |
| | | :data="dataSource" |
| | | :edit-config="{trigger: 'click', mode: 'cell'}" |
| | | :edit-rules="editRules" |
| | | :checkbox-config="{trigger: 'cell', highlight: true}" |
| | | @checkbox-change="onSelectChange" |
| | | @checkbox-all="onSelectChange" |
| | | > |
| | | <vxe-table-column type="checkbox" width="40"></vxe-table-column> |
| | | <vxe-table-column title="序号" field="itemCode" width="50" align="center"></vxe-table-column> |
| | | <vxe-table-column title="部位" field="itemPart" align="center"></vxe-table-column> |
| | | <vxe-table-column title="保养项目" field="itemName" align="center"></vxe-table-column> |
| | |
| | | updateOrderInspectionStatus: '/mes/mesProductionWorkOrder/edit' |
| | | }, |
| | | inspectionEquipmentOptions: [], |
| | | workOrderId: null |
| | | workOrderId: null, |
| | | selectedCount: 0 |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | handleEquipmentChange(id) { |
| | | getAction(this.url.queryByEquipmentId, {equipmentId: id}).then(res => { |
| | | if (res.success) { |
| | | console.log(res.result) |
| | | this.model = { |
| | | ...this.model, |
| | | standardId: res.result.id, |
| | |
| | | } |
| | | }) |
| | | }, |
| | | onSelectChange({records}) { |
| | | this.selectedCount = records.length; |
| | | }, |
| | | batchSetNormal() { |
| | | const selectRecords = this.$refs.table.getCheckboxRecords(); |
| | | selectRecords.forEach(record => { |
| | | record.inspectionResult = '1' |
| | | record.exceptionDescription = '' |
| | | }); |
| | | this.$refs.table.syncData() |
| | | }, |
| | | handleOk () { |
| | | this.$refs.table.validate((valid) => { |
| | | if (valid) { |
| | | this.$message.error("请完成所有必填信息后再提交!") |
| | | } else { |
| | | let tableData = this.$refs.table.getTableData().fullData |
| | | if (!tableData || tableData.length === 0) { |
| | | this.$message.error("点检项为空,无法提交!") |
| | | return |
| | | } |
| | | const data = { |
| | | ...this.model, |
| | | workOrderId: this.workOrderId, |
| | |
| | | }) |
| | | }, |
| | | resetFormData() { |
| | | this.$refs.form.resetFields() |
| | | if (this.$refs.form) { |
| | | this.$refs.form.resetFields() |
| | | } |
| | | this.model = {} |
| | | this.dataSource = [] |
| | | this.selectedCount = 0 |
| | | if (this.$refs.table) { |
| | | this.$refs.table.clearCheckboxRow() |
| | | } |
| | | }, |
| | | submitCallback(){ |
| | | this.$emit('ok'); |