From 92ff846fb659c62037a32b1d8c15eae9df9d9b54 Mon Sep 17 00:00:00 2001 From: zenglf <18502938215@163.com> Date: 星期一, 18 九月 2023 13:24:30 +0800 Subject: [PATCH] Merge branch 'develop' of http://117.34.109.166:18448/r/vue_mdc_430 --- src/views/eam/EquipmentCalibrationOrder.vue | 485 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 485 insertions(+), 0 deletions(-) diff --git a/src/views/eam/EquipmentCalibrationOrder.vue b/src/views/eam/EquipmentCalibrationOrder.vue new file mode 100644 index 0000000..94c693b --- /dev/null +++ b/src/views/eam/EquipmentCalibrationOrder.vue @@ -0,0 +1,485 @@ +<template> + <a-card + :bordered="false" + title="璁惧妫�瀹氬伐鍗�" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="宸ュ崟缂栫爜"> + <a-input + placeholder="璇疯緭鍏ュ伐鍗曠紪鐮�" + v-model="queryParam.num" + ></a-input> + </a-form-item> + </a-col> + <!-- <a-col + :md="6" + :sm="8" + > + <a-form-item label="鐐规鏂规硶鍚嶇О"> + <j-input + placeholder="璇疯緭鍏ョ偣妫�鏂规硶鍚嶇О" + v-model="queryParam.name" + ></j-input> + </a-form-item> + </a-col> --> + <a-col + :md="6" + :sm="8" + > + <span + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" + >閲嶇疆</a-button> + </span> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + </div> + + <!-- table鍖哄煙-begin --> + <div> + <div + class="ant-alert ant-alert-info" + style="margin-bottom: 16px;" + > + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a + style="margin-left: 24px" + @click="onClearSelected" + >娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + :scroll="{ x: 'calc(2000px + 50%)', y: 900 }" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + @change="handleTableChange" + :rowSelection="rowSelection" + :customRow="clickThenSelect" + > + <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" --> + <span + slot="action" + slot-scope="text, record" + > + <a-popconfirm + title="纭畾涓嬪彂宸ュ崟鍚�?" + @confirm="() => handleOrderIssue(record)" + > + <a v-if="record.status === '1'">涓嬪彂</a> + </a-popconfirm> + <a-divider + v-if="record.status === '1'" + type="vertical" + /> + <a + v-if="record.status === '1'" + @click="handleEdit(record)" + >缂栬緫</a> + <a-divider + v-if="record.status === '1'" + type="vertical" + /> + <a + v-if="record.status === '2' " + @click="handleOrderExe(record)" + >鎵ц</a> + <a-divider + v-if="record.status === '2'" + type="vertical" + /> + <a + v-if="record.status === '4'" + @click="handleOrderExe(record)" + >鏌ョ湅</a> + <a-divider + v-if="record.status === '4'" + type="vertical" + /> + <a-popconfirm + title="纭畾鎾ゅ洖宸ュ崟鍚�?" + @confirm="() => handleOrderReset(record,'1')" + > + <a v-if="record.status === '2'">鎾ゅ洖</a> + </a-popconfirm> + <a-divider + v-if="record.status === '2'" + type="vertical" + /> + <a-popconfirm + title="纭畾鎾ゅ洖宸ュ崟鍚�?" + @confirm="() => handleOrderReset(record,'2')" + > + <a v-if="record.status === '4'">鎾ゅ洖</a> + </a-popconfirm> + <a-divider + v-if="record.status === '4'" + type="vertical" + /> + <a-dropdown> + <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a v-if="record.status === '1'">鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + <span + slot="num" + slot-scope="text, record" + > + <a + v-if="record.status === '3' || record.status === '2' " + class="lot" + @click="handleOrderExe(record)" + >{{record.num}}</a> + + <span v-else>{{record.num}}</span> + </span> + </a-table> + <a-tabs + type="card" + defaultActiveKey="1" + > + <a-tab-pane + key="1" + forceRender + > + <span slot="tab"> + <a-badge>绮惧害鍙傛暟 </a-badge> + </span> + <div + class="table-operator" + style="margin:10px" + > + <equipment-precision-parameters-list ref="PrecisionParametersList"></equipment-precision-parameters-list> + </div> + </a-tab-pane> + + <a-tab-pane + key="2" + forceRender + > + <span slot="tab"> + <a-badge>妫�瀹氭姤鍛� </a-badge> + </span> + <div + class="table-operator" + style="margin:10px" + > + <equipment-calibration-order-report-list ref="EquipmentCalibrationOrderReportList"></equipment-calibration-order-report-list> + </div> + </a-tab-pane> + + </a-tabs> + </div> + + <equipment-calibration-order-modal + ref="modalForm" + @ok="modalFormOk" + ></equipment-calibration-order-modal> + + <equipment-calibration-order-exe-drawer + ref="EquipmentCalibrationOrderExeDrawer" + @ok="modalFormOk" + ></equipment-calibration-order-exe-drawer> + </a-card> +</template> + +<script> + +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import EquipmentCalibrationOrderModal from './modules/equipmentCalibrationOrder/EquipmentCalibrationOrderModal' +import EquipmentCalibrationOrderExeDrawer from './modules/equipmentCalibrationOrder/EquipmentCalibrationOrderExeDrawer' +import { getAction, postAction, requestPut } from '@/api/manage' +import EquipmentPrecisionParametersList from './modules/equipmentCalibrationOrder/EquipmentPrecisionParametersList' +import EquipmentCalibrationOrderReportList from './modules/equipmentCalibrationOrder/EquipmentCalibrationOrderReportList' + +export default { + name: 'EquipmentCalibrationOrder', + mixins: [JeecgListMixin, mixinDevice], + components: { + EquipmentCalibrationOrderModal, + EquipmentCalibrationOrderExeDrawer, + EquipmentPrecisionParametersList, + EquipmentCalibrationOrderReportList, + }, + data() { + return { + description: '璁惧妫�瀹氬伐鍗�', + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 5, + pageSizeOptions: ['5', '10', '50'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '鐘舵��', + align: "center", + dataIndex: 'status_dictText' + }, + { + title: '宸ュ崟鍙�', + align: "center", + dataIndex: 'num', + // scopedSlots: { customRender: 'num' } + }, + { + title: '妫�瀹氭柟寮�', + align: "center", + dataIndex: 'calibrationType_dictText', + }, + { + title: '璁惧缂栫爜', + align: "center", + dataIndex: 'equipmentNum', + }, + { + title: '璁惧鍚嶇О', + align: "center", + dataIndex: 'equipmentName', + }, + { + title: '鍨嬪彿', + align: "center", + dataIndex: 'equipmentModel', + }, + { + title: '瑙勬牸', + align: "center", + dataIndex: 'equipmentSpecification', + }, + { + title: '鍒ゅ畾渚濇嵁', + align: "center", + dataIndex: 'managementMode_dictText', + }, + + { + title: '鍒ゅ畾缁撴灉', + align: "center", + dataIndex: 'calibrationResult' + }, + { + title: '鍒涘缓浜�', + align: "center", + dataIndex: 'createBy' + }, + { + title: '鍒涘缓鏃ユ湡', + align: "center", + dataIndex: 'createTime' + }, + { + title: '妫�瀹氫汉', + align: "center", + dataIndex: 'calibrationUserId_dictText' + }, + { + title: '瀹屾垚鏃堕棿', + align: "center", + dataIndex: 'calibrationTime' + }, + { + title: '涓嬪彂鏃堕棿', + align: "center", + dataIndex: 'issueTime' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + fixed: "right", + width: 300, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/eam/calibrationOrder/listNew", + delete: "/eam/calibrationOrder/delete", + edit: "/eam/calibrationOrder/editStatus", + }, + } + }, + + computed: { + importExcelUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + rowSelection() { + return { + type: 'checkbox', + onChange: (selectedRowKeys, selectedRows) => { + this.selectedRowKeys = selectedRowKeys; + this.onSelectChange(selectedRowKeys, selectedRows); + }, + getCheckboxProps: record => ({ + props: { + disabled: record.distable + }, + }), + selectedRowKeys: this.selectedRowKeys, + }; + }, + }, + + methods: { + clickThenSelect(record) { + return { + on: { + click: () => { + this.onSelectChange(record.id.split(","), [record]); + } + } + } + }, + + onSelectChange(selectedRowKeys, selectionRows) { + if (selectedRowKeys.length == 1) { + this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = selectedRowKeys[0] + this.$refs.PrecisionParametersList.calibrationOrderId = selectedRowKeys[0] + } else { + this.$refs.PrecisionParametersList.calibrationOrderId = '-1' + this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1' + } + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + }, + + handleOrderExe(record) { + this.$refs.EquipmentCalibrationOrderExeDrawer.visible = true + this.$refs.EquipmentCalibrationOrderExeDrawer.title = '妫�瀹氬伐鍗曟墽琛�' + this.$refs.EquipmentCalibrationOrderExeDrawer.handleShow(record) + if (record.status === '4') { + this.$refs.EquipmentCalibrationOrderExeDrawer.buttonDistable = true//淇濆瓨銆佹殏瀛樸�佹姤宸� + this.$refs.EquipmentCalibrationOrderExeDrawer.revocationDistable = true//鎾ら攢鎸夐挳 + this.$refs.EquipmentCalibrationOrderExeDrawer.SWbuttonDistable = true//鎻愪氦鎸夐挳 + } else if (record.status === '2') { + this.$refs.EquipmentCalibrationOrderExeDrawer.buttonDistable = false//淇濆瓨銆佹殏瀛樸�佹姤宸� + this.$refs.EquipmentCalibrationOrderExeDrawer.revocationDistable = true//鎾ら攢鎸夐挳 + this.$refs.EquipmentCalibrationOrderExeDrawer.SWbuttonDistable = false//鎻愪氦鎸夐挳 + } + + }, + + handleOrderIssue(record) { + const that = this; + requestPut(that.url.edit, { id: record.id, status: '2' }).then((res) => { + if (res.success) { + that.$message.success("宸ュ崟涓嬪彂鎴愬姛锛�") + that.loadData() + } else { + that.$message.warning("宸ュ崟涓嬪彂澶辫触锛�") + } + }) + }, + //鎾ゅ洖 + handleOrderReset(record, status) { + const that = this; + requestPut(that.url.edit, { id: record.id, status: status }).then((res) => { + if (res.success) { + that.$message.success("宸ュ崟鎾ゅ洖鎴愬姛锛�") + that.loadData() + } else { + that.$message.warning("宸ュ崟鎾ゅ洖澶辫触锛�") + } + }) + }, + searchQuery() { + this.$refs.PrecisionParametersList.calibrationOrderId = '-1' + this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1' + this.loadData(1); + }, + searchReset() { + this.queryParam = {}; + this.selectedRowKeys = [] + this.selectionRows = [] + this.$refs.PrecisionParametersList.calibrationOrderId = '-1' + this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1' + this.loadData(1); + }, + + modalFormOk() { + // 鏂板/淇敼 鎴愬姛鏃讹紝閲嶈浇鍒楄〃 + this.loadData() + //娓呯┖鍒楄〃閫変腑 + this.onClearSelected() + + this.$refs.PrecisionParametersList.calibrationOrderId = '-1' + this.$refs.EquipmentCalibrationOrderReportList.calibrationOrderId = '-1' + }, + + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file -- Gitblit v1.9.3