From 47cf5518f0f61dbf8066c2273b9f77c2cd7b1751 Mon Sep 17 00:00:00 2001
From: YLouie <929705085@qq.com>
Date: 星期五, 19 九月 2025 17:56:03 +0800
Subject: [PATCH] 销售订单plm同步
---
src/views/technology/routing/index.vue | 330 ++++++++++++++++++++++++------------------------------
1 files changed, 147 insertions(+), 183 deletions(-)
diff --git a/src/views/technology/routing/index.vue b/src/views/technology/routing/index.vue
index 87bf396..7c5b002 100644
--- a/src/views/technology/routing/index.vue
+++ b/src/views/technology/routing/index.vue
@@ -1,106 +1,48 @@
<template>
<div class="mod-config">
<basic-container>
- <ttable
- :table="table"
- @handleSelectionChange="handleSelectionChange"
- @customUploadPage="routingImport"
- :uploadInfo="uploadInfo"
- :customUpload="customUpload"
- :prelang="prelang"
- :options="options"
- :ajaxFun="ajaxFun"
- ref="routingTable"
- >
- <template #toolbar>
- <el-button
- v-if="permissions.technology_routing_ifssync"
- type="primary"
- :loading="ifsSynsLoading"
- @click="syncIfs"
- >IFS鍚屾</el-button
- >
- <el-button
- v-if="permissions.technology_routing_advancecalc"
- type="primary"
- :loading="preCalcLoading"
- @click="calcTech"
- >鎻愬墠璁$畻</el-button
- >
- </template>
+ <ttable :table="table" @handleSelectionChange="handleSelectionChange" @customUploadPage="routingImport"
+ :uploadInfo="uploadInfo" :customUpload="customUpload" :prelang="prelang" :options="options" :ajaxFun="ajaxFun"
+ ref="routingTable">
+ <template #toolbar></template>
</ttable>
<el-dialog title="瀵煎叆" :visible.sync="importRoutingVisible" width="50%">
<span>
<div style="display:flex;justify-content:space-around;">
<div>
- <el-upload
- style="margin-left:8px;display: inline;"
- class="upload-demo"
- drag
- :headers="headers"
- :action="zhuangbeiUploadInfo.url"
- :beforeUpload="beforeAvatarUpload"
- :limit="1"
- :show-file-list="false"
- :file-list="zhuangbeifileList"
- :data="zhuangbeiUploadInfo.uploadData"
- :on-success="zhuangbeiFileSuccessUploadScan"
- :on-error="handleError"
+ <el-upload style="margin-left:8px;display: inline;" class="upload-demo" drag :headers="headers"
+ :action="zhuangbeiUploadInfo.url" :beforeUpload="beforeAvatarUpload" :limit="1" :show-file-list="false"
+ :file-list="zhuangbeifileList" :data="zhuangbeiUploadInfo.uploadData"
+ :on-success="zhuangbeiFileSuccessUploadScan" :on-error="handleError"
accept=".xlsx,.xls,.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
- :auto-upload="true"
- ref="zhuangbeiUploadScan"
- multiple
- >
+ :auto-upload="true" ref="zhuangbeiUploadScan" multiple>
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>瀵煎叆瑁呭鏁版嵁</em></div>
<div class="el-upload__tip" slot="tip">
- 鍙兘涓婁紶xlsx/xls鏂囦欢锛屼笖涓嶈秴杩�10M<el-button
- type="text"
- style="font-size:12px;"
- @click="downZhuangbeiDataTemplate"
- >涓嬭浇妯℃澘</el-button
- >
+ 鍙兘涓婁紶xlsx/xls鏂囦欢锛屼笖涓嶈秴杩�10M<el-button type="text" style="font-size:12px;"
+ @click="downZhuangbeiDataTemplate">涓嬭浇妯℃澘</el-button>
</div>
</el-upload>
</div>
<div>
- <el-upload
- style="margin-left:8px;display: inline;"
- class="upload-demo"
- drag
- :headers="headers"
- :action="shepinUploadInfo.url"
- :beforeUpload="beforeAvatarUpload"
- :limit="1"
- :show-file-list="false"
- :file-list="shepinfileList"
- :data="shepinUploadInfo.uploadData"
- :on-success="shepinFileSuccessUploadScan"
- :on-error="handleError"
+ <el-upload style="margin-left:8px;display: inline;" class="upload-demo" drag :headers="headers"
+ :action="shepinUploadInfo.url" :beforeUpload="beforeAvatarUpload" :limit="1" :show-file-list="false"
+ :file-list="shepinfileList" :data="shepinUploadInfo.uploadData"
+ :on-success="shepinFileSuccessUploadScan" :on-error="handleError"
accept=".xlsx,.xls,.csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
- :auto-upload="true"
- ref="shepinUploadScan"
- multiple
- >
+ :auto-upload="true" ref="shepinUploadScan" multiple>
<i class="el-icon-upload"></i>
<div class="el-upload__text"><em>瀵煎叆灏勯鏁版嵁</em></div>
<div class="el-upload__tip" slot="tip">
- 鍙兘涓婁紶xlsx/xls鏂囦欢锛屼笖涓嶈秴杩�10M<el-button
- type="text"
- style="font-size:12px;"
- @click="downShepinDataTemplate"
- >涓嬭浇妯℃澘</el-button
- >
+ 鍙兘涓婁紶xlsx/xls鏂囦欢锛屼笖涓嶈秴杩�10M<el-button type="text" style="font-size:12px;"
+ @click="downShepinDataTemplate">涓嬭浇妯℃澘</el-button>
</div>
</el-upload>
</div>
</div>
</span>
</el-dialog>
- <partDialog
- :currshowlist.sync="showPart"
- @listenToPartEvent="selectPart"
- />
+ <partDialog :currshowlist.sync="showPart" @listenToPartEvent="selectPart" />
</basic-container>
</div>
</template>
@@ -114,7 +56,6 @@
import {
fetchList,
delObj,
- changeState,
changeStateBatch,
exportRoutingTemplate,
routingIfsSync,
@@ -138,7 +79,7 @@
customUpload: true,
uploadInfo: {
// 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl
- isShow: true,
+ isShow: false,
url: '/mes/routing/uploadExcel'
},
prelang: 'routing',
@@ -196,7 +137,7 @@
noShowTip: false
},
// 鏄惁涓轰富宸ヨ壓
- {
+ /* {
minWidth: '120',
prop: 'master',
label: '涓诲伐鑹�',
@@ -210,7 +151,7 @@
formatter: (row, column, cellValue) => {
return cellValue == true ? '鏄�' : '鍚�'
}
- },
+ }, */
// 鐘舵��
{
minWidth: '120',
@@ -266,19 +207,19 @@
searchInfoType: 'text'
},
// 宸ヨ壓绫诲瀷
- {
- minWidth: '120',
- prop: 'bomTypeDb',
- label: '宸ヨ壓绫诲瀷',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'select',
- formatter: this.formatBomTypeDbType,
- optList: () => {
- return this.bomTypeDbOptions
- }
- },
+ // {
+ // minWidth: '120',
+ // prop: 'bomTypeDb',
+ // label: '宸ヨ壓绫诲瀷',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'select',
+ // formatter: this.formatBomTypeDbType,
+ // optList: () => {
+ // return this.bomTypeDbOptions
+ // }
+ // },
// 閫愭閲囩敤鏃ユ湡
{
minWidth: '200',
@@ -300,7 +241,7 @@
searchInfoType: 'datetimerange'
},
// 鏇夸唬
- {
+ /* {
minWidth: '120',
prop: 'alternativeNo',
label: '鏇夸唬',
@@ -308,33 +249,33 @@
isTrue: true,
isSearch: true,
searchInfoType: 'text'
- },
+ }, */
// 鏇夸唬鎻忚堪
- {
- minWidth: '120',
- prop: 'alternativeDesc',
- label: '鏇夸唬鎻忚堪',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ /* {
+ minWidth: '120',
+ prop: 'alternativeDesc',
+ label: '鏇夸唬鎻忚堪',
+ sort: true,
+ isTrue: true,
+ isSearch: true,
+ searchInfoType: 'text'
+ }, */
// 鏄惁宸插悓姝ヨ嚦IFS
- {
- minWidth: '120',
- prop: 'ifsSync',
- label: '宸插悓姝ヨ嚦IFS',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'select',
- optList: () => {
- return this.getIfsSyncOptionList()
- },
- formatter: (row, column, cellValue) => {
- return cellValue == true ? '鏄�' : '鍚�'
- }
- },
+ // {
+ // minWidth: '120',
+ // prop: 'ifsSync',
+ // label: '宸插悓姝ヨ嚦IFS',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'select',
+ // optList: () => {
+ // return this.getIfsSyncOptionList()
+ // },
+ // formatter: (row, column, cellValue) => {
+ // return cellValue == true ? '鏄�' : '鍚�'
+ // }
+ // },
// 鏇存柊鏃堕棿
{
minWidth: '200',
@@ -356,65 +297,8 @@
searchInfoType: 'datetimerange'
}
],
- toolbar: [
- {
- text: '鏂板',
- type: 'primary',
- fun: this.addOrUpdateHandle,
- disabled: false,
- permitArr: []
- },
- {
- text: '鎵瑰噯',
- fun: () => {
- this.approveHandle('ACCEPT')
- },
- disabled: false,
- permitArr: ['01draft']
- },
- {
- text: '鎾ゅ洖',
- fun: () => {
- this.approveHandle('REVOKE')
- },
- disabled: false,
- permitArr: ['02accepted']
- },
- {
- text: '鎷掔粷',
- fun: () => {
- this.approveHandle('CANCEL')
- },
- disabled: false,
- permitArr: ['02accepted']
- },
- {
- text: '澶嶅埗',
- fun: this.copyRouting,
- disabled: false,
- permitArr: []
- },
- {
- text: '鍒犻櫎',
- fun: () => {
- this.deleteAll()
- },
- disabled: false,
- permitArr: []
- }
- ],
- operator: [
- {
- text: '鍒犻櫎',
- type: 'text',
- size: 'small',
- fun: this.deleteHandle
- // show: {
- // val: ['01draft'],
- // key: 'state'
- // }
- }
- ],
+ toolbar: [],
+ operator: null,
operatorConfig: {
fixed: 'right',
label: '鎿嶄綔',
@@ -491,7 +375,82 @@
this.getData()
},
created() {
+ if (this.permissions.technology_routing_add) {
+ this.table.toolbar.push({
+ text: '鏂板',
+ disabled: false,
+ type: 'primary',
+ fun: () => { this.addOrUpdateHandle() },
+ permitArr: []
+ })
+ }
+ if (this.permissions.technology_routing_accept) {
+ this.table.toolbar.push({
+ text: '鎵瑰噯',
+ disabled: true,
+ fun: () => { this.approveHandle('ACCEPT') },
+ permitArr: ['01draft'],
+ })
+ }
+ if (this.permissions.technology_routing_revoke) {
+ this.table.toolbar.push({
+ text: '鎾ゅ洖',
+ disabled: true,
+ fun: () => { this.approveHandle('REVOKE') },
+ permitArr: ['02accepted'],
+ })
+ }
+ if (this.permissions.technology_routing_cancel) {
+ this.table.toolbar.push({
+ text: '鎷掔粷',
+ disabled: true,
+ fun: () => { this.approveHandle('CANCEL') },
+ permitArr: ['02accepted'],
+ })
+ }
+ if (this.permissions.technology_routing_copy) {
+ this.table.toolbar.push({
+ text: '澶嶅埗',
+ disabled: false,
+ fun: () => { this.copyRouting() },
+ permitArr: []
+ })
+ }
+ if (this.permissions.technology_routing_batch_del) {
+ this.table.toolbar.push({
+ text: '鎵归噺鍒犻櫎',
+ type: 'primary',
+ disabled: false,
+ permitArr: [],
+ fun: () => { this.deleteAll() },
+ })
+ }
+ if (this.permissions.technology_routing_del) {
+ this.table.operator = [
+ {
+ text: '鍒犻櫎',
+ type: 'text',
+ size: 'small',
+ fun: this.deleteHandle
+ // show: {
+ // val: ['01draft'],
+ // key: 'state'
+ // }
+ }
+ ]
+ }
this.getBomTypeDbOptions()
+ },
+ watch: {
+ multipleSelection(newVal) {
+ if (newVal.length == 0) {
+ this.table.toolbar.forEach(ele => {
+ if (ele.text == '鎷掔粷' || ele.text == '鎵瑰噯' || ele.text == '鎾ゅ洖') {
+ ele.disabled = true
+ }
+ })
+ }
+ }
},
methods: {
getData() {
@@ -508,8 +467,12 @@
},
// 鏂板 / 淇敼
addOrUpdateHandle(row) {
+ if (!this.permissions.technology_routing_edit && row.id != null) {
+ this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+ return
+ }
this.$router.push({
- name: 'routingForm',
+ path: '/technology/routing/routing-form',
query: { id: row == null ? null : row.id }
})
},
@@ -521,7 +484,7 @@
closeOnClickModal: false,
type: 'warning'
})
- .then(function() {
+ .then(function () {
const ids = []
ids.push(row.id)
return delObj(ids)
@@ -546,7 +509,7 @@
type: 'warning',
closeOnClickModal: false
})
- .then(function() {
+ .then(function () {
const ids = that.multipleSelection.map((item) => {
return item.id
})
@@ -603,7 +566,7 @@
handleSelectionChange(val) {
// 鏍规嵁鐘舵�侊紝绂佺敤琛ㄥご鎸夐挳
// 绛涢�夊嚭閫変腑璁板綍鐨勭姸鎬�
- var stateArr = val.map(function(value, index) {
+ var stateArr = val.map(function (value, index) {
return value.state
})
// 閫変腑鐘舵�佹暟缁勫厓绱犲幓閲�
@@ -613,6 +576,7 @@
uniqueStateArr.push(stateArr[i])
}
}
+ // this.uniqueStateArr = uniqueStateArr
// 寰幆琛ㄥご鎸夐挳锛屽垽鏂瘡涓寜閽殑permitArr鏄惁瀹屽叏鍖呭惈閫変腑鐘舵�侊紝鑻ュ畬鍏ㄥ寘鍚紝鍒欐寜閽寒锛屽惁鍒欐寜閽伆
var toolbar = this.table.toolbar
for (var j = 0; j < toolbar.length; j++) {
--
Gitblit v1.9.3