瀏覽代碼

fix: 协同办公优化

liujt 3 天之前
父節點
當前提交
e720aab501

+ 6 - 2
hybrid/html/vue-form-making/form-making-v3.es.js

@@ -50493,6 +50493,7 @@ const _sfc_main$_ = {
               }, "\u25B6", 10, _hoisted_2$x)) : (openBlock(), createElementBlock("span", _hoisted_3$o)),
               createVNode(_component_van_checkbox, {
                 class: "dept-tree__checkbox",
+                shape: "square",
                 "model-value": state(node).checked,
                 indeterminate: state(node).indeterminate,
                 onChange: ($event) => toggle2(node)
@@ -50517,7 +50518,7 @@ const _sfc_main$_ = {
     };
   }
 };
-var DeptCascaderTree = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-1ec09c66"]]);
+var DeptCascaderTree = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-7717f1ae"]]);
 var DeptCascader_vue_vue_type_style_index_0_scoped_true_lang = "";
 const _hoisted_1$z = { class: "dept-cascader__header" };
 const _hoisted_2$w = { class: "dept-cascader__title" };
@@ -50674,6 +50675,9 @@ const _sfc_main$Z = {
           "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fieldValue.value = $event),
           "is-link": !__props.printRead && !__props.disabled,
           readonly: "",
+          type: "textarea",
+          rows: "1",
+          autosize: "true",
           placeholder: __props.placeholder,
           disabled: __props.disabled
         }, { ...__props.publicProps }, {
@@ -50747,7 +50751,7 @@ const _sfc_main$Z = {
     };
   }
 };
-var FmVantDeptCascader = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-0333cc83"]]);
+var FmVantDeptCascader = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-7fe446a6"]]);
 const _sfc_main$Y = {
   components: {
     FmVantSelect,

文件差異過大導致無法顯示
+ 0 - 0
hybrid/html/vue-form-making/form-making-v3.umd.js


文件差異過大導致無法顯示
+ 0 - 0
hybrid/html/vue-form-making/index.css


+ 8 - 0
pages.json

@@ -148,6 +148,14 @@
 				"navigationBarTextStyle": "white"
 			}
 		},
+		{ // 销售退货审批
+			"path": "pages/home/wt/components/salesReturnGoods/processTask",
+			"style": {
+				"navigationBarTitleText": "",
+				"navigationStyle": "custom",
+				"navigationBarTextStyle": "white"
+			}
+		},
 		{ // 销售发货确认
 			"path": "pages/home/wt/components/salesInvoiceConfirm/processTask",
 			"style": {

+ 188 - 0
pages/home/wt/components/salesReturnGoods/processTask.vue

@@ -0,0 +1,188 @@
+<template>
+	<view class="havedone-container">
+		<uni-nav-bar fixed="true" statusBar="true" left-icon="back" :title="uniNavBarTitle"
+		 background-color="#157A2C" color="#fff"
+			@clickLeft="back"></uni-nav-bar>
+			<!-- <iframe src="http://aiot.zoomwin.com.cn:51001/test/a.html" style="width: 200px;height: 600px" frameborder="0"></iframe> -->
+		<view v-if="processInstance.processDefinition">
+			<taskForm id='async-biz-form-component' :taskId="listData.taskId" :businessId="listData.businessId" :id="listData.id"
+				:taskDefinitionKey="listData.taskDefinitionKey"
+				 ref="bziRef"></taskForm>
+				 
+		</view>
+		<view v-if="listData.type !='view'">
+			<view v-for="(item, index) in runningTasks" :key="index">
+				<div v-if="processInstance.processDefinition">
+					<taskSubmit id='async-sub-form-component' :taskId="listData.taskId" :businessId="listData.businessId" :id="listData.id"
+						:taskDefinitionKey="listData.taskDefinitionKey" @handleAudit="handleAudit"
+						@getTableValue="getTableValue" @handleUpdateAssignee="handleUpdateAssignee(item)"
+						@handleBackList="handleBackList(item)" ref="subForm">
+					</taskSubmit>
+				</div>
+			</view>
+		</view>
+		<u-toast ref="uToast"></u-toast>
+	</view>
+</template>
+
+<script>
+	import {
+		getProcessInstance,
+		getTaskListByProcessInstanceId
+	} from '@/api/wt/index.js'
+import Vue from 'vue'
+import taskForm from './taskForm.vue'
+import taskSubmit from './taskSubmit.vue'
+
+	export default {
+		name: 'processTask',
+		components:{ taskForm,taskSubmit },
+		data() {
+			return {
+				uniNavBarTitle: '',
+				processInstanceLoading: false,
+				listData: {},
+				processInstance: {},
+				runningTasks: [],
+				auditForms: [],
+				activeComp: null,
+			}
+		},
+
+		onLoad(option) {
+			this.listData = option
+			this.getDetail()
+			 this.activeComp = 'tab1'
+		},
+		methods: {
+			/** 获得流程实例 */
+		async	getDetail() {
+				// 获得流程实例相关
+				this.processInstanceLoading = true;
+				getProcessInstance({
+					id: this.listData.id
+				}).then(async (response) => {
+					if (!response) {
+						this.$message.error('查询不到流程信息!');
+						return;
+					}
+					// 设置流程信息 
+						this.processInstance = response;
+					this.uniNavBarTitle =`${ response.name } 【${ response.startUser?.nickname}】`
+						
+			
+					// //将业务表单,注册为动态组件
+					// Vue.component('async-biz-form-component', (resolve) => {
+					// 	require(['pages/home' + this.listData.miniHandleRouter], resolve);
+					// });
+					// Vue.component('async-sub-form-component', (resolve) => {
+					// 	require(['pages/home' + this.listData.miniViewRouter], resolve);
+					// });
+					
+				
+					this.processInstanceLoading = false;
+				});
+
+				this.runningTasks = [];
+				this.auditForms = [];
+				getTaskListByProcessInstanceId({
+					processInstanceId: this.listData.id
+				}).then((response) => {
+					console.log(response, 'response');
+					// 审批记录
+					this.tasks = [];
+					// 移除已取消的审批
+					response.forEach((task) => {
+						if (task.result !== 4) {
+							this.tasks.push(task);
+						}
+					});
+					// 排序,将未完成的排在前面,已完成的排在后面;
+					this.tasks.sort((a, b) => {
+						// 有已完成的情况,按照完成时间倒序
+						if (a.endTime && b.endTime) {
+							return b.endTime - a.endTime;
+						} else if (a.endTime) {
+							return 1;
+						} else if (b.endTime) {
+							return -1;
+							// 都是未完成,按照创建时间倒序
+						} else {
+							return b.createTime - a.createTime;
+						}
+					});
+
+					// 需要审核的记录
+					let userInfo = wx.getStorageSync("userInfo");
+					this.tasks.forEach((task) => {
+						if (task.result !== 1 && task.result !== 6) {
+							// 只有待处理才需要
+							return;
+						}
+						if (!task.assigneeUser || task.assigneeUser.id !== userInfo.userId) {
+							// 自己不是处理人
+							return;
+						}
+						if (task.taskDefinitionKey !== this.listData.taskDefinitionKey) {
+							// 不是当前流程的
+							return;
+						}
+						this.runningTasks.push({
+							...task
+						});
+						console.log(this.runningTasks, ' this.runningTasks');
+						this.auditForms.push({
+							reason: ''
+						});
+					});
+				});
+			},
+
+
+			/** 处理审批通过和不通过的操作 */
+			handleAudit(data) {
+				let text = data.status === 1 ? '通过' : '不通过';
+				this.$refs.uToast.show({
+					type: 'success',
+					message: `审批${data.title || text}成功!`,
+					iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+				})
+				// 获得最新详情
+				setTimeout(() => {
+				
+					uni.navigateBack()
+				}, 1000)
+
+
+				// const index = this.runningTasks.indexOf(task);
+				// this.$refs['form' + index][0].validate((valid) => {
+				//   if (!valid) {
+				//     return;
+				//   }
+				//   const data = {
+				//     id: task.id,
+				//     reason: this.auditForms[index].reason
+				//   };
+				//   if (pass) {
+				//     approveTask(data).then((response) => {
+				//       this.$message.success('审批通过成功!');
+				//       this.handleClose(); // 获得最新详情
+				//     });
+				//   } else {
+				//     rejectTask(data).then((response) => {
+				//       this.$message.success('审批不通过成功!');
+				//       this.handleClose(); // 获得最新详情
+				//     });
+				//   }
+				// });
+			},
+			getTableValue(fn) {
+				fn(this.$refs.bziRef.getTableValue());
+			}
+		}
+
+	}
+</script>
+
+<style>
+</style>

+ 148 - 0
pages/home/wt/components/salesReturnGoods/taskForm.vue

@@ -0,0 +1,148 @@
+<template>
+	<view class="">
+		<u-sticky offset-top="50">
+			<u-subsection fontSize='25' mode='subsection' :list="list" :current="curNow" @change="sectionChange"
+				activeColor='#157A2C'></u-subsection>
+		</u-sticky>
+
+		<view v-show='curNow===0'>
+			<u--form style="margin: 0 20px;" labelPosition="left" :model="form" ref="uForm" labelWidth='140rpx'>
+				<u-form-item label="客户名称" prop="contactName" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.contactName"></u--input>
+				</u-form-item>
+				<u-form-item label="退货编码" prop="returnNo" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.returnNo"></u--input>
+				</u-form-item>
+				<u-form-item label="退货类型" prop="typeName" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.typeName"></u--input>
+				</u-form-item>
+				<u-form-item v-show="['30', '50'].includes(form.type)" label="赔偿金额(元)" prop="redressAmount"
+					borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.redressAmount"></u--input>
+				</u-form-item>
+				<u-form-item label="赔偿总金额(元)" prop="totalAmount" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.totalAmount"></u--input>
+				</u-form-item>
+				<u-form-item label="退货备注" prop="remark" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.remark"></u--input>
+				</u-form-item>
+				<u-form-item label="发货编码" prop="sendNo" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.sendNo"></u--input>
+				</u-form-item>
+				<u-form-item label="订单编码" prop="orderNo" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.orderNo"></u--input>
+				</u-form-item>
+				<u-form-item label="制单人" prop="makerName" borderBottom>
+					<u--input style="width: 100%;" disabled v-model="form.makerName"></u--input>
+				</u-form-item>
+			</u--form>
+
+		</view>
+		<view v-show='curNow===1'>
+
+			<view v-for="(item,index) in form['productList']" :key="index">
+				<u--form style="margin: 0 20px;" labelPosition="left" :model="form" ref="uForm" labelWidth='140rpx'>
+					<u-row v-for="(key,index1) in tableField" :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>
+
+<script>
+	import {
+		getSaleOrderReturnGetByIdAPI
+	} from '@/api/wt/index.js'
+	export default {
+		props: {
+			businessId: {
+				default: ''
+			},
+			taskDefinitionKey: {
+				default: ''
+			},
+		},
+		data() {
+			return {
+				form: {},
+				tableField: [{
+						label: '名称',
+						field: 'productName',
+					},
+					{
+						label: '编码',
+						field: 'productCode',
+					},
+					{
+						label: '类型',
+						field: 'productCategoryName',
+					},
+					{
+						label: '型号',
+						field: 'modelType',
+					},
+					{
+						label: '规格',
+						field: 'specification',
+					},
+					{
+						label: '发货数量',
+						field: 'sendTotalCount',
+					},
+					{
+						label: '退货数量',
+						field: 'totalCount',
+					},
+					{
+						label: '单价',
+						field: 'singlePrice',
+					},
+					{
+						label: '合计',
+						field: 'totalPrice',
+					},
+				],
+				list: ['退货信息', '产品清单'],
+				curNow: 0
+			}
+		},
+		async mounted() {
+			await this.getDetailData(this.businessId);
+		},
+		methods: {
+			sectionChange(index) {
+				this.curNow = index;
+			},
+			async getDetailData(id) {
+				const data = await getSaleOrderReturnGetByIdAPI(id);
+				this.form = data;
+			},
+			//
+			getTableValue() {
+				return new Promise(async (resolve, reject) => {
+					try {
+						await this.$refs.uForm[0].validate()
+						resolve(this.form)
+					} catch {
+						reject(null)
+					}
+
+
+				})
+			},
+		}
+	}
+</script>
+
+<style>
+</style>

+ 100 - 0
pages/home/wt/components/salesReturnGoods/taskSubmit.vue

@@ -0,0 +1,100 @@
+<template>
+	<view class="">
+		<u--form style="margin: 0 20px;" labelPosition="left" :model="form" :rules="rules" ref="uForm"
+			labelWidth='140rpx'>
+			<u-form-item label="审批建议" prop="reason" required>
+				<u--textarea style="width: 100%;" height='120' border='surround' placeholder="请输入审批建议"
+					v-model="form.reason"></u--textarea>
+			</u-form-item>
+		</u--form>
+		<view>
+			<u-button style="width: 100%;margin-bottom: 10rpx;" icon="edit-pen" :loading='loading' type="success"
+				text="通过" @click="handleAudit(1)">
+			</u-button>
+			<u-button style="width: 100%;" :loading='loading' type="error" icon="close" text="驳回"
+				@click="handleAudit(0)" v-if="!['starter'].includes(taskDefinitionKey)"></u-button>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import {
+		approveTaskSalesOrderReturn
+	} from '@/api/wt/index.js'
+	export default {
+		name: 'taskSubmit',
+		props: {
+			businessId: {
+				default: ''
+			},
+			taskId: {
+				default: ''
+			},
+			id: {
+				default: ''
+			},
+			taskDefinitionKey: {
+				default: ''
+			}
+		},
+
+		data() {
+			return {
+				loading: false,
+				form: {
+					technicianId: '',
+					reason: '',
+				},
+				rules: {
+					reason: {
+						type: 'string',
+						required: true,
+						message: '请输入审批建议',
+						trigger: 'blur'
+					}
+				}
+			}
+		},
+		mounted() {
+			this.$refs.uForm.setRules(this.rules)
+		},
+		methods: {
+			async handleAudit(status) {
+				if (!!status) await this.$refs.uForm.validate()
+				let returnType = '';
+
+
+
+				this.loading = true
+				await this._approveTaskWithVariables(status, returnType);
+			},
+			async _approveTaskWithVariables(status, returnType) {
+				let res = await approveTaskSalesOrderReturn({
+					id: this.taskId,
+					reason: this.form.reason,
+					operateType: status == 0 ? 2 : 1,
+					returnType
+				})
+				if (res.code != '-1') {
+					this.$emit('handleAudit', {
+						status,
+						title: status === 0 ? '驳回' : ''
+					});
+				}
+				this.loading = false
+			},
+
+			getTableValue() {
+				return new Promise((resolve, reject) => {
+					this.$emit('getTableValue', async (data) => {
+						resolve(await data);
+					});
+				});
+			}
+		}
+	}
+</script>
+
+<style>
+</style>

部分文件因文件數量過多而無法顯示