Преглед изворни кода

feat(销售合同): 新增合同作废功能并完善合同表单信息

liujt пре 4 месеци
родитељ
комит
e24f65bf03

+ 55 - 0
enum/dict.js

@@ -119,4 +119,59 @@ export const dimensionType = [{
 		value: 3,
 		text: '包装维度'
 	}
+];
+
+export const transactionMethodsOp = [
+  {
+    value: 1,
+    label: '先票后款'
+  },
+  {
+    value: 2,
+    label: '先款后票'
+  }
+];
+
+export const shippingModeOp = [
+  {
+    value: 1,
+    label: '发货再对账'
+  },
+  {
+    value: 2,
+    label: '对账再发货'
+  }
+];
+
+export const shippingModePurchaseOp = [
+  {
+    value: 1,
+    label: '收货再对账'
+  },
+  {
+    value: 2,
+    label: '对账再收货'
+  }
+];
+
+// 计价方式
+export const pricingWayList = [
+  { id: 1, name: '按数量计价' },
+  { id: 2, name: '按重量计价' },
+  { id: 3, name: '按增重计价' }
+];
+
+export const quoteTypeOp = [
+  {
+    value: 1,
+    label: '常规价'
+  },
+  {
+    value: 2,
+    label: '内部价'
+  },
+  {
+    value: 3,
+    label: '议价'
+  }
 ];

+ 255 - 10
pages/home/wt/components/salesContract/taskForm.vue

@@ -12,10 +12,36 @@
 					<u--input style="width: 100%;" disabled :value='`${form.typeName} ${form.categoryName}`'></u--input>
 				</u-form-item>
 				<!-- @tap="showUserPicker" -->
+				<u-form-item label="来源类型" prop="sourceType" borderBottom>
+					<u--input style="width: 100%;" disabled :value='`${form.sourceTypeName}`'>
+					</u--input>
+				</u-form-item>
+				<u-form-item v-if="form.sourceType && form.sourceName" :label="sourceName" prop="sourceName" borderBottom>
+					<u--input style="width: 100%;" disabled :value='`${form.sourceName}`'>
+					</u--input>
+				</u-form-item>
 				<u-form-item label="合同名称" prop="contractName" borderBottom>
 					<u--input style="width: 100%;" disabled v-model="form.contractName"></u--input>
 					<!-- <u-icon slot="right" name="arrow-right"></u-icon> -->
 				</u-form-item>
+				<u-form-item label="合同编号" prop="contractNumber" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.contractNumber"></u--input>
+				</u-form-item>
+				<u-form-item label="需求类型" prop="requireSourceTypeName" borderBottom v-if="form.type == 2">
+					<u--input style="width: 100%;" disabled v-model="form.requireSourceTypeName"></u--input>
+				</u-form-item>
+				<u-form-item label="需求部门" prop="requireDeptName" borderBottom v-if="form.type == 2">
+					<u--input style="width: 100%;" disabled v-model="form.requireDeptName"></u--input>
+				</u-form-item>
+				<u-form-item label="需求人" prop="requireUserId" borderBottom v-if="form.type == 2">
+					<u--input style="width: 100%;" disabled v-model="form.requireUserName"></u--input>
+				</u-form-item>
+				<u-form-item :label="form.type == 2 ? '采购部门' : '销售部门'" prop="businessDeptName" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.businessDeptName"></u--input>
+				</u-form-item>
+				<u-form-item :label="form.type == 2 ? '采购员' : '业务员'" prop="businessUserName" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.businessUserName"></u--input>
+				</u-form-item>
 				<u-form-item label="编码" prop="contractNo" borderBottom>
 					<u--input style="width: 100%;" disabled v-model="form.contractNo"></u--input>
 				</u-form-item>
@@ -29,9 +55,24 @@
 				<u-form-item label="结束日期" prop="contractEndDate" borderBottom>
 					<u--input style="width: 100%;" disabled v-model="form.contractEndDate"></u--input>
 				</u-form-item>
+				<u-form-item label="交易方式" prop="transactionMode" borderBottom>
+					<u--input style="width: 100%;" disabled :value="form.transactionModeName"></u--input>
+				</u-form-item>
+				<u-form-item :label="form.type == 2 ? '收货模式' : '发货模式'" prop="deliveryMode" borderBottom>
+					<u--input style="width: 100%;" disabled :value="form.deliveryModeName"></u--input>
+				</u-form-item>
 				<u-form-item label="结算方式" prop="settlementModeName" borderBottom>
 					<u--input style="width: 100%;" disabled v-model="form.settlementModeName"></u--input>
 				</u-form-item>
+				<u-form-item v-if="form.settlementMode == 2 || form.settlementMode == 1" :label="form.settlementMode == 2 ? '结算月份范围' : '结算日期范围'" prop="settlementDate" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.settlementDate"></u--input>
+				</u-form-item>
+				<u-form-item label="收款日期" prop="receiptDate" borderBottom v-if="form.settlementMode == 2">
+					<u--input style="width: 100%;" disabled v-model="form.receiptDate"></u--input>
+				</u-form-item>
+				<u-form-item label="期数" prop="issueNumber" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.issueNumber"></u--input>
+				</u-form-item>
 				<u-form-item label="附件" prop="settlementModeName" borderBottom>
 				 <fileMain v-model="form.fileId" type="view"></fileMain>
 				</u-form-item>
@@ -135,6 +176,8 @@
 		getDetail
 	} from '@/api/wt/index.js'
 	import fileMain from "@/pages/doc/index.vue"
+	import {transactionMethodsOp,shippingModeOp,shippingModePurchaseOp, pricingWayList, levelList, quoteTypeOp} from '@/enum/dict.js'
+		
 	export default {
 		components:{fileMain},
 		props: {
@@ -145,10 +188,111 @@
 				default: ''
 			},
 		},
+		computed: {
+			sourceName() {
+				console.log('this.form.sourceType',this.form.sourceType)
+				switch (this.form.sourceType) {
+					case 1:
+						return '报价单'
+					case 2:
+						return '核价单'
+					case 3:
+						return '计划名称'
+					case 4:
+						return '商机名称'
+					case 5:
+						return '退货单'
+					case 6:
+						return '客户'
+					case 7:
+						return '销售订单'
+					default:
+						return ''
+				}
+			},
+			shippingModeOptions() {
+				return this.form.type == 2 ? shippingModePurchaseOp : shippingModeOp;
+			},
+			feeTableField() {
+				return [{
+						label: '期数',
+						field: 'issueNumber',
+					}, 
+					{
+						label: '款项类型',
+						field: 'typeName',
+					},
+					{
+						label: '款项名称',
+						field: 'moneyName',
+					},
+					{
+						label: '比例(%)',
+						field: 'ratio',
+					},
+					{
+						label: this.form.type == 2 ? '计划付款金额(元)' : '计划收款金额(元)',
+						field: 'price',
+					},
+					{
+						label: this.form.type == 2 ? '计划付款日期' : '计划收款日期',
+						field: 'deadLine',
+					},
+					{
+						label: '说明',
+						field: 'remark',
+					}
+				]
+			},
+			list() {
+				return this.form.type == 2 ? ['合同信息', '基本信息', '产品清单', '付款计划'] : ['合同信息', '基本信息', '产品清单', '收款计划']
+			},
+		},
 		data() {
 			return {
+				pricingWayList,
+				quoteTypeOp,
+				levelList,
 				detailData: {},
 				form: {},
+				transactionMethodsOp,
+				sourceTypeList: [
+					{
+						code: 1,
+						name: '报价单',
+						parentId: '1'
+					},
+					{
+						code: 2,
+						name: '核价单',
+						parentId: '2'
+					},
+					{
+						code: 3,
+						name: '采购计划',
+						parentId: '2'
+					},
+					{
+						code: 4,
+						name: '商机',
+						parentId: '1'
+					},
+					{
+						code: 5,
+						name: '退货单',
+						parentId: '1'
+					},
+					{
+						code: 6,
+						name: '客户',
+						parentId: '1'
+					},
+					{
+						code: 7,
+						name: '销售订单',
+						parentId: '1'
+					}
+					],
 				tableField: [{
 						label: '类型',
 						field: 'productCategoryName',
@@ -160,6 +304,11 @@
 						label: '编码',
 						field: 'productCode',
 					},
+					{
+						field: 'pricingWayName',
+						label: '计价方式',
+
+					},
 					{
 						field: 'specification',
 						label: '规格',
@@ -175,32 +324,116 @@
 						field: 'customerMark',
 					},
 					{
-						label: '单价',
-						field: 'singlePrice',
+						label: '工序',
+						field: 'taskName',
 					},
 					{
 						label: '数量',
 						field: 'totalCount',
 					},
+					{
+						label: '价格类型',
+						field: 'goodsPriceType ',
+					},
+					{
+						label: '单价',
+						field: 'singlePrice',
+					},
+					{
+						label: '税率',
+						field: 'taxRate',
+					},
+					{
+						label: '不含税单价',
+						field: 'notaxSinglePrice',
+					},
+					{
+						label: '报价方式',
+						field: 'quoteWayName',
+					},
+					{
+						label: '折让比例',
+						field: 'discountRatio',
+					},
+					{
+						label: '折让单价',
+						field: 'discountSinglePrice',
+					},
 					{
 						label: '合计',
 						field: 'totalPrice',
 					},
+					{
+						label: '折让合计',
+						field: 'discountTotalPrice',
+					},
+					{
+						label: '生产要求',
+						field: 'productionRequirements',
+					},
+					{
+						label: '包装规格',
+						field: 'packingSpecification',
+					},
+					{
+						label: '计量数量',
+						field: 'totalCount',
+					},
+					{
+						label: '单重',
+						field: 'singleWeight',
+					},
+					{
+						label: '总重',
+						field: 'totalWeight',
+					},
+					{
+						label: '增重重量',
+						field: 'increaseTotalWeight',
+					},
+					{
+						label: '物品级别',
+						field: 'goodsLevelName',
+					},
+					{
+						label: '批次号',
+						field: 'batchNo',
+					},
+					{
+						label: '型号',
+						field: 'modelType',
+					},
+					{
+						label: '机型',
+						field: 'modelKey',
+					},
+					{
+						label: '颜色',
+						field: 'colorKey',
+					},
 				],
-				feeTableField: [{
-						label: '款项名称',
-						field: 'moneyName',
+				feeTableField1: [{
+						label: '期数',
+						field: 'issueNumber',
+					}, 
+					{
+						label: '款项类型',
+						field: 'type',
 					},
 					{
-						label: '金额(元)',
-						field: 'price',
+						label: '款项名称',
+						field: 'moneyName',
 					},
 					{
 						label: '比例(%)',
 						field: 'ratio',
 					},
 					{
-						label: '截止日期',
+						label: '计划付款金额(元)',
+						field: 'price',
+					},
+					{
+						label: '计划付款日期',
 						field: 'deadLine',
 					},
 					{
@@ -208,7 +441,7 @@
 						field: 'remark',
 					}
 				],
-				list: ['合同信息', '基本信息', '产品清单', '付款方式'],
+				list1: ['合同信息', '基本信息', '产品清单', '付款计划'],
 				curNow: 0
 			}
 		},
@@ -222,9 +455,21 @@
 			async getDetailData(id) {
 				const data = await getDetail(id);
 				if (data) {
+					const {contractVO} = data
+					console.log('data~~~',data)
+					contractVO['sourceTypeName'] = this.sourceTypeList.find(item => item.code == contractVO['sourceType'])?.name || '';
+					contractVO['transactionModeName'] = this.transactionMethodsOp.find(item => item.value == contractVO['transactionMode'])?.label || '';
+					contractVO['deliveryModeName'] = this.shippingModeOptions.find(item => item.value == contractVO['deliveryMode'])?.label || '';
+					contractVO['settlementDate'] = contractVO.startSettlementDate ? `${contractVO.startSettlementDate} - ${contractVO.endSettlementDate}` : '';
 					data['receiptPaymentList'] = data['receiptPaymentList'].length ? data['receiptPaymentList'] : [{}]
+					data.productList = data.productList.map(item => {
+						item.pricingWayName = this.pricingWayList.find(way => way.id == item.pricingWay)?.name || '';
+						item.quoteWayName = this.quoteTypeOp.find(type => type.value == item.quoteType)?.label || '';
+						item.goodsLevelName = this.levelList.find(level => level.value == item.goodsLevel)?.label || '';
+						return item;
+					})
 					this.detailData = data;
-					this.form = data.contractVO;
+					this.form = contractVO;
 
 				}
 			}

+ 48 - 2
pages/home/wt/components/salesContract/taskSubmit.vue

@@ -13,14 +13,18 @@
 			</u-button>
 			<u-button style="width: 45%;" :loading='loading' type="error" text="驳回" @click="rejectTask(0)"></u-button>
 		</view>
-
+		<view class="btnConcel">
+			<u-button @click="showAction = true">更多</u-button>
+		</view>
+		<u-action-sheet :actions="actionList" :closeOnClickOverlay="true" :closeOnClickAction="true" title="更多操作" :show="showAction" @close="showAction = false" @select="selectActionClick"></u-action-sheet>
 	</view>
 </template>
 
 <script>
 	import {
 		approveTaskWithVariables,
-		rejectTask
+		rejectTask,
+		cancelTask
 	} from '@/api/wt/index.js'
 	export default {
 		name: 'taskSubmit',
@@ -41,7 +45,14 @@
 
 		data() {
 			return {
+				showAction: false,
+				showCancelModal: false,
 				loading: false,
+				actionList: [{
+					name: '作废',
+					fontSize: '28',
+					color: '#ffaa7f'
+				}],
 				form: {
 					technicianId: '',
 					reason: '',
@@ -60,6 +71,38 @@
 			this.$refs.uForm.setRules(this.rules)
 		},
 		methods: {
+			selectActionClick(item) {
+				console.log('selectActionClick', item)
+				if (item.name == '作废') {
+					uni.showModal({
+						title: '提示',
+						content: '是否确认作废?',
+						success: (res) => {
+							if (res.confirm) {
+								this.loading = true
+								cancelTask({
+									taskId: this.taskId,
+									id: this.id,
+									reason: this.form.reason,
+									businessId: this.businessId,
+								}).then(() => {
+									if (res.code != '-1') {
+										this.loading = false
+										this.$emit('handleAudit', {
+											title: '作废'
+										});
+									}
+								}).catch(() => {
+									this.loading = false
+									this.$message.error("流程作废失败");
+								});
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
+						}
+					});
+				}
+			},
 			async handleAudit(status) {
 				if (!!status) await this.$refs.uForm.validate()
 				this.loading = true
@@ -117,4 +160,7 @@
 		display: flex;
 
 	}
+	.btnConcel {
+		margin-top: 20rpx;
+	}
 </style>