form.vue 24 KB

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