wsx 10 сар өмнө
parent
commit
ff87748ad7

+ 1 - 1
pages/saleManage/businessOpportunity/index.vue

@@ -73,7 +73,7 @@
 					type: '1',
 					pageUrl: '/pages/saleManage/businessOpportunity/add',
 					judge: [{
-						authorities: 'eom:businessopportunity:update',
+						authorities: '',
 					},{
 						key: 'approvalStatus',
 						value: [0, 3],

+ 5 - 1
pages/saleManage/components/selectContact.vue

@@ -157,7 +157,11 @@
 			confirm([id]) {
 				this.categoryLevelId = id
 				this.page = 1
-				this.listData.forEach(item => item.checked = false)
+
+
+				if (this.isAll === '2') {
+					this.listData.forEach(item => item.checked = false)
+				}
 
 				this.getList()
 			},

+ 1 - 0
pages/salesServiceManagement/demandList/add.vue

@@ -144,6 +144,7 @@
 				this.$set(this.form, 'orderId', data.orderId);
 				console.log(data, 'data');
 				let list = JSON.parse(JSON.stringify(data.tableList));
+				console.log(list);
 				// 如果计量数量没有的话默认是 1
 				list.map(
 					(el) =>

+ 62 - 15
pages/salesServiceManagement/demandList/components/AfterSales.vue

@@ -1,6 +1,8 @@
 <template>
 	<view class="after_sales">
-		<view class="sales_info" v-if="tableList.length > 0">
+		<block v-for="item in tableList" :key="item.id">
+
+			<!-- 	<view class="sales_info" v-if="tableList.length > 0">
 			<view>名称:{{ fieldRow('categoryName') }}</view>
 			<view>类型:{{ fieldRow('productCategoryName') }}</view>
 			<view>编码:{{ fieldRow('categoryCode') }}</view>
@@ -17,7 +19,35 @@
 				<u-button v-if="!isReport" @click="del" :plain="true" :hairline="true" size='mini' type="default"
 					class="delete" text="删除"></u-button>
 			</view>
-		</view>
+		</view> -->
+
+			<view class="sales_info">
+				<view>名称:{{ item.categoryName }}</view>
+				<view>类型:{{ item.productCategoryName }}</view>
+				<view>编码:{{ item.categoryCode }}</view>
+				<view>发货条码:{{ item.barcodes }}</view>
+				<view>发货时间:{{ item.shipmentDate }}</view>
+				<view>质保有效期:{{ item.guaranteePeriodDeadline }}</view>
+				<view>计量数量:{{ item.measureQuantity }}</view>
+				<view class="action" v-if="type != 'view'">
+					<text class="text">
+						操作:
+					</text>
+					<!-- <u-button @click="goProblem('add','',item.id)" :plain="true" :hairline="true" size='mini'
+						type="default" text="添加故障"></u-button> -->
+					<u-button @click="addFault('add','',item.id)" :plain="true" :hairline="true" size='mini'
+						type="default" text="添加故障"></u-button>
+					<u-button v-if="!isReport" @click="del(item.id)" :plain="true" :hairline="true" size='mini'
+						type="default" class="delete" text="删除"></u-button>
+				</view>
+
+
+				<!-- <block v-for="item"></block> -->
+			</view>
+
+
+		</block>
+
 		<div class="wapper">
 			<view v-for="(item, index) in faultDetails" :key="index" class="view_box" style="position: relative;">
 				<myCard @edit="goProblem('edit',index,item)" @del="delProblem(index)" :item="item" :index="index+1"
@@ -69,10 +99,14 @@
 		},
 		computed: {
 			faultDetails() {
+				let arr = []
+				console.log(this.tableList);
 				if (this.tableList.length > 0) {
-					return this.tableList[0].faultDetails
+					this.tableList.forEach(item =>
+						arr.push(...item.faultDetails))
 				}
-				return []
+				console.log(arr);
+				return arr
 			},
 			fieldRow() {
 				return (field) => {
@@ -105,6 +139,7 @@
 		},
 		data() {
 			return {
+				dataId: '',
 				typeOptions: [{
 						text: '维修',
 						value: '1'
@@ -181,20 +216,22 @@
 				data,
 				index
 			}) => {
-				console.log(data, 'datadatadatadatadatadata')
-				if (type == 'add' || type == 'report') {
-					if (this.isReport) {
-						data.customize = '5'
-					}
-					this.tableList[0].faultDetails.push(data)
-				} else {
-					this.$set(this.tableList[0].faultDetails, index, data)
+				console.log(type);
+				console.log(this.tableList);
+				console.log(data);
+
+				if (type === 'add') {
+					this.tableList.find(item => item.id === this.dataId).faultDetails.push(data)
 				}
+
+
 			})
 
 		},
 		methods: {
-			del() {
+			del(id) {
+				console.log(id);
+				console.log(this.tableList);
 				uni.showModal({
 					title: '确认删除',
 					content: '确定要删除这条售后对象吗?',
@@ -202,7 +239,7 @@
 					confirmColor: '#FF4D4F',
 					success: (res) => {
 						if (res.confirm) {
-							this.tableList = [];
+							this.tableList = this.tableList.filter(item => item.id !== id);
 						} else if (res.cancel) {
 							// 用户点击了取消按钮
 							console.log('用户取消删除');
@@ -242,7 +279,16 @@
 					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&index=${index}&data=${data}&str=${str}&arr=${encodeURIComponent(arr)}`
 				})
 			},
-			addFault() {
+			addFault(type, index, id) {
+				this.dataId = id
+				console.log(id);
+				let str = this.type == 'report' ? 'report' : '';
+				// let resD = JSON.parse(JSON.stringify(obj));
+
+				uni.navigateTo({
+					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&str=${str}`
+				})
+
 
 			},
 			// 返回列表数据
@@ -263,6 +309,7 @@
 <style lang="scss" scoped>
 	.after_sales {
 		height: calc(100vh - 246rpx);
+
 		.sales_info {
 			padding: 8px 16px;
 			font-size: 13px;

+ 5 - 5
pages/salesServiceManagement/demandList/components/Invoice.vue

@@ -121,7 +121,7 @@ export default {
       };
     },
     checkListLen() {
-      return this.detailsData.id ? 1 : 0;
+      return this.detailsData.length
     },
   },
   data() {
@@ -131,7 +131,7 @@ export default {
       page: 1,
       size: 10,
       dataList: [],
-      detailsData: {},
+      detailsData: [],
     };
   },
   onLoad({ contactId }) {
@@ -186,11 +186,11 @@ export default {
       } else {
         this.$refs.itemRef.resetTable();
       }
-      this.detailsData = {};
+      this.detailsData = [];
     },
     // 选择
     jumpAdd() {
-      if (!this.detailsData.id) {
+      if (!this.detailsData.length) {
         this.$refs.uToast.show({
           type: "warning",
           message: "请选择一条物品明细数据",
@@ -201,7 +201,7 @@ export default {
       let data = {
         orderCode: obj.docNo,
         orderId: obj.id,
-        tableList: [this.detailsData],
+        tableList: this.detailsData,
       };
       uni.$emit("goosData", data);
       uni.navigateBack();

+ 22 - 9
pages/salesServiceManagement/demandList/components/itemSelect.vue

@@ -50,11 +50,13 @@
 		data() {
 			return {
 				listData: [],
+				sectionList: []
 			}
 		},
 		onLoad({}) {},
 		methods: {
 			async getData(row) {
+				this.sectionList = [];
 				this.listData = [];
 				let params = {
 					code: 'after_sales_product_list_source'
@@ -66,7 +68,8 @@
 					this._getInfo(row.docNo);
 				}
 			},
-			resetTable(){
+			resetTable() {
+				this.sectionList = [];
 				this.listData = [];
 			},
 			async _getInfo(sourceBizNo) {
@@ -89,7 +92,7 @@
 						return {
 							...productItem,
 							outInDetailRecordRequestList: productItem.outInDetailRecordRequestList.map((
-							packingItem) => {
+								packingItem) => {
 								return {
 									...packingItem,
 									categoryName: productItem.categoryName,
@@ -132,14 +135,24 @@
 				this.listData = list;
 			},
 			async selectVal(e, val, index) {
+				// 添加进选中的数组
+				if (e.detail.value.length && e.detail.value[0] === val.id) {
+					this.sectionList.push(val)
+				}
+				if (!e.detail.value.length) {
+					this.sectionList = this.sectionList.filter(item => item.id !== val.id)
+				}
+				// if()
+				console.log(this.sectionList);
 				this.$set(this.listData[index], 'checked', !this.listData[index].checked)
-				this.listData.forEach((item, i) => {
-					if (item.id != val.id) {
-						this.$set(this.listData[i], 'checked', false)
-					}
-				})
-				let data = val.checked ? val : {};
-				this.$emit('getDetails', data);
+				// this.listData.forEach((item, i) => {
+				// 	if (item.id != val.id) {
+				// 		this.$set(this.listData[i], 'checked', false)
+				// 	}
+				// })
+				// this.sectionList.push(val)
+				// let data = val.checked ? val : {};
+				this.$emit('getDetails', this.sectionList);
 			},
 			getTime(createTime) {
 				let date = new Date(createTime);

+ 38 - 22
pages/salesServiceManagement/demandList/index.vue

@@ -56,7 +56,7 @@
 				</form>
 			</view>
 		</uni-popup>
-		<!-- <Screen ref="screen" @succeed="doSearch" /> -->
+
 		<u-toast ref="uToast"></u-toast>
 
 		<MySearch :show.sync="searchShow" :formItems="formItems" @search="confirmSearch" ref="mySearchRef">
@@ -66,24 +66,43 @@
 </template>
 
 <script>
+	import {
+		getByCode
+	} from '@/api/pda/common.js'
+
+	import {
+		initDict
+	} from '@/utils/utils.js'
+
+
 	import {
 		getTableList,
 		revokeSalesDemand,
 		deleteSalesDemand
 	} from '@/api/salesServiceManagement/demandList/index.js'
 	import myCard from '@/pages/saleManage/components/myCard.vue'
-	import Screen from './screen.vue'
+
+
 	export default {
 		components: {
 			myCard,
-			Screen
 		},
-
+		watch: {
+			fault_level_arr: {
+				handler(val) {
+					console.log(val);
+					this.formItems.find(item => item.prop === 'faultLevel').props.localdata = val
+				},
+				deep: true
+			}
+		},
 		data() {
 			return {
 				searchForm: {},
 				emptyShow: false,
 				searchShow: false,
+				fault_level_obj: {},
+				fault_level_arr: [],
 				formItems: [{
 						label: '客户名称:',
 						prop: 'contactName',
@@ -122,13 +141,7 @@
 						prop: 'faultLevel',
 						component: 'MySelect',
 						props: {
-							localdata: [{
-								label: '一般',
-								value: 1
-							}, {
-								label: '紧急',
-								value: 2
-							}],
+							localdata: [],
 							dataKey: 'label',
 							dataValue: 'value'
 						}
@@ -249,11 +262,8 @@
 					}, {
 						label: '故障等级:',
 						prop: 'faultLevel',
-						formatter(row) {
-							let cellValue = row.faultLevel;
-							return cellValue == 1 ?
-								'紧急' : cellValue == 2 ? '一般' : ''
-
+						formatter: (row) => {
+							return this.fault_level_obj && this.fault_level_obj[row.faultLevel] || ''
 						}
 					}],
 					[{
@@ -292,23 +302,29 @@
 				]
 			}
 		},
-		computed: {
-
-		},
 
 		onReachBottom() {
 			console.log('123');
 			this.getList()
 		},
-
+		onLoad() {
+			this.getDict()
+		},
 		onShow() {
 			this.doSearch();
 		},
 
+
 		methods: {
-			handleSearch() {
-				this.$refs.screen.open();
+			async getDict() {
+				let res = await getByCode('fault_level')
+				let [arr, obj] = initDict(res)
+				this.fault_level_obj = obj
+				this.fault_level_arr = arr
+				console.log(this.fault_level_obj);
+				// console.log(arr, obj);
 			},
+
 			doSearch() {
 				this.isEnd = false
 				this.page = 1

+ 2 - 11
pages/salesServiceManagement/workOrder/index.vue

@@ -43,8 +43,6 @@
 </template>
 
 <script>
-	// import MyPicker from '@/uni_modules/uview-ui/components/u-picker/u-picker.vue'
-
 	import {
 		getByCode
 	} from '@/api/pda/common.js'
@@ -61,9 +59,7 @@
 	import myCard from '@/pages/saleManage/components/myCard.vue'
 	import CheckAndAccept from './components/forWork/checkAndAccept.vue'
 	import Evaluate from './components/forWork/evaluate.vue'
-	import {
-		login
-	} from '../../../api/common'
+
 	export default {
 		components: {
 			myCard,
@@ -241,7 +237,7 @@
 						label: '故障等级:',
 						prop: 'faultLevel',
 						formatter: (row) => {
-							console.log();
+							console.log(this.fault_level_obj);
 							return this.fault_level_obj[row.faultLevel]
 						}
 					}, {
@@ -403,13 +399,8 @@
 				],
 			}
 		},
-		computed: {},
 		onLoad() {
-
 			this.getDict()
-
-
-
 		},
 		onShow() {
 			this.doSearch();