From 665c1372ff732ba6b5ae23e2c92d52b76cdf2beb Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期一, 18 八月 2025 18:06:07 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/views/cms/RatedLifeList.vue | 9 + src/views/cms/CuttingToolList.vue | 2 src/views/cms/CuttingInboundList.vue | 183 +++++++++++++++++++++++++++++------- src/views/cms/CuttingList.vue | 43 ++++++++ src/views/cms/modules/RatedLifeForm.vue | 11 + 5 files changed, 205 insertions(+), 43 deletions(-) diff --git a/src/views/cms/CuttingInboundList.vue b/src/views/cms/CuttingInboundList.vue index 0e0876e..d66163d 100644 --- a/src/views/cms/CuttingInboundList.vue +++ b/src/views/cms/CuttingInboundList.vue @@ -51,10 +51,10 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <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-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> --> + </a-upload> </div> <!-- table鍖哄煙-begin --> @@ -128,6 +128,9 @@ </a-card> </template> + + + <script> import '@/assets/less/TableExpand.less' @@ -135,6 +138,10 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import CuttingInboundModal from './modules/CuttingInboundModal' import CuttingInboundDetailList from './CuttingInboundDetailList' + import { downFile } from '@api/manage' + import Vue from 'vue' + import { ACCESS_TOKEN } from '@/store/mutation-types' + import store from '@/store' export default { @@ -198,7 +205,7 @@ { title:'鍏ュ簱鍗曠姸鎬�', align:"center", - dataIndex: 'orderStatus' + dataIndex: 'orderStatus_dictText', }, { title: '鎿嶄綔', @@ -215,14 +222,15 @@ deleteBatch: "/cms/cuttingInbound/deleteBatch", exportXlsUrl: "/cms/cuttingInbound/exportXls", importExcelUrl: "cms/cuttingInbound/importExcel", - }, dictOptions:{}, superFieldList:[], } }, created() { - this.getSuperFieldList(); + this.getSuperFieldList(); + // 娣诲姞瀛楀吀鏁版嵁鍔犺浇 + this.initDictConfig(); }, computed: { importExcelUrl: function(){ @@ -234,43 +242,146 @@ 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') + }, + 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} ` + }); + } + } + }, } } </script> diff --git a/src/views/cms/CuttingList.vue b/src/views/cms/CuttingList.vue new file mode 100644 index 0000000..d042b3b --- /dev/null +++ b/src/views/cms/CuttingList.vue @@ -0,0 +1,43 @@ +<template > + <a-card :bordered="false" :body-style="{ padding: '0 24px 24px 24px' }"> + <a-tabs default-active-key="1"> + <a-tab-pane key="1" tab="鍒�鍏蜂俊鎭�"> + <cutting-tool-list ref="cuttingToolList"></cutting-tool-list> + </a-tab-pane> + <a-tab-pane key="2" tab="鍒�鍏峰簱瀛�"> + <cutting-inventory-list ref="cuttingInventoryList"></cutting-inventory-list> + </a-tab-pane> + <a-tab-pane key="3" tab="鍒�鍏烽瀹氬鍛�"> + <rated-life-list ref="RatedLifeList"></rated-life-list> + </a-tab-pane> + </a-tabs> + </a-card> +</template> + +<script> +import CuttingToolList from './CuttingToolList' +import CuttingInventoryList from './CuttingInventoryList' +import RatedLifeList from './RatedLifeList.vue' + +export default { + name: '鍒�鍏峰彴璐�', + components: { + CuttingToolList, + CuttingInventoryList, + RatedLifeList, + }, + data() { + return {} + }, + methods: { + callback(key) { + console.log('鍒囨崲鍒伴〉绛�:', key) + } + } +} +</script> + +<style scoped> +@import '~@assets/less/common.less'; + +</style> diff --git a/src/views/cms/CuttingToolList.vue b/src/views/cms/CuttingToolList.vue index 38825cc..7094f06 100644 --- a/src/views/cms/CuttingToolList.vue +++ b/src/views/cms/CuttingToolList.vue @@ -1,5 +1,5 @@ <template> - <a-card :bordered="false"> + <a-card :bordered="false" > <!-- 鏌ヨ鍖哄煙 --> <div class="table-page-search-wrapper"> <a-form layout="inline" @keyup.enter.native="searchQuery"> diff --git a/src/views/cms/RatedLifeList.vue b/src/views/cms/RatedLifeList.vue index e07526a..dc721ec 100644 --- a/src/views/cms/RatedLifeList.vue +++ b/src/views/cms/RatedLifeList.vue @@ -43,10 +43,10 @@ <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> <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-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> --> + </a-upload> </div> <!-- table鍖哄煙-begin --> @@ -147,7 +147,8 @@ { title:'鍒�鍏风紪鐮�', align:"center", - dataIndex: 'cuttingId' + dataIndex: 'cuttingId', + sorter: true }, { title:'宸ヤ欢鏉愯川', @@ -174,7 +175,7 @@ deleteBatch: "/cms/ratedLife/deleteBatch", exportXlsUrl: "/cms/ratedLife/exportXls", importExcelUrl: "cms/ratedLife/importExcel", - + }, dictOptions:{}, superFieldList:[], diff --git a/src/views/cms/modules/RatedLifeForm.vue b/src/views/cms/modules/RatedLifeForm.vue index f780224..0a03b6d 100644 --- a/src/views/cms/modules/RatedLifeForm.vue +++ b/src/views/cms/modules/RatedLifeForm.vue @@ -5,7 +5,14 @@ <a-row> <a-col :span="24"> <a-form-model-item label="鍒�鍏风紪鐮�" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cuttingId"> - <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" ></a-input> +<!-- <a-input v-model="model.cuttingId" placeholder="璇疯緭鍏ュ垁鍏风紪鐮�" ></a-input>--> + <j-search-select-tag + placeholder="璇烽�夋嫨鍒�鍏风紪鐮�" + v-model="model.cuttingId" + :remoteSearch="true" + :async="true" + dict="cms_cutting_tool,cutting_code,cutting_code" + /> </a-form-model-item> </a-col> <a-col :span="24"> @@ -106,7 +113,7 @@ that.confirmLoading = false; }) } - + }) }, } -- Gitblit v1.9.3