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