Ver código fonte

新增售后需求派单功能及优化表单交互

yusheng 7 meses atrás
pai
commit
f751d8e28e

+ 10 - 0
api/salesServiceManagement/demandList/index.js

@@ -85,4 +85,14 @@ export async function deleteSalesDemand(data) {
 		return res.data;
 	}
 	return Promise.reject(new Error(res.message));
+}
+
+
+// 需求派单
+export async function demanDispatch(data) {
+	const res = await putJ(Vue.prototype.apiUrl + `/eom/afterSalesDemand/dispatch`, data);
+	if (res.code == 0) {
+		return res.data;
+	}
+
 }

+ 58 - 19
hybrid/html/a.html

@@ -20,14 +20,19 @@
 				align-items: center;
 				margin-bottom: 10px;
 			}
-.blank_adopzrdd>span {
-					display: inline-block;
-					width: 80px;
-				}
-			:root#app{ background: #4298fd0d;
+
+			.blank_adopzrdd>span {
+				display: inline-block;
+				width: 80px;
+			}
+
+			:root#app {
+				background: #4298fd0d;
+			}
+
+			::v-deep.fm-form-item {
+				margin-bottom: 10px !important;
 			}
-			::v-deep.fm-form-item{ margin-bottom:10px !important;
-		     }
 		</style>
 		<div id="app">
 
@@ -46,8 +51,8 @@
 						<div v-for="(item, index) in scope.model.blank_adopzrdd" :key="index" style="width: 100%;">
 							<div class="blank_adopzrdd">
 								<span>{{ index + 1 }}报销事项:</span>
-								<van-field    rows="1" v-model="scope.model.blank_adopzrdd[index].remark" type="textarea" autosize
-									style="width: calc(100% - 80px)"></van-field>
+								<van-field rows="1" v-model="scope.model.blank_adopzrdd[index].remark" type="textarea"
+									autosize style="width: calc(100% - 80px)"></van-field>
 							</div>
 							<div class="blank_adopzrdd">
 								<span>
@@ -64,15 +69,15 @@
 
 					</div>
 				</template>
+				<template v-slot:manage_workorder="scope">
+
+
+					<van-field v-model="scope.model.manage_workorder.code" readonly @click="addWorkOrder()"></van-field>
+				</template>
 
 			</fm-generate-vant-form>
 			<div>
-				<!-- <van-form>
-					<van-cell-group inset>
-						<van-field type="textarea" v-model="form.reason" label="意见" placeholder="" rows="2" autosize
-							show-word-limit />
-					</van-cell-group>
-				</van-form> -->
+
 				<div v-if='isEdit'
 					style="display: flex;justify-content: space-between; padding: 30px 30px; position: fixed; bottom: 0; width: 100%; height: 80px;">
 					<van-button style="width:48%" type="primary" @click="handleAudit(1)">提交
@@ -95,6 +100,7 @@
 				EnvObj = res;
 				console.log('当前环境:' + JSON.stringify(res));
 			});
+
 			Vue.createApp({
 				data() {
 					return {
@@ -109,11 +115,17 @@
 					}
 				},
 				created() {
+					let _this = this
+					window.x_sun = (e) => {
+						_this.setSalesServiceWork(JSON.parse(e))
+
+					}
+
+
 					this.headers = this.getQueryParams('headers');
 					let params = this.getQueryParams('params');
 					this.isEdit = params.isEdit || true
 					this.APIUrl = this.headers.serverInfo || 'http://192.168.1.105:18086'
-					console.log(params)
 					axios({
 						method: 'get',
 						url: this.APIUrl + `/flowable/bpmcustomform/getById/${params.id}`,
@@ -123,7 +135,9 @@
 							this.form = res.data.data
 							this.form.formId = res.data.data.id
 							this.form.id = ''
-							this.form.valueJson = {}
+							this.form.valueJson = {
+								manage_workorder: 3333
+							}
 							this.title = this.form.name
 							this.jsonData = JSON.parse(res.data.data.formJson.makingJson);
 							this.jsonData.list.forEach(item => {
@@ -154,6 +168,7 @@
 
 								}
 							})
+
 							this.jsonData.config.dataSource && this.jsonData.config.dataSource.forEach(item => {
 								item.headers = {
 									Authorization: this.headers.Authorization
@@ -161,9 +176,20 @@
 								item.url = item.url && item.url.replace('/api', this.APIUrl)
 							})
 							this.isFlag = true
+							if (params.manage_workorder) {
+								this.$nextTick(() => {
+									this.$refs.generateForm.setRules('manage_workorder', [{
+										required: false,
+										message: '必须填写'
+									}])
+									this.setSalesServiceWork(params.manage_workorder)
+								})
 
+
+							}
 						}
 					});
+
 					// axios({
 					// 	method: 'get',
 					// 	url: this.APIUrl + `/bpm/task/list-by-process-instance-id?processInstanceId=${params.id}`,
@@ -178,7 +204,13 @@
 
 				},
 				methods: {
-
+					addWorkOrder() {
+						uni.postMessage({
+							data: {
+								type: 'selectWork',
+							}
+						});
+					},
 
 					async addNewRow(key) {
 						console.log(key);
@@ -209,11 +241,18 @@
 							input_jd9ouzyh: num
 						});
 					},
+					setSalesServiceWork(data) {
+						this.$refs.generateForm.setData({
+							manage_workorder: data
+						});
+
+
+					},
 
 					getQueryParams(queryName) {
 						const urlSearchParams = new URLSearchParams(window.location.search);
 						const query = urlSearchParams.get(queryName);
-						console.log(query,'query')
+						console.log(query, 'query')
 						return JSON.parse(query);
 					},
 					generateFormValid(validate = true) {

+ 1 - 1
hybrid/html/c.html

@@ -49,7 +49,7 @@
 								<span>
 
 									金额:</span>
-								<van-field v-model="scope.model.blank_adopzrdd[index].price" type="number"
+								<van-field v-model="scope.model.blank_adopzrdd[index].price" type="number" 
 									style="width: calc(100% - 80px)"></van-field>
 							</div>
 

+ 2 - 2
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智慧工厂",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.3.24",
+    "versionName" : "V1.0.3.25",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {
@@ -10,7 +10,7 @@
             "proxy" : {
                 "/api" : {
                     // "target" : "http://192.168.1.110:18086/",
-                    "target" : "http://192.168.1.125:18086/",
+                    "target" : "http://192.168.1.251:18086/",
                     // "target" : "http://192.168.1.251:18086/",
                     // "target": "http://192.168.1.251:18186",
                     "changeOrigin" : true,

+ 78 - 37
pages/home/wt/components/formParser/routerView.vue

@@ -1,9 +1,9 @@
 <template>
 	<view class="blacklog-container">
-<!-- 		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="back">
+		<!-- 		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="title" @clickLeft="back">
 		</uni-nav-bar> -->
-<!-- 		<div style="height: 88rpx;width: 100%;"></div> -->
-			<web-view style="margin-top: 88rpx;" v-if="isShow" :src="webViewUrl"></web-view>
+		<!-- 		<div style="height: 88rpx;width: 100%;"></div> -->
+		<web-view style="margin-top: 88rpx;" :src="webViewUrl" ref="webViewRef" @message="getMessage"></web-view>
 	</view>
 </template>
 
@@ -12,46 +12,87 @@
 	import {
 		getParentIdListByDeptId
 	} from '@/api/common.js'
-	export default{
-		data(){
-			return{
-				isShow:false,
-				webViewUrl:'',
-				title:'申请'
+	export default {
+		data() {
+			return {
+				isShow: false,
+				webViewUrl: '',
+				title: '申请'
 			}
 		},
+
+		methods: {
+			getMessage(event) {
+				let data = event.detail.data
+				console.log(data, 'dsdsd')
+				if (data[0].type == 'selectWork') {
+					uni.navigateTo({
+						url: `/pages/salesServiceManagement/accessory/components/selectWork?isPieCar=1`
+					})
+				}
+
+			}
+		},
+		mounted() {
+			uni.$off('updateWorkData')
+			uni.$on('updateWorkData', ({
+				data
+			}) => {
+				this.$nextTick(() => {
+					console.log(this.$scope.$getAppWebview(), 'this.$refs.webViewRef')
+					let webView = this.$scope.$getAppWebview()
+
+					if (webView) {
+						webView.children()[0].evalJS(`window.x_sun('${
+							JSON.stringify({
+								id: data.id, // 列表工单ID
+								code: data.code, // 列表工单编号(要显示的code)
+								name: data.planName // 列表工单名称(可选,根据弹窗需求传递)
+							})
+						}')`)
+
+					}
+
+				})
+			})
+		},
+
+
 		async onLoad(option = {}) {
+
+
 			let headers = {};
 			const value = uni.getStorageSync("token"); //取存本地的token
 			// const apiInfo = uni.getStorageSync("apiInfo"); //取存本地的token
-			
-			console.log(Vue.prototype.apiUrl,'apiInfo')
-			  headers = {
-			    "content-type": "application/json",
-			    "zoomwin-token": value,
-			    Authorization: value,
-			    "zoomwin-sid": uni.getStorageSync("userInfo").sessionId,
-				serverInfo : Vue.prototype.apiUrl||'',
-			  };
-			  //http://192.168.1.105:18086
-			  let params =  JSON.parse(option.params)
-			  let userInfo = uni.getStorageSync("userInfo")
-			  params.userInfo={
-				  userId:userInfo.userId,
-				  groupId:userInfo.groupId
-			  }
-			  let html = params.type =='add'? 'a.html':'c.html'
-			  this.title= params.type =='add'? '申请':'审批'
-			  try{
-				   params.userInfo.groupIdList = await getParentIdListByDeptId(params.userInfo.groupId)
-			  }catch{
-				  params.userInfo.groupIdList = []
-			  }
-			   console.log(params)
-		  setTimeout(()=>{
-			  this.webViewUrl = `/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
-			  this.isShow = true
-		  })
+
+			console.log(Vue.prototype.apiUrl, 'apiInfo')
+			headers = {
+				"content-type": "application/json",
+				"zoomwin-token": value,
+				Authorization: value,
+				"zoomwin-sid": uni.getStorageSync("userInfo").sessionId,
+				serverInfo: Vue.prototype.apiUrl || '',
+			};
+			//http://192.168.1.105:18086
+			let params = JSON.parse(option.params)
+			let userInfo = uni.getStorageSync("userInfo")
+			params.userInfo = {
+				userId: userInfo.userId,
+				groupId: userInfo.groupId
+			}
+			let html = params.type == 'add' ? 'a.html' : 'c.html'
+			this.title = params.type == 'add' ? '申请' : '审批'
+			try {
+				params.userInfo.groupIdList = await getParentIdListByDeptId(params.userInfo.groupId)
+			} catch {
+				params.userInfo.groupIdList = []
+			}
+			console.log(params)
+			setTimeout(() => {
+				this.webViewUrl =
+					`/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
+				this.isShow = true
+			})
 		},
 	}
 </script>

+ 7 - 2
pages/saleManage/components/myCard.vue

@@ -20,7 +20,7 @@
 
 				<view class="item_one rx-sc" v-else-if="val.type=='action'">
 					<view class="lable">{{val.label}}</view>
-					<view class="text">
+					<view class="text" style="flex-wrap: wrap;">
 						<template v-for="(btn,bI) in btnList">
 							<u-button :plain="true" :hairline="true" size='mini' :type="btn.btnType" v-if="judge(btn)"
 								:text="btn.name" @click="action(btn)" :key="bI"></u-button>
@@ -73,7 +73,8 @@
 						item.judge.forEach(({
 							key,
 							value,
-							authorities
+							authorities,
+							fn
 						}) => {
 							if (authorities) {
 								is = this.$isAuthorities(authorities)
@@ -81,6 +82,9 @@
 							if (value && !value.includes(this.item[key])) {
 								is = false
 							}
+							if(fn){
+								is=fn(this.item) 
+							}
 						})
 						return is
 					} else {
@@ -154,6 +158,7 @@
 					color: #fff !important;
 					border: none;
 					background: #157a2c;
+					margin-top: 3px;
 
 
 					// border: none;

+ 12 - 1
pages/salesServiceManagement/accessory/components/selectWork.vue

@@ -93,6 +93,8 @@
 				checkData: {},
 				pageNum: 1,
 				isEnd: false,
+				orderStatusList:'',
+				isPieCar:''
 			}
 		},
 		computed: {
@@ -108,7 +110,9 @@
 				}
 			}
 		},
-		onLoad() {
+		onLoad(data) {
+			this.orderStatusList=data.orderStatusList
+			this.isPieCar=data.isPieCar
 			this.doSearch();
 		},
 		methods: {
@@ -129,6 +133,13 @@
 					pageNum: this.page,
 					size: 10,
 				}
+				if(this.orderStatusList){
+					data.orderStatusList=this.orderStatusList
+				}
+				if(this.isPieCar){
+					data.isPieCar=this.isPieCar
+				}
+				
 				getSalesWorkOrder(data).then(res => {
 					if (this.page === 1) {
 						this.tableList = res.list;

+ 171 - 28
pages/salesServiceManagement/demandList/add.vue

@@ -54,6 +54,70 @@
 				<uni-datetime-picker :disabled="!isDisable" type="date" slot="value" v-model="form.expectedTime">
 				</uni-datetime-picker>
 			</u-cell>
+			<u-cell title="售后类型" arrow-direction="down">
+				<uni-data-picker :readonly="!isDisable" v-model="form.afterSalesType" slot="value" placeholder="请选择"
+					:localdata="after_sales_type">
+				</uni-data-picker>
+			</u-cell>
+			<u-cell title="是否收费" arrow-direction="down">
+				<uni-data-picker v-if="isDisable" v-model="form.isFee" slot="value" placeholder="请选择"
+					:localdata="chargeList">
+				</uni-data-picker>
+				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
+					:value="form.isFee==1?'是':'否'">
+
+				</u--input>
+
+			</u-cell>
+			<u-cell title="是否带配件" arrow-direction="down">
+				<uni-data-picker v-if="isDisable" v-model="form.isWithAccessories" slot="value" placeholder="请选择"
+					:localdata="chargeList">
+				</uni-data-picker>
+				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
+					:value="form.isWithAccessories==1?'是':'否'">
+
+				</u--input>
+			</u-cell>
+			<u-cell title="是否派车" arrow-direction="down">
+				<uni-data-picker v-if="isDisable" v-model="form.isPieCar" slot="value" placeholder="请选择"
+					:localdata="chargeList">
+				</uni-data-picker>
+				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
+					:value="form.isPieCar==1?'是':'否'">
+
+				</u--input>
+			</u-cell>
+			<u-cell title="派车类型" arrow-direction="down" v-if="form.isPieCar==1">
+				<uni-data-picker v-if="isDisable" v-model="form.pieCarType" slot="value" placeholder="请选择"
+					:localdata="pie_car_type">
+				</uni-data-picker>
+				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
+					:value="form.pieCarType==1?'是':'否'">
+				
+				</u--input>
+			</u-cell>
+			<u-cell title="是否外包" arrow-direction="down">
+				<uni-data-picker v-if="isDisable" v-model="form.isOutsource" slot="value" placeholder="请选择"
+					:localdata="chargeList">
+				</uni-data-picker>
+				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
+					:value="form.isOutsource==1?'是':'否'">
+				
+				</u--input>
+			</u-cell>
+			<u-cell title="是否生成采购订单" arrow-direction="down">
+				<uni-data-picker v-if="isDisable" v-model="form.isCreatePurchaseOrder" slot="value"
+					placeholder="请选择" :localdata="chargeList">
+				</uni-data-picker>
+				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
+					:value="form.isCreatePurchaseOrder==1?'是':'否'">
+				
+				</u--input>
+			</u-cell>
+			<u-cell title="涉及事业部门" arrow-direction="down">
+				<u--input slot="value" :disabled="!isDisable" placeholder="请选择" border="surround" v-model="form.involveDeptName"
+					@click.native="salesDeptShow"></u--input>
+			</u-cell>
 			<u-cell title="报修人" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
 					<u--input style="flex:1" placeholder="请输入" disabled border="surround" v-model="createUserName">
@@ -61,7 +125,8 @@
 				</view>
 			</u-cell>
 		</u-cell-group>
-		<AfterSales ref="salesRef" :type="type" v-show="current == 1" :itemList="form.productDetail" />
+		<AfterSales ref="salesRef" :type="type" v-show="current == 1" :afterSalesType="form.afterSalesType"
+			:itemList="form.productDetail" />
 		<!-- 联系人 -->
 		<ContactList ref="contactRef" :type="type" v-show="current == 2" :itemList="form.contactInfoVOS" />
 		<view class="footerButton" v-if="isDisable">
@@ -69,6 +134,8 @@
 			<u-button type="primary" @click="save" text="保存"></u-button>
 		</view>
 		<u-toast ref="uToast"></u-toast>
+		<ba-tree-picker ref="treePicker" :multiple="false" @select-change="confirm" :localdata="listData" valueKey="id"
+			textKey="name" childrenKey="children" />
 	</view>
 </template>
 
@@ -86,6 +153,10 @@
 	} from '@/api/salesServiceManagement/demandList/index.js'
 	import AfterSales from './components/AfterSales.vue'
 	import ContactList from './components/contactList.vue'
+	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
+	import {
+		listOrganizations,
+	} from '@/api/myTicket/index.js'
 	export default {
 		components: {
 			AfterSales,
@@ -98,7 +169,7 @@
 			},
 			orderCodeName() {
 				let name = this.associationTypeList.find(item => item.value === this.form.associationType)?.text || ''
-				if(name === '客户') {
+				if (name === '客户') {
 					return '产品'
 				}
 				return name
@@ -107,19 +178,28 @@
 		data() {
 			return {
 				form: {
-					code: '',
-					name: '',
-					contactName: '',
-					expectedTime: '',
-					faultLevel: '',
-					contactAddress: '',
-					orderCode: '',
-					productDetail: [],
+					tableList: [],
 					contactInfoVOS: [],
-					contactCode: '',
+					faultDetailList: [],
+					associationType: '1',
+					aftertype: '',
+					salespersonName: '',
+					salespersonId: '',
+					isWithAccessories: 0,
+					isFee: 0,
+					isPieCar: 0,
+					pieCarType: '',
+					isOutsource: 0,
+					isCreatePurchaseOrder: 0,
+					supplierName: '',
+					supplierId: '',
+					supplierCode: '',
+					involveDeptId: '',
+					involveDeptName: '',
+					remark: '',
+					processInstanceId: '' // 新增流程实例ID字段
 				},
-				associationTypeList: [
-					{
+				associationTypeList: [{
 						value: '1',
 						text: '发货单'
 					},
@@ -136,8 +216,38 @@
 				list: ['基本信息', '售后对象', '联系人'],
 				current: 0,
 				fault_level: [],
+				after_sales_type: [],
+				chargeList: [{
+						text: '是',
+						value: 1
+					},
+					{
+						text: '否',
+						value: 0
+					}
+				],
+				partList: [{
+						text: '是',
+						value: 1
+					},
+					{
+						text: '否',
+						value: 0
+					}
+				],
+				carList: [{
+						text: '是',
+						value: 1
+					},
+					{
+						text: '否',
+						value: 0
+					}
+				],
 				title: '新增需求',
-				type: 'add'
+				type: 'add',
+				listData: [],
+				pie_car_type: []
 			}
 		},
 		created() {
@@ -178,7 +288,9 @@
 				);
 				this.$set(this.form, 'productDetail', list);
 			})
-
+			listOrganizations(1).then(data => {
+				this.listData = data
+			})
 			uni.$off('setProduceList')
 			uni.$on('setProduceList', (data) => {
 				console.log('data', data)
@@ -216,6 +328,10 @@
 
 		},
 		methods: {
+			//选择部门
+			salesDeptShow() {
+				this.$refs.treePicker._show()
+			},
 			// 查询详情
 			async getDetails(id) {
 				this.getByCode();
@@ -224,12 +340,22 @@
 				let data = JSON.parse(JSON.stringify(res));
 				console.log('data111', data.orderCode)
 				this.form = data;
-				// this.$set(this.form, 'orderCode', data.orderCode);
+				['afterSalesType'].forEach(key => {
+					this.$set(
+						this.form,
+						key,
+						res[key].toString()
+					);
+				})
+
+
+
 				this.createUserName = data.createUserName;
+				console.log(this.form, 'this.form')
 				let obj = this.fault_level.find(el => el.value == res.faultLevel)
 				let associationTypeObj = this.associationTypeList.find(el => el.value == res.associationType)
 				this.form.associationType = associationTypeObj.value;
-				if(res.faultLevel) {
+				if (res.faultLevel) {
 					this.sourceCodeOnchange({
 						"detail": {
 							"value": [obj]
@@ -298,7 +424,7 @@
 					return;
 				}
 				console.log(this.form.associationType)
-				if(this.form.associationType === '3') {
+				if (this.form.associationType === '3') {
 					// uni.navigateTo({
 					// 	url: '/pages/salesServiceManagement/demandList/components/product?contactId=' + this.form
 					// 		.contactId + '&associationType=' + this.form.associationType
@@ -312,18 +438,26 @@
 							.contactId + '&associationType=' + this.form.associationType
 					})
 				}
-				
+
 			},
-			async getByCode() {
-				const codeValue = await getByCode('fault_level');
-				let list = codeValue.map(item => {
-					const key = Object.keys(item)[0]
-					return {
-						value: key,
-						text: item[key]
-					}
+			//部门回调
+			confirm(data, name) {
+				this.form.involveDeptName = name || ''
+				this.form.involveDeptId = data[0] || ''
+			},
+			getByCode() {
+				const codeS = ['fault_level', 'after_sales_type', 'pie_car_type']
+				codeS.forEach(async (code) => {
+					const codeValue = await getByCode(code);
+					this[code] = codeValue.map(item => {
+						const key = Object.keys(item)[0]
+						return {
+							value: key,
+							text: item[key]
+						}
+					})
 				})
-				this.fault_level = list;
+
 			},
 			save() {
 				let data = JSON.parse(JSON.stringify(this.form));
@@ -365,6 +499,14 @@
 						})
 						return
 					}
+					if (!data.afterSalesType) {
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择售后类型",
+						})
+						return
+					}
+
 					// 联系人数据
 					let contactInfoVOS = this.$refs.contactRef.getTabData();
 					if (contactInfoVOS.length == 0) {
@@ -424,6 +566,7 @@
 		position: fixed;
 		bottom: 0;
 		z-index: 10;
+		background: #fff;
 
 		/deep/.u-button {
 			height: 100%;

+ 124 - 50
pages/salesServiceManagement/demandList/components/AfterSales.vue

@@ -36,7 +36,7 @@
 					<!-- <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>
+						type="default" :text="afterSalesType == '3'?'添加质量反馈':'添加故障'"></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>
@@ -50,7 +50,7 @@
 
 		<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"
+				<myCard @edit="goProblem('edit',item)" @del="delProblem(item)" :item="item" :index="index+1"
 					:columns="columns" :btnList="btnData">
 					<view class="images" slot="imageUrl">
 						<PreviewPhoto type="view" :imageList="imagesData(item)" />
@@ -64,6 +64,9 @@
 <script>
 	import PreviewPhoto from "@/pages/maintenance/check/components/PreviewPhoto.vue"
 	import myCard from '@/pages/saleManage/components/myCard.vue'
+	import {
+		getByCode
+	} from '@/api/pda/common.js'
 	export default {
 		components: {
 			myCard,
@@ -82,7 +85,11 @@
 			isReport: {
 				type: Boolean,
 				default: false
-			}
+			},
+			afterSalesType: {
+				type: String,
+				default: ''
+			},
 		},
 		watch: {
 			itemList: {
@@ -95,15 +102,60 @@
 				},
 				deep: true,
 				immediate: true
-			}
+			},
+
 		},
 		computed: {
+			columns() {
+				return [
+					[{
+						label: this.afterSalesType == 3 ? '质量类型:' : '故障类型:',
+						prop: 'type',
+						className: 'perce100',
+						formatter: (row) => {
+							let options = this.afterSalesType == 3 ? this.after_sale_quality_type : this
+								.typeOptions
+							const user = options.find(item => item.value === row.type);
+							return user?.text
+						}
+					}],
+					[{
+						label: this.afterSalesType == 3 ? '质量问题反馈:' : '故障现象:',
+						prop: 'faultPhenomenon',
+					}],
+					[{
+						label: this.afterSalesType == 3 ? '质量问题分析:' : '故障原因:',
+						prop: 'faultReason'
+					}],
+					[{
+						label: this.afterSalesType == 3 ? '质量处理方式:' : '维修过程:',
+						prop: 'maintenanceProcess',
+					}],
+					[{
+						label: '图片:',
+						prop: 'maintenanceProcess',
+						slot: 'imageUrl',
+						className: 'perce100 image_url',
+
+					}],
+					[{
+						label: '操作:',
+						prop: 'action',
+						type: this.type != 'view' ? 'action' : '',
+						className: 'perce100',
+					}],
+				]
+			},
 			faultDetails() {
 				let arr = []
 				console.log(this.tableList);
 				if (this.tableList.length > 0) {
 					this.tableList.forEach(item =>
-						arr.push(...item.faultDetails))
+						arr.push(...item.faultDetails.map((val, index) => {
+							val['parentId'] = item.id
+							val['currentIndex'] = index
+							return val
+						})))
 				}
 				console.log(arr);
 				return arr
@@ -153,42 +205,43 @@
 						value: '3'
 					}
 				],
-				columns: [
-					[{
-						label: '故障类型:',
-						prop: 'type',
-						className: 'perce100',
-						formatter: (row) => {
-							const user = this.typeOptions.find(item => item.value === row.type);
-							return user.text
-						}
-					}],
-					[{
-						label: '故障现象:',
-						prop: 'faultPhenomenon',
-					}],
-					[{
-						label: '故障原因:',
-						prop: 'faultReason'
-					}],
-					[{
-						label: '维修过程:',
-						prop: 'maintenanceProcess',
-					}],
-					[{
-						label: '图片:',
-						prop: 'maintenanceProcess',
-						slot: 'imageUrl',
-						className: 'perce100 image_url',
+				after_sale_quality_type: [],
+				// columns: [
+				// 	[{
+				// 		label: '故障类型:',
+				// 		prop: 'type',
+				// 		className: 'perce100',
+				// 		formatter: (row) => {
+				// 			const user = this.typeOptions.find(item => item.value === row.type);
+				// 			return user.text
+				// 		}
+				// 	}],
+				// 	[{
+				// 		label: '故障现象:',
+				// 		prop: 'faultPhenomenon',
+				// 	}],
+				// 	[{
+				// 		label: '故障原因:',
+				// 		prop: 'faultReason'
+				// 	}],
+				// 	[{
+				// 		label: '维修过程:',
+				// 		prop: 'maintenanceProcess',
+				// 	}],
+				// 	[{
+				// 		label: '图片:',
+				// 		prop: 'maintenanceProcess',
+				// 		slot: 'imageUrl',
+				// 		className: 'perce100 image_url',
 
-					}],
-					[{
-						label: '操作:',
-						prop: 'action',
-						type: this.type != 'view' ? 'action' : '',
-						className: 'perce100',
-					}],
-				],
+				// 	}],
+				// 	[{
+				// 		label: '操作:',
+				// 		prop: 'action',
+				// 		type: this.type != 'view' ? 'action' : '',
+				// 		className: 'perce100',
+				// 	}],
+				// ],
 				btnList: [{
 						name: '编辑',
 						apiName: 'edit',
@@ -208,8 +261,11 @@
 				tableList: []
 			}
 		},
-		onLoad({}) {},
+		onLoad({}) {
+
+		},
 		created() {
+			this.getByCode();
 			uni.$off('updateFaultList')
 			uni.$on('updateFaultList', ({
 				type,
@@ -219,16 +275,31 @@
 				console.log(type);
 				console.log(this.tableList);
 				console.log(data);
-
 				if (type === 'add') {
 					this.tableList.find(item => item.id === this.dataId).faultDetails.push(data)
+				} else {
+				
+					let faultDetails = this.tableList.find(item => item.id === this.dataId).faultDetails
+					this.$set(faultDetails,index,data)
 				}
-
-
 			})
 
 		},
 		methods: {
+			getByCode() {
+				const codeS = ['after_sale_quality_type']
+				codeS.forEach(async (code) => {
+					const codeValue = await getByCode(code);
+					this[code] = codeValue.map(item => {
+						const key = Object.keys(item)[0]
+						return {
+							value: key,
+							text: item[key]
+						}
+					})
+				})
+
+			},
 			del(id) {
 				console.log(id);
 				console.log(this.tableList);
@@ -248,7 +319,7 @@
 				});
 			},
 			// 删除故障
-			delProblem(index) {
+			delProblem(data) {
 				uni.showModal({
 					title: '确认删除',
 					content: '确定要删除这条故障吗?',
@@ -256,7 +327,7 @@
 					confirmColor: '#FF4D4F',
 					success: (res) => {
 						if (res.confirm) {
-							this.tableList[0].faultDetails.splice(index, 1);
+							this.tableList.find(item=>item.id==data.parentId).faultDetails.splice(data.currentIndex, 1);
 						} else if (res.cancel) {
 							// 用户点击了取消按钮
 							console.log('用户取消删除');
@@ -265,7 +336,8 @@
 				});
 			},
 			// 现在只针对做 一 对 多 的 故障数据
-			goProblem(type, index, obj = {}) {
+			goProblem(type, obj = {}) {
+				this.dataId = obj.parentId
 				let str = this.type == 'report' ? 'report' : '';
 				let resD = JSON.parse(JSON.stringify(obj));
 				let arr = [];
@@ -276,7 +348,8 @@
 				console.log(arr, 'arr ----')
 				let data = JSON.stringify(resD);
 				uni.navigateTo({
-					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&index=${index}&data=${data}&str=${str}&arr=${encodeURIComponent(arr)}`
+					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&index=${obj.currentIndex}&data=${data}&str=${str}&arr=${encodeURIComponent(arr)}&afterSalesType=` +
+						this.afterSalesType
 				})
 			},
 			addFault(type, index, id) {
@@ -286,7 +359,8 @@
 				// let resD = JSON.parse(JSON.stringify(obj));
 
 				uni.navigateTo({
-					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&str=${str}`
+					url: `/pages/salesServiceManagement/demandList/components/faultAdd?type=${type}&str=${str}&afterSalesType=` +
+						this.afterSalesType
 				})
 
 
@@ -328,7 +402,7 @@
 				}
 
 				/deep/ .u-button {
-					width: 100rpx;
+					width: 120rpx;
 					font-size: 26rpx;
 					margin-left: 10rpx;
 					margin-right: 0rpx;

+ 36 - 14
pages/salesServiceManagement/demandList/components/faultAdd.vue

@@ -1,22 +1,22 @@
 <template>
 	<view class="mainBox">
-		<uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back" title="故障信息"
-			@clickLeft="back">
+		<uni-nav-bar background-color="#157A2C" color="#fff" fixed="true" statusBar="true" left-icon="back"
+			:title="afterSalesType==3?'质量问题信息':'故障信息'" @clickLeft="back">
 		</uni-nav-bar>
 		<u-cell-group>
 
-			<u-cell title="故障类型" arrow-direction="down">
-				<uni-data-picker v-model="form.type" slot="value" placeholder="请选择" :localdata="typeOptions"
+			<u-cell :title="afterSalesType==3?'质量类型':'故障类型'" arrow-direction="down">
+				<uni-data-picker v-model="form.type" slot="value" placeholder="请选择" :localdata="afterSalesType==3?after_sale_quality_type:typeOptions"
 					@change="sourceCodeOnchange">
 				</uni-data-picker>
 			</u-cell>
-			<u-cell title="故障现象" arrow-direction="down">
+			<u-cell :title="afterSalesType==3?'质量问题反馈':'故障现象'" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround" v-model="form.faultPhenomenon"></u--input>
 			</u-cell>
-			<u-cell title="故障原因" arrow-direction="down">
+			<u-cell :title="afterSalesType==3?'质量问题分析':'故障原因'" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround" v-model="form.faultReason"></u--input>
 			</u-cell>
-			<u-cell title="维修过程" arrow-direction="down">
+			<u-cell :title="afterSalesType==3?'质量处理方式':'维修过程'" arrow-direction="down">
 				<u--input slot="value" placeholder="请输入" border="surround" v-model="form.maintenanceProcess"></u--input>
 			</u-cell>
 			<view class="photo">
@@ -33,12 +33,16 @@
 
 <script>
 	import PhotoBtn from '@/pages/salesServiceManagement/workOrder/components/forWork/PhotoBtn.vue';
+	import {
+		getByCode
+	} from '@/api/pda/common.js'
 	export default {
 		components: {
 			PhotoBtn
 		},
 		data() {
 			return {
+				afterSalesType: '',
 				form: {
 					type: '',
 					faultPhenomenon: '',
@@ -49,6 +53,7 @@
 				type: '',
 				infoIdx: '',
 				str: "",
+				after_sale_quality_type:[],
 				typeOptions: [{
 						text: '维修',
 						value: '1'
@@ -66,33 +71,50 @@
 		},
 
 		async onLoad(data) {
+
 			this.infoIdx = data.index;
 			this.str = data.str;
 			this.type = data.type;
+			this.afterSalesType = data.afterSalesType
 
 			if (data.data) {
 				this.form = JSON.parse(data.data);
 			}
-			console.log(data.arr,'123')
-			if(data.arr){
+			console.log(data.arr, '123')
+			if (data.arr) {
 				const arr = JSON.parse(decodeURIComponent(data.arr));
 				this.form.imageUrl = arr
 			}
-			
+			this.getByCode()
+
 		},
 		methods: {
+			getByCode() {
+				const codeS = ['after_sale_quality_type']
+				codeS.forEach(async (code) => {
+					const codeValue = await getByCode(code);
+					this[code] = codeValue.map(item => {
+						const key = Object.keys(item)[0]
+						return {
+							value: key,
+							text: item[key]
+						}
+					})
+				})
+			
+			},
 			save() {
 				if (!this.form.type) {
 					this.$refs.uToast.show({
 						type: "warning",
-						message: "故障类型不能为空",
+						message: (this.afterSalesType == 3 ? '质量类型' : '故障类型') + "不能为空",
 					})
 					return;
 				}
 				if (!this.form.faultPhenomenon) {
 					this.$refs.uToast.show({
 						type: "warning",
-						message: "故障现象不能为空",
+						message: (this.afterSalesType == 3 ? '质量问题反馈' : '故障现象') + "不能为空",
 					})
 					return;
 				}
@@ -100,14 +122,14 @@
 					if (!this.form.faultReason) {
 						this.$refs.uToast.show({
 							type: "warning",
-							message: "故障原因不能为空",
+							message: (this.afterSalesType == 3 ? '质量问题分析' : '故障原因') + "不能为空",
 						})
 						return
 					}
 					if (!this.form.maintenanceProcess) {
 						this.$refs.uToast.show({
 							type: "warning",
-							message: "维修过程不能为空",
+							message: (this.afterSalesType == 3 ? '质量处理方式' : '维修过程') + "不能为空",
 						})
 						return
 					}

+ 211 - 66
pages/salesServiceManagement/demandList/index.vue

@@ -29,33 +29,33 @@
 		<view class="add" @click="add('add','')">
 			<u-icon name="plus" color="#fff"></u-icon>
 		</view>
-		<uni-popup ref="popup" type="center" :mask-closable="false">
+
+
+		<ba-tree-picker ref="treePicker" :multiple="false" @select-change="confirm" :localdata="listData" valueKey="id"
+			textKey="name" childrenKey="children" />
+		<u-toast ref="uToast"></u-toast>
+
+		<u-modal @confirm="handleSubmit" ref="popup" type="center" :show="modalShow" @cancel="modalShow=false"
+			:showCancelButton="true" :closeOnClickOverlay="true">
 			<view class="popup-content">
-				<view class="popup-header">
-					<text>审核</text>
-					<view class="close-icon" @click="hidePopup">×</view>
-				</view>
-				<form @submit="handleSubmit">
+
+				<form>
 					<view class="form-item">
-						<label class="form-label">*审核结果</label>
-						<!-- 		<uni-data-picker v-model="examForm.auditResult" slot="value" placeholder="请选择"
-							:localdata="auditResultOptions" @change="handleAuditResultChange">
-						</uni-data-picker> -->
-						<!-- 		<uni-data-picker name="auditResult" :localdata="auditResultOptions"
-							v-model="examForm.auditResult" @change="handleAuditResultChange">
-						</uni-data-picker> -->
+						<label class="form-label">*部门</label>
+						<u--input placeholder="部门" @click.native="showPicker"
+							v-model="addForm.planExecuteGroupName"></u--input>
 					</view>
 					<view class="form-item">
-						<label class="form-label">审核意见</label>
-						<textarea name="auditOpinion" placeholder="请输入" v-model="examForm.auditOpinion"></textarea>
-					</view>
-					<view class="button-group">
-						<button formType="submit" type="primary">确认</button>
-						<button @click="hidePopup">取消</button>
+						<label class="form-label">*计划执行人</label>
+
+						<uni-data-picker v-model="addForm.planExecuteUserId" placeholder="请选择" :localdata="userList"
+							@change="industryOnchange">
+						</uni-data-picker>
 					</view>
+
 				</form>
 			</view>
-		</uni-popup>
+		</u-modal>
 
 		<u-toast ref="uToast"></u-toast>
 
@@ -74,14 +74,22 @@
 		initDict
 	} from '@/utils/utils.js'
 
-
+	import {
+		listOrganizations,
+		getUserPage
+	} from '@/api/myTicket/index.js'
 	import {
 		getTableList,
 		revokeSalesDemand,
-		deleteSalesDemand
+		deleteSalesDemand,
+		demanDispatch,
+		auditSalesDemand
 	} from '@/api/salesServiceManagement/demandList/index.js'
 	import myCard from '@/pages/saleManage/components/myCard.vue'
-
+	import {
+		processInstanceCreateAPI,
+		processInstancePage
+	} from '@/api/wt/index.js'
 
 	export default {
 		components: {
@@ -98,6 +106,16 @@
 		},
 		data() {
 			return {
+				addForm: {
+					planExecuteUserId: '',
+					planExecuteUserName: '',
+					planExecuteGroupId: '',
+					planExecuteGroupName: '',
+					id: ''
+				},
+				modalShow: false,
+				userList: [],
+				listData: [],
 				searchForm: {},
 				emptyShow: false,
 				searchShow: false,
@@ -199,7 +217,16 @@
 							authorities: '',
 						}, {
 							key: 'demandStatus',
-							value: [0, 2, 3, 4, 5],
+							fn: (row) => {
+								if (row?.afterSalesType == 3) {
+									return (
+										(row?.approvalResult == 0 || row?.approvalResult == 3) &&
+										row?.demandStatus != 2
+									);
+								} else {
+									return row?.demandStatus == 0;
+								}
+							},
 
 						}],
 					},
@@ -212,8 +239,16 @@
 						judge: [{
 							authorities: '',
 						}, {
-							key: 'demandStatus',
-							value: [0, 2, 3, 4, 5],
+							fn: (row) => {
+								if (row?.afterSalesType == 3) {
+									return (
+										(row?.approvalResult == 0 || row?.approvalResult == 3) &&
+										row?.demandStatus != 2
+									);
+								} else {
+									return row?.demandStatus == 0;
+								}
+							},
 						}],
 					}, {
 						name: '提交',
@@ -224,23 +259,19 @@
 						judge: [{
 							authorities: '',
 						}, {
-							key: 'demandStatus',
-							value: [0],
+							fn: (row) => {
+								if (row?.afterSalesType == 3) {
+									return (
+										(row?.approvalResult == 0 || row?.approvalResult == 3) &&
+										row?.demandStatus != 2
+									);
+								} else {
+									return row?.demandStatus == 0;
+								}
+							},
 						}],
 					},
-					{
-						name: '撤回',
-						apiName: 'handleRevoke',
-						btnType: 'primary',
-						type: '2',
-						pageUrl: '',
-						judge: [{
-							authorities: '',
-						}, {
-							key: 'demandStatus',
-							value: [0],
-						}],
-					}
+
 				],
 				columns: [
 					[{
@@ -273,25 +304,32 @@
 						label: '创建时间:',
 						prop: 'createTime',
 					}],
-					// [{
-					// 	label: '审核人:',
-					// 	prop: 'approvalUserName'
-					// }, {
-					// 	label: '状态:',
-					// 	prop: 'demandStatus',
-					// 	formatter: (row) => {
-					// 		let cellValue = row.demandStatus;
-					// 		return cellValue == 0 ?
-					// 			'待审核' :
-					// 			cellValue == 2 ?
-					// 			'已拒绝' :
-					// 			cellValue == 1 ?
-					// 			'已通过' :
-					// 			cellValue == 3 ?
-					// 			'已撤回' :
-					// 			'';
-					// 	}
-					// }],
+					[{
+						label: '状态:',
+						prop: 'demandStatus',
+						formatter: (row) => {
+							const reviewStatus = {
+								0: '未提交',
+								1: '审核中',
+								2: '已审核',
+								3: '审核不通过'
+							}
+							let cellValue = row.demandStatus;
+							if (row.afterSalesType == 3) {
+								return cellValue == 2 ? '已关闭' : reviewStatus[row.approvalResult];
+							} else {
+								return cellValue == 0 ?
+									'待提交' :
+									cellValue == 1 ?
+									'已提交' :
+									cellValue == 2 ?
+									'已关闭' :
+									cellValue == 3 ?
+									'已完成' :
+									'';
+							}
+						}
+					}],
 					[{
 						label: '操作:',
 						prop: 'action',
@@ -309,6 +347,7 @@
 		},
 		onLoad() {
 			this.getDict()
+			this.getDept()
 		},
 		onShow() {
 			this.doSearch();
@@ -316,6 +355,76 @@
 
 
 		methods: {
+			handleAudit(row) {
+				this.current = row
+				if(row.afterSalesType==3){
+					this.listSubmit()
+				}else{
+					this.modalShow = true
+				}
+				
+				console.log(this.modalShow, 'dsds')
+			},
+
+			
+			// 显示选择器
+			showPicker() {
+				this.$refs.treePicker._show();
+			},
+			// btnShow(row) {
+
+			// },
+			confirm(data, name) {
+
+				this.addForm.planExecuteGroupName = name
+				this.addForm.planExecuteGroupId = data[0]
+				this.addForm.planExecuteUserName = ''
+				this.addForm.planExecuteUserId = ''
+				this.getUser(data[0])
+			},
+			industryOnchange(obj) {
+				this.addForm.planExecuteUserName = obj.detail.value[0].text
+
+			},
+			getDept() {
+				listOrganizations(1).then(data => {
+					this.listData = data
+				})
+			},
+			getUser(deptCode) {
+				getUserPage({
+					pageNum: 1,
+					size: -1,
+					groupId: deptCode
+				}).then(data => {
+					this.userList = data.list.map(item => {
+						item.text = item.name
+						item.value = item.id
+						return item
+					})
+				})
+
+			},
+			handleSubmit() {
+				auditSalesDemand({
+						...this.addForm,
+						submitSource: 3,
+						id: this.current.id
+					})
+					.then((res) => {
+						if (res) {
+							this.modalShow = false
+							this.$refs.uToast.show({
+								type: "success",
+								message: "操作成功",
+							})
+							this.doSearch();
+						}
+					})
+					.catch((err) => {
+						this.modalShow = false
+					});
+			},
 			async getDict() {
 				let res = await getByCode('fault_level')
 				let [arr, obj] = initDict(res)
@@ -364,6 +473,7 @@
 					uni.hideLoading()
 				})
 			},
+
 			hidePopup() {
 				this.$refs.popup.close();
 				this.examForm = {
@@ -372,6 +482,46 @@
 					id: ''
 				};
 			},
+
+			async listSubmit() {
+				try {
+					//后台不提供接口
+					let list = await processInstancePage({
+						pageNo: 1,
+						pageSize: 1,
+						reset: true,
+						key: 'after_sale_quality_issues_feedback'
+					})
+					let params = {
+						businessId: this.current.id,
+						businessKey: 'after_sale_quality_issues_feedback',
+						formCreateUserId: this.current.createUserId,
+						processDefinitionId: list?.list[0]?.processDefinition.id,
+						variables: {
+							businessCode: this.current.code,
+							businessName: this.current.name,
+							businessType: '质量问题反馈',
+						},
+					}
+
+					await processInstanceCreateAPI(params)
+					uni.showModal({
+						title: `提交成功`,
+						content: '',
+						confirmText: '确认',
+						showCancel: false, // 是否显示取消按钮,默认为 true
+						success: () => {
+							this.doSearch()
+						}
+
+					})
+
+
+				} catch {
+
+				}
+
+			},
 			// 撤回
 			async handleRevoke(row) {
 				const res = await uni.showModal({
@@ -435,12 +585,7 @@
 				// })
 			},
 
-			handleAudit(item) {
-				console.log(item, 'iitem --')
-				uni.navigateTo({
-					url: `/pages/salesServiceManagement/demandList/components/submission?id=${item.id}`
-				})
-			},
+
 			clearSearch() {
 				this.searchVal = ''
 				this.doSearch()

+ 90 - 2
pages/salesServiceManagement/recycle/index.vue

@@ -15,7 +15,7 @@
 		<view class="wrapper">
 			<u-list @scrolltolower="scrolltolower" class="listContent" style="height: auto;">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
-					<myCard :columns="columns" :btnList="btnList" @details="add(item,'view')" @edit="add(item,'edit')"
+					<myCard :columns="columns" :btnList="btnList" @details="add(item,'view')" @edit="add(item,'edit')" @auSubmit="auSubmit(item)"
 						@delete="deleteRow(item)" :item="item">
 					</myCard>
 				</view>
@@ -37,6 +37,14 @@
 		recycleDelete
 	} from '@/api/salesServiceManagement/accessory/index.js';
 	import myCard from '@/pages/saleManage/components/myCard.vue';
+	import {
+		processInstanceCreateAPI,
+		processInstancePage,getWarehouseListByIdsAPI
+	} from '@/api/wt/index.js'
+	import {
+		recycleDetails,
+
+	} from '@/api/salesServiceManagement/workOrder/index.js'
 	export default {
 		components: {
 			myCard
@@ -166,6 +174,20 @@
 						label: '回收时间:',
 						prop: 'usageTime',
 					}],
+					[{
+						label: '状态:',
+						prop: 'approvalStatus',
+						formatter: (row) => {
+							const reviewStatus = {
+								0: '未提交',
+								1: '审核中',
+								2: '已审核',
+								3: '审核不通过'
+							}
+							let cellValue = row.approvalStatus;
+							return reviewStatus[cellValue]
+						}
+					}],
 					[{
 						label: '操作:',
 						prop: 'action',
@@ -192,6 +214,23 @@
 						key: 'source',
 						value: [0],
 
+					},{
+						key: 'approvalStatus',
+						value: [0, 3],
+
+					}],
+				}, {
+					name: '提交',
+					apiName: 'auSubmit',
+					btnType: 'primary',
+					type: '2',
+					pageUrl: '',
+					judge: [{
+						authorities: '',
+					}, {
+						key: 'approvalStatus',
+						value: [0, 3],
+
 					}],
 				}, {
 					name: '删除',
@@ -202,6 +241,10 @@
 					judge: [{
 						authorities: '',
 					}, {
+						key: 'approvalStatus',
+						value: [0, 3],
+
+					},{
 						key: 'source',
 						value: [0],
 
@@ -247,6 +290,7 @@
 					pageNum: this.page,
 					size: this.size,
 					keyWord: this.searchVal,
+					workOrderIsReport:1,
 					...this.searchForm
 				}
 				recyclePage(data).then(res => {
@@ -278,6 +322,50 @@
 					url: `/pages/salesServiceManagement/recycle/recycleAdd?type=${type}&id=${item?item.id:''}`
 				})
 			},
+			async auSubmit(res) {
+				try {
+					//后台不提供接口
+					const data = await recycleDetails(res.id);
+					let storemanIds = '';
+					let ids = data.detailList.map((item) => item.warehouseId);
+					let warehouseList = await getWarehouseListByIdsAPI(ids || []);
+					storemanIds = warehouseList.map((item) => item.ownerId);
+					let list = await processInstancePage({
+						pageNo: 1,
+						pageSize: 1,
+						reset: true,
+						key: 'after_sale_accessory_apply'
+					})
+					let params = {
+						businessId: res.id,
+						businessKey: 'after_sale_accessory_apply',
+						formCreateUserId: res.createUserId,
+						processDefinitionId: list?.list[0]?.processDefinition.id,
+						variables: {
+							businessCode: res.code,
+							businessName: res.recycleDeptName,
+							businessType: '售后配件回收入库',
+							storemanIds
+						},
+					}
+
+					await processInstanceCreateAPI(params)
+					uni.showModal({
+						title: `提交成功`,
+						content: '',
+						confirmText: '确认',
+						showCancel: false, // 是否显示取消按钮,默认为 true
+						success: () => {
+							this.doSearch()
+						}
+
+					})
+
+
+				} catch {
+
+				}
+			},
 			async deleteRow(row) {
 				const res = await uni.showModal({
 					title: '确认删除',
@@ -376,7 +464,7 @@
 		align-items: center;
 		justify-content: center;
 	}
-	
+
 	/deep/ .u-empty {
 		margin-top: 200px !important;
 	}

+ 1 - 1
pages/salesServiceManagement/recycle/recycleAdd.vue

@@ -261,7 +261,7 @@
 			},
 			selectWorkOrder() {
 				uni.navigateTo({
-					url: `/pages/salesServiceManagement/accessory/components/selectWork`
+					url: `/pages/salesServiceManagement/accessory/components/selectWork?orderStatusList='3,4'`
 				})
 			}
 		}

+ 48 - 7
pages/salesServiceManagement/workOrder/index.vue

@@ -26,9 +26,10 @@
 			<u-list @scrolltolower="scrolltolower" class="listContent" style="height: auto;">
 				<view v-for="(item, index) in tableList" :key="index" style="position: relative;">
 					<myCard @addSpareItems="addSpareItems(item.id)" @report="edit('report',item.id)"
-						@edit="edit('edit',item.id)" @details="edit('view',item.id)" @handleAudit="handleAudit(item)"
-						@checkAndAccept="checkAndAccept(item)" @evaluate="evaluate(item)" :item="item" :index="index+1"
-						@receive="receive(item)" :columns="columns" :btnList="btnList">
+						@handleDetail="handleDetail(item)" @edit="edit('edit',item.id)" @details="edit('view',item.id)"
+						@handleAudit="handleAudit(item)" @checkAndAccept="checkAndAccept(item)"
+						@evaluate="evaluate(item)" :item="item" :index="index+1" @receive="receive(item)"
+						:columns="columns" :btnList="btnList">
 					</myCard>
 
 					<u-empty v-show="emptyShow && tableList.length==0" width="300" height="300" textSize="30"></u-empty>
@@ -60,7 +61,9 @@
 	import myCard from '@/pages/saleManage/components/myCard.vue'
 	import CheckAndAccept from './components/forWork/checkAndAccept.vue'
 	import Evaluate from './components/forWork/evaluate.vue'
-
+	import {
+		getBpmCustomFormList,
+	} from '@/api/wt/index.js'
 	export default {
 		components: {
 			myCard,
@@ -397,6 +400,19 @@
 							value: [1, 2],
 						}],
 					},
+					{
+						name: '用车申请',
+						apiName: 'handleDetail',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'pieCarType',
+							value: [1, 2],
+						}],
+					},
 				],
 			}
 		},
@@ -421,7 +437,32 @@
 				console.log(arr, obj);
 			},
 
-
+			async handleDetail(row) {
+				const list = await getBpmCustomFormList({
+					status: 1
+				})
+				const data = list.find(
+					(item) => item?.code === 'carBy'
+				);
+				console.log(data, 'data')
+				// return
+				let params = JSON.stringify({
+					id: data.id,
+					processInstanceId: data.processInstance?.id || data.processDefinitionId || '',
+					type: 'add',
+					isEdit: true,
+					manage_workorder: {
+						id: row.id, // 列表工单ID
+						code: row.code, // 列表工单编号(要显示的code)
+						name: row.planName // 列表工单名称(可选,根据弹窗需求传递)
+					}
+				})
+				let queryParams = `params=${params}`
+				let url = '/pages/home/wt/components/formParser/routerView'
+				uni.navigateTo({
+					url: `${url}?${queryParams}`
+				})
+			},
 			changeChartsTab(value) {
 				this.pickTabIndex = value;
 				this.doSearch();
@@ -502,9 +543,9 @@
 			// 报工
 			async edit(type, id) {
 				// 判断报工是否可执行
-				if(type == 'report') {
+				if (type == 'report') {
 					const result = await this.checkId(id)
-					if(!result) return
+					if (!result) return
 				}
 				uni.navigateTo({
 					url: `/pages/salesServiceManagement/workOrder/components/editPlan?type=${type}&id=${id}`