From 617d2ad422a2ae5badc0572b06f33c2791cb95ad Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期五, 29 十二月 2023 14:38:45 +0800
Subject: [PATCH] 质检代码调整
---
src/views/technology/completeproductstructure/index.vue | 292 +++++++++++++++++++++++++++++++--------------------------
1 files changed, 158 insertions(+), 134 deletions(-)
diff --git a/src/views/technology/completeproductstructure/index.vue b/src/views/technology/completeproductstructure/index.vue
index d8d450f..8af0091 100644
--- a/src/views/technology/completeproductstructure/index.vue
+++ b/src/views/technology/completeproductstructure/index.vue
@@ -20,12 +20,13 @@
import {
fetchList,
delObj,
- addByStructure
+ addByStructure,
} from '@/api/technology/completeproductstructure'
import ttable from '@/views/common/ztt-table.vue'
import { mapGetters } from 'vuex'
import { changeState } from '../../../api/technology/completeproductstructure'
import { remote } from '@/api/admin/dict'
+
export default {
data() {
return {
@@ -33,8 +34,8 @@
multipleSelection: [],
uploadInfo: {
// 鏄惁灞曠ず涓婁紶EXCEL浠ュ強瀵瑰簲鐨剈rl
- isShow: true,
- url: 'mes/bom/uploadExcel'
+ isShow: false,
+ url: 'mes/bom/uploadExcel',
},
prelang: 'completeProductStructure',
options: {
@@ -49,7 +50,7 @@
isRefresh: true, // 鏄惁鏄剧ず鍒锋柊鎸夐挳
isShowHide: true, // 鏄惁鏄剧ず鏄惧奖鎸夐挳
isSearch: false, // 楂樼骇鏌ヨ鎸夐挳
- defaultOrderBy: { column: 'id', direction: 'desc' }
+ defaultOrderBy: { column: 'id', direction: 'desc' },
},
table: {
total: 0,
@@ -67,7 +68,7 @@
isTrue: true,
isSearch: true,
searchInfoType: 'text',
- render: { fun: this.addOrUpdateHandle }
+ render: { fun: this.addOrUpdateHandle },
},
// 闆朵欢鍚嶇О
{
@@ -77,7 +78,7 @@
sort: true,
isTrue: true,
isSearch: true,
- searchInfoType: 'text'
+ searchInfoType: 'text',
},
// 闆朵欢鍙�
{
@@ -87,7 +88,7 @@
sort: true,
isTrue: true,
isSearch: true,
- searchInfoType: 'text'
+ searchInfoType: 'text',
},
// 鐘舵��
@@ -112,7 +113,7 @@
formatVal = '宸插彇娑�'
}
return formatVal
- }
+ },
},
// 绫诲瀷
@@ -127,7 +128,7 @@
formatter: this.formatBomTypeDbType,
optList: () => {
return this.bomTypeDbOptions
- }
+ },
},
// 鐗堟湰鍙�
{
@@ -137,61 +138,61 @@
sort: true,
isTrue: true,
isSearch: true,
- searchInfoType: 'text'
+ searchInfoType: 'text',
},
// 鏇夸唬鍙�
- {
- minWidth: '120',
- prop: 'alternativeNo',
- label: '鏇夸唬鍙�',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ // {
+ // minWidth: '120',
+ // prop: 'alternativeNo',
+ // label: '鏇夸唬鍙�',
+ // sort: true,
+ // 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',
+ // },
// 缁濈紭棰滆壊
- {
- minWidth: '120',
- prop: 'insulationColor',
- label: '缁濈紭棰滆壊',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ // {
+ // minWidth: '120',
+ // prop: 'insulationColor',
+ // label: '缁濈紭棰滆壊',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'text',
+ // },
// 鎶ゅ棰滆壊
- {
- minWidth: '120',
- prop: 'sheathColor',
- label: '鎶ゅ棰滆壊',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ // {
+ // minWidth: '120',
+ // prop: 'sheathColor',
+ // label: '鎶ゅ棰滆壊',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'text',
+ // },
// 鐗规��1
- {
- minWidth: '120',
- prop: 'characteristicOne',
- label: '鐗规��1',
- sort: true,
- isTrue: true,
- isSearch: true,
- searchInfoType: 'text'
- },
+ // {
+ // minWidth: '120',
+ // prop: 'characteristicOne',
+ // label: '鐗规��1',
+ // sort: true,
+ // isTrue: true,
+ // isSearch: true,
+ // searchInfoType: 'text',
+ // },
// 鍒涘缓浜�
{
minWidth: '120',
@@ -200,7 +201,7 @@
sort: true,
isTrue: true,
isSearch: true,
- searchInfoType: 'text'
+ searchInfoType: 'text',
},
// 鍒涘缓鏃堕棿
{
@@ -210,99 +211,110 @@
sort: true,
isTrue: true,
isSearch: true,
- searchInfoType: 'datetimerange'
- }
+ searchInfoType: 'datetimerange',
+ },
],
- toolbar: [
- {
- text: '鏂板',
- type: 'primary',
- fun: this.addOrUpdateHandle,
- disabled: false,
- permitArr: []
- },
- {
- text: '浜у搧缁撴瀯鐢熸垚BOM',
- fun: this.addByStructureHandle,
- 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.deleteAll()
- },
- disabled: false,
- permitArr: []
- }
- ],
- operator: [
- {
- text: '鍒犻櫎',
- type: 'text',
- size: 'small',
- fun: this.deleteHandle
- }
- ],
+ toolbar: [],
+ operator: null,
operatorConfig: {
fixed: 'right',
label: '鎿嶄綔',
width: 100,
- minWidth: 100
- }
+ minWidth: 100,
+ },
},
stateOptionList: [
{
value: '01draft',
- label: '鑽夌'
+ label: '鑽夌',
},
{
value: '02accepted',
- label: '宸叉帴鍙�'
+ label: '宸叉帴鍙�',
},
{
value: '03cancelled',
- label: '宸插彇娑�'
- }
+ label: '宸插彇娑�',
+ },
],
- bomTypeDbOptions: []
+ uniqueStateArr: [],
+ bomTypeDbOptions: [],
}
},
components: {
- ttable
+ ttable,
},
computed: {
- ...mapGetters(['permissions'])
+ ...mapGetters(['permissions']),
},
activated() {
this.getData()
},
created() {
+ if(this.permissions.technology_completeproductstructure_bom){
+ this.table.toolbar.push({
+ text: '浜у搧缁撴瀯鐢熸垚BOM',
+ disabled: false,
+ type: 'primary',
+ fun: ()=>{this.addByStructureHandle()},
+ permitArr: [],
+ })
+ }
+ if(this.permissions.technology_completeproductstructure_accept){
+ this.table.toolbar.push({
+ text: '鎵瑰噯',
+ disabled: true,
+ fun: ()=>{this.approveHandle('ACCEPT')},
+ permitArr: ['01draft'],
+ })
+ }
+ if(this.permissions.technology_completeproductstructure_revoke){
+ this.table.toolbar.push({
+ text: '鎾ゅ洖',
+ disabled: true,
+ fun: () => {this.approveHandle('REVOKE')},
+ permitArr: ['02accepted'],
+ })
+ }
+ if(this.permissions.technology_completeproductstructure_cancel){
+ this.table.toolbar.push({
+ text: '鎷掔粷',
+ disabled: true,
+ fun: ()=>{this.approveHandle('CANCEL')},
+ permitArr: ['02accepted'],
+ })
+ }
+ if(this.permissions.technology_completeproductstructure_batch_delete){
+ this.table.toolbar.push({
+ text: '鎵归噺鍒犻櫎',
+ type:'primary',
+ disabled: false,
+ permitArr: [],
+ fun: ()=>{this.deleteAll()},
+ })
+ }
+ if(this.permissions.technology_completeproductstructure_del){
+ this.table.operator = [
+ {
+ text: '鍒犻櫎',
+ type: 'text',
+ size: 'small',
+ fun: this.deleteHandle,
+ },
+ ]
+ }
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: {
getBomTypeDbOptions() {
@@ -331,17 +343,29 @@
},
// 鏂板 / 淇敼
addOrUpdateHandle(row) {
+ if(!this.permissions.technology_completeproductstructure_edit && row.id!=null){
+ this.$message.error("璇ヨ鑹叉病鏈夋搷浣滄潈闄�")
+ return
+ }
this.$router.push({
name: 'completeProductStructure',
- params: { id: row == null ? null : row.id }
+ params: { id: row == null ? null : row.id },
})
},
// 鎸変骇鍝佺粨鏋勭敓鎴怋OM
addByStructureHandle() {
- addByStructure()
- this.$message({
- message: '宸插湪鍚庡彴鐢熸垚BOM锛岃鎵ц缁撴潫鍚庡埛鏂伴〉闈�',
- type: 'success'
+ addByStructure().then((res) => {
+ console.log(res.data.data);
+ let mes="";
+ res.data.data.forEach(item=>{
+ mes+=item
+ })
+ this.$message({
+ message: mes,
+ type: 'success',
+ dangerouslyUseHTMLString: true
+ })
+ this.getData()
})
},
// 鍒犻櫎
@@ -350,9 +374,9 @@
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning',
- closeOnClickModal: false
+ closeOnClickModal: false,
})
- .then(function() {
+ .then(function () {
const ids = []
ids.push(row.id)
return delObj(ids)
@@ -374,9 +398,9 @@
confirmButtonText: '纭畾',
cancelButtonText: '鍙栨秷',
type: 'warning',
- closeOnClickModal: false
+ closeOnClickModal: false,
})
- .then(function() {
+ .then(function () {
const ids = that.multipleSelection.map((item) => {
return item.id
})
@@ -427,7 +451,7 @@
handleSelectionChange(val) {
// 鏍规嵁鐘舵�侊紝绂佺敤琛ㄥご鎸夐挳
// 绛涢�夊嚭閫変腑璁板綍鐨勭姸鎬�
- var stateArr = val.map(function(value, index) {
+ var stateArr = val.map(function (value, index) {
return value.state
})
// 閫変腑鐘舵�佹暟缁勫厓绱犲幓閲�
@@ -457,7 +481,7 @@
},
getStateOptionList() {
return this.stateOptionList
- }
- }
+ },
+ },
}
</script>
--
Gitblit v1.9.3