form.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894
  1. <template>
  2. <view class="page-container uni-column">
  3. <view class="carrier-info uni-column">
  4. <view class="carrier-code uni-row">
  5. <text>箱号</text>
  6. <text style="margin-left: 24rpx;">{{processInspecion.lot.allCarrierName}}</text>
  7. </view>
  8. <view class="info-row uni-row">
  9. <view class="label">图号</view>
  10. <view class="value">{{ processInspecion.lot.drawingNumber }}</view>
  11. </view>
  12. <view class="info-row uni-row">
  13. <view class="label">批次号</view>
  14. <view class="value">{{ processInspecion.lot.lotCode }}</view>
  15. </view>
  16. <view class="info-row uni-row">
  17. <view class="label">工艺版本</view>
  18. <view class="value">{{ processInspecion.lot.technologyVersion }}</view>
  19. </view>
  20. <view class="info-row uni-row">
  21. <view class="label">产品描述</view>
  22. <view class="value">{{processInspecion.lot. productDescription }}</view>
  23. </view>
  24. <view class="info-row uni-row">
  25. <view class="label">当前工序</view>
  26. <view class="value">{{ processInspecion.lot.processAlias }}</view>
  27. </view>
  28. <view v-if="processInspecion.lot.nickName != ''" class="info-row uni-row">
  29. <view class="label">操作者</view>
  30. <view class="value">{{ processInspecion.lot.nickName }}</view>
  31. </view>
  32. <view v-if="processInspecion.lot.equipmentDetailCode != ''" class="info-row uni-row">
  33. <view class="label">设备</view>
  34. <view class="value">{{ processInspecion.lot.equipmentDetailCode }}</view>
  35. </view>
  36. <view class="info-row uni-row">
  37. <view class="label">检查载具</view>
  38. <view class="value">{{ processInspecion.lot.inspectionCarrierCode }}
  39. {{ processInspecion.isInspectionCarrierChanged == 1 ? '(已解绑)' : ''}}
  40. </view>
  41. </view>
  42. <view class="info-row uni-row">
  43. <view class="drawing-btn" @click="handleDrawingMenu">图纸信息</view>
  44. </view>
  45. </view>
  46. <!-- 废品信息 -->
  47. <view class="title unfit-title uni-row">
  48. <text>检查信息</text>
  49. <view v-if="editable()" class="add-btn" @click="handleAddWaste">添加</view>
  50. </view>
  51. <view class="unfit-container">
  52. <view class="unfit-item-container uni-column" v-for="(item, index) in unfitInfos" :key="index">
  53. <view class="resu uni-row">
  54. <view class="label">检查标准</view>
  55. <view class="value" style="margin-left:16rpx;width: 400rpx;">{{ item.checkStandard }}</view>
  56. <uni-icons v-if="editable()" type="trash" size="24" style="margin-left: 55rpx;" color="#fc6565"
  57. @click="handleDelWaste(index)" />
  58. </view>
  59. <view class="resu uni-row">
  60. <view class="label">检查结果</view>
  61. <input v-if="editable()" v-model="item.checkResult" placeholder="请输入检查结果" maxlength="50" />
  62. <view v-else class="value" style="margin-left:16rpx;">{{ item.checkResult }}</view>
  63. </view>
  64. <view class="resu uni-row">
  65. <view class="label">超差范围</view>
  66. <input v-if="editable()" v-model="item.exceedLimits" placeholder="请输入超差范围" maxlength="50" />
  67. <view v-else class="value" style="margin-left:16rpx;">{{ item.exceedLimits }}</view>
  68. </view>
  69. <view class="resu uni-row">
  70. <view :class="!editable() ? 'label' : ''">检查量</view>
  71. <input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
  72. v-model="item.examiningNum" placeholder="" />
  73. <view v-else class="number value" style="margin-left:16rpx;">{{ item.examiningNum }}</view>
  74. <view :class="!editable() ? 'label' : ''" style="margin-left: 16rpx;">不良品量</view>
  75. <input v-if="editable()" class="number" type="number" @blur="rejectNumberChange"
  76. v-model="item.disqualificationNum" placeholder="" />
  77. <view v-else class="value" style="margin-left:16rpx;">{{ item.disqualificationNum }}</view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 拍照上传部分 -->
  82. <view class="title unfit-title uni-row">
  83. <text>拍照上传</text>
  84. </view>
  85. <view class=" uni-row" style="padding: 24rpx;
  86. margin: 0 16rpx;
  87. background-color: #ffffff;
  88. border-radius: 12rpx;">
  89. <uni-file-picker v-model="photoList" :readonly="!editable()" return-type="array" :image-styles="imageStyles"
  90. @select="select" file-mediatype="image" class="my-files" @delete="handleDeletedPhoto"></uni-file-picker>
  91. </view>
  92. <!-- 咨询部分 -->
  93. <view class="title unfit-title uni-row">
  94. <text>咨询</text>
  95. </view>
  96. <view class="consultation-container uni-column">
  97. <view class="consultation-item-container" v-for="(item, index) in consultations" :key="index">
  98. <view class="question uni-column">
  99. <view class="label uni-row">
  100. <text>问题描述</text>
  101. <text :style="selectType(item)">{{item.consultDepartment == 0?'技术':'品管'}}
  102. {{ selectText(item) }}</text>
  103. </view>
  104. <view class="content">{{ item.content }}</view>
  105. </view>
  106. </view>
  107. </view>
  108. <!-- 报工部分 -->
  109. <view class="daywork-container">
  110. <view class="result uni-row">
  111. <view class="label" style="margin-top: 20rpx;width: 170rpx;">仪器室检状态</view>
  112. <uni-data-checkbox :disabled="!editable()" style="margin-top: 20rpx;" v-model="processInspecion.inspectionStatus"
  113. :localdata="range" @change="handleChangeInspecionStatus"></uni-data-checkbox>
  114. </view>
  115. <view class="result uni-row">
  116. <view class="label" style="margin-top: 20rpx; margin-right: 10rpx;">放行状态</view>
  117. <uni-data-checkbox :disabled="true" style="margin-top: 20rpx;" v-model="processInspecion.status"
  118. :localdata="range"></uni-data-checkbox>
  119. </view>
  120. <view class="remark uni-row">
  121. <view class="label">备注</view>
  122. <textarea v-if="editable()" v-model="processInspecion.remark" maxlength="999" />
  123. <view v-else class="value">{{ processInspecion.remark }}</view>
  124. </view>
  125. <view v-if="editable()" class="btns-container uni-row">
  126. <view class="finished-btn" @click="endWork">提交</view>
  127. <view class="finished-btn" style="margin-left: 12rpx;background-color: #0055ff;"
  128. @click="handleToOtherChamber">移交其他仪器室</view>
  129. <view class="question-btn uni-column" @click.stop="handleAddConsultation">
  130. <uni-icons type="headphones" size="24" />
  131. <text>咨询</text>
  132. </view>
  133. </view>
  134. </view>
  135. <dialog-selectInspectionChamber ref='selectInspectionChamber'
  136. @handleSelectInspectionChamber='handleSelectInspectionChamber'></dialog-selectInspectionChamber>
  137. </view>
  138. </template>
  139. <script setup>
  140. import {
  141. ref,
  142. onMounted,
  143. getCurrentInstance
  144. } from 'vue'
  145. import {
  146. onLoad,
  147. onReady,
  148. onUnload,
  149. onShow
  150. } from '@dcloudio/uni-app'
  151. import {
  152. store
  153. } from '@/store/index.js'
  154. import {
  155. saveInstrumentRoomInspection,
  156. selectInspecion,
  157. updateChamberId
  158. } from '@/api/business/processInspection.js'
  159. import {
  160. getInspectionStandardsList
  161. } from '@/api/business/inspectionStandards.js'
  162. import {
  163. getURL
  164. } from '@/api/sys/user.js'
  165. const lot = ref({})
  166. const isEventTriggered = ref(false); // 创建一个标志位
  167. const unfitInfos = ref([]) //废品信息
  168. const consultations = ref([]) //咨询信息
  169. const flag = ref(false)
  170. const selectInspectionChamber = ref(null)
  171. // 创建一个引用来存储最后一次请求的时间戳
  172. const lastRequestTimestamp = ref(0);
  173. const processInspecion = ref({
  174. remark: "",
  175. rejectNum: 0,
  176. examiningNum: 0,
  177. status: 0,
  178. inspectionStatus:0
  179. })
  180. const initStatus = ref(0)
  181. const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
  182. const webHost = ref(urlList.baseUrl)
  183. const photoList = ref([])
  184. const selected = ref([]);
  185. const selectedPhotos = ref([])
  186. const imageStyles = {
  187. width: 60,
  188. height: 60
  189. }
  190. const editable = () => {
  191. // if (store.userInfo.permissions.some(item => item === 'business:outsourcedInspection:edit')) {
  192. // return true
  193. // }
  194. if (initStatus.value == 0) {
  195. return true
  196. }
  197. if (processInspecion.value.firstUpdaterId == store.userInfo.userId) {
  198. return true
  199. }
  200. return false
  201. }
  202. const consul = [{
  203. value: 0,
  204. text: "待确认",
  205. type: "color: #fcab53"
  206. }, {
  207. value: 2,
  208. text: "合格",
  209. type: "color: #55ff7f"
  210. }, {
  211. value: 1,
  212. text: "不合格",
  213. type: "color: #ff0c2c"
  214. }]
  215. const range = [{
  216. value: 0,
  217. text: "待确认",
  218. type: "color: #fcab53"
  219. }, {
  220. value: 1,
  221. text: "合格",
  222. type: "color: #55ff7f"
  223. }, {
  224. value: 2,
  225. text: "不合格",
  226. type: "color: #ff0c2c"
  227. }]
  228. /***************************** 页面生命周期函数 *****************************/
  229. onShow(() => {
  230. uni.$off('addWasteInfoEvent');
  231. })
  232. onLoad(() => {
  233. uni.$off('addWasteInfoEvent');
  234. console.log(store.processInspection)
  235. console.log(flag.value)
  236. if (!flag.value) {
  237. if (store.processInspection != null) {
  238. uni.showLoading({
  239. title: '加载中'
  240. });
  241. processInspecion.value = store.processInspection
  242. selectInspecion(processInspecion.value).then(res => {
  243. if (res.code == 200) {
  244. processInspecion.value = res.data;
  245. processInspecion.value.flag = false
  246. unfitInfos.value = res.data.processInspectionDetails;
  247. initStatus.value = res.data.inspectionStatus
  248. selectedPhotos.value = res.data.processInspectionPictureList
  249. photoList.value = res.data.processInspectionPictureList.map(item => {
  250. return {
  251. ...item,
  252. url: webHost.value + item.url
  253. };
  254. });
  255. consultations.value = res.data.dayworkItemConsults;
  256. console.log("res", res);
  257. console.log(processInspecion.value)
  258. uni.hideLoading();
  259. // getInspecion();
  260. } else {
  261. uni.showToast({
  262. icon: 'none',
  263. title: res.msg,
  264. duration: 2000
  265. })
  266. }
  267. });
  268. }
  269. }
  270. })
  271. function getOringicalList() {
  272. console.log(processInspecion.value)
  273. //查询该产品,当前工序,当前检查绑定的检查
  274. getInspectionStandardsList({
  275. productId: processInspecion.value.lot.productId,
  276. processId: processInspecion.value.lot.processId,
  277. inspectionCode: "instrumentRoomInspection"
  278. }).then(res => {
  279. unfitInfos.value = res.rows.map(item => {
  280. // 映射新的数组,包含 inspectionStandardsId 和 checkStandard 属性
  281. return {
  282. inspectionStandardsId: item.id, // 从 item 中获取 id
  283. checkStandard: item.standard // 从 item 中获取 standard
  284. };
  285. });
  286. })
  287. }
  288. /***************************** 定义了一些方法 *****************************/
  289. //咨询文本
  290. function selectText(item) {
  291. // for (var i = 0; i < consul.length; i++) {
  292. // if (item.status == consul[i].value) {
  293. // return consul[i].text
  294. // }
  295. // }
  296. if(item.consultResultId == 0) {
  297. return '待确认'
  298. }else{
  299. return item.result
  300. }
  301. }
  302. function upLoadImageHandler(arg) {
  303. getURL(arg).then(res => {
  304. let data = JSON.parse(res)
  305. selectedPhotos.value.push({
  306. url: data.fileName,
  307. pictureName: data.originalFilename,
  308. tenantId: store.tenantId
  309. })
  310. console.log(selectedPhotos.value)
  311. })
  312. }
  313. function select(e) {
  314. console.log(e)
  315. const {
  316. tempFilePaths,
  317. tempFiles
  318. } = e
  319. tempFiles.forEach((item, index) => {
  320. upLoadImageHandler({
  321. filePath: tempFilePaths[index],
  322. name: item.name
  323. })
  324. })
  325. }
  326. function handleDeletedPhoto(e) {
  327. let fileName = selectedPhotos.value.map(info => info.pictureName)
  328. const firstSlashIndex = e.tempFile.url.lastIndexOf('/');
  329. const lastSlashIndex = e.tempFile.url.lastIndexOf('_');
  330. const type = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex)
  331. const pictureName = e.tempFile.url.substring(firstSlashIndex + 1, lastSlashIndex) + e.tempFile.url.substring(e
  332. .tempFile.url.lastIndexOf('.') - 1 + 1);;
  333. let index = -1; // 初始化 index 为 -1,表示未找到
  334. // 首先检查 e.tempFile.name 是否存在
  335. if (fileName.findIndex(name => name === e.tempFile.name) !== -1) {
  336. index = fileName.findIndex(name => name === e.tempFile.name);
  337. }
  338. // 如果 e.tempFile.name 不存在,检查 e.tempFile.pictureName 是否存在
  339. else if (fileName.findIndex(name => name === e.tempFile.pictureName) !== -1) {
  340. index = fileName.findIndex(name => name === e.tempFile.pictureName);
  341. }
  342. // 如果以上两个都不存在,检查 pictureName 是否存在
  343. else if (fileName.findIndex(name => name === pictureName) !== -1) {
  344. index = fileName.findIndex(name => name === pictureName);
  345. }
  346. selectedPhotos.value.splice(index, 1)
  347. }
  348. function handleDrawingMenu() {
  349. // 对 technologicalProcessDetailId 进行URL编码
  350. var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
  351. var enTechnologicalProcessId = encodeURIComponent(processInspecion.value.lot.technologicalProcessId);
  352. var enprocessCode = encodeURIComponent(processInspecion.value.lot.processCode);
  353. var encodeCode = encodeURIComponent(processInspecion.value.lot.lotCode);
  354. var enProcessAlias = encodeURIComponent(processInspecion.value.lot.processAlias);
  355. var enIsWasteRecycling = encodeURIComponent(processInspecion.value.lot.isWasteRecycling);
  356. var enIsAmend = encodeURIComponent(processInspecion.value.lot.isAmend);
  357. // 构建查询参数字符串
  358. var queryParam =
  359. `param1=${encodedId}&param2=${encodeCode}&param3=${enprocessCode}&param4=${enTechnologicalProcessId}&param5=${enProcessAlias}&param6=${enIsWasteRecycling}&param7=${enIsAmend}`;
  360. // 使用模板字符串构建完整的URL
  361. var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
  362. // 导航到指定页面
  363. uni.navigateTo({
  364. url: navigateUrl
  365. });
  366. }
  367. const rejectNumberChange = () => {
  368. let sumDisqualificationNum = 0
  369. let sumExaminingNum = 0
  370. unfitInfos.value.forEach(v => {
  371. sumDisqualificationNum += (v.disqualificationNum != null ? Number(v.disqualificationNum) : 0)
  372. sumExaminingNum += (v.examiningNum != null ? Number(v.examiningNum) : 0)
  373. })
  374. processInspecion.value.disqualificationNum = sumDisqualificationNum
  375. processInspecion.value.examiningNum = sumExaminingNum
  376. console.log(processInspecion.value)
  377. }
  378. //查询咨询列表
  379. function getInspecion() {
  380. processInspecion.value = store.processInspection
  381. selectInspecion(processInspecion.value).then(res => {
  382. console.log("咨询", res);
  383. if (res.code == 200) {
  384. console.log("res", res);
  385. } else {
  386. uni.showToast({
  387. icon: 'none',
  388. title: res.msg,
  389. duration: 2000
  390. })
  391. }
  392. });
  393. }
  394. //结束报工按钮
  395. function endWork() {
  396. let unf = unfitInfos.value;
  397. for (var i = 0; i < unfitInfos.value.length; i++) {
  398. if (unf[i].examiningNum < 0 || unf[i].disqualificationNum < 0) {
  399. uni.showToast({
  400. icon: 'none',
  401. title: '检查量,不良品量不能小于0',
  402. duration: 2000
  403. })
  404. return
  405. }
  406. if (unf[i].examiningNum > processInspecion.value.lot.pudName) {
  407. uni.showToast({
  408. icon: 'none',
  409. title: '检查量不能大于投产量'
  410. })
  411. return
  412. }
  413. }
  414. if (processInspecion.value.disqualificationNum > processInspecion.value.lot.pudName) {
  415. uni.showToast({
  416. icon: 'none',
  417. title: '不良品量不能大于投产量'
  418. })
  419. return
  420. }
  421. save();
  422. }
  423. function save() {
  424. const currentTime = Date.now();
  425. // 检查是否已经过去了 2 秒
  426. if (currentTime - lastRequestTimestamp.value < 2000) {
  427. // 如果在 2 秒 内已经点击,那么不执行
  428. uni.showToast({
  429. icon: 'none',
  430. title: `请勿重复点击`,
  431. duration: 2000
  432. })
  433. return;
  434. }
  435. lastRequestTimestamp.value = currentTime;
  436. let pages = getCurrentPages();
  437. processInspecion.value.dayworkItemConsults = consultations.value;
  438. processInspecion.value.processInspectionDetails = unfitInfos.value;
  439. processInspecion.value.user = store.userInfo;
  440. processInspecion.value.tenantId = store.tenantId
  441. processInspecion.value.inspectionCarrierId = processInspecion.value.lot.inspectionCarrierId
  442. processInspecion.value.inspectionCarrierCode = processInspecion.value.lot.inspectionCarrierCode
  443. processInspecion.value.processInspectionPictureList = selectedPhotos.value
  444. console.log(processInspecion.value)
  445. saveInstrumentRoomInspection(processInspecion.value).then(res => {
  446. if (res.code == 200) {
  447. let index = 0;
  448. for (let i = 0; i < pages.length; i++) {
  449. if (pages[i].$page.fullPath == "/pages/instrumentRoomInspection/index") {
  450. index = pages.length - i - 1;
  451. }
  452. }
  453. console.log("index", index);
  454. uni.navigateBack({
  455. delta: index
  456. });
  457. } else {
  458. uni.showToast({
  459. icon: 'none',
  460. title: res.msg,
  461. duration: 2000
  462. })
  463. }
  464. });
  465. }
  466. function handleChangeInspecionStatus(e){
  467. console.log(e.detail.value)
  468. //没有咨询
  469. if(consultations.value && consultations.value.length == 0){
  470. processInspecion.value.status = e.detail.value
  471. }
  472. }
  473. //咨询样式
  474. function selectType(item) {
  475. for (var i = 0; i < consul.length; i++) {
  476. if (item.status == consul[i].value) {
  477. return consul[i].type
  478. }
  479. }
  480. }
  481. const addWasteInfo = (data) => {
  482. console.log(data, "55555555")
  483. flag.value = true
  484. var info = {
  485. inspectionStandardsId: data.id,
  486. checkStandard: data.standard
  487. }
  488. unfitInfos.value.push(info)
  489. console.log(data)
  490. }
  491. const addConsultation = (data) => {
  492. let info = data
  493. info.forEach(item => {
  494. item.status = 0
  495. })
  496. consultations.value = consultations.value.concat(info)
  497. isEventTriggered.value = true; // 更新标志位状态
  498. processInspecion.value.status = 0
  499. }
  500. /***************************** 定义了一些事件 *****************************/
  501. // 添加不合格信息
  502. const handleAddWaste = () => {
  503. flag.value = true
  504. // 监听事件,暂时不用,后续会使用
  505. uni.$on('addWasteInfoEvent', (data) => {
  506. addWasteInfo(data)
  507. })
  508. var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
  509. var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
  510. // 构建查询参数字符串
  511. var queryParam = `param1=${encodedId}&param2=${enprocessId}`;
  512. // 使用模板字符串构建完整的URL
  513. var navigateUrl = `/pages/instrumentRoomInspection/options?${queryParam}`;
  514. // 导航到指定页面
  515. uni.navigateTo({
  516. url: navigateUrl
  517. });
  518. }
  519. //移交其他仪器室
  520. function handleToOtherChamber() {
  521. //打开选择仪器室的弹窗
  522. selectInspectionChamber.value.open()
  523. }
  524. //选择带回
  525. function handleSelectInspectionChamber(data) {
  526. processInspecion.value.inspectionChamberId = data
  527. //修改仪器室
  528. updateChamberId(processInspecion.value).then(res => {
  529. if (res.code == 200) {
  530. store.processInspection = null
  531. uni.showToast({
  532. icon: 'none',
  533. title: "修改成功",
  534. duration: 2000
  535. })
  536. let index = 0;
  537. let pages = getCurrentPages();
  538. for (let i = 0; i < pages.length; i++) {
  539. if (pages[i].$page.fullPath == "/pages/instrumentRoomInspection/index") {
  540. index = pages.length - i - 1;
  541. }
  542. }
  543. console.log(index)
  544. uni.navigateBack({
  545. delta: index
  546. });
  547. }
  548. })
  549. console.log(processInspecion.value)
  550. }
  551. // 删除不合格信息
  552. const handleDelWaste = (index) => {
  553. uni.showModal({
  554. title: '提示',
  555. content: '确定删除该项?',
  556. success: function(res) {
  557. if (res.confirm) {
  558. unfitInfos.value.splice(index, 1)
  559. } else if (res.cancel) {
  560. return
  561. }
  562. }
  563. })
  564. }
  565. // 咨询
  566. const handleAddConsultation = () => {
  567. console.log("9999")
  568. isEventTriggered.value = false;
  569. // 监听事件
  570. uni.$once('addWasteConsultationEvent', (data) => {
  571. if (!isEventTriggered.value) {
  572. // 如果事件尚未触发,则执行事件触发逻辑
  573. addConsultation(data)
  574. }
  575. })
  576. uni.navigateTo({
  577. url: "/pages/instrumentRoomInspection/consultation",
  578. success: (res) => {
  579. // 通过eventChannel向被打开页面传送数据
  580. res.eventChannel.emit("instrumentRoomInspectionConsultation", {
  581. data: processInspecion.value.lot
  582. })
  583. }
  584. })
  585. }
  586. </script>
  587. <style lang="scss">
  588. .page-container {
  589. // height: 100%;
  590. background-color: #ececec;
  591. font-size: 28rpx;
  592. >.title {
  593. font-weight: 700;
  594. margin: 24rpx 16rpx;
  595. }
  596. }
  597. .carrier-info {
  598. margin: 32rpx 16rpx 0 16rpx;
  599. padding: 24rpx;
  600. background-color: #ffffff;
  601. border-radius: 8rpx;
  602. .carrier-code {
  603. font-size: 32rpx;
  604. font-weight: 700;
  605. }
  606. .info-row {
  607. margin-top: 16rpx;
  608. color: #767676;
  609. .label {
  610. width: 160rpx;
  611. }
  612. .drawing-btn {
  613. padding: 12rpx 32rpx;
  614. background-color: #0055ff;
  615. color: #ffffff;
  616. border-radius: 12rpx;
  617. margin-left: auto;
  618. font-size: 28rpx;
  619. }
  620. .value {
  621. flex: 1;
  622. textarea {
  623. flex: 1;
  624. border: 1px solid #888888;
  625. box-sizing: border-box;
  626. padding: 16rpx;
  627. }
  628. }
  629. }
  630. }
  631. .unfit-title {
  632. margin-bottom: 24rpx;
  633. justify-content: space-between;
  634. align-items: center;
  635. text {
  636. font-size: 28rpx;
  637. font-weight: 700;
  638. }
  639. .add-btn {
  640. padding: 12rpx 32rpx;
  641. background-color: #a4adb3;
  642. color: #ffffff;
  643. border-radius: 12rpx;
  644. font-size: 24rpx;
  645. }
  646. }
  647. .unfit-container {
  648. padding: 24rpx;
  649. margin: 0 16rpx;
  650. background-color: #ffffff;
  651. border-radius: 12rpx;
  652. .unfit-item-container {
  653. position: relative;
  654. >* {
  655. margin-bottom: 24rpx;
  656. }
  657. .title {
  658. font-weight: 700;
  659. justify-content: space-between;
  660. align-items: center;
  661. image {
  662. width: 40rpx;
  663. height: 40rpx;
  664. }
  665. }
  666. .standard {}
  667. .resu {
  668. width: 100%;
  669. align-items: center;
  670. input {
  671. margin-left: 20rpx;
  672. width: 200rpx;
  673. height: 56rpx;
  674. flex: 1;
  675. border: 1px solid #9f9f9f;
  676. font-size: 28rpx;
  677. }
  678. }
  679. .result {
  680. align-items: center;
  681. border-bottom: 1px solid #9f9f9f;
  682. padding-bottom: 32rpx;
  683. .label {
  684. flex: 1;
  685. }
  686. input {
  687. width: 280rpx;
  688. height: 56rpx;
  689. border: 1px solid #9f9f9f;
  690. font-size: 28rpx;
  691. &.number {
  692. width: 104rpx;
  693. text-align: center;
  694. }
  695. }
  696. }
  697. }
  698. .unfit-item-container:last-child {
  699. .result {
  700. border-bottom: none;
  701. padding-bottom: 0;
  702. }
  703. }
  704. }
  705. .consultation-container {
  706. margin: 0 16rpx;
  707. padding: 24rpx;
  708. background-color: #ffffff;
  709. border-radius: 8rpx;
  710. .consultation-item-container {
  711. margin-bottom: 24rpx;
  712. border-bottom: 2px solid #888888;
  713. padding-bottom: 24rpx;
  714. }
  715. .consultation-item-container:last-child {
  716. margin-bottom: 0;
  717. border-bottom: 0;
  718. padding-bottom: 0;
  719. }
  720. .question,
  721. .answer {
  722. .label {
  723. justify-content: space-between;
  724. margin-bottom: 16rpx;
  725. font-weight: 700;
  726. }
  727. .content {
  728. line-height: 40rpx;
  729. }
  730. }
  731. .answer {
  732. margin-top: 24rpx;
  733. }
  734. }
  735. .daywork-container {
  736. margin-top: 24rpx;
  737. padding: 24rpx;
  738. background-color: #ffffff;
  739. border: 1px solid #bcbcbc;
  740. .result {
  741. align-items: center;
  742. .label {
  743. width: 112rpx;
  744. }
  745. input {
  746. flex: 1;
  747. height: 56rpx;
  748. border: 1px solid #9f9f9f;
  749. font-size: 28rpx;
  750. text-align: center;
  751. }
  752. }
  753. .remark {
  754. margin-top: 24rpx;
  755. .label {
  756. width: 112rpx;
  757. }
  758. textarea {
  759. flex: 1;
  760. border: 1px solid #9f9f9f;
  761. height: 168rpx;
  762. }
  763. }
  764. .btns-container {
  765. margin-top: 24rpx;
  766. .finished-btn {
  767. display: flex;
  768. flex: 1;
  769. height: 80rpx;
  770. background-color: #fc6565;
  771. color: #ffffff;
  772. text-align: center;
  773. justify-content: center;
  774. align-items: center;
  775. border-radius: 8rpx;
  776. }
  777. .question-btn {
  778. width: 80rpx;
  779. align-items: flex-end;
  780. image {
  781. width: 48rpx;
  782. height: 48rpx;
  783. }
  784. text {
  785. font-size: 24rpx;
  786. }
  787. }
  788. }
  789. }
  790. .my-files {
  791. display: flex;
  792. justify-content: center;
  793. :deep(.uni-file-picker__container) {
  794. flex-direction: row;
  795. }
  796. }
  797. </style>