form.vue 24 KB

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