Forráskód Böngészése

Merge branch 'master' of http://110.41.163.243:9980/kd-aiot/aiot-app into dengfei

695593266@qq.com 10 hónapja
szülő
commit
c8a86029f2

+ 24 - 9
App.vue

@@ -47,7 +47,7 @@
 						confirmText: '立即更新',
 						success: (val) => {
 							if (val.confirm) {
-					
+
 								const downloadTask = uni.downloadFile({
 									url: `${Vue.prototype.webviewUrl}/kd-aiot/${res.fileStorePath}`,
 									success: (data) => {
@@ -89,30 +89,32 @@
 										}
 									}
 								});
-								
+
 								// 先显示初始的loading提示
 								uni.showLoading({
 									title: "正在下载安装包: 0%",
 									mask: true,
 								});
-								
+
 								// 记录上次显示的进度,避免频繁更新
 								let lastProgress = 0;
 								let loadingVisible = true;
-								
+
 								downloadTask.onProgressUpdate((ress) => {
 									console.log('下载进度:', ress)
-									
+
 									// 只在进度有明显变化(每10%)或者达到100%时更新提示
-									if ((ress.progress > lastProgress && ress.progress % 10 === 0) || ress.progress === 100) {
+									if ((ress.progress > lastProgress && ress.progress %
+											10 === 0) || ress.progress === 100) {
 										// 先隐藏再显示以更新内容
 										if (loadingVisible) {
 											uni.hideLoading();
 										}
-										
+
 										if (ress.progress < 100) {
 											uni.showLoading({
-												title: "正在下载安装包: " + ress.progress + "%",
+												title: "正在下载安装包: " + ress
+													.progress + "%",
 												mask: true,
 											});
 											loadingVisible = true;
@@ -122,7 +124,7 @@
 										lastProgress = ress.progress;
 									}
 								})
-								
+
 								// 确保任务完成时隐藏loading
 								downloadTask.onStop(() => {
 									if (loadingVisible) {
@@ -195,6 +197,19 @@
 		-moz-osx-font-smoothing: grayscale;
 	}
 
+
+
+	.required-mark-new::before {
+		content: "*";
+		color: red;
+		position:absolute;
+		left:7rpx;
+	}
+
+	.footerButton {
+		background: #fff
+	}
+
 	.icon-chanpinchuku:before {
 		content: '\e6a1';
 	}

+ 16 - 12
hybrid/html/a.html

@@ -135,9 +135,7 @@
 							this.form = res.data.data
 							this.form.formId = res.data.data.id
 							this.form.id = ''
-							this.form.valueJson = {
-								manage_workorder: 3333
-							}
+							this.form.valueJson = {}
 							this.title = this.form.name
 							this.jsonData = JSON.parse(res.data.data.formJson.makingJson);
 							this.jsonData.list.forEach(item => {
@@ -176,17 +174,17 @@
 								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.$nextTick(() => {
+
+								if (params.manage_workorder) {
 									this.setSalesServiceWork(params.manage_workorder)
-								})
+
+								}
+
+							})
 
 
-							}
 						}
 					});
 
@@ -245,7 +243,13 @@
 						this.$refs.generateForm.setData({
 							manage_workorder: data
 						});
-
+						this.$refs.generateForm.setRules('manage_workorder', [{
+							required: false,
+							message: '必须填写'
+						}])
+						setTimeout(() => {
+							this.$refs.generateForm.validate(['manage_workorder'])
+						})
 
 					},
 

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智慧工厂",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.3.26",
+    "versionName" : "V1.0.3.30",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {

+ 8 - 0
pages.json

@@ -2098,6 +2098,14 @@
 				"navigationBarTextStyle": "white"
 			}
 		},
+		{
+			"path": "pages/purchasingManage/components/selectSaleOrder",
+			"style": {
+				"navigationBarTitleText": "选择订单",
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
+			}
+		},
 		{
 			"path": "pages/saleManage/components/selectUser",
 			"style": {

+ 427 - 0
pages/purchasingManage/components/selectSaleOrder.vue

@@ -0,0 +1,427 @@
+<template>
+	<view class="mainBox">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" title="选择" @clickLeft="backAdd">
+
+		</uni-nav-bar>
+		<view class="searchBox">
+			<input v-model="searchVal" placeholder="请输入名称" class="searchInput" />
+			<u-button type="icon-shixiangxinzeng" size="30" @click="doSearch" data-icon="Search" class="searchBtn">
+				<view class="iconfont icon-sousuo"></view>
+				<view class="text">搜索</view>
+			</u-button>
+		</view>
+		<view class="wrapper">
+			<u-list @scrolltolower="scrolltolower" class="listContent">
+				<checkbox-group v-for="(item, index) in listData" :key="index" @change="e => selectVal(e, item, index)">
+					<label>
+						<view class="listBox">
+							<view class="listBox-sel">
+								<checkbox :value="item.code" color="#fff" :disabled="item.disabled"
+									:checked="item.checked" />
+							</view>
+							<view class="listBox-con">
+								<view class="listBox-top">
+									<view class="listBox-name">
+										{{ item.productNames }}
+									</view>
+									<view class="listBox-code">
+										{{ item.orderNo }}
+									</view>
+								</view>
+								<view class="listBox-bottom">
+									<view>编码:{{ item.productCodes }}</view>
+									<view>订单类型:{{ item.needProduce }}</view>
+									<view>客户名称:{{ item.partaName }}</view>
+									<view>客户联系人:{{ item.partaLinkName }}</view>
+									<view>生产编号:{{ item.productionCodes }}</view>
+									<view>库存数:{{ item.inventoryQuantity }}</view>
+									<view>库存状态:{{ item.inventoryQuantity }}</view>
+								</view>
+							</view>
+						</view>
+					</label>
+				</checkbox-group>
+				<u-empty class="noDate" style="margin-top: 20vh" v-if="!listData.length"></u-empty>
+			</u-list>
+		</view>
+
+		<view class="footer">
+			<view class="bottom" v-if="this.isAll==1">
+				<checkbox v-if="!seletedAll" color="#fff" :checked="seletedAll" @tap="_seletedAll">全选</checkbox>
+				<checkbox class="select-all" color="#fff" v-else :checked="seletedAll" @tap="_seletedAll">取消全选
+				</checkbox>
+			</view>
+			<u-button type="success" size="small" class="u-reset-button" :disabled="!checkListLen" @click="jumpAdd">
+				<view class="selBtn">选择( {{ checkListLen }} )</view>
+			</u-button>
+		</view>
+		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择部门"
+			:localdata="classificationList" valueKey="id" textKey="name" />
+	</view>
+</template>
+
+<script>
+	import {
+		getTableList,
+	} from '@/api/saleManage/saleorder'
+	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
+	export default {
+		components: {
+			baTreePicker
+		},
+
+		data() {
+			return {
+				page: 1,
+				size: 10,
+				isEnd: false,
+				searchVal: '',
+				pickTabIndex: 1,
+				popupShow: false, //右侧搜索窗
+				typeIndex: 1,
+				listData: [], //列表数据
+				classificationList: [], //分类数据
+				seletedAll: false, //全选状态,
+				isAll: ''
+
+			}
+		},
+		//选择的列表长度
+		computed: {
+
+			checkListLen() {
+
+				return this.listData.filter(el => el.checked).length
+			},
+
+		},
+		onShow() {
+			this.isEnd = false
+			this.page = 1
+			this.getList()
+		},
+		onLoad({
+			isAll
+		}) {
+			this.isAll = isAll //1多选 2单选
+			this.getList()
+		},
+		onShow() {},
+		methods: {
+			scrolltolower() {
+				this.getList()
+			},
+			//列表数据
+			getList() {
+				if (this.isEnd) {
+					return
+				}
+
+				uni.showLoading({
+					title: '加载中'
+				})
+
+				let params = {
+					pageNum: this.page,
+					size: this.size,
+					name: this.searchVal
+				}
+
+				getTableList(params).then(res => {
+					if (this.page === 1) {
+						this.listData = res.list
+					} else {
+						this.listData.push(...res.list)
+					}
+					this.page += 1
+					this.isEnd = this.listData.length >= res.count
+				}).then(() => {
+					uni.hideLoading()
+				})
+
+
+
+				// this.isEnd = false
+				// this._getClassifyList()
+			},
+			async _getClassifyList() {
+				uni.showLoading({
+					title: '数据加载中'
+				})
+				const params = {
+					pageNum: 1,
+					size: this.size,
+					searchName: this.searchVal,
+					isNoSendDone: 0,
+					orderStatus: 2,
+
+				}
+
+				getTableList(params).then(res => {
+					uni.hideLoading()
+					if (this.page == 1) {
+						this.listData = []
+					}
+					this.listData = this.listData.concat(res.list)
+					this.isEnd = this.listData.length >= res.count
+				})
+			},
+			confirm([id]) {
+				this.categoryLevelId = id
+				this.page = 1
+				this.getList()
+			},
+			async getClassify() {
+				listOrganizations(1).then(res => {
+					this.classificationList = res
+					this.page = 1
+					this.getList()
+				});
+			},
+			doSearch() {
+				this.isEnd = false
+				this.page = 1
+				this.getList()
+			},
+			//勾选
+			selectVal(e, val, index) {
+
+				this.$set(this.listData[index], 'checked', !this.listData[index].checked)
+
+				if (this.isAll != 1) {
+					this.listData.forEach((item, i) => {
+						if (item.id != val.id) {
+							this.$set(this.listData[i], 'checked', false)
+						}
+					})
+				} else {
+
+					this.seletedAll = !this.listData.some(item => !item.checked)
+				}
+
+			},
+			//全选按钮
+			_seletedAll() {
+				if (!this.seletedAll) {
+					this.seletedAll = true
+					this.listData.map(item => {
+						this.$set(item, 'checked', true)
+					})
+				} else {
+					this.seletedAll = false
+					this.listData.map(item => {
+						this.$set(item, 'checked', false)
+					})
+				}
+			},
+			//跳转回添加页面
+			jumpAdd() {
+				uni.$emit(
+					'setSaleOrder',
+					this.listData.filter(item => item.checked)
+				)
+
+				uni.navigateBack()
+			},
+			//返回添加页
+			backAdd() {
+				uni.navigateBack()
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.mainBox {
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.wrapper {
+			flex: 1;
+			overflow: hidden;
+		}
+
+		.searchBox {
+			padding: 10rpx 0;
+			box-sizing: border-box;
+			background-color: #dedede;
+			height: 90rpx;
+			width: 100%;
+			line-height: 90rpx;
+			display: flex;
+			justify-content: space-around;
+			align-items: center;
+
+			input {
+				height: 78rpx;
+				width: 65%;
+				background: #f9f9f9 !important;
+				margin: 0 10rpx;
+				padding: 0 10rpx;
+				box-sizing: border-box;
+				border-radius: 5rpx;
+			}
+
+			.searchBtn {
+				height: 80rpx;
+				background: #f9f9f9 !important;
+				color: #676767;
+				font-size: 28rpx;
+				padding: 0 42rpx;
+				box-sizing: border-box;
+				outline: none;
+				border: none;
+				width: 260rpx;
+
+				.icon-sousuo {
+					font-size: 22px;
+				}
+
+				.text {
+					font-size: 16px;
+					margin-left: 10px;
+				}
+			}
+		}
+
+		.tab-title {
+			position: fixed;
+			top: 190rpx;
+			z-index: 99;
+			width: 100%;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			height: $tab-height;
+			line-height: $tab-height;
+			background-color: #ffffff;
+			border-bottom: 2rpx solid #f2f2f2;
+			box-sizing: border-box;
+
+			.tab-item {
+				width: 25%;
+				text-align: center;
+				font-size: 32rpx;
+				color: $uni-text-color-grey;
+			}
+
+			.tab-item.active {
+				color: $j-primary-border-green;
+				border-bottom: 1px solid $j-primary-border-green;
+				font-weight: bold;
+			}
+
+			.tab-item.filter {
+				flex: 1;
+				padding: 0px 30rpx;
+
+				.uni-icons {
+					display: flex;
+					padding-top: 5px;
+				}
+			}
+
+			.screenIcon {
+				display: flex;
+				width: 80px;
+				justify-content: center;
+
+				.screenText {
+					font-size: 32rpx;
+					color: $uni-text-color-grey;
+				}
+			}
+		}
+
+		.listContent {
+			height: 100% !important;
+
+			.listBox {
+				display: flex;
+				// height: 180rpx;
+				padding: 20rpx 0;
+				border-bottom: 2rpx solid #e5e5e5;
+
+				.listBox-sel {
+					height: 90rpx;
+					width: 80rpx;
+					// line-height: 90rpx;
+					text-align: center;
+
+					checkbox {
+						transform: scale(1.2);
+					}
+				}
+
+				.listBox-con {
+					width: 100%;
+					// display: flex;
+					// flex-wrap: wrap;
+					// justify-content: space-between;
+					align-items: center;
+					padding: 0 18rpx 0 0;
+
+					.listBox-top {
+						width: 100%;
+						display: flex;
+						justify-content: space-between;
+						padding-bottom: 10rpx;
+
+						.listBox-name,
+						.listBox-code {
+							display: inline-block;
+							font-size: $uni-font-size-sm;
+							font-weight: bold;
+						}
+					}
+
+					.listBox-bottom {
+						width: 100%;
+						display: flex;
+						justify-content: space-between;
+						font-size: $uni-font-size-sm;
+						flex-wrap: wrap;
+
+						>view {
+							width: 50%;
+							overflow: hidden;
+							white-space: nowrap;
+							text-overflow: ellipsis;
+						}
+					}
+				}
+			}
+
+			.noDate {
+				height: 100%;
+			}
+		}
+
+		//底部按钮
+		.footer {
+			height: 90rpx;
+			position: relative;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			bottom: 0;
+			width: 100%;
+			height: 100rpx;
+			border-top: 1rpx solid #eeecec;
+			background-color: #ffffff;
+			z-index: 999;
+
+			.bottom {
+				margin-left: 10rpx;
+			}
+
+			.u-reset-button {
+				position: absolute;
+				right: 10rpx;
+				top: 20rpx;
+				width: 150rpx;
+			}
+		}
+	}
+</style>

+ 81 - 6
pages/purchasingManage/purchaseNeedManage/add.vue

@@ -40,11 +40,24 @@
 					需求人
 				</view>
 				<!-- <u--input slot="value" placeholder="请输入" border="requireUserId" v-model="form.name"></u--input> -->
-				<u--input style="flex:1" border="surround" v-model="form.requireUserId"
+				<u--input slot="value" style="flex:1" border="surround" v-model="form.requireUserId"
 						placeholder="请选择需求人" @click.native="openSelector">
 				</u--input>
 			</u-cell>
+			<u-cell title="销售合同" arrow-direction="down">
+				<u--input slot="value" placeholder="请选择" border="surround" v-model="form.saleOrderNo"
+					@click.native="selectContractShow"></u--input>
+			</u-cell>
+			<u-cell title="销售订单" arrow-direction="down">
+				<!-- <u--input slot="value" placeholder="请输入" border="requireUserId" v-model="form.name"></u--input> -->
+				<u--input slot="value" style="flex:1" border="surround" v-model="form.requireUserId"
+						placeholder="请选择销售订单" @click.native="slectOrderShow">
+				</u--input>
+			</u-cell>
 			<u-cell title="是否接受拆单" arrow-direction="down">
+				<uni-data-picker v-model="form.acceptUnpack" slot="value" placeholder="请选择"
+					:localdata="[{text: '接受', value: '1'}, { text: '不接受', value: '0'}]" @change="sourceCodeOnchange">
+				</uni-data-picker>
 				<!-- <u--input slot="value" :disabled="true" placeholder="请输入" border="surround"
 					v-model="form.responsibleName"></u--input> -->
 				<!-- <u-radio-group
@@ -68,9 +81,10 @@
 					<text class="required-mark">*</text>
 					用途
 				</view>
-				<uni-data-picker v-model="form.useTo" slot="value" placeholder="请选择"
+				<!-- <uni-data-picker v-model="form.useTo" slot="value" placeholder="请选择"
 					:localdata="business_opport_code" @change="sourceCodeOnchange">
-				</uni-data-picker>
+				</uni-data-picker> -->
+				<u--textarea slot="value" placeholder="请输入" border="surround" v-model="form.useTo"></u--textarea>
 			</u-cell>
 			<u-cell title="附件" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
@@ -127,6 +141,7 @@
 	import {
 		getUserPage
 	} from '@/api/common.js';
+	import { getTableList, getSaleOrderDetail } from '@/api/saleManage/saleorder/index'
 	export default {
 		components: {
 			produceList,
@@ -173,7 +188,33 @@
 		created() {
 
 			this.getByCode()
+			//选择合同回调
+			uni.$off('setContractList')
+			uni.$on('setContractList', async (data) => {
+				if (data && data.length > 0) {
+					this.form = Object.assign({}, this.form, {
+						saleContractId: data[0].id,
+						saleContractName: data[0].contractName,
+						saleContractNo: data[0].contractNo,
+					});
+					this.getSaleOrderList(data[0].id);
+				}
+
+			})
 
+			uni.$off('setSaleOrder')
+			uni.$on('setSaleOrder', async (data) => {
+				if(data && data.length > 0) {
+					this.form = Object.assign({}, this.form, {
+						saleContractId: '',
+						saleContractName: '',
+						saleContractNo: '',
+						saleOrderId: data[0].id,
+						saleOrderNo: data[0].orderNo
+					});
+					this.getSaleOrderDetail(this.form.saleOrderId)
+				}
+			})
 		},
 		onLoad(data) {
 			this.getTreeList()
@@ -213,9 +254,32 @@
 		},
 		onUnload() {
 			uni.$off('setSelectList')
+			uni.$off('setContractList')
+			uni.$off('setSaleOrder')
 			// uni.$off('updatelinkList')
 		},
 		methods: {
+			async getSaleOrderList(contractId) {
+				let res = await getTableList({
+				pageNum: 1,
+				size: 10,
+				contractId
+				});
+				this.form.saleOrderId = res.list[0]?.id;
+				this.form.saleOrderNo = res.list[0]?.orderNo;
+				this.getSaleOrderDetail(this.form.saleOrderId);
+			},
+			async getSaleOrderDetail(id) {
+				const data = await getSaleOrderDetail(id);
+				data.productList.forEach((item) => {
+				item.expectReceiveDate = item.produceDeliveryDeadline;
+				item.arrivalWay = 1;
+				});
+
+				this.$nextTick(() => {
+				this.$refs.produceListRef.init(data.productList);
+				});
+			},
 			async getTreeList() {
 				const data = await listOrganizations({});
 				let treeList = toTreeData({
@@ -267,6 +331,17 @@
 			onClose(item) {
 				this.form.userName = item.text;
 			},
+			//选择合同
+			selectContractShow() {
+				uni.navigateTo({
+					url: '/pages/saleManage/components/selectContract?isAll=' + 2
+				})
+			},
+			slectOrderShow() {
+				uni.navigateTo({
+					url: '/pages/purchasingManage/components/selectSaleOrder?isAll=' + 2
+				})
+			},
 			getByCode() {
 				const codeS = ['business_opport_code']
 				codeS.forEach(async (code) => {
@@ -401,9 +476,9 @@
 		}
 	}
 
-	/deep/.u-button {
-		// height: 100%;
-	}
+	// /deep/.u-button {
+	// 	// height: 100%;
+	// }
 
 	/deep/.u-subsection__item__text {
 		font-size: 28rpx !important;

+ 31 - 27
pages/saleManage/components/myCard.vue

@@ -4,41 +4,45 @@
 
 
 		<view class="item_box rx-bc" v-for="(_item,i) in columns" :key="i">
-			<view class="perce50" :class="val.className" :style="val.style" v-for="(val) in _item" :key="val.prop">
-				<view class="item_box rx-sc" v-if="val.type=='title'">
-					<view class="round" v-if='index'>{{index}}</view>
-					<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-if="val.slot">
-						<slot :name="val.slot"> </slot>
+			<template v-for="(val) in _item">
 
-					</view>
-					<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-else>
+				<view class="perce50" :class="val.className" :style="val.style" :key="val.prop" v-if="!val.isNone">
+					<view class="item_box rx-sc" v-if="val.type=='title'">
+						<view class="round" v-if='index'>{{index}}</view>
+						<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-if="val.slot">
+							<slot :name="val.slot"> </slot>
+
+						</view>
+						<view class="orderId" :style="{marginLeft: index?'16rpx':''}" v-else>
+
+							{{item[val.prop]||''}}
+						</view>
 
-						{{item[val.prop]||''}}
 					</view>
 
-				</view>
+					<view class="item_one rx-sc" v-else-if="val.type=='action'">
+						<view class="lable">{{val.label}}</view>
+						<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>
+							</template>
 
-				<view class="item_one rx-sc" v-else-if="val.type=='action'">
-					<view class="lable">{{val.label}}</view>
-					<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>
-						</template>
+						</view>
 
 					</view>
-
-				</view>
-				<view class="item_one rx-sc kk" v-else>
-					<view class="lable">{{val.label}}</view>
-					<view class="text" v-if="val.formatter">{{val.formatter(item)||''}}</view>
-					<view class="text" v-else-if="val.slot">
-						<slot :name="val.slot"> </slot>
+					<view class="item_one rx-sc kk" v-else>
+						<view class="lable">{{val.label}}</view>
+						<view class="text" v-if="val.formatter">{{val.formatter(item)||''}}</view>
+						<view class="text" v-else-if="val.slot">
+							<slot :name="val.slot"> </slot>
+						</view>
+						<view class="text" v-else>{{item[val.prop]||''}}</view>
 					</view>
-					<view class="text" v-else>{{item[val.prop]||''}}</view>
+
 				</view>
+			</template>
 
-			</view>
 		</view>
 
 	</view>
@@ -82,8 +86,8 @@
 							if (value && !value.includes(this.item[key])) {
 								is = false
 							}
-							if(fn){
-								is=fn(this.item) 
+							if (fn) {
+								is = fn(this.item)
 							}
 						})
 						return is

+ 1 - 1
pages/salesServiceManagement/accessory/accessoryAdd.vue

@@ -50,7 +50,7 @@
 			</u-cell>
 			<u-cell title="用途" arrow-direction="down">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
-					<u--textarea style="flex:1; min-height: 160rpx;" border="surround" placeholder="请输入内容"
+					<u--textarea :disabled="!isDisable" style="flex:1; min-height: 160rpx;" border="surround" placeholder="请输入内容"
 						v-model="form.purpose"></u--textarea>
 				</view>
 			</u-cell>

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

@@ -223,6 +223,7 @@
 				if (this.isPieCar) {
 					data.isPieCar = this.isPieCar
 				}
+				console.log(data,';data')
 
 				getSalesWorkOrder(data).then(res => {
 					if (this.page === 1) {

+ 112 - 33
pages/salesServiceManagement/accessory/index.vue

@@ -18,7 +18,7 @@
 			<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" :item="item" @details="add(item,'view')"
-						@edit="add(item,'edit')" @delete="deleteRow(item)">
+						@listSubmit="listSubmit(item)" @edit="add(item,'edit')" @delete="deleteRow(item)">
 					</myCard>
 				</view>
 
@@ -42,6 +42,10 @@
 		accessoryDelete
 	} from '@/api/salesServiceManagement/accessory/index.js';
 	import myCard from '@/pages/saleManage/components/myCard.vue';
+	import {
+		processInstanceCreateAPI,
+		processInstancePage
+	} from '@/api/wt/index.js'
 	export default {
 		components: {
 			myCard
@@ -181,6 +185,20 @@
 							return str;
 						}
 					}],
+					[{
+						label: '状态:',
+						prop: 'approvalStatus',
+						formatter: (row) => {
+							const reviewStatus = {
+								0: '未提交',
+								1: '审核中',
+								2: '已审核',
+								3: '审核不通过'
+							}
+							return reviewStatus[row.approvalStatus];
+						}
+					}],
+
 					[{
 						label: '创建时间:',
 						prop: 'createTime'
@@ -196,44 +214,66 @@
 					}],
 				],
 				btnList: [{
-					name: '详情',
-					apiName: 'details',
-					btnType: 'primary',
-					type: '2',
-					pageUrl: '',
+						name: '详情',
+						apiName: 'details',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
 
-				}, {
-					name: '修改',
-					apiName: 'edit',
-					btnType: 'primary',
-					type: '2',
-					pageUrl: '',
-					judge: [{
-						authorities: '',
-					}, {
-						key: 'source',
-						value: [0],
-					}],
-				}, {
-					name: '删除',
-					apiName: 'delete',
-					btnType: 'primary',
-					type: '2',
-					pageUrl: '',
-					judge: [{
-						authorities: '',
 					}, {
-						key: 'source',
-						value: [0],
+						name: '修改',
+						apiName: 'edit',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'source',
+							value: [0],
+						}, {
+							key: 'approvalStatus',
+							value: [0, 3],
+						}],
+					},
+					{
+						name: '发起流程',
+						apiName: 'listSubmit',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						},  {
+							key: 'approvalStatus',
+							value: [0, 3],
+						}],
+					},
 
-					}],
-				}],
+					{
+						name: '删除',
+						apiName: 'delete',
+						btnType: 'primary',
+						type: '2',
+						pageUrl: '',
+						judge: [{
+							authorities: '',
+						}, {
+							key: 'source',
+							value: [0],
+
+						}, {
+							key: 'approvalStatus',
+							value: [0, 3],
+						}],
+					}
+				],
 				page: 1,
 				size: 10,
 				isEnd: false,
 				tableList: [],
 				searchVal: '',
-				
+
 			}
 		},
 		onShow() {
@@ -243,6 +283,47 @@
 			this.getList()
 		},
 		methods: {
+
+			async listSubmit(data) {
+				try {
+					//后台不提供接口
+					let list = await processInstancePage({
+						pageNo: 1,
+						pageSize: 1,
+						reset: true,
+						key: 'eom_sh_bpbj'
+					})
+					let params = {
+						businessId: data.id,
+						businessKey: 'eom_sh_bpbj',
+						formCreateUserId: data.createUserId,
+						processDefinitionId: list?.list[0]?.processDefinition.id,
+						variables: {
+							businessCode: data.code,
+							businessName: data.name,
+							businessType: '申请备品备件',
+						},
+					}
+
+					await processInstanceCreateAPI(params)
+					uni.showModal({
+						title: `提交成功`,
+						content: '',
+						confirmText: '确认',
+						showCancel: false, // 是否显示取消按钮,默认为 true
+						success: () => {
+							this.doSearch()
+						}
+
+					})
+
+
+				} catch {
+
+				}
+
+			},
+
 			doSearch() {
 				this.isEnd = false;
 				this.page = 1;
@@ -343,8 +424,6 @@
 </script>
 
 <style scoped lang="scss">
-	
-
 	.top-wrapper {
 		background-color: #fff;
 		display: flex;

+ 57 - 31
pages/salesServiceManagement/demandList/add.vue

@@ -12,40 +12,40 @@
 					</u--input>
 				</view>
 			</u-cell>
-			<u-cell title="关联类型" arrow-direction="down">
+			<u-cell title="关联类型" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker :readonly="!isDisable" v-model="form.associationType" slot="value" placeholder="请选择"
 					:localdata="associationTypeList" @change="associationTypeOnchange">
 				</uni-data-picker>
 			</u-cell>
-			<u-cell title="需求名称" arrow-direction="down">
+			<u-cell title="需求名称" arrow-direction="down" class="required-mark-new">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
 					<u--input style="flex:1" :disabled="!isDisable" placeholder="请输入" border="surround"
 						v-model="form.name">
 					</u--input>
 				</view>
 			</u-cell>
-			<u-cell title="客户名称" arrow-direction="down">
+			<u-cell title="客户名称" arrow-direction="down" class="required-mark-new">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
 					<u--input :disabled="!isDisable" style="flex:1" placeholder="请选择" border="surround"
 						@click.native="selectContactShow" v-model="form.contactName">
 					</u--input>
 				</view>
 			</u-cell>
-			<u-cell v-if="form.associationType" :title="orderCodeName" arrow-direction="down">
+			<u-cell v-if="form.associationType" :title="orderCodeName" arrow-direction="down" class="required-mark-new">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
 					<u--input :disabled="!isDisable" style="flex:1" placeholder="请选择" border="surround"
 						@click.native="invoiceDialogOpen" v-model="form.orderCode">
 					</u--input>
 				</view>
 			</u-cell>
-			<u-cell title="报修地址" arrow-direction="down">
+			<u-cell title="报修地址" arrow-direction="down" class="required-mark-new">
 				<view slot="value" style="display: flex;align-items: center;width: 100%;">
 					<u--input :disabled="!isDisable" style="flex:1" placeholder="请输入" border="surround"
 						v-model="form.contactAddress">
 					</u--input>
 				</view>
 			</u-cell>
-			<u-cell title="故障等级" arrow-direction="down">
+			<u-cell title="故障等级" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker :readonly="!isDisable" v-model="form.faultLevel" slot="value" placeholder="请选择"
 					:localdata="fault_level" @change="sourceCodeOnchange">
 				</uni-data-picker>
@@ -54,12 +54,12 @@
 				<uni-datetime-picker :disabled="!isDisable" type="date" slot="value" v-model="form.expectedTime">
 				</uni-datetime-picker>
 			</u-cell>
-			<u-cell title="售后类型" arrow-direction="down">
+			<u-cell title="售后类型" arrow-direction="down" class="required-mark-new">
 				<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">
+			<u-cell title="是否收费" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker v-if="isDisable" v-model="form.isFee" slot="value" placeholder="请选择"
 					:localdata="chargeList">
 				</uni-data-picker>
@@ -69,7 +69,7 @@
 				</u--input>
 
 			</u-cell>
-			<u-cell title="是否带配件" arrow-direction="down">
+			<u-cell title="是否带配件" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker v-if="isDisable" v-model="form.isWithAccessories" slot="value" placeholder="请选择"
 					:localdata="chargeList">
 				</uni-data-picker>
@@ -78,7 +78,7 @@
 
 				</u--input>
 			</u-cell>
-			<u-cell title="是否派车" arrow-direction="down">
+			<u-cell title="是否派车" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker v-if="isDisable" v-model="form.isPieCar" slot="value" placeholder="请选择"
 					:localdata="chargeList">
 				</uni-data-picker>
@@ -92,11 +92,11 @@
 					:localdata="pie_car_type">
 				</uni-data-picker>
 				<u--input v-else slot="value" style="flex:1" placeholder="请输入" disabled border="surround"
-					:value="form.pieCarType==1?'是':'否'">
+					:value="getTetx(form.pieCarType)">
 
 				</u--input>
 			</u-cell>
-			<u-cell title="是否外包" arrow-direction="down">
+			<u-cell title="是否外包" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker v-if="isDisable" v-model="form.isOutsource" slot="value" placeholder="请选择"
 					:localdata="chargeList">
 				</uni-data-picker>
@@ -105,7 +105,7 @@
 
 				</u--input>
 			</u-cell>
-			<u-cell title="是否生成采购订单" arrow-direction="down">
+			<u-cell title="是否生成采购订单" arrow-direction="down" class="required-mark-new">
 				<uni-data-picker v-if="isDisable" v-model="form.isCreatePurchaseOrder" slot="value" placeholder="请选择"
 					:localdata="chargeList">
 				</uni-data-picker>
@@ -114,18 +114,21 @@
 
 				</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 title="涉及事业部门" arrow-direction="down" class="required-mark-new" @click.native="salesDeptShow">
+				<u--input slot="value" :disabled="!isDisable" style="pointer-events: none;" placeholder="请选择"
+					border="surround" v-model="form.involveDeptName"></u--input>
 			</u-cell>
 			<u-cell title="备注说明" arrow-direction="down">
-				<u--textarea border="surround" :disabled="!isDisable" placeholder=" " slot="value" v-model="form.remark" autoHeight ></u--textarea>
+				<u--textarea border="surround" :disabled="!isDisable" placeholder=" " slot="value" v-model="form.remark"
+					autoHeight></u--textarea>
 			</u-cell>
 		</u-cell-group>
 		<AfterSales ref="salesRef" :type="type" v-show="current == 1" :afterSalesType="form.afterSalesType"
 			:itemList="form.productDetail" />
+		<!-- 方案列表 -->
+		<SchemeList ref="schemeRef" v-show="current == 2" :type='type' :itemList="costListVOS" />
 		<!-- 联系人 -->
-		<ContactList ref="contactRef" :type="type" v-show="current == 2" :itemList="form.contactInfoVOS" />
+		<ContactList ref="contactRef" :type="type" v-show="current == 3" :itemList="form.contactInfoVOS" />
 		<view class="footerButton" v-if="isDisable">
 			<u-button type="default" text="返回" @click="back"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
@@ -153,6 +156,7 @@
 	} from '@/api/salesServiceManagement/demandList/index.js'
 	import AfterSales from './components/AfterSales.vue'
 	import ContactList from './components/contactList.vue'
+	import SchemeList from '@/pages/salesServiceManagement/workOrder/components/schemeList.vue';
 	import baTreePicker from '@/components/ba-tree-picker/ba-tree-picker.vue'
 	import {
 		listOrganizations,
@@ -160,7 +164,8 @@
 	export default {
 		components: {
 			AfterSales,
-			ContactList
+			ContactList,
+			SchemeList
 		},
 		computed: {
 			isDisable() {
@@ -199,6 +204,7 @@
 					remark: '',
 					processInstanceId: '' // 新增流程实例ID字段
 				},
+				costListVOS: [],
 				associationTypeList: [{
 						value: '1',
 						text: '发货单'
@@ -213,7 +219,7 @@
 					}
 				],
 				createUserName: '',
-				list: ['基本信息', '售后对象', '联系人'],
+				list: ['基本信息', '售后对象', '方案', '联系人'],
 				current: 0,
 				fault_level: [],
 				after_sales_type: [],
@@ -255,6 +261,7 @@
 		},
 		onLoad(params) {
 			this.type = params.type;
+			console.log(params.type, 'params.type')
 			if (params.id) {
 				this.title = params.type == 'view' ? '需求详情' : '修改需求'
 				this.getDetails(params.id);
@@ -298,6 +305,7 @@
 					el.categoryCode = el.code;
 					el.categoryName = el.name;
 					el.categoryModel = el.modelType;
+					el.productCategoryName = el.categoryLevelPath
 					return el;
 				});
 				let params = {
@@ -328,6 +336,9 @@
 
 		},
 		methods: {
+			getTetx(val) {
+				return this.pie_car_type.find(data => data.value == val)?.text
+			},
 			//选择部门
 			salesDeptShow() {
 				if (!this.isDisable) {
@@ -350,7 +361,7 @@
 						res[key].toString()
 					);
 				})
-
+				this.costListVOS = this.form.costListVOS
 
 
 				this.createUserName = data.createUserName;
@@ -453,6 +464,7 @@
 			confirm(data, name) {
 				this.form.involveDeptName = name || ''
 				this.form.involveDeptId = data[0] || ''
+				console.log(this.form, 'this.form')
 			},
 			getByCode() {
 				const codeS = ['fault_level', 'after_sales_type', 'pie_car_type']
@@ -486,6 +498,14 @@
 						})
 						return
 					}
+					if (!data.associationType) {
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择关联类型",
+						})
+						return
+					}
+
 					if (!data.orderCode && this.form.associationType !== '3') {
 						const message = this.form.associationType === "1" ? "请选择发货单" : "请选择销售订单"
 						this.$refs.uToast.show({
@@ -515,6 +535,14 @@
 						})
 						return
 					}
+					if (!data.involveDeptName) {
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择涉及事业部门",
+						})
+						return
+					}
+
 					let isMessage = [];
 					[{
 						name: '请选择是否收费',
@@ -531,9 +559,6 @@
 					}, {
 						name: '请选择是否生成采购订单',
 						key: 'isCreatePurchaseOrder'
-					}, {
-						name: '请选择涉及事业部门',
-						key: 'involveDeptName'
 					}].forEach(item => {
 						if (data[item.key] != 1 && data[item.key] !== 0 && !isMessage.length) {
 							console.log(item, 'item')
@@ -559,17 +584,18 @@
 						this.current = 2
 						return
 					}
-					data.contactInfoVOS = contactInfoVOS;
+					data.contactInfoVOS = this.$refs.contactRef.getTabData();
 					// 售后对象数据
 					let productDetail = this.$refs.salesRef.getTabData();
 					data.productDetail = productDetail.map((item) => {
-							item['produceTime'] = item['produceTime'] || null;
-							return item;
-						}),
+						item['produceTime'] = item['produceTime'] || null;
+						return item;
+					})
+					data.costListVOS = this.$refs.schemeRef.getTabData()
 
-						uni.showLoading({
-							title: '加载中'
-						})
+					uni.showLoading({
+						title: '加载中'
+					})
 
 					let requestname =
 						this.type === 'add' ? saveSalesDemand : updateSalesDemand;

+ 12 - 5
pages/salesServiceManagement/demandList/components/itemSelect.vue

@@ -98,14 +98,16 @@
 					(productItem, productIndex) => {
 						return {
 							...productItem,
+							productCategoryName: productItem.categoryLevelPath,
+							productBrand: productItem.brandNum,
 							outInDetailRecordRequestList: productItem.outInDetailRecordRequestList.map((
 								packingItem) => {
 								return {
 									...packingItem,
 									categoryName: productItem.categoryName,
 									categoryCode: productItem.categoryCode,
+									productCategoryName: productItem.categoryLevelPath,
 									categoryModel: productItem.categoryModel,
-									productCategoryName: packingItem.categoryLevelName,
 									produceTime: packingItem.produceTime || null,
 									shipmentDate: res.createTime || null,
 									guaranteePeriodDeadline: this.getTime(res.createTime)[0],
@@ -118,11 +120,16 @@
 				// 获取包装维度数据
 				const arr = [];
 				for (const key in productList) {
-					for (const k in productList[key].outInDetailRecordRequestList) {
-						arr.push({
-							...productList[key].outInDetailRecordRequestList[k]
-						});
+					if (productList[key].outInDetailRecordRequestList.length) {
+						for (const k in productList[key].outInDetailRecordRequestList) {
+							arr.push({
+								...productList[key].outInDetailRecordRequestList[k]
+							});
+						}
+					} else {
+						arr.push(productList[key])
 					}
+
 				}
 				this.listData = arr;
 			},

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

@@ -345,7 +345,7 @@
 							businessCode: res.code,
 							businessName: res.recycleDeptName,
 							businessType: '售后配件回收入库',
-							storemanIds
+							storemanIds:storemanIds.toString()
 						},
 					}
 

+ 4 - 2
pages/salesServiceManagement/recycle/recycleAdd.vue

@@ -77,7 +77,7 @@
 				</view>
 			</u-cell>
 		</u-cell-group>
-		<accessoryList :itemList="itemList" ref="accessoryRef" :type="type" v-show="current == 1" />
+		<accessoryList :itemList="itemList" ref="accessoryRef" :type="type" v-show="current == 1" title='配件回收清单' />
 		<view class="footerButton" v-if="isDisable">
 			<u-button type="default" text="返回" @click="back"></u-button>
 			<u-button type="primary" @click="save" text="保存"></u-button>
@@ -226,12 +226,14 @@
 						type: "warning",
 						message: "请选择工单",
 					})
+					return
 				};
 				if (!this.form.demandDetailId) {
 					this.$refs.uToast.show({
 						type: "warning",
 						message: "请选择设备",
 					})
+					return
 				};
 				console.log(this.form, 'this.form 123456')
 				let detailList = this.$refs.accessoryRef.getTabData() || [];
@@ -261,7 +263,7 @@
 			},
 			selectWorkOrder() {
 				uni.navigateTo({
-					url: `/pages/salesServiceManagement/accessory/components/selectWork?orderStatusList='3,4'`
+					url: `/pages/salesServiceManagement/accessory/components/selectWork?orderStatusList=3,4`
 				})
 			}
 		}

+ 148 - 147
pages/salesServiceManagement/workOrder/components/accessoryAdd.vue

@@ -164,7 +164,7 @@
 		</view>
 		<screenAccess :dataSources="dataSources" ref="screen" @succeed="getData" />
 		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
-			:selectedData="selectedData" :localdata="classificationList" valueKey="id" textKey="name"
+		 :localdata="classificationList" valueKey="id" textKey="name"
 			childrenKey="children" />
 		<u-toast ref="uToast"></u-toast>
 	</view>
@@ -179,8 +179,9 @@
 		getMaterielDetails,
 	} from '@/api/repair';
 	import {
-		treeByPid
-	} from '@/api/pda/workOrder.js';
+		getProduceTreeByPid,
+
+	} from '@/api/warehouseManagement'
 	import {
 		getList
 	} from '@/api/classifyManage/itemInformation.js'
@@ -195,8 +196,8 @@
 				accessoriesList: [], // 配件列表
 				addList: [], // 添加列表
 				classificationList: [],
-				categoryLevelId: 6, // 分类id(默认6 查询备品备件)
-				selectedData: ['6'],
+				categoryLevelId: '', // 分类id(默认6 查询备品备件)
+				// selectedData: ['6'],
 				isEnd: false,
 				pageNum: 1,
 				dimensionList: [{
@@ -352,8 +353,8 @@
 			},
 			// 查部门
 			getTreeList() {
-				treeByPid({
-					ids: [6]
+				getProduceTreeByPid({
+					type: 5
 				}).then(res => {
 					this.classificationList = res;
 					this.confirm(res[0].id, res[0].name);
@@ -413,30 +414,30 @@
 
 <style scoped lang="scss">
 	// @import url('@/pages/salesServiceManagement/demandList/components/invoice.scss');
-	
-	
-	
+
+
+
 	.listContent {
 		height: 100% !important;
-	
+
 		.listBox {
 			display: flex;
 			// height: 180rpx;
 			padding: 20rpx 0;
 			border-bottom: 2rpx solid #e5e5e5;
-	
+
 			.listBox-sel {
 				height: 90rpx;
 				width: 80rpx;
 				// line-height: 90rpx;
 				text-align: center;
-	
+
 				checkbox {
 					transform: scale(1.2);
 				}
 			}
 		}
-		
+
 		.listBox-con {
 			width: 100%;
 			// display: flex;
@@ -444,13 +445,13 @@
 			// justify-content: space-between;
 			align-items: center;
 			padding: 0 18rpx 0 0;
-		
+
 			.listBox-top {
 				width: 100%;
 				display: flex;
 				justify-content: space-between;
 				padding-bottom: 10rpx;
-		
+
 				.listBox-name,
 				.listBox-code {
 					display: inline-block;
@@ -458,171 +459,171 @@
 					font-weight: bold;
 				}
 			}
-		
+
 			.listBox-bottom {
 				width: 100%;
 				display: flex;
 				justify-content: space-between;
 				font-size: $uni-font-size-sm;
 				flex-wrap: wrap;
-		
+
 				>view {
 					width: 100%;
 					overflow: hidden;
 					white-space: nowrap;
 					text-overflow: ellipsis;
 				}
-		
+
 				.half {
 					width: 50%;
 				}
-				
-				.label-s{
+
+				.label-s {
 					width: 50%;
 					display: inline-block !important;
 				}
 			}
 		}
-	
+
 		.noDate {
 			height: 100%;
 		}
 	}
-	
-	
-	
+
+
+
 	.mainBox {
-			height: 100vh;
+		height: 100vh;
+		display: flex;
+		flex-direction: column;
+
+		.wrapper {
+			// flex: 1;
+			height: calc(100vh - 250rpx);
+			overflow: hidden;
+		}
+
+		//底部按钮
+		.footer {
+			height: 45px;
+			position: relative;
 			display: flex;
-			flex-direction: column;
-	
-			.wrapper {
-				// flex: 1;
-				height: calc(100vh - 250rpx);
-				overflow: hidden;
+			justify-content: space-between;
+			align-items: center;
+			bottom: 0;
+			width: 100%;
+			height: 50px;
+			border-top: 1px solid #eeecec;
+			background-color: #ffffff;
+			z-index: 999;
+
+			.bottom {
+				margin-left: 10rpx;
 			}
-	
-			//底部按钮
-			.footer {
-				height: 45px;
-				position: relative;
-				display: flex;
-				justify-content: space-between;
-				align-items: center;
-				bottom: 0;
-				width: 100%;
-				height: 50px;
-				border-top: 1px solid #eeecec;
-				background-color: #ffffff;
-				z-index: 999;
-	
-				.bottom {
-					margin-left: 10rpx;
-				}
-	
-				.u-reset-button {
-					position: absolute;
-					right: 10rpx;
-					top: 20rpx;
-					width: 150rpx;
-				}
+
+			.u-reset-button {
+				position: absolute;
+				right: 10rpx;
+				top: 20rpx;
+				width: 150rpx;
 			}
-	
-			.top-wrapper {
-				background-color: #fff;
-				display: flex;
-				width: 750rpx;
-				height: 88rpx;
-				padding: 16rpx 32rpx;
-				align-items: center;
-				gap: 16rpx;
-	
-				/deep/.uni-section {
-					margin-top: 0px;
-				}
-	
-				/deep/.uni-section-header {
-					padding: 0px;
-	
-				}
-	
-				.search_btn {
-					width: 120rpx;
-					height: 70rpx;
-					line-height: 70rpx;
-					padding: 0 24rpx;
-					background: $theme-color;
-					font-size: 32rpx;
-					color: #fff;
-					margin: 0;
-					margin-left: 26rpx;
-				}
-	
+		}
+
+		.top-wrapper {
+			background-color: #fff;
+			display: flex;
+			width: 750rpx;
+			height: 88rpx;
+			padding: 16rpx 32rpx;
+			align-items: center;
+			gap: 16rpx;
+
+			/deep/.uni-section {
+				margin-top: 0px;
+			}
+
+			/deep/.uni-section-header {
+				padding: 0px;
+
+			}
+
+			.search_btn {
+				width: 120rpx;
+				height: 70rpx;
+				line-height: 70rpx;
+				padding: 0 24rpx;
+				background: $theme-color;
+				font-size: 32rpx;
+				color: #fff;
+				margin: 0;
+				margin-left: 26rpx;
+			}
+
+			.menu_icon {
+				width: 44rpx;
+				height: 44rpx;
+				margin-left: 14rpx;
+			}
+		}
+
+		.dimension {
+			width: calc(100% - 270rpx);
+		}
+
+		.nav_box {
+			padding: 6rpx 32rpx;
+			position: relative;
+
+			.btn {
+				width: 68rpx;
+				text-align: center;
+				background: #1890ff;
+				color: #fff;
+				border: 2rpx solid;
+				border-color: #1890ff;
+				height: 40rpx;
+				line-height: 40rpx;
+				font-size: 26rpx;
+				margin-right: 10rpx;
+			}
+
+			.remove {
+				color: #606266;
+				border-color: #dddddd;
+				background: #fff;
+			}
+
+			.nav_item {
+				font-size: 28rpx;
+				font-weight: 400;
+				color: $theme-color;
+				background: #F0F8F2;
+				margin-right: 16rpx;
+				padding: 4rpx 16rpx;
+				border-radius: 8rpx;
+				border: 2rpx solid #ACD4B5;
+
+			}
+
+			.menu_box {
+				position: absolute;
+				right: 20rpx;
+				top: 10rpx;
+
 				.menu_icon {
 					width: 44rpx;
 					height: 44rpx;
-					margin-left: 14rpx;
 				}
+
 			}
-	
-			.dimension {
-				width: calc(100% - 270rpx);
-			}
-	
-			.nav_box {
-				padding: 6rpx 32rpx;
-				position: relative;
-	
-				.btn {
-					width: 68rpx;
-					text-align: center;
-					background: #1890ff;
-					color: #fff;
-					border: 2rpx solid;
-					border-color: #1890ff;
-					height: 40rpx;
-					line-height: 40rpx;
-					font-size: 26rpx;
-					margin-right: 10rpx;
-				}
-	
-				.remove {
-					color: #606266;
-					border-color: #dddddd;
-					background: #fff;
-				}
-	
-				.nav_item {
-					font-size: 28rpx;
-					font-weight: 400;
-					color: $theme-color;
-					background: #F0F8F2;
-					margin-right: 16rpx;
-					padding: 4rpx 16rpx;
-					border-radius: 8rpx;
-					border: 2rpx solid #ACD4B5;
-	
-				}
-	
-				.menu_box {
-					position: absolute;
-					right: 20rpx;
-					top: 10rpx;
-	
-					.menu_icon {
-						width: 44rpx;
-						height: 44rpx;
-					}
-	
-				}
-	
-				.active {
-					background: $theme-color;
-					border: 2rpx solid $theme-color;
-					color: #FFF;
-				}
+
+			.active {
+				background: $theme-color;
+				border: 2rpx solid $theme-color;
+				color: #FFF;
 			}
 		}
-	
+	}
+
 	// @import './accessory.scss';
 </style>

+ 52 - 7
pages/salesServiceManagement/workOrder/components/accessoryList.vue

@@ -8,9 +8,18 @@
 						@input="(val) =>inputChange(val,'totalCount',index)" slot="totalCount"
 						v-model="item.totalCount">
 					</u--input>
-					<u--input  :disabled="isDisable"  placeholder="请输入" type="number" @input="(val) =>inputChange(val,'singlePrice',index)"
-						slot="singlePrice" v-model="item.singlePrice">
+					<u--input :disabled="isDisable" placeholder="请输入" type="number"
+						@input="(val) =>inputChange(val,'singlePrice',index)" slot="singlePrice"
+						v-model="item.singlePrice">
 					</u--input>
+
+					<uni-data-picker style="width:100%" v-if="title == '配件回收清单'&&!isDisable"
+						@change="handleLastChange(index)" :map="{text:'name',value:'id'}" v-model="item.warehouseId"
+						slot="warehouseId" placeholder="请选择" :localdata="warehouseList">
+					</uni-data-picker>
+					<span v-else slot="warehouseId">
+						{{item.warehouseName}}
+					</span>
 				</myCard>
 			</view>
 		</u-list>
@@ -22,10 +31,10 @@
 
 <script>
 	import myCard from '@/pages/saleManage/components/myCard.vue';
+
 	import {
-		getWarehouseOutStock,
-		getIdWarehouseList
-	} from '@/api/salesServiceManagement/workOrder/index.js';
+		getWarehouseList,
+	} from "@/api/pda/workOrder.js";
 	export default {
 		components: {
 			myCard
@@ -98,7 +107,8 @@
 					}],
 					[{
 						label: '仓库:',
-						prop: 'warehouseName'
+						prop: 'warehouseName',
+						slot: 'warehouseId'
 					}],
 					[{
 						label: '操作:',
@@ -114,7 +124,8 @@
 					type: '2',
 					pageUrl: '',
 				}],
-				tableList: []
+				tableList: [],
+				warehouseList: []
 			}
 		},
 		computed: {
@@ -142,11 +153,22 @@
 					}
 				})
 			})
+			this.getWarehouseFn()
 		},
 		onShow() {
 
 		},
 		methods: {
+			handleLastChange(index) {
+				let data = this.warehouseList.find(item => item.id == this.tableList[index].warehouseId)
+				this.$set(this.tableList[index], 'warehouseName', data?.name)
+			},
+			// 仓库
+			getWarehouseFn() {
+				getWarehouseList().then((res) => {
+					this.warehouseList = res
+				});
+			},
 			add() {
 				let dataSources = this.title == '配件回收清单' ? '1' : '0';
 				uni.navigateTo({
@@ -194,6 +216,29 @@
 				obj.totalPrice = total;
 			},
 			getTabData() {
+				let is = true;
+				if (this.title == '配件回收清单') {
+					let warehouseIdS = this.tableList.filter((item) => item.warehouseId);
+					if (warehouseIdS.length != this.tableList.length) {
+						this.$refs.uToast.show({
+							type: "warning",
+							message: "请选择仓库",
+						})
+						return
+					}
+				}
+				this.tableList.forEach((item) => {
+					if (!item.totalCount) {
+						is = false;
+					}
+				});
+				if (!is) {
+					this.$refs.uToast.show({
+						type: "warning",
+						message: "请填写数量",
+					})
+					return
+				}
 				return this.tableList || [];
 			}
 		}

+ 10 - 7
pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -18,7 +18,7 @@
 		<ContactList ref="contactRef" :type="type" v-show="currentValue == 6" :itemList="contactInfoVOS"
 			:isReport="isReport" />
 		<!-- 方案列表 -->
-		<SchemeList ref="schemeRef" v-show="currentValue == 7" :type='type' :itemList="costListVOS" />
+		<SchemeList ref="schemeRef" v-show="currentValue == 7" :type='type' :itemList="costListVOS" pageName="workOrder" />
 		<!-- 报工信息 -->
 		<ReportInfo ref="reportInfoRef" :form="reportForm" v-show="currentValue == 1" />
 		<view :class=" type == 'report' ? 'footerButton footer_button':'footerButton'" v-if="isDisable">
@@ -237,7 +237,7 @@
 				// 点击报工 逻辑
 				if (type == 'report') {
 					let flag = true;
-					productDetail[0].faultDetails.forEach((el) => {
+					productDetail[0]?.faultDetails?.forEach((el) => {
 						if (!el.faultReason || !el.maintenanceProcess) {
 							this.$refs.uToast.show({
 								type: "warning",
@@ -254,6 +254,8 @@
 				}
 				let contactInfoVOS = this.$refs.contactRef.getTabData();
 				let costListVOS = this.$refs.schemeRef.getTabData();
+				// console.log(this.$refs.schemeRef.getTotalPrice(),'this.$refs.schemeRef.getTotalPrice()')
+				// return
 				let obj = resData.afterSalesDemandVO;
 				let data = {
 					attachments: resData.attachments,
@@ -263,6 +265,7 @@
 					id: resData.id,
 					inFactDuration: resData.inFactDuration,
 					maintenanceProcess: resData.maintenanceProcess,
+					totalCost:this.$refs.schemeRef.getTotalPrice(),
 					salesDemandUpdatePO: {
 						orderCode: obj.orderCode,
 						orderId: obj.orderId,
@@ -274,7 +277,7 @@
 						id: obj.id,
 					}
 				}
-				productDetail.map((el) => {
+				productDetail?.map((el) => {
 					delete el.produceTime;
 				})
 				data.salesDemandUpdatePO.productDetail = productDetail;
@@ -298,16 +301,16 @@
 				}
 
 				// 报工进来 保存或者报工 数据
-				if (this.type == 'report' && productDetail[0].faultDetails.length > 0) {
+				if (this.type == 'report' && productDetail[0]?.faultDetails?.length > 0) {
 					let list = this.$refs.accessoryRef.getTabData() || [];
 					if (list.length > 0) {
 						let detailList = this.clistData(list);
 						// 指定绑定第一条设备信息
 						let item = data.salesDemandUpdatePO.productDetail[0];
 						let accessoryApply = {
-							demandDetailId: item.id,
-							categoryCode: item.categoryCode,
-							categoryName: item.categoryName,
+							demandDetailId: item?.id,
+							categoryCode: item?.categoryCode,
+							categoryName: item?.categoryName,
 							contactName: data.salesDemandUpdatePO.contractInfo.name,
 							contactCode: data.salesDemandUpdatePO.contractInfo.code,
 							detailList

+ 3 - 3
pages/salesServiceManagement/workOrder/components/forWork/checkAndAccept.vue

@@ -7,7 +7,7 @@
 					验收
 					<text class="btn confirm" @tap="submit">确定</text>
 				</view>
-				<uni-forms :modelValue="formData" class="form" label-width='75px'>
+				<uni-forms :modelValue="formData" class="form" label-width='80px'>
 					<uni-forms-item label="验收人" name="accepterUserId">
 						<uni-data-select v-model="formData.accepterUserId" @change="handleChange" :clear="false"
 							:localdata="contactInfoVOS"></uni-data-select>
@@ -144,8 +144,8 @@
 			color: #fff;
 
 			.btn {
-				width: 80rpx;
-				height: 32rpx;
+				// width: 80rpx;
+				// height: 32rpx;
 				display: inline-block;
 				font-size: 30rpx;
 				border: 1px solid #fff;

+ 2 - 2
pages/salesServiceManagement/workOrder/components/schemeAdd.vue

@@ -124,7 +124,7 @@
 		},
 		onLoad(params) {
 			let data = JSON.parse(params.data);
-			if (data.code) {
+			if (data.name) {
 				this.form = data;
 			}
 			console.log(data, 'params')
@@ -178,7 +178,7 @@
 				}
 				this.oldTypeId = this.form.typeId;
 				this.form = {
-					typeId: e.detail.value[0].text,
+					typeId: this.form.typeId,
 					code: '',
 					name: '',
 					categoryModel: '', // 型号

+ 50 - 13
pages/salesServiceManagement/workOrder/components/schemeList.vue

@@ -35,6 +35,7 @@
 				type: Array,
 				default: () => []
 			},
+			pageName: ''
 		},
 		watch: {
 			itemList: {
@@ -59,8 +60,11 @@
 						judge: [{
 							authorities: '',
 						}, {
-							key: 'customize',
-							value: ['5'],
+							fn: (row) => {
+								return (this.type != 'view' &&
+									row.isApply != 1
+								);
+							}
 
 						}]
 					},
@@ -73,9 +77,11 @@
 						judge: [{
 							authorities: '',
 						}, {
-							key: 'customize',
-							value: ['5'],
-
+							fn: (row) => {
+								return (this.type != 'view' &&
+									row.isApply != 1
+								);
+							},
 						}]
 					},
 				],
@@ -142,6 +148,37 @@
 						label: '详细内容:',
 						prop: 'content'
 					}],
+					[{
+							prop: 'sparePartsApplyApprovalStatus',
+							label: '审核状态:',
+							isNone: this.pageName != 'workOrder',
+							formatter: (row) => {
+								if (row.typeId == 2) {
+									const reviewStatus = {
+										0: '未提交',
+										1: '审核中',
+										2: '已审核',
+										3: '审核不通过'
+									}
+									return !row.sparePartsApplyApprovalStatus ?
+										'未提交' :
+										reviewStatus[row.sparePartsApplyApprovalStatus];
+								}
+							},
+						},
+						{
+							prop: 'sparePartsApplyApprovalStatus',
+							isNone: this.pageName != 'workOrder',
+							label: '出库状态:',
+							formatter: (row) => {
+								if (row.typeId == 2) {
+									return row.sparePartsApplyApprovalStatus == 2 ?
+										'已出库' :
+										'未出库';
+								}
+							},
+						}
+					],
 					[{
 						label: '操作:',
 						prop: 'action',
@@ -155,7 +192,6 @@
 			this.getLevelCode('after_sales_project')
 			uni.$off('updateInfo');
 			uni.$on('updateInfo', (data) => {
-				data.customize = '5';
 				if (data.index || data.index == 0) {
 					let index = data.index;
 					delete data.index;
@@ -169,6 +205,13 @@
 
 		},
 		methods: {
+			getTotalPrice(){
+				 return this.tableList.reduce((a,b)=>{
+					 console.log(b,'b.settlementPrice')
+					return a+(Number(b.settlementPrice)||0)
+				 },0)
+			},
+
 			async getLevelCode(code) {
 				try {
 					const res = await getByCode(code);
@@ -237,13 +280,7 @@
 				});
 			},
 			getTabData() {
-				let list = this.tableList.map((el) => {
-					if (el.customize) {
-						delete el.customize;
-					}
-					return el;
-				})
-				return list || [];
+				return this.tableList || []
 			}
 		}
 	}

+ 10 - 8
pages/salesServiceManagement/workOrder/components/selectProduct.vue

@@ -125,7 +125,7 @@
 			</u-list>
 		</view>
 		<ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="confirm" title="选择分类"
-			:selectedData="selectedData" :localdata="classificationList" valueKey="id" textKey="name"
+			:localdata="classificationList" valueKey="id" textKey="name"
 			childrenKey="children" />
 		<view class="footer">
 			<u-button type="success" size="small" class="u-reset-button" @click="jumpAdd">
@@ -143,8 +143,9 @@
 		getInventoryTotalAPI
 	} from '@/api/wms/index.js'
 	import {
-		treeByPid
-	} from '@/api/pda/workOrder.js'
+		getProduceTreeByPid,
+
+	} from '@/api/warehouseManagement'
 	import {
 		getProductList,
 		getBatchDetails,
@@ -163,8 +164,8 @@
 				tableList: [],
 				obtain: '主数据',
 				dimension: '1', // 列表维度
-				categoryLevelId: 6, // 分类id(默认6 查询备品备件)
-				selectedData: ['6'],
+				categoryLevelId: '', // 分类id(默认6 查询备品备件)
+				// selectedData: ['6'],
 				classificationList: [],
 				pageNum: 1,
 				isEnd: false,
@@ -334,8 +335,8 @@
 				this.checkedkList = this.tableList.filter(item => item.checked)
 			},
 			getTreeList() {
-				treeByPid({
-					ids: [6]
+				getProduceTreeByPid({
+					type: 5
 				}).then(res => {
 					this.classificationList = res;
 					this.confirm(res[0].id, res[0].name, res[0].rootCategoryLevelId)
@@ -356,7 +357,7 @@
 					})
 					return;
 				}
-				//获取仓库库存
+				// //获取仓库库存
 				// if (this.obtain == '仓库') {
 				// 	let codeList = list.map((item) => item.code);
 				// 	let inventoryTotalList = await getInventoryTotalAPI(codeList);
@@ -369,6 +370,7 @@
 
 				// 单选
 				if (this.selectType == '1') {
+					list[0].warehouseNum=list[0].measureQuantity
 					uni.$emit('updateScheme', list[0]);
 				}
 				this.back();