Browse Source

售后工单 页面功能开发

8521520123jsy 1 năm trước cách đây
mục cha
commit
6af6bc0f9d

+ 1 - 1
pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -10,7 +10,7 @@
 		<AfterSales v-show="current == 2" :itemList="productDetail" :type="type" :isReport="isReport" />
 		<ContactList ref="contactRef" :type="type" v-show="current == 3" :itemList="contactInfoVOS"
 			:isReport="isReport" />
-		<SchemeList v-if="current == 4" :type='type' :itemList="costListVOS" />
+		<SchemeList v-show="current == 4" :type='type' :itemList="costListVOS" />
 
 		<view class="footerButton" v-if="isDisable">
 			<u-button type="default" text="返回" @click="back"></u-button>

+ 53 - 15
pages/salesServiceManagement/workOrder/components/schemeList.vue

@@ -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 || [];
 			}
 		}
 	}