Ver Fonte

fix: 协同办公

liujt há 1 semana atrás
pai
commit
e6da47d1c3
2 ficheiros alterados com 175 adições e 4 exclusões
  1. 174 3
      hybrid/html/a.html
  2. 1 1
      manifest.json

+ 174 - 3
hybrid/html/a.html

@@ -51,13 +51,29 @@
 			::v-deep.fm-form-item {
 				margin-bottom: 10px !important;
 			}
+
+			.process {
+				margin-top: 44px;
+			}
 		</style>
 		<div id="app">
 
 			<van-nav-bar height='100rpx;margin-top:100rpx' @click-left="onClickLeft"
 				style="background-color: rgb(21, 122, 44);color: rgb(255, 255, 255);" :title="title" left-arrow
 				:safe-area-inset-top='true' :placeholder='true' :fixed='true'></van-nav-bar>
-			<fm-generate-vant-form style='height: 81vh !important;overflow: auto;background: #a3a6ad1c;margin-top:44px'
+			<div class="process">
+				<div class="seal-form-row" @click="openProcessCategoryPicker">
+					<span class="seal-form-label">流程分类</span>
+					<span class="seal-form-val">{{ form.LCFLName || '请选择' }}</span>
+					<span class="seal-form-arrow">›</span>
+				</div>
+				<div class="seal-form-row" @click="openProcessTypePicker">
+					<span class="seal-form-label">流程类型</span>
+					<span class="seal-form-val">{{ form.FQLCName || '请选择' }}</span>
+					<span class="seal-form-arrow">›</span>
+				</div>
+			</div>
+			<fm-generate-vant-form style='height: 65vh !important;overflow: auto;background: #a3a6ad1c;'
 				v-if='isFlag' :data="jsonData" :value="form.valueJson" ref="generateForm" :edit='isEdit' @on-upload-local="handleUploadLocal">
 				<!-- 费用报销 -->
 				<template v-slot:blank_adopzrdd="scope">
@@ -629,11 +645,34 @@
 				/>
 			</van-popup>
 
+			<!-- 流程分类级联选择弹窗 -->
+			<van-popup v-model:show="processCategoryPopVisible" position="bottom" :style="{ height: '50%' }">
+				<van-picker
+					show-toolbar
+					title="选择流程分类"
+					:columns="processCategoryColumns"
+					@confirm="onProcessCategoryConfirm"
+					@cancel="processCategoryPopVisible = false"
+				/>
+			</van-popup>
+
+			<!-- 流程类型单选弹窗 -->
+			<van-popup v-model:show="processTypePopVisible" position="bottom" :style="{ height: '40%' }">
+				<van-picker
+					show-toolbar
+					title="选择流程类型"
+					:columns="processTypeColumns"
+					@confirm="onProcessTypeConfirm"
+					@cancel="processTypePopVisible = false"
+				/>
+			</van-popup>
+
 			<!-- 城市级联选择弹窗 -->
 			<van-popup v-model:show="cityPickerVisible" position="bottom" :style="{ height: '60%' }">
 				<van-area
 					title="选择城市"
 					:area-list="areaList"
+					:columns-num="2"
 					@confirm="onCityPickerConfirm"
 					@cancel="cityPickerVisible = false"
 				/>
@@ -676,7 +715,7 @@
 					</div>
 					<div class="seal-form-row">
 						<span class="seal-form-label">详细描述</span>
-						<input class="seal-form-input" v-model="eventEditForm.eventDesc" placeholder="请输入" />
+						<input class="seal-form-input" v-model="eventEditForm.eventDesc" placeholder="含患者信息及使用目的、问题点及出现问题的场景描述" />
 					</div>
 					<div class="seal-form-row">
 						<span class="seal-form-label">图片上传</span>
@@ -940,6 +979,13 @@
 						{ value: '单程', text: '单程' },
 						{ value: '往返', text: '往返' }
 					],
+					// 流程分类 / 流程类型
+					processCategoryPopVisible: false,
+					processTypePopVisible: false,
+					processCategoryRawData: [],
+					processCategoryColumns: [],
+					processTypeRawData: [],
+					processTypeColumns: [],
 					// 城市级联选择 (van-area)
 					cityPickerVisible: false,
 					cityPickerType: '', // 'departure' | 'destination'
@@ -1116,6 +1162,36 @@
 							})
 							this.isFlag = true
 
+							axios({
+								method: 'get',
+								url: this.APIUrl + '/bpm/model/get?id=' + this.form.processModelId,
+								headers: this.headers,
+							}).then(res => {
+								console.log('model~~~', res.data.data)
+								const info = res.data.data
+								this.form.FQLC = info?.id || '';
+								this.form.FQLCName = info?.name || '';
+								this.form.key = info?.key;
+								this.form.LCFL = info?.category || '';
+
+								axios({
+									method: 'get',
+									url: this.APIUrl + `/main/categoryLevel/getProduceTreeByPid?code=PROCESS001`,
+									headers: this.headers,
+								}).then(res => {
+									console.log('getProduceTreeByPid~~~', res.data.data[0].children)
+									this.processCategoryRawData = res.data.data[0].children
+									// 树数据加载完成后,补充 LCFLName
+									if (this.processCategoryRawData && this.form.LCFL) {
+										this.form.LCFLName = this.findCategoryNameByNameOrId(this.form.LCFL)
+									}
+								})
+
+								if(this.form.LCFL) {
+									this.loadProcessTypeList()
+								}
+							})
+
 							this.$nextTick(() => {
 
 								if (params.manage_workorder) {
@@ -1129,6 +1205,9 @@
 						}
 					});
 
+
+					
+
 					// axios({
 					// 	method: 'get',
 					// 	url: this.APIUrl + `/bpm/task/list-by-process-instance-id?processInstanceId=${params.id}`,
@@ -1327,7 +1406,8 @@
 						var diff = Math.floor((de - ds) / 1000)
 						var d = Math.floor(diff / 86400), h = Math.floor((diff % 86400) / 3600), m = Math.floor((diff % 3600) / 60), sec = diff % 60
 						var parts = []
-						if (d) parts.push(d + '天'); if (h) parts.push(h + '时'); if (m) parts.push(m + '分'); if (sec || !parts.length) parts.push(sec + '秒')
+						if (d) parts.push(d + '天'); if (h) parts.push(h + '时'); if (m) parts.push(m + '分'); 
+						// if (sec || !parts.length) parts.push(sec + '秒')
 						this.tripEditForm.duration = parts.join('')
 					},
 					async onTripEditSave() {
@@ -1426,6 +1506,88 @@
 						this.tripEditForm.isRoundTrip = sel
 						this.roundTripPopVisible = false
 					},
+					// ===== 流程分类 / 流程类型(级联选择) =====
+					buildProcessColumns(data) {
+						if (!data || !data.length) return []
+						return data.map(function(item) {
+							var node = { text: item.name, value: item.id || item.name }
+							if (item.children && item.children.length) {
+								node.children = item.children.map(function(child) {
+									return { text: child.name, value: child.id || child.name }
+								})
+							}
+							return node
+						})
+					},
+					findCategoryNameByNameOrId(val) {
+						var tree = this.processCategoryRawData || []
+						for (var i = 0; i < tree.length; i++) {
+							var cat = tree[i]
+							if (cat.name === val || cat.id === val) return cat.name
+							if (cat.children) {
+								for (var j = 0; j < cat.children.length; j++) {
+									if (cat.children[j].name === val || cat.children[j].id === val) return cat.children[j].name
+								}
+							}
+						}
+						return val || ''
+					},
+					openProcessCategoryPicker() {
+						// 将树形数据转换为级联列格式
+						if (this.processCategoryRawData && this.processCategoryRawData.length) {
+							this.processCategoryColumns = this.buildProcessColumns(this.processCategoryRawData)
+						}
+						this.processCategoryPopVisible = true
+					},
+					onProcessCategoryConfirm(picker) {
+						var opts = picker && picker.selectedOptions
+						if (opts && opts.length > 0) {
+							this.form.LCFL = opts[0].value || ''
+							this.form.LCFLName = opts[0].text || ''
+						}
+						this.processCategoryPopVisible = false
+						// 清空流程类型,重新加载
+						this.form.FQLC = ''
+						this.form.FQLCName = ''
+						this.processTypeRawData = []
+						this.processTypeColumns = []
+						this.loadProcessTypeList()
+					},
+					// ===== 流程类型单选 =====
+					loadProcessTypeList() {
+						if (!this.form.LCFL) return
+						axios({
+							method: 'get',
+							url: this.APIUrl + '/bpm/model/page',
+							headers: this.headers,
+							params: {
+								pageNo: 1,
+								pageSize: 999,
+								processTypeId: this.form.LCFL
+							}
+						}).then(res => {
+							console.log('processTypeList~~~', res.data.data)
+							var list = res.data.data.list || res.data.data || []
+							this.processTypeRawData = list
+							this.processTypeColumns = list.map(function(item) {
+								return { text: item.name, value: item.name }
+							})
+						})
+					},
+					openProcessTypePicker() {
+						if (this.processTypeRawData && this.processTypeRawData.length) {
+							this.processTypeColumns = this.processTypeRawData.map(function(item) {
+								return { text: item.name, value: item.name }
+							})
+						}
+						this.processTypePopVisible = true
+					},
+					onProcessTypeConfirm(picker) {
+						var sel = (picker && picker.selectedOptions && picker.selectedOptions[0]) ? picker.selectedOptions[0].text : picker
+						this.form.FQLC = picker.selectedOptions[0].value
+						this.form.FQLCName = sel
+						this.processTypePopVisible = false
+					},
 					// ===== 城市级联选择 (van-area) =====
 					openCityPicker(type) {
 						this.cityPickerType = type
@@ -1638,6 +1800,15 @@
 						return JSON.parse(query);
 					},
 					generateFormValid(validate = true) {
+						// 校验流程分类和流程类型必填
+						if (!this.form.LCFL) {
+							vant.showNotify({ type: 'warning', message: '请选择流程分类' })
+							return Promise.reject(new Error('请选择流程分类'))
+						}
+						if (!this.form.FQLC) {
+							vant.showNotify({ type: 'warning', message: '请选择流程类型' })
+							return Promise.reject(new Error('请选择流程类型'))
+						}
 						return this.$refs.generateForm.getData(validate).then((data) => { //清空content
 							for (key in data) {
 								if (key.includes('fileupload')) {

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "AiMil工业互联网平台",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.4.33",
+    "versionName" : "V1.0.4.34",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {