Procházet zdrojové kódy

feat(售后需求管理): 添加必填字段标记样式及优化表单验证逻辑

yusheng před 6 měsíci
rodič
revize
d960e58613

+ 9 - 0
App.vue

@@ -197,6 +197,15 @@
 		-moz-osx-font-smoothing: grayscale;
 	}
 
+
+
+	.required-mark-new::before {
+		content: "*";
+		color: red;
+		position:absolute;
+		left:7rpx;
+	}
+
 	.footerButton {
 		background: #fff
 	}

+ 4 - 2
hybrid/html/a.html

@@ -176,17 +176,19 @@
 								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: '必须填写'
 									}])
+										if (params.manage_workorder) {
 									this.setSalesServiceWork(params.manage_workorder)
+							}
+
 								})
 
 
-							}
 						}
 					});
 

+ 1 - 1
manifest.json

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

+ 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) {

+ 1 - 4
pages/salesServiceManagement/accessory/index.vue

@@ -244,10 +244,7 @@
 						pageUrl: '',
 						judge: [{
 							authorities: '',
-						}, {
-							key: 'source',
-							value: [0],
-						}, {
+						},  {
 							key: 'approvalStatus',
 							value: [0, 3],
 						}],

+ 24 - 16
pages/salesServiceManagement/demandList/add.vue

@@ -6,46 +6,46 @@
 		<u-subsection :list="list" :current="current" @change="sectionChange"></u-subsection>
 		<u-cell-group v-show="current == 0">
 			<!-- 售后对象 -->
-			<u-cell title="需求编码" arrow-direction="down">
-				<view slot="value" style="display: flex;align-items: center;width: 100%;">
+			<u-cell title="需求编码" arrow-direction="down" >
+				<view slot="value" style="display: flex;align-items: center;width: 100%;" >
 					<u--input disabled style="flex:1" border="surround" v-model="form.code">
 					</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>
@@ -96,7 +96,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.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,8 +114,8 @@
 
 				</u--input>
 			</u-cell>
-			<u-cell title="涉及事业部门" arrow-direction="down">
-				<u--input slot="value" :disabled="!isDisable" placeholder="请选择" border="surround"
+			<u-cell title="涉及事业部门" arrow-direction="down" class="required-mark-new">
+				<u--input slot="value" :disabled="!isDisable"  readonly placeholder="请选择" border="surround"
 					v-model="form.involveDeptName" @click.native="salesDeptShow"></u--input>
 			</u-cell>
 			<u-cell title="备注说明" arrow-direction="down">
@@ -494,6 +494,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({

+ 1 - 1
pages/salesServiceManagement/demandList/components/itemSelect.vue

@@ -104,8 +104,8 @@
 									...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],

+ 3 - 0
pages/salesServiceManagement/workOrder/components/editPlan.vue

@@ -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,

+ 6 - 0
pages/salesServiceManagement/workOrder/components/schemeList.vue

@@ -205,6 +205,12 @@
 
 		},
 		methods: {
+			getTotalPrice(){
+				 return this.tableList.reduce((a,b)=>{
+					 console.log(b,'b.settlementPrice')
+					return a+(Number(b.settlementPrice)||0)
+				 },0)
+			},
 
 			async getLevelCode(code) {
 				try {

+ 8 - 7
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)