form.vue 24 KB

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