|
|
@@ -2,7 +2,7 @@
|
|
|
<view class="scheme">
|
|
|
<u-list class="listContent">
|
|
|
<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
|
|
|
- <myCard :item="item" @details="add('view',item)" @edit="add('edit',item,index)" :index="index+1"
|
|
|
+ <myCard :item="item" @del="del(index)" @edit="add('edit',item,index)" :index="index+1"
|
|
|
:columns="columns" :btnList="btnData">
|
|
|
</myCard>
|
|
|
</view>
|
|
|
@@ -33,6 +33,7 @@
|
|
|
itemList: {
|
|
|
handler(newVal) {
|
|
|
let list = JSON.parse(JSON.stringify(newVal));
|
|
|
+ console.log(list, 'list-------')
|
|
|
this.tableList = list
|
|
|
},
|
|
|
deep: true,
|
|
|
@@ -106,19 +107,34 @@
|
|
|
}],
|
|
|
],
|
|
|
btnList: [{
|
|
|
- name: '修改',
|
|
|
- apiName: 'edit',
|
|
|
- btnType: 'primary',
|
|
|
- type: '2',
|
|
|
- pageUrl: '',
|
|
|
- juge: [{
|
|
|
- authorities: '',
|
|
|
- }, {
|
|
|
- key: 'customize',
|
|
|
- value: ['5'],
|
|
|
+ name: '修改',
|
|
|
+ apiName: 'edit',
|
|
|
+ btnType: 'primary',
|
|
|
+ type: '2',
|
|
|
+ pageUrl: '',
|
|
|
+ judge: [{
|
|
|
+ authorities: '',
|
|
|
+ }, {
|
|
|
+ key: 'customize',
|
|
|
+ value: ['5'],
|
|
|
+
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '删除',
|
|
|
+ apiName: 'del',
|
|
|
+ btnType: 'primary',
|
|
|
+ type: '2',
|
|
|
+ pageUrl: '',
|
|
|
+ judge: [{
|
|
|
+ authorities: '',
|
|
|
+ }, {
|
|
|
+ key: 'customize',
|
|
|
+ value: ['5'],
|
|
|
|
|
|
- }]
|
|
|
- }],
|
|
|
+ }]
|
|
|
+ },
|
|
|
+ ],
|
|
|
tableList: []
|
|
|
}
|
|
|
},
|
|
|
@@ -133,7 +149,7 @@
|
|
|
created() {
|
|
|
uni.$off('updateInfo');
|
|
|
uni.$on('updateInfo', (data) => {
|
|
|
- console.log(data,'data ----')
|
|
|
+ console.log(data, 'data ----')
|
|
|
data.customize = '5';
|
|
|
if (data.index || data.index == 0) {
|
|
|
let index = data.index;
|
|
|
@@ -157,8 +173,30 @@
|
|
|
url: `/pages/salesServiceManagement/workOrder/components/schemeAdd?obtain=仓库&type=${type}&data=${data}`
|
|
|
})
|
|
|
},
|
|
|
+ del(index) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '确认删除',
|
|
|
+ content: '确定要删除所选方案数据吗?',
|
|
|
+ confirmText: '删除',
|
|
|
+ confirmColor: '#FF4D4F',
|
|
|
+ success: (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ this.tableList.splice(index, 1)
|
|
|
+ } else if (res.cancel) {
|
|
|
+ // 用户点击了取消按钮
|
|
|
+ console.log('用户取消删除');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
getTabData() {
|
|
|
- return this.tableList || [];
|
|
|
+ let list = this.tableList.map((el)=>{
|
|
|
+ if (el.customize) {
|
|
|
+ delete el.customize;
|
|
|
+ }
|
|
|
+ return el;
|
|
|
+ })
|
|
|
+ return list || [];
|
|
|
}
|
|
|
}
|
|
|
}
|