instrumentRoomForm.vue 24 KB

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