form.vue 24 KB

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