From a674e9834bec0ce5a18b751c7434323cc7199ce5 Mon Sep 17 00:00:00 2001 From: lixiangyu <lixiangyu@xalxzn.com> Date: 星期四, 11 九月 2025 17:57:34 +0800 Subject: [PATCH] feat(cms): CuttingReceiveDetailList.vue刀具领用功能中新增领用单提交功能 CuttingReceiveList.vue 刀具领用 提交按钮的前端样式和刀具领用归还按钮的前端样式 --- src/views/cms/CuttingInboundList.vue | 807 +++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 575 insertions(+), 232 deletions(-) diff --git a/src/views/cms/CuttingInboundList.vue b/src/views/cms/CuttingInboundList.vue index 0e0876e..94dbb77 100644 --- a/src/views/cms/CuttingInboundList.vue +++ b/src/views/cms/CuttingInboundList.vue @@ -1,106 +1,126 @@ <template> - <a-card :bordered="false"> - <!-- 鏌ヨ鍖哄煙 --> - <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="鍏ュ簱鍗曠姸鎬�"> - <j-search-select-tag - placeholder="璇烽�夋嫨鍏ュ簱鍗曠姸鎬�" - v-model="queryParam.orderStatus" - dict="order_status" - /> - </a-form-item> - </a-col> - <a-col :md="6" :sm="8"> - <a-form-item label="鍏ュ簱浜�"> - <j-search-select-tag - placeholder="璇烽�夋嫨鍏ュ簱浜�" - v-model="queryParam.receiver" - dict="sys_user,realname,id,del_flag!=1" - /> - </a-form-item> - </a-col> - <a-col - :md="6" - :sm="8" - > + <a-card :bordered="false"> + <!-- 鏌ヨ鍖哄煙 --> + <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="鍏ュ簱鍗曠姸鎬�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鍏ュ簱鍗曠姸鎬�" + v-model="queryParam.orderStatus" + dict="order_status" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="鍏ュ簱浜�"> + <j-search-select-tag + placeholder="璇烽�夋嫨鍏ュ簱浜�" + v-model="queryParam.receiver" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + <a-col :md="6" :sm="8"> + <a-form-item label="纭浜�"> + <j-search-select-tag + v-model="queryParam.confirmer" + placeholder="璇烽�夋嫨纭浜�" + dict="sys_user,realname,id,del_flag!=1" + /> + </a-form-item> + </a-col> + <!-- <a-col :md="6" :sm="8">--> + <!-- <a-form-item label="鍏ュ簱鏃堕棿">--> + <!-- <j-date--> + <!-- v-model="queryParam.receiveTime"--> + <!-- type="date"--> + <!-- value-format="YYYY-MM-DD"--> + <!-- />--> + <!-- </a-form-item>--> + <!-- </a-col>--> + <a-col + :md="6" + :sm="8" + > <span - style="float: left;overflow: hidden;" - class="table-page-search-submitButtons" + style="float: left;overflow: hidden;" + class="table-page-search-submitButtons" > <a-button - type="primary" - @click="searchQuery" - icon="search" + type="primary" + @click="searchQuery" + icon="search" >鏌ヨ</a-button> <a-button - type="primary" - @click="searchReset" - icon="reload" - style="margin-left: 8px" + type="primary" + @click="searchReset" + icon="reload" + style="margin-left: 8px" >閲嶇疆</a-button> </span> - </a-col> - </a-row> - </a-form> - </div> - <!-- 鏌ヨ鍖哄煙-END --> + </a-col> + </a-row> + </a-form> + </div> + <!-- 鏌ヨ鍖哄煙-END --> - <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> - <div class="table-operator"> - <a-button @click="handleAdd" type="primary" icon="plus">鏂板</a-button> - <!-- <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏峰叆搴撳崟')">瀵煎嚭</a-button> - <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> - <a-button type="primary" icon="import">瀵煎叆</a-button> - </a-upload> --> - </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 class="table-operator"> + <a-button @click="handleAdd" type="primary" icon="plus">鏂板垁鍏ュ簱</a-button> + <a-button type="primary" icon="download" @click="handleExportXls('鍒�鍏峰叆搴撳崟')">瀵煎嚭</a-button> + <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" + @change="handleImportExcel"> + <a-button type="primary" icon="import">瀵煎叆</a-button> + </a-upload> </div> - <a-table - ref="table" - size="middle" - :scroll="{x:true}" - bordered - rowKey="id" - :columns="columns" - :dataSource="dataSource" - :pagination="ipagination" - :loading="loading" - class="j-table-force-nowrap" - :customRow="customRow" - @change="handleTableChange"> + <!-- 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> - <template slot="htmlSlot" slot-scope="text"> - <div v-html="text"></div> - </template> - <template slot="imgSlot" slot-scope="text,record"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> - <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> - </template> - <template slot="fileSlot" slot-scope="text"> - <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> - <a-button - v-else - :ghost="true" - type="primary" - icon="download" - size="small" - @click="downloadFile(text)"> - 涓嬭浇 - </a-button> - </template> + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + class="j-table-force-nowrap" + :customRow="customRow" + @change="handleTableChange"> - <span slot="action" slot-scope="text, record"> - <a @click="handleEdit(record)">缂栬緫</a> + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" + style="max-width:80px;font-size: 12px;font-style: italic;" /> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)" :disabled="record.orderStatus === '2'">缂栬緫</a> <a-divider type="vertical" /> <a-dropdown> <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> @@ -108,7 +128,15 @@ <a-menu-item> <a @click="handleDetail(record)">璇︽儏</a> </a-menu-item> - <a-menu-item> + <!-- <a-menu-item v-if="record.orderStatus != '2'">--> + <!-- <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)">--> + <!-- <a>鍒犻櫎</a>--> + <!-- </a-popconfirm>--> + <!-- </a-menu-item>--> + <a-menu-item v-if="record.orderStatus != '2'"> + <a @click="handleSubmit(record.id)" :disabled="record.orderStatus == '3'">鎻愪氦</a> + </a-menu-item> + <a-menu-item v-if="record.orderStatus != '2'"> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> <a>鍒犻櫎</a> </a-popconfirm> @@ -117,163 +145,478 @@ </a-dropdown> </span> - </a-table> - </div> - <a-tabs defaultActiveKey="1"> - <a-tab-pane tab="鍒�鍏峰叆搴撴槑缁�" key="1"> - <cutting-inbound-detail-list ref="cuttingInbounDetailList"></cutting-inbound-detail-list> - </a-tab-pane> - </a-tabs> - <cutting-inbound-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-modal> - </a-card> + </a-table> + </div> + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="鍒�鍏峰叆搴撴槑缁�" key="1"> + <cutting-inbound-detail-list ref="cuttingInbounDetailList"></cutting-inbound-detail-list> + </a-tab-pane> + </a-tabs> + <cutting-inbound-modal ref="modalForm" @ok="modalFormOk"></cutting-inbound-modal> + </a-card> </template> + <script> - import '@/assets/less/TableExpand.less' - import { mixinDevice } from '@/utils/mixin' - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import CuttingInboundModal from './modules/CuttingInboundModal' - import CuttingInboundDetailList from './CuttingInboundDetailList' +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import CuttingInboundModal from './modules/CuttingInboundModal' +import CuttingInboundDetailList from './CuttingInboundDetailList' +import { downFile, httpAction } from '@api/manage' +import Vue from 'vue' +import { ACCESS_TOKEN } from '@/store/mutation-types' +import store from '@/store' +import { Modal } from 'ant-design-vue' - - export default { - name: 'CuttingInboundList', - mixins:[JeecgListMixin, mixinDevice], - components: { +export default { + name: 'CuttingInboundList', + mixins: [JeecgListMixin, mixinDevice], + components: { CuttingInboundModal, CuttingInboundDetailList - }, - data () { + }, + data() { return { - description: '鍒�鍏峰叆搴撳崟绠$悊椤甸潰', - // 琛ㄥご - columns: [ - { - title: '#', - dataIndex: '', - key:'rowIndex', - width:60, - align:"center", - customRender:function (t,r,index) { - return parseInt(index)+1; + description: '鍒�鍏峰叆搴撳崟绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鍏ュ簱浜�', + align: 'center', + dataIndex: 'receiver_dictText' + }, + { + title: '鍏ュ簱鏃堕棿', + align: 'center', + dataIndex: 'receiveTime', + customRender: function(text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) + } + }, + { + title: '鍏ュ簱璇存槑', + align: 'center', + dataIndex: 'receiveComment' + }, + { + title: '纭浜�', + align: 'center', + dataIndex: 'confirmer_dictText' + }, + { + title: '纭鏃堕棿', + align: 'center', + dataIndex: 'confirmTime', + customRender: function(text) { + return !text ? '' : (text.length > 10 ? text.substr(0, 10) : text) + } + }, + { + title: '纭鎰忚', + align: 'center', + dataIndex: 'confirmComment' + }, + { + title: '鍏ュ簱鍗曠姸鎬�', + align: 'center', + dataIndex: 'orderStatus_dictText' + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + align: 'center', + fixed: 'right', + width: 147, + scopedSlots: { customRender: 'action' } } - }, - { - title:'鍏ュ簱浜�', - align:"center", - dataIndex: 'receiver_dictText' - }, - { - title:'鍏ュ簱鏃堕棿', - align:"center", - dataIndex: 'receiveTime', - customRender:function (text) { - return !text?"":(text.length>10?text.substr(0,10):text) - } - }, - { - title:'鍏ュ簱璇存槑', - align:"center", - dataIndex: 'receiveComment' - }, - { - title:'纭浜�', - align:"center", - dataIndex: 'confirmer_dictText' - }, - { - title:'纭鏃堕棿', - align:"center", - dataIndex: 'confirmTime', - customRender:function (text) { - return !text?"":(text.length>10?text.substr(0,10):text) - } - }, - { - title:'纭鎰忚', - align:"center", - dataIndex: 'confirmComment' - }, - { - title:'鍏ュ簱鍗曠姸鎬�', - align:"center", - dataIndex: 'orderStatus' - }, - { - title: '鎿嶄綔', - dataIndex: 'action', - align:"center", - fixed:"right", - width:147, - scopedSlots: { customRender: 'action' } - } - ], - url: { - list: "/cms/cuttingInbound/list", - delete: "/cms/cuttingInbound/delete", - deleteBatch: "/cms/cuttingInbound/deleteBatch", - exportXlsUrl: "/cms/cuttingInbound/exportXls", - importExcelUrl: "cms/cuttingInbound/importExcel", - - }, - dictOptions:{}, - superFieldList:[], + ], + url: { + list: '/cms/cuttingInbound/list', + delete: '/cms/cuttingInbound/delete', + deleteBatch: '/cms/cuttingInbound/deleteBatch', + exportXlsUrl: '/cms/cuttingInbound/exportXls', + importExcelUrl: 'cms/cuttingInbound/importExcel', + submit: '/cms/cuttingInbound/submit' + }, + dictOptions: {}, + superFieldList: [] } - }, - created() { - this.getSuperFieldList(); - }, - computed: { - importExcelUrl: function(){ - return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + created() { + this.getSuperFieldList() + // 娣诲姞瀛楀吀鏁版嵁鍔犺浇 + this.initDictConfig() + }, + computed: { + importExcelUrl: function() { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` + } + }, + methods: { + searchQuery() { + this.loadData(1) }, - }, - methods: { searchReset() { - this.queryParam = {} - this.$refs.cuttingInbounDetailList.dataSource = [] - this.loadData(1); - }, - handleEdit: function (record) { - this.$refs.modalForm.edit(record) - this.$refs.modalForm.title = '缂栬緫' - this.$refs.modalForm.disableSubmit = false - }, - handleAdd() { - this.$refs.modalForm.add() - this.$refs.modalForm.title = '鏂板' - this.$refs.modalForm.disableSubmit = false - }, - handleDetail:function(record){ - this.$refs.modalForm.edit(record); - this.$refs.modalForm.title="璇︽儏"; - this.$refs.modalForm.disableSubmit = true; - }, - customRow(record) { - return { - on: { - click: (e) => { - //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 - this.$bus.$emit('getToolingStorageData', record) - //鐐瑰嚮褰撳墠琛屽彉鑹� - let oldList = document.querySelectorAll('.checked-td-of-add-table') - if (oldList) { - for (let j = 0; j < oldList.length; j++) { - oldList[j].classList.remove('checked-td-of-add-table') - } + this.queryParam = {} + this.$refs.cuttingInbounDetailList.dataSource = [] + this.loadData(1) + }, + handleEdit: function(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '缂栬緫' + this.$refs.modalForm.disableSubmit = false + }, + handleAdd() { + this.$refs.modalForm.add() + this.$refs.modalForm.title = '鏂板' + this.$refs.modalForm.disableSubmit = false + }, + handleDetail: function(record) { + this.$refs.modalForm.edit(record) + this.$refs.modalForm.title = '璇︽儏' + this.$refs.modalForm.disableSubmit = true + }, + + // 鑷畾涔夎鐐瑰嚮浜嬩欢 + customRow(record) { + return { + on: { + click: (e) => { + //灏嗗綋鍓嶉�変腑鐨勮褰曚紶鍒板瓙椤甸潰 + this.$bus.$emit('getToolingStorageData', record) + //鐐瑰嚮褰撳墠琛屽彉鑹� + let oldList = document.querySelectorAll('.checked-td-of-add-table') + if (oldList) { + for (let j = 0; j < oldList.length; j++) { + oldList[j].classList.remove('checked-td-of-add-table') + } + } + let children = e.target.parentNode.children + for (let i = 0; i < children.length; i++) { + children[i].classList.add('checked-td-of-add-table') + } + } } - let children = e.target.parentNode.children - for (let i = 0; i < children.length; i++) { - children[i].classList.add('checked-td-of-add-table') + } + }, + + handleExportXls(fileName) { + if (!fileName || typeof fileName != 'string') { + fileName = '瀵煎嚭鏂囦欢' + } + let param = this.getQueryParams() + if (this.selectedRowKeys && this.selectedRowKeys.length > 0) { + param['selections'] = this.selectedRowKeys.join(',') + } + console.log('瀵煎嚭鍙傛暟', param) + downFile(this.url.exportXlsUrl, param).then((data) => { + if (!data) { + // this.$message.warning("鏂囦欢涓嬭浇澶辫触") + this.$notification.warning({ + message: '娑堟伅', + description: '鏂囦欢涓嬭浇澶辫触' + }) + return } - }, - }, + if (typeof window.navigator.msSaveBlob !== 'undefined') { + window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }), fileName + '.xls') + } else { + let url = window.URL.createObjectURL(new Blob([data], { type: 'application/vnd.ms-excel' })) + let link = document.createElement('a') + link.style.display = 'none' + link.href = url + link.setAttribute('download', fileName + '.xls') + document.body.appendChild(link) + link.click() + document.body.removeChild(link) //涓嬭浇瀹屾垚绉婚櫎鍏冪礌 + window.URL.revokeObjectURL(url) //閲婃斁鎺塨lob瀵硅薄 + } + }) + }, + + /* 瀵煎叆 */ + handleImportExcel(info) { + this.loading = true + if (info.file.status !== 'uploading') { + console.log(info.file, info.fileList) + } + if (info.file.status === 'done') { + this.loading = false + if (info.file.response.success) { + // this.$message.success(`${info.file.name} 鏂囦欢涓婁紶鎴愬姛`); + if (info.file.response.code === 201) { + let { message, result: { msg, fileUrl, fileName } } = info.file.response + let href = window._CONFIG['domianURL'] + fileUrl + this.$warning({ + title: message, + content: (<div> + <span>{msg}</span><br /> + <span>鍏蜂綋璇︽儏璇� <a href={href} target="_blank" download={fileName}>鐐瑰嚮涓嬭浇</a> </span> + </div> + ) + }) + } else { + // this.$message.success(info.file.response.message || `${info.file.name} 鏂囦欢涓婁紶鎴愬姛`) + this.$notification.success({ + message: '娑堟伅', + description: info.file.response.message || `${info.file.name} 鏂囦欢涓婁紶鎴愬姛` + }) + } + this.loadData() + } else { + // this.$message.error(`${info.file.name} ${info.file.response.message}.`); + this.$notification.error({ + message: '娑堟伅', + description: `${info.file.name} ${info.file.response.message}.` + }) + } + } else if (info.file.status === 'error') { + this.loading = false + if (info.file.response.status === 500) { + let data = info.file.response + const token = Vue.ls.get(ACCESS_TOKEN) + if (token && data.message.includes('Token澶辨晥')) { + this.$error({ + title: '鐧诲綍宸茶繃鏈�', + content: '寰堟姳姝夛紝鐧诲綍宸茶繃鏈燂紝璇烽噸鏂扮櫥褰�', + okText: '閲嶆柊鐧诲綍', + mask: false, + onOk: () => { + store.dispatch('Logout').then(() => { + Vue.ls.remove(ACCESS_TOKEN) + window.location.reload() + }) + } + }) + } + } else { + // this.$message.error(`鏂囦欢涓婁紶澶辫触: ${info.file.msg} `); + this.$notification.error({ + message: '娑堟伅', + description: `鏂囦欢涓婁紶澶辫触: ${info.file.msg} ` + }) + } + } + }, + + // 鍗曟嵁鎻愪氦 + + handleSubmit: function(id) { + if (!this.url.submit) { + this.$message.error('璇疯缃畊rl.submit灞炴��!') + return + } + + let targetId = id // 浠庡弬鏁拌幏鍙朓D + // 濡傛灉娌℃湁閫氳繃鍙傛暟浼犻�扞D锛屽垯妫�鏌ラ�変腑鐨勮褰� + if (!targetId) { + if (this.selectedRowKeys.length != 1) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + return + } else { + targetId = this.selectedRowKeys[0] + } + } + + // 灏嗗弬鏁颁綔涓烘煡璇㈠弬鏁伴檮鍔犲埌URL涓� + let httpurl = this.url.submit + '?orderId=' + encodeURIComponent(targetId) + let method = 'get' + var params = {} // 娓呯┖params锛屽洜涓哄弬鏁板凡缁忓湪URL涓紶閫� + + const that = this + + this.$confirm({ + title: '纭鎻愪氦锛�', + // content: '姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...', + okText: '纭', + cancelText: '鍙栨秷', + onOk() { + // 鏄剧ず鍔犺浇鎻愮ず + const hide = that.$message.loading('姝e湪鎻愪氦鏁版嵁锛岃鑰愬績绛夊緟...', 0) + + // 鍙戦�佽姹� + return httpAction(httpurl, params, method).then((res) => { + hide() // 闅愯棌鍔犺浇鎻愮ず + if (res.success) { + that.$message.success(res.message) + that.loadData() + } else { + that.$message.warning(res.message) + } + }).catch(error => { + hide() // 闅愯棌鍔犺浇鎻愮ず + that.$message.error('鎻愪氦澶辫触: ' + error.message) + }).finally(() => { + that.loading = false + }) + } + }) } - }, - } - } + + // /** + // * 鍗曟嵁鎻愪氦锛堟敮鎸佸疄鏃惰繘搴︽洿鏂帮級 + // */ + // handleSubmit: function(id) { + // if (!this.url.submit) { + // this.$message.error('璇疯缃畊rl.submit灞炴��!') + // return + // } + // + // let targetId = id; // 浠庡弬鏁拌幏鍙朓D + // // 濡傛灉娌℃湁閫氳繃鍙傛暟浼犻�扞D锛屽垯妫�鏌ラ�変腑鐨勮褰� + // if (!targetId) { + // if (this.selectedRowKeys.length != 1) { + // this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒') + // return + // } else { + // targetId = this.selectedRowKeys[0] + // } + // } + // + // const that = this + // + // this.$confirm({ + // title: '纭鎻愪氦锛�', + // content: '鎻愪氦杩囩▼涓彲鑳介渶瑕佽緝闀挎椂闂达紝璇疯�愬績绛夊緟...', + // okText: '纭', + // cancelText: '鍙栨秷', + // + // onOk() { + // // 鍒涘缓杩涘害鏉℃ā鎬佹 + // let percent = 0; + // let totalTools = 0; // 鍒�鍏锋�绘暟 + // let processedTools = 0; // 宸插鐞嗗垁鍏锋暟 + // + // // 浣跨敤 this.$info 鍒涘缓妯℃�佹 + // const modal = that.$info({ + // title: '姝e湪鎻愪氦鏁版嵁', + // content: that.$createElement('div', [ + // that.$createElement('p', '姝e湪澶勭悊鍒�鍏峰叆搴擄紝璇风◢鍊�...'), + // that.$createElement('a-progress', { + // props: { + // percent: percent, + // status: 'active' + // } + // }), + // // that.$createElement('p', { + // // style: { + // // marginTop: '10px' + // // } + // // }, `杩涘害: ${processedTools}/${totalTools} 鎶婂垁鍏穈) + // ]), + // okButtonProps: { style: { display: 'none' } }, // 闅愯棌纭鎸夐挳 + // cancelText: '鍙栨秷', + // closable: false, // 绂佹鍏抽棴妯℃�佹 + // }); + // + // // 鏇存柊杩涘害鏄剧ず鍑芥暟 + // const updateProgress = () => { + // if (totalTools > 0) { + // percent = Math.round((processedTools / totalTools) * 100); + // // 纭繚杩涘害涓嶈秴杩�90%锛屼繚鐣欐渶鍚�10%缁欐渶缁堝畬鎴� + // percent = percent > 90 ? 90 : percent; + // } + // + // modal.update({ + // content: that.$createElement('div', [ + // that.$createElement('p', '姝e湪澶勭悊鍒�鍏峰叆搴擄紝璇风◢鍊�...'), + // that.$createElement('a-progress', { + // props: { + // percent: percent, + // status: 'active' + // } + // }), + // // that.$createElement('p', { + // // style: { + // // marginTop: '10px' + // // } + // // }, `杩涘害: ${processedTools}/${totalTools} 鎶婂垁鍏穈) + // ]) + // }); + // }; + // + // // 鍙戦�佽姹� + // let httpurl = that.url.submit + '?orderId=' + encodeURIComponent(targetId) + // + // return httpAction(httpurl, {}, 'get').then((res) => { + // // 鏍规嵁鍚庣杩斿洖鐨勬�诲垁鍏锋暟璁剧疆杩涘害 + // if (res.success) { + // // 濡傛灉鍚庣杩斿洖浜嗘�诲垁鍏锋暟 + // if (res.result && res.result.quantity !== undefined) { + // totalTools = res.result.quantity; + // processedTools = res.result.totalSubmitted || 0; //宸插鐞嗗垁鍏锋暟 + // } + // // 濡傛灉鍚庣杩斿洖浜嗘槑缁嗗垪琛紝鏍规嵁receive_number璁$畻鎬绘暟閲� + // else if (res.result && res.result.detailList) { + // // 鏍规嵁姣忎釜鏄庣粏鐨剅eceive_number绱姞璁$畻鎬诲垁鍏锋暟 + // totalTools = res.result.detailList.reduce((total, detail) => { + // return total + (detail.receiveNumber || 0); + // }, 0); + // processedTools = totalTools; // 宸插鐞嗘暟閲� + // } + // + // // 鏇存柊杩涘害鏄剧ず + // percent = 100; // 鐩存帴鏄剧ず100%瀹屾垚 + // updateProgress(); + // + // // 鏄剧ず瀹屾垚鐘舵�� + // setTimeout(() => { + // modal.update({ + // content: that.$createElement('div', [ + // that.$createElement('p', '姝e湪澶勭悊鍒�鍏峰叆搴擄紝璇风◢鍊�...'), + // that.$createElement('a-progress', { + // props: { + // percent: percent, + // status: 'success' + // } + // }), + // that.$createElement('p', { + // style: { + // marginTop: '10px' + // } + // }, totalTools > 0 ? + // `杩涘害: ${processedTools}/${totalTools} 鎶婂垁鍏穈 : + // '澶勭悊瀹屾垚') + // ]) + // }); + // + // // 寤惰繜鍏抽棴妯℃�佹 + // setTimeout(() => { + // modal.destroy(); + // that.$message.success(res.message || '鎻愪氦鎴愬姛'); + // that.loadData(); + // }, 500); + // }, 300); + // } else { + // // 澶勭悊閿欒鎯呭喌 + // modal.destroy(); + // that.$message.warning(res.message || '鎻愪氦澶辫触'); + // } + // }).catch(error => { + // modal.destroy(); + // that.$message.error('鎻愪氦澶辫触: ' + error.message) + // }).finally(() => { + // that.loading = false + // }) + // } + // }) + // }, + + } +} </script> <style scoped> - @import '~@assets/less/common.less'; +@import '~@assets/less/common.less'; </style> \ No newline at end of file -- Gitblit v1.9.3