From 9a0e4f1641f41a3dc1df4453ad416fb1522bd2ea Mon Sep 17 00:00:00 2001 From: 王震 <10952869+daywangzhen@user.noreply.gitee.com> Date: 星期四, 18 一月 2024 17:30:49 +0800 Subject: [PATCH] modified: src/page/wel.vue modified: src/views/quality/rawMaterial/rawMaterial-form.vue --- src/views/plan/customerorder/index.vue | 199 ++++++++++++++++++++----------------------------- 1 files changed, 81 insertions(+), 118 deletions(-) diff --git a/src/views/plan/customerorder/index.vue b/src/views/plan/customerorder/index.vue index dbee1f0..7990386 100644 --- a/src/views/plan/customerorder/index.vue +++ b/src/views/plan/customerorder/index.vue @@ -12,22 +12,6 @@ ref="customerOrderTable" > <template #toolbar> - <!-- <el-dropdown - v-if="permissions.customerorder_state_change" - @command="handleCommand" - > - <el-button> - 鐘舵�佹敼鍙�<i class="el-icon-arrow-down el-icon--right"></i> - </el-button> - <el-dropdown-menu slot="dropdown"> - <el-dropdown-item - :command="item.command" - v-for="item in stateTagArr" - :disabled="item.disabled"> - {{ item.label }} - </el-dropdown-item> - </el-dropdown-menu> - </el-dropdown> --> <el-dropdown v-if="permissions.customerorder_doc_relate" @command="documentHandle" @@ -38,10 +22,10 @@ </el-button> <el-dropdown-menu slot="dropdown"> <el-dropdown-item + :key="index" :command="item.command" - v-for="item in documentTagArr" - :disabled="item.disabled" - > + v-for="(item,index) in documentTagArr" + :disabled="item.disabled"> {{ item.label }} </el-dropdown-item> </el-dropdown-menu> @@ -57,42 +41,21 @@ </el-button> <el-dropdown-menu slot="dropdown"> <el-dropdown-item + :key="index" :command="item.command" - v-for="item in commitStateTagArr" + v-for="(item,index) in commitStateTagArr" :disabled="item.disabled" >{{ item.label }}</el-dropdown-item > </el-dropdown-menu> </el-dropdown> - <!-- <el-button - v-if="permissions.customerorder_push_otc" - style="margin-left:10px;" - type="primary" - @click="pushOtc" - >鎺ㄩ�丒RP</el-button - > --> - <!-- <el-button - style="margin-left:10px;" - type="primary" - @click="importOutPutBatch" - >瀵煎叆浜у嚭鎵规</el-button - > --> <el-button style="margin-left:10px;" type="primary" @click="()=>exportDialogVisible=true" - >瀵煎嚭鍙拌处</el-button - > - <el-button - v-if="permissions.plan_customerorder_return" - style="margin-left:10px;" - type="primary" - @click="returnOrder" - >璁㈠崟閫�鍥�</el-button - > + >瀵煎嚭鍙拌处</el-button> </template> </ttable> - <!-- 寮圭獥, 鏃ユ湡閫夋嫨 --> <ConfirmPullCustomerorder v-if="showPullCustomerOrderVisible" @@ -309,7 +272,8 @@ exportCustomerOrder, exportCustomerOrderSplit, syncOrder, - dropByContractNo + dropByContractNo, + downloadWordFile } from '../../../api/plan/customerorder' import DocumentTable from '@/views/common/document.vue' import { remote } from '@/api/admin/dict' @@ -321,6 +285,7 @@ export default { data() { return { + uniqueStateArr: [], dataForm: { selectTime: null, exportTime: null @@ -474,7 +439,7 @@ searchInfoType: 'text' }, { - minWidth: '120', + minWidth: '100', prop: 'sourceId', label: '娣诲姞鏉ユ簮', isTag: true, @@ -690,7 +655,7 @@ // fun: this.packageExportHandle // }, { - text: '浣滃簾', + text: '鍒犻櫎', type: 'text', size: 'small', fun: this.cancelHandle, @@ -769,10 +734,10 @@ ], sourceIdList: [{ label: '鍚屾', - value: '0' + value: "0" },{ label: '鎵嬪姩', - value: '1' + value: "1" }], stockVisible: false, partName: null, @@ -835,9 +800,9 @@ ...mapGetters(['permissions']) }, watch: { - exportDialogVisible(newVal){ - if(!newVal){ - this.$refs['exportForm'].resetFields() + exportDialogVisible(newVal) { + if (!newVal) { + this.$refs.exportForm.resetFields() } }, coState: { @@ -855,36 +820,6 @@ created() { // this.getManufactureAttrs() this.getTitles() - /** - * { - text: '鑾峰彇閿�鍞鍗�', - type: 'primary', - fun: this.pullCustomerOrder, - disabled: false, - permitArr: [] - }, - { - text: '鑾峰彇IFS琛屽彿', - type: 'primary', - fun: this.pullIfsLineNo, - disabled: false, - permitArr: [], - loading: false - }, - { - text: '鎻愪氦瀹℃牳', - type: 'primary', - fun: this.auditCustomerOrder, - disabled: false, - permitArr: [], - loading: false - }, - { - text: '涓荤敓浜ц鍒�', - disabled: false, - fun: this.masterPlanHandle - } - */ this.table.toolbar.push({ text: '鏂板閿�鍞鍗�', type: 'primary', @@ -892,14 +827,6 @@ disabled: false, permitArr: [] }) - // this.table.toolbar.push({ - // text: '鍚屾ERP', - // type: 'primary', - // fun: this.syncERP, - // loading: false, - // disabled: false, - // permitArr: [] - // }) if (this.permissions.customerorder_from_otc) { this.table.toolbar.push({ text: '鑾峰彇閿�鍞鍗�', @@ -909,43 +836,67 @@ permitArr: [] }) } - // if (this.permissions.customerorder_ifs_line) { - // this.table.toolbar.push({ - // text: '鑾峰彇ERP琛屽彿', - // type: 'primary', - // fun: this.pullIfsLineNo, - // disabled: false, - // permitArr: [], - // loading: false - // }) - // } if (this.permissions.customerorder_submit_oa) { - // this.table.toolbar.push({ - // text: '鎻愪氦瀹℃牳', - // type: 'primary', - // fun: this.auditCustomerOrder, - // disabled: false, - // permitArr: [], - // loading: false - // }) + this.table.toolbar.push({ + text: '鎻愪氦瀹℃牳', + type: 'primary', + fun: this.auditCustomerOrder, + disabled: false, + permitArr: [], + loading: false + }) } if (this.permissions.customerorder_set_salesparts) { this.table.toolbar.push({ text: '璁剧疆閿�鍞欢', type: 'primary', fun: this.setSalesPart, - disabled: false + disabled: false, + permitArr: [] }) } + this.table.toolbar.push({ + text: '涓嬭浇Word', + disabled: false, + type: 'primary', + fun: this.downloadWord, + permitArr: ['03plan','04planed'], + }) if (this.permissions.customerorder_create_masterplan) { this.table.toolbar.push({ text: '涓荤敓浜ц鍒�', disabled: false, - fun: this.masterPlanHandle + fun: this.masterPlanHandle, + permitArr: [] }) } }, methods: { + //涓嬭浇word + downloadWord(){ + let ids = this.multipleSelection.map(ele=>ele.id) + if(ids.length<1){ + this.$message.error("璇烽�夋嫨涓�鏉℃暟鎹�") + return + } + downloadWordFile(ids).then(response=>{ + // 澶勭悊杩斿洖鐨勬枃浠舵祦 + const blob = response.data + const link = document.createElement('a') + link.href = URL.createObjectURL(blob) + const disposition = response.headers["content-disposition"] + let temp = disposition.substring(disposition.lastIndexOf('=') + 1) + link.download = decodeURI(temp) + document.body.appendChild(link) + link.click() + window.setTimeout(function() { + URL.revokeObjectURL(blob) + document.body.removeChild(link) + }, 0) + }).catch(error=>{ + console.error(error); + }) + }, getOtcPartSyncOptionList() { return this.otcPartSyncOptionList }, @@ -954,7 +905,7 @@ queryParam.push( Object.assign({ prop: 'coState', - searchInfoType: 'select', + searchInfoType: 'select' // propVal: '01partUnCheck' // propVal: '02technologyUnCheck' }) @@ -975,7 +926,6 @@ }, // 鍒涘缓涓荤敓浜ц鍒� masterPlanHandle() { - console.log(this.multipleSelection); if (this.multipleSelection && this.multipleSelection.length > 0) { if (this.judgeCoState(this.multipleSelection)) { // 鍒ゆ柇涓�涓嬪墿浣欐暟閲忔槸鍚﹀ぇ浜�0 @@ -1092,15 +1042,15 @@ let flag = true const ids = [] this.multipleSelection.forEach((item) => { - if (item.salesPartNo != null && item.salesPartNo !== '') { + if (item.partNo != null && item.partNo !== '') { ids.push(item.id) } else { flag = false } }) if (flag) { - checkOA(this.multipleSelection.map((e) => e.id)).then((res) => { - console.log(res) + + checkOA(this.multipleSelection.map((e) => e.id),{}).then((res) => { if (!res.data.data.success) { this.$confirm(`${res.data.data.message}`, '鎻愮ず', { confirmButtonText: '纭畾', @@ -1149,7 +1099,6 @@ // 绠辩爜淇℃伅瀵煎嚭 packageExportHandle(row) { - console.log(row.otcQuantity) if (row.otcQuantity) { this.packageExport.visible = true this.packageExport.form = { @@ -1186,13 +1135,13 @@ }, // 浣滃簾 cancelHandle(row) { - this.$confirm('鏄惁纭浣滃簾閿�鍞鍗曞彿涓�' + row.customerOrderNo + '鎻愮ず', { + this.$confirm('纭浣滃簾id涓恒��' + row.id + '銆戠殑鏁版嵁?','鎻愮ず' , { confirmButtonText: '纭畾', cancelButtonText: '鍙栨秷', closeOnClickModal: false, type: 'warning' }).then(() => { - dropByContractNo(row.customerOrderNo).then((res) => { + dropByContractNo({id:row.id}).then((res) => { if (res.data.code === 0) { this.$message.success('浣滃簾鎴愬姛') this.getData() @@ -1263,6 +1212,21 @@ this.stateTagArr[i].disabled = false } else { this.stateTagArr[i].disabled = true + } + } + // 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑permitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆 + var toolbar = this.table.toolbar + for (var j = 0; j < toolbar.length; j++) { + if ( + uniqueStateArr.every((val) => + toolbar[j].permitArr.length <= 0 + ? true + : toolbar[j].permitArr.includes(val) + ) + ) { + toolbar[j].disabled = false + } else { + toolbar[j].disabled = true } } this.multipleSelection = val @@ -1578,7 +1542,6 @@ }, // 瀵煎嚭鍙拌处 exportStandBook() { - // console.log(this.$refs.customerOrderTable.getQueryParam(),"SSS") // if (this.multipleSelection.length > 0) { // let ids = '' // this.multipleSelection.forEach((item) => { -- Gitblit v1.9.3