form.vue 23 KB

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