DisposeRubbishFormDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <view>
  3. <cu-custom @click="goBack" :isBack="true" bgColor="bg-gradual-blue">
  4. <block slot="content">建筑垃圾清运处理</block>
  5. </cu-custom>
  6. <!-- First Section: 巡视工单 to 联系方式 -->
  7. <view class="form-section">
  8. <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm">
  9. <u-form-item label="清运编号" prop="no">
  10. <u--input v-model="inputForm.no" :disabled="true" placeholder="工单编号" clearable></u--input>
  11. </u-form-item>
  12. <u-form-item label="所属单位" prop="processingUnitName" :required="true">
  13. <u--input v-model="inputForm.processingUnitName" :disabled="true" placeholder="所属单位" clearable></u--input>
  14. </u-form-item>
  15. <u-form-item label="村负责人" prop="clearUserName">
  16. <u--input v-model="inputForm.clearUserName" :disabled="true" placeholder="村负责人" clearable></u--input>
  17. </u-form-item>
  18. <u-form-item label="联系方式" prop="clearUserMobile">
  19. <u--input v-model="inputForm.clearUserMobile" :disabled="true" placeholder="联系方式" clearable></u--input>
  20. </u-form-item>
  21. <u-form-item label="处理方式" prop="disposeType" :required="true" >
  22. <jp-picker v-model="inputForm.disposeType" rangeKey="label" :disabled="true" rangeValue="value" :range="[
  23. { label: '转运调剂处理', value: '1' },
  24. { label: '自行处理', value: '2' },
  25. ]" ></jp-picker>
  26. </u-form-item>
  27. <u-form-item label="垃圾站点" prop="rubbishStation">
  28. <u--input v-model="inputForm.rubbishStation" :disabled="true" placeholder="垃圾站点" clearable></u--input>
  29. </u-form-item>
  30. <template>
  31. <div>
  32. <u-form-item
  33. v-for="(item, index_workOver) in inputForm.workOverNoList"
  34. :key="index_workOver"
  35. :label="`巡视工单 ${index_workOver + 1}`"
  36. :required="true"
  37. :prop="'workOverNoList[' + index_workOver + '].no'"
  38. >
  39. <u--input
  40. v-model="inputForm.workOverNoList[index_workOver].no"
  41. :disabled="true"
  42. placeholder="请选择巡视工单编号">
  43. </u--input>
  44. <u-button type="primary" style="width: 20%" text="详情" @click="disposeWorkOver(inputForm.workOverNoList[index_workOver].id)"></u-button>
  45. </u-form-item>
  46. </div>
  47. </template>
  48. </u--form>
  49. </view>
  50. <!-- Second Section: 上传图片 -->
  51. <view class="form-section">
  52. <text class="u-demo-block__title">清理前照片</text>
  53. <view class="u-page__upload-item">
  54. <u-upload
  55. :disabled="true"
  56. :fileList="fileList1"
  57. @afterRead="afterRead"
  58. name="1"
  59. multiple
  60. :maxCount="10"
  61. ></u-upload>
  62. </view>
  63. </view>
  64. <!-- Second Section: 上传图片 -->
  65. <view class="form-section">
  66. <text class="u-demo-block__title">清理中照片</text>
  67. <view class="u-page__upload-item">
  68. <u-upload
  69. :disabled="true"
  70. :fileList="fileList2"
  71. @afterRead="afterRead"
  72. name="2"
  73. multiple
  74. :maxCount="10"
  75. ></u-upload>
  76. </view>
  77. </view>
  78. <!-- Second Section: 上传图片 -->
  79. <view class="form-section">
  80. <text class="u-demo-block__title">清理后照片</text>
  81. <view class="u-page__upload-item">
  82. <u-upload
  83. :disabled="true"
  84. :fileList="fileList3"
  85. @afterRead="afterRead"
  86. name="3"
  87. multiple
  88. :maxCount="10"
  89. ></u-upload>
  90. </view>
  91. </view>
  92. <!-- Third Section: 备注 -->
  93. <view class="form-section">
  94. <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm" >
  95. <u-form-item label="备注" borderBottom prop="remarks">
  96. <u--textarea placeholder='请填写备注' :disabled="true" :maxlength="500" v-model="inputForm.remarks"></u--textarea>
  97. </u-form-item>
  98. </u--form>
  99. </view>
  100. <view class="form-section">
  101. <span style="color: #4396fd;">现场信息登记</span>
  102. <u--form :model="inputForm" labelWidth="100px" class="u-form" labelPosition="left" :rules="rules" ref="inputForm">
  103. <u-form-item label="重量(t)" prop="weight" :required="true">
  104. <u--input
  105. :disabled="true"
  106. v-model="inputForm.weight"
  107. placeholder="重量"
  108. clearable
  109. ></u--input>
  110. </u-form-item>
  111. <u-form-item label="运输里程(km)" prop="transportMileage" :required="true">
  112. <u--input
  113. :disabled="true"
  114. v-model="inputForm.transportMileage"
  115. placeholder="运输里程"
  116. clearable
  117. ></u--input>
  118. </u-form-item>
  119. <u-form-item label="补贴(元)" prop="subsidy" :required="true">
  120. <u--input
  121. :disabled="true"
  122. v-model="inputForm.subsidy"
  123. placeholder="补贴"
  124. clearable
  125. ></u--input>
  126. </u-form-item>
  127. </u--form>
  128. </view>
  129. <!-- Second Section: 上传图片 -->
  130. <view class="form-section">
  131. <text style="color: black">过磅现场照片</text>
  132. <view class="u-page__upload-item" >
  133. <text class="u-demo-block__title">照片上传</text>
  134. <u-upload
  135. :disabled="true"
  136. :fileList="fileList4"
  137. @afterRead="afterRead"
  138. name="4"
  139. multiple
  140. :maxCount="10"
  141. ></u-upload>
  142. </view>
  143. </view>
  144. </view>
  145. </template>
  146. <script>
  147. import disposeRubbishService from '@/api/garbageClearance/disposeRubbishService'
  148. import overService from '@/api/garbageClearance/overService'
  149. import WorkOverChoose from './WorkOverChoose'
  150. import taskService from "@/api/flowable/taskService"
  151. import {mapState, mapMutations, mapActions} from 'vuex'
  152. import * as $auth from "../../common/auth";
  153. import { EventBus } from '@/store/eventBus.js';
  154. export default {
  155. components: {
  156. WorkOverChoose,
  157. },
  158. computed: mapState({
  159. userInfo: (state) => state.user.userInfo,
  160. avatar: (state) => state.user.avatar
  161. }),
  162. data () {
  163. return {
  164. disFlag: true, // 启用动态获取处理单位则设置为false
  165. isProcessing: false, // 遮罩层
  166. processingUnits: [],
  167. taskName: '', //当前节点处理人节点名称
  168. fileList1: [],
  169. fileList2: [],
  170. fileList3: [],
  171. fileList4: [],
  172. nodeFlag: false,
  173. weighFlag: false, // 过磅管理员看到的信息
  174. inputForm: {
  175. programId: '',
  176. programIds: [],
  177. no: '',
  178. processingUnit: '',
  179. processingUnitName: '',
  180. clearUserId: '',
  181. clearUserName: '',
  182. clearUserMobile: '',
  183. remarks: '',
  184. status: '',
  185. workOverNoList: [],
  186. disposeType: '',
  187. rubbishStation: '',
  188. weight: '',
  189. transportMileage: '',
  190. subsidy: '',
  191. },
  192. rules: {
  193. 'processingUnit': [
  194. {
  195. required: true,
  196. message: '处理单位不能为空',
  197. trigger: ['blur', 'change']
  198. }
  199. ],
  200. }
  201. }
  202. },
  203. // 页面加载时执行
  204. async created() {
  205. },
  206. props: {
  207. businessId: {
  208. type: String,
  209. default: ''
  210. },
  211. formReadOnly: {
  212. type: Boolean,
  213. default: false
  214. },
  215. status: {
  216. type: String,
  217. default: ''
  218. },
  219. backUrl: {
  220. type: String,
  221. default: ''
  222. },
  223. isBack: {
  224. type: Boolean,
  225. default: false
  226. },
  227. bgColor: {
  228. type: String,
  229. default: ''
  230. }
  231. },
  232. watch: {
  233. 'businessId': {
  234. handler (newVal) {
  235. if (this.businessId) {
  236. this.init(this.businessId)
  237. } else {
  238. this.$nextTick(() => {
  239. // this.$refs.inputForm.reset()
  240. })
  241. }
  242. },
  243. immediate: true,
  244. deep: false
  245. },
  246. },
  247. methods: {
  248. async init(id) {
  249. this.nodeFlag = true;
  250. this.inputForm.id = id;
  251. if (id) {
  252. // 使用 await 等待查询结果
  253. const data = await disposeRubbishService.queryById(id);
  254. // 获取当前节点流程信息,并等待其执行完成
  255. const taskName = await taskService.getTaskNameByProcInsId(data.procInsId);
  256. this.taskName = taskName
  257. // 恢复表单数据
  258. this.inputForm = this.recover(this.inputForm, data);
  259. // 处理文件列表
  260. if (data.fileList1) {
  261. this.fileList1 = data.fileList1.map(item => ({
  262. attachmentName: item.name,
  263. fileSize: item.size,
  264. url: item.temporaryUrl,
  265. type: item.type // 如果不需要,可以不写
  266. }));
  267. }
  268. if (data.fileList2) {
  269. this.fileList2 = data.fileList2.map(item => ({
  270. attachmentName: item.name,
  271. fileSize: item.size,
  272. url: item.temporaryUrl,
  273. type: item.type // 如果不需要,可以不写
  274. }));
  275. }
  276. if (data.fileList3) {
  277. this.fileList3 = data.fileList3.map(item => ({
  278. attachmentName: item.name,
  279. fileSize: item.size,
  280. url: item.temporaryUrl,
  281. type: item.type // 如果不需要,可以不写
  282. }));
  283. }
  284. if (data.fileList4) {
  285. this.fileList4 = data.fileList4.map(item => ({
  286. attachmentName: item.name,
  287. fileSize: item.size,
  288. url: item.temporaryUrl,
  289. type: item.type // 如果不需要,可以不写
  290. }));
  291. }
  292. }
  293. },
  294. // 显示 项目选择器
  295. disposeWorkOver(id) {
  296. uni.navigateTo({
  297. url: '/pages/edt/PatrolWorkOrderForm?id='+id + '&showFlag=true'
  298. })
  299. },
  300. goBack() {
  301. if (this.backUrl) {
  302. // 如果提供了 backUrl,则使用 navigateTo 跳转到指定 URL
  303. uni.navigateTo({
  304. url: this.backUrl
  305. });
  306. } else {
  307. // 否则,返回到上一层页面
  308. uni.navigateBack({
  309. delta: 1 // delta 默认为 1,表示返回到上一层
  310. });
  311. }
  312. }
  313. }
  314. }
  315. </script>
  316. <style>
  317. .form-section {
  318. padding: 10px 15px;
  319. margin-bottom: 10px;
  320. background-color: #ffffff;
  321. border-radius: 5px;
  322. box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  323. }
  324. .u-page__upload-item {
  325. margin-top: 10px;
  326. }
  327. .button-container {
  328. margin-top: 20px;
  329. text-align: center;
  330. }
  331. .cu-form-group .title {
  332. min-width: 100px;
  333. }
  334. /* 遮罩层样式 */
  335. .mask {
  336. position: fixed;
  337. top: 0;
  338. left: 0;
  339. width: 100%;
  340. height: 100%;
  341. background-color: rgba(0, 0, 0, 0.05); /* 半透明遮罩 */
  342. z-index: 9999; /* 确保遮罩层在最顶层 */
  343. }
  344. </style>