Bladeren bron

feat(采购合同审批): 完善任务提交和表单展示功能

liujt 4 maanden geleden
bovenliggende
commit
2776f9d6b2

+ 242 - 5
pages/home/wt/components/purchaseContract/taskForm.vue

@@ -12,10 +12,37 @@
 					<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 +56,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>
@@ -136,6 +178,7 @@
 		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
@@ -148,10 +191,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',
@@ -163,7 +307,11 @@
 						label: '编码',
 						field: 'productCode',
 					},
+					{
+						field: 'pricingWayName',
+						label: '计价方式',
 
+					},
 					{
 						field: 'specification',
 						label: '规格',
@@ -179,19 +327,95 @@
 						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: [{
+				feeTableField1: [{
 						label: '款项名称',
 						field: 'moneyName',
 					},
@@ -212,7 +436,7 @@
 						field: 'remark',
 					}
 				],
-				list: ['合同信息', '基本信息', '产品清单', '付款方式'],
+				list1: ['合同信息', '基本信息', '产品清单', '付款方式'],
 				curNow: 0
 			}
 		},
@@ -226,9 +450,22 @@
 			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;
+
 				}
 			}
 		}

+ 44 - 2
pages/home/wt/components/purchaseContract/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,13 @@
 
 		data() {
 			return {
+				showAction: false,
 				loading: false,
+				actionList: [{
+					name: '作废',
+					fontSize: '28',
+					color: '#ffaa7f'
+				}],
 				form: {
 					technicianId: '',
 					reason: '',
@@ -60,6 +70,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

+ 0 - 1
pages/home/wt/components/salesContract/taskSubmit.vue

@@ -46,7 +46,6 @@
 		data() {
 			return {
 				showAction: false,
-				showCancelModal: false,
 				loading: false,
 				actionList: [{
 					name: '作废',