Explorar o código

feat(销售/采购订单审批): 添加付款/收款计划显示功能并增加作废操作

liujt hai 4 meses
pai
achega
7d9aac776c

+ 54 - 1
pages/home/wt/components/purchaseOrder/taskForm.vue

@@ -114,6 +114,22 @@
 			</view>
 
 		</view>
+		<view v-show='curNow===3'>
+			<view v-for="(item,index) in form['receiptPaymentList']" :key="index">
+				<u--form style="margin: 0 20px;" labelPosition="left" :model="form" ref="uForm" labelWidth='140rpx'>
+					<u-row v-for="(key,index1) in feeTableField" :key="index1">
+						<u-col :span="12">
+							<u-form-item :label="key.label" prop="categoryName" borderBottom>
+								<u--input style="width: 100%;" :title='item[key.field]' disabled
+									v-model="item[key.field]"></u--input>
+							</u-form-item>
+						</u-col>
+
+					</u-row>
+				</u--form>
+				<u-gap height="40" bgColor="#f0f0f0"></u-gap>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -122,6 +138,7 @@
 		purchaseOrderGetByIdAPI
 	} 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
@@ -134,6 +151,42 @@
 				default: ''
 			},
 		},
+		computed: {
+			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',
+					}
+				]
+			},
+		},
 		data() {
 			return {
 				form: {},
@@ -176,7 +229,7 @@
 						field: 'totalPrice',
 					},
 				],
-				list: ['订单信息', '基本信息', '产品清单'],
+				list: ['订单信息', '基本信息', '产品清单', '付款计划'],
 				curNow: 0
 			}
 		},

+ 47 - 2
pages/home/wt/components/purchaseOrder/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',
@@ -42,6 +46,12 @@
 		data() {
 			return {
 				loading: false,
+				showAction: 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
@@ -118,4 +160,7 @@
 		display: flex;
 
 	}
+	.btnConcel {
+		margin-top: 20rpx;
+	}
 </style>

+ 58 - 2
pages/home/wt/components/salesOrder/taskForm.vue

@@ -102,6 +102,22 @@
 			</view>
 
 		</view>
+		<view v-show='curNow===3'>
+			<view v-for="(item,index) in form['receiptPaymentList']" :key="index">
+				<u--form style="margin: 0 20px;" labelPosition="left" :model="form" ref="uForm" labelWidth='140rpx'>
+					<u-row v-for="(key,index1) in feeTableField" :key="index1">
+						<u-col :span="12">
+							<u-form-item :label="key.label" prop="categoryName" borderBottom>
+								<u--input style="width: 100%;" :title='item[key.field]' disabled
+									v-model="item[key.field]"></u--input>
+							</u-form-item>
+						</u-col>
+
+					</u-row>
+				</u--form>
+				<u-gap height="40" bgColor="#f0f0f0"></u-gap>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -110,6 +126,7 @@
 		getSaleOrderDetailAPI
 	} 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
@@ -122,6 +139,42 @@
 				default: ''
 			},
 		},
+		computed: {
+			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',
+					}
+				]
+			},
+		},
 		data() {
 			return {
 				form: {},
@@ -171,7 +224,7 @@
 						field: 'discountTotalPrice',
 					},
 				],
-				list: ['订单信息', '基本信息', '产品清单'],
+				list: ['订单信息', '基本信息', '产品清单', '收款计划'],
 				curNow: 0
 			}
 		},
@@ -190,5 +243,8 @@
 	}
 </script>
 
-<style>
+<style scoped>
+.btnConcel {
+		margin-top: 20rpx;
+	}
 </style>

+ 47 - 2
pages/home/wt/components/salesOrder/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
@@ -117,4 +159,7 @@
 		display: flex;
 
 	}
+	.btnConcel {
+		margin-top: 20rpx;
+	}
 </style>