form.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  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. console.log(processInspecion.value)
  459. if(processInspecion.value.flag) {
  460. //打开选择仪器室的弹窗
  461. selectInspectionChamber.value.open()
  462. console.log(processInspecion.value)
  463. }else{
  464. saveFirstInspection(processInspecion.value).then(res => {
  465. if (res.code == 200) {
  466. let index = 0;
  467. for (let i = 0; i < pages.length; i++) {
  468. if (pages[i].$page.fullPath == "/pages/reportingForWork/index") {
  469. index = pages.length - i - 1;
  470. }
  471. }
  472. console.log("index", index);
  473. uni.navigateBack({
  474. delta: index
  475. });
  476. } else {
  477. uni.showToast({
  478. icon: 'none',
  479. title: res.msg,
  480. duration: 2000
  481. })
  482. }
  483. });
  484. }
  485. }
  486. function handleSelectInspectionChamber(data) {
  487. processInspecion.value.inspectionChamberId = data
  488. console.log(processInspecion.value)
  489. saveFirstInspection(processInspecion.value).then(res => {
  490. if (res.code == 200) {
  491. let index = 0;
  492. let pages = getCurrentPages();
  493. for (let i = 0; i < pages.length; i++) {
  494. if (pages[i].$page.fullPath == "/pages/reportingForWork/index") {
  495. index = pages.length - i - 1;
  496. }
  497. }
  498. console.log("index", index);
  499. uni.navigateBack({
  500. delta: index
  501. });
  502. } else {
  503. uni.showToast({
  504. icon: 'none',
  505. title: res.msg,
  506. duration: 2000
  507. })
  508. }
  509. });
  510. }
  511. //咨询样式
  512. function selectType(item) {
  513. for (var i = 0; i < consul.length; i++) {
  514. if (item.status == consul[i].value) {
  515. return consul[i].type
  516. }
  517. }
  518. }
  519. const addWasteInfo = (data) => {
  520. console.log(data,"55555555")
  521. flag.value = true
  522. var info = {
  523. inspectionStandardsId: data.id,
  524. checkStandard: data.standard
  525. }
  526. unfitInfos.value.push(info)
  527. console.log(data)
  528. }
  529. const addConsultation = (data) => {
  530. let info = data
  531. info.forEach(item =>{
  532. item.status = 0
  533. })
  534. consultations.value = consultations.value.concat(info)
  535. isEventTriggered.value = true; // 更新标志位状态
  536. }
  537. /***************************** 定义了一些事件 *****************************/
  538. // 添加不合格信息
  539. const handleAddWaste = () => {
  540. flag.value = true
  541. // 监听事件,暂时不用,后续会使用
  542. uni.$once('addWasteInfoEvent', (data) => {
  543. addWasteInfo(data)
  544. })
  545. var encodedId = encodeURIComponent(processInspecion.value.lot.productId);
  546. var enprocessId = encodeURIComponent(processInspecion.value.lot.processId);
  547. // 构建查询参数字符串
  548. var queryParam = `param1=${encodedId}&param2=${enprocessId}`;
  549. // 使用模板字符串构建完整的URL
  550. var navigateUrl = `/pages/firstInspection/options?${queryParam}`;
  551. // 导航到指定页面
  552. uni.navigateTo({
  553. url: navigateUrl
  554. });
  555. }
  556. // 删除不合格信息
  557. const handleDelWaste = (index) => {
  558. uni.showModal({
  559. title: '提示',
  560. content: '确定删除该项?',
  561. success: function(res) {
  562. if (res.confirm) {
  563. unfitInfos.value.splice(index, 1)
  564. } else if (res.cancel) {
  565. return
  566. }
  567. }
  568. })
  569. }
  570. // 咨询
  571. const handleAddConsultation = () => {
  572. console.log("9999")
  573. isEventTriggered.value = false;
  574. // 监听事件
  575. uni.$once('addWasteConsultationEvent', (data) => {
  576. if (!isEventTriggered.value) {
  577. // 如果事件尚未触发,则执行事件触发逻辑
  578. addConsultation(data)
  579. }
  580. })
  581. uni.navigateTo({
  582. url: "/pages/firstInspection/consultation",
  583. success: (res) => {
  584. // 通过eventChannel向被打开页面传送数据
  585. res.eventChannel.emit("firstInpsectionConsultation", {
  586. data: processInspecion.value.lot
  587. })
  588. }
  589. })
  590. }
  591. </script>
  592. <style lang="scss">
  593. .page-container {
  594. // height: 100%;
  595. background-color: #ececec;
  596. font-size: 28rpx;
  597. >.title {
  598. font-weight: 700;
  599. margin: 24rpx 16rpx;
  600. }
  601. }
  602. .carrier-info {
  603. margin: 32rpx 16rpx 0 16rpx;
  604. padding: 24rpx;
  605. background-color: #ffffff;
  606. border-radius: 8rpx;
  607. .carrier-code {
  608. font-size: 32rpx;
  609. font-weight: 700;
  610. }
  611. .info-row {
  612. margin-top: 16rpx;
  613. color: #767676;
  614. .label {
  615. width: 160rpx;
  616. }
  617. .drawing-btn {
  618. padding: 12rpx 32rpx;
  619. background-color: #0055ff;
  620. color: #ffffff;
  621. border-radius: 12rpx;
  622. margin-left: auto;
  623. font-size: 28rpx;
  624. }
  625. .value {
  626. flex: 1;
  627. textarea {
  628. flex: 1;
  629. border: 1px solid #888888;
  630. box-sizing: border-box;
  631. padding: 16rpx;
  632. }
  633. }
  634. }
  635. }
  636. .unfit-title {
  637. margin-bottom: 24rpx;
  638. justify-content: space-between;
  639. align-items: center;
  640. text {
  641. font-size: 28rpx;
  642. font-weight: 700;
  643. }
  644. .add-btn {
  645. padding: 12rpx 32rpx;
  646. background-color: #a4adb3;
  647. color: #ffffff;
  648. border-radius: 12rpx;
  649. font-size: 24rpx;
  650. }
  651. }
  652. .unfit-container {
  653. padding: 24rpx;
  654. margin: 0 16rpx;
  655. background-color: #ffffff;
  656. border-radius: 12rpx;
  657. .unfit-item-container {
  658. position: relative;
  659. >* {
  660. margin-bottom: 24rpx;
  661. }
  662. .title {
  663. font-weight: 700;
  664. justify-content: space-between;
  665. align-items: center;
  666. image {
  667. width: 40rpx;
  668. height: 40rpx;
  669. }
  670. }
  671. .standard {}
  672. .resu {
  673. width: 100%;
  674. align-items: center;
  675. input {
  676. margin-left: 20rpx;
  677. width: 200rpx;
  678. height: 56rpx;
  679. flex: 1;
  680. border: 1px solid #9f9f9f;
  681. font-size: 28rpx;
  682. }
  683. }
  684. .uni-input-input:disabled {
  685. background-color: #f5f7fa;
  686. }
  687. .result {
  688. align-items: center;
  689. border-bottom: 1px solid #9f9f9f;
  690. padding-bottom: 32rpx;
  691. .label {
  692. flex: 1;
  693. }
  694. input {
  695. width: 280rpx;
  696. height: 56rpx;
  697. border: 1px solid #9f9f9f;
  698. font-size: 28rpx;
  699. &.number {
  700. width: 104rpx;
  701. text-align: center;
  702. }
  703. }
  704. }
  705. }
  706. .unfit-item-container:last-child {
  707. .result {
  708. border-bottom: none;
  709. padding-bottom: 0;
  710. }
  711. }
  712. }
  713. .consultation-container {
  714. margin: 0 16rpx;
  715. padding: 24rpx;
  716. background-color: #ffffff;
  717. border-radius: 8rpx;
  718. .consultation-item-container {
  719. margin-bottom: 24rpx;
  720. border-bottom: 2px solid #888888;
  721. padding-bottom: 24rpx;
  722. }
  723. .consultation-item-container:last-child {
  724. margin-bottom: 0;
  725. border-bottom: 0;
  726. padding-bottom: 0;
  727. }
  728. .question,
  729. .answer {
  730. .label {
  731. justify-content: space-between;
  732. margin-bottom: 16rpx;
  733. font-weight: 700;
  734. }
  735. .content {
  736. line-height: 40rpx;
  737. }
  738. }
  739. .answer {
  740. margin-top: 24rpx;
  741. }
  742. }
  743. .daywork-container {
  744. margin-top: 24rpx;
  745. padding: 24rpx;
  746. background-color: #ffffff;
  747. border: 1px solid #bcbcbc;
  748. .switch {
  749. margin-top: -4px;
  750. //align-items: center;
  751. }
  752. .result {
  753. align-items: center;
  754. .label {
  755. width: 112rpx;
  756. }
  757. input {
  758. flex: 1;
  759. height: 56rpx;
  760. border: 1px solid #9f9f9f;
  761. font-size: 28rpx;
  762. text-align: center;
  763. }
  764. }
  765. .remark {
  766. margin-top: 24rpx;
  767. .label {
  768. width: 112rpx;
  769. }
  770. textarea {
  771. flex: 1;
  772. border: 1px solid #9f9f9f;
  773. height: 168rpx;
  774. }
  775. }
  776. .btns-container {
  777. margin-top: 24rpx;
  778. .finished-btn {
  779. display: flex;
  780. flex: 1;
  781. height: 80rpx;
  782. background-color: #fc6565;
  783. color: #ffffff;
  784. text-align: center;
  785. justify-content: center;
  786. align-items: center;
  787. border-radius: 8rpx;
  788. }
  789. .question-btn {
  790. width: 80rpx;
  791. align-items: flex-end;
  792. image {
  793. width: 48rpx;
  794. height: 48rpx;
  795. }
  796. text {
  797. font-size: 24rpx;
  798. }
  799. }
  800. }
  801. .switch {
  802. margin-top: -8rpx;
  803. align-items: center;
  804. transform: scale(0.7);
  805. }
  806. }
  807. input:disabled {background-color: #00ff00;}
  808. .my-files {
  809. display: flex;
  810. justify-content: center;
  811. :deep(.uni-file-picker__container) {
  812. flex-direction: row;
  813. }
  814. }
  815. </style>