workOrderReport.vue 26 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039
  1. <template>
  2. <u-popup :show="visible" :round="0" :closeOnClickOverlay="false" :zIndex="99999" @close="closePopup"
  3. class="u-popup-my">
  4. <view class="popup-content">
  5. <view class="popup-header">
  6. <text class="popup-title">{{ title }}</text>
  7. <view class="close-btn" @click="closePopup">×</view>
  8. </view>
  9. <scroll-view class="popup-body" scroll-y>
  10. <view class="page">
  11. <view class="card-a">
  12. <!-- 头部 -->
  13. <view class="a-header">
  14. <text class="a-main-title">{{ form.ruleName }}</text>
  15. <view class="a-sub">
  16. <text>📋
  17. {{
  18. getDictValue("记录规则类型", form.recordRulesClassify)
  19. }}</text>
  20. </view>
  21. </view>
  22. <!-- 基本信息网格 -->
  23. <view class="info-grid">
  24. <view class="info-item">
  25. <text class="info-label">检查时间</text>
  26. <uni-datetime-picker type="datetime" v-model="form.checkStartTime"
  27. returnType="timestamp"
  28. :disabled="title == '详情'">
  29. <view class="info-value">{{
  30. form.checkStartTime&& dayjs(form.checkStartTime).format('YYYY-MM-DD HH:mm:ss')|| "请选择" }}</view>
  31. </uni-datetime-picker>
  32. </view>
  33. <view class="info-item">
  34. <text class="info-label">报工时间</text>
  35. <uni-datetime-picker type="datetime" v-model="form.checkFinishTime"
  36. :disabled="title == '详情'" returnType="timestamp" >
  37. <view class="info-value">
  38. {{ form.checkFinishTime&& dayjs(form.checkFinishTime).format('YYYY-MM-DD HH:mm:ss')|| "请选择"}}
  39. </view>
  40. </uni-datetime-picker>
  41. </view>
  42. <view class="info-item" v-if="!form.type">
  43. <text class="info-label">部门</text>
  44. <view class="info-value" :class="{ disabled: title == '详情' }"
  45. @click="title != '详情' && $refs.treePicker._show()">{{ form.groupName || "请选择" }}
  46. </view>
  47. </view>
  48. <view class="info-item" v-if="!form.type">
  49. <text class="info-label">指定负责人</text>
  50. <view class="info-value" :class="{ disabled: title == '详情' }"
  51. @click="title != '详情' && $refs.selector.open()">{{
  52. form.executeUsers.map((item) => item.userName).toString() ||
  53. "请选择"
  54. }}</view>
  55. </view>
  56. <view class="info-item" v-if="form.type">
  57. <text class="info-label">班组</text>
  58. <view class="info-value">{{ form.teamName }}</view>
  59. </view>
  60. <view class="info-item" v-if="form.type">
  61. <text class="info-label">执行人</text>
  62. <view class="info-value" :class="{ disabled: title == '详情' }"
  63. @click="title != '详情' && $refs.selector.open()">{{
  64. form.executeUsers.map((item) => item.userName).toString() ||
  65. "请选择"
  66. }}</view>
  67. </view>
  68. <view class="info-item" v-if="form.type">
  69. <text class="info-label">场站</text>
  70. <view class="info-value" :class="{ disabled: title == '详情' }"
  71. @click="title != '详情' && (showProductLineIdPicker = true)">
  72. {{ form.productLineName || "请选择" }}
  73. </view>
  74. </view>
  75. <view class="info-item" v-if="pageName == 'steamInjectionInspectionRecord'">
  76. <text class="info-label">甲方检查人</text>
  77. <view class="info-value" :class="{ disabled: title == '详情' }"
  78. @click="title != '详情' && selectContactShow(17)">{{ form.contactName || "请选择" }}
  79. </view>
  80. </view>
  81. <view class="info-item" v-if="pageName == 'solidWasteRecord'">
  82. <text class="info-label">处理方</text>
  83. <view class="info-value" :class="{ disabled: title == '详情' }"
  84. @click="title != '详情' && selectContactShow(19)">{{ form.supplierName || "请选择" }}
  85. </view>
  86. </view>
  87. <view class="info-item" v-if="pageName == 'qualityTestRecords'">
  88. <text class="info-label">联合站检查人</text>
  89. <view class="info-value" :class="{ disabled: title == '详情' }"
  90. @click="title != '详情' && selectContactShow(17)">{{ form.contactName || "请选择" }}
  91. </view>
  92. </view>
  93. </view>
  94. <!-- 运行参数记录区 -->
  95. <view class="records-area">
  96. <view class="section-header">
  97. <view class="section-title">
  98. <text>📊 记录数据</text>
  99. </view>
  100. </view>
  101. <!-- 批量操作按钮放在标题下方 -->
  102. <view class="batch-bar" v-if="pageName != 'productionRecords' && title != '详情'">
  103. <button class="btn btn-primary" @click="batchCheck">
  104. ✅ 批量检查
  105. </button>
  106. <button class="btn btn-secondary" @click="batchQualified">
  107. 🏭 批量合格
  108. </button>
  109. </view>
  110. <!-- 检查项列表 -->
  111. <view v-for="(item, idx) in form.detailList" :key="idx" class="check-item-a">
  112. <view class="item-row1">
  113. <view class="item-info">
  114. <text class="item-name">{{ idx + 1 }}. {{ item.paramValue }}
  115. {{ item.unitName ? "(" + item.unitName + ")" : "" }}</text>
  116. </view>
  117. </view>
  118. <view class="item-row-input" v-if="item.substanceName">
  119. <text class="input-label">设备</text>
  120. <view class="item-input"> {{ item.substanceName }}</view>
  121. </view>
  122. <!-- 描述/数量 -->
  123. <view class="item-row-input">
  124. <text class="input-label">{{
  125. pageName == "qualityTestRecords" ? "描述" : "数量"
  126. }}</text>
  127. <input class="item-input" v-model="item.num" type="text" placeholder="请输入数量"
  128. :disabled="title == '详情'" />
  129. </view>
  130. <view class="item-row-input" v-if="pageName == 'qualityTestRecords'">
  131. <text class="input-label">执行人</text>
  132. <view class="info-value" style="padding: 6px 10px; flex: 1; border-radius: 28rpx"
  133. :class="{ disabled: title == '详情' }"
  134. @click="title != '详情' && itemExecuteUsers(idx, item)">{{
  135. (item.checkUsers &&
  136. item.checkUsers
  137. .map((item) => item.userName)
  138. .toString()) ||
  139. "请选择"
  140. }}</view>
  141. </view>
  142. <view class="item-actions" v-if="pageName != 'productionRecords'">
  143. <u-radio-group class="result-group" v-model="item.checkStatus"
  144. :disabled="title == '详情'">
  145. <u-radio label="已检查" :name="1"></u-radio>
  146. <u-radio label="未检查" :name="0"></u-radio>
  147. </u-radio-group>
  148. <u-radio-group class="result-group" v-model="item.checkResult"
  149. :disabled="title == '详情'">
  150. <u-radio label="合格" :name="1"></u-radio>
  151. <u-radio label="不合格" :name="0"></u-radio>
  152. </u-radio-group>
  153. </view>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. </scroll-view>
  159. <view class="popup-footer">
  160. <u-button type="default" @click="closePopup">关闭</u-button>
  161. <u-button type="primary" @click="submit()" v-if="title == '报工'" :loading="loading">提交</u-button>
  162. </view>
  163. </view>
  164. <u-toast ref="uToast"></u-toast>
  165. <ba-tree-picker ref="treePicker" key="verify" :multiple="false" @select-change="searchDeptNodeClick"
  166. title="选择部门" :localdata="classificationList" valueKey="id" textKey="name" childrenKey="children" />
  167. <search-select :multiple="true" ref="selector" v-model="form.executeUsersIds" :data-list="
  168. executorList.map((val) => {
  169. return {
  170. text: val.name,
  171. value: val.id,
  172. };
  173. })
  174. " title="选择" @confirm="executeIdListChange">
  175. </search-select>
  176. <!-- 场站 -->
  177. <u-picker :show="showProductLineIdPicker" keyName="label" :columns="[
  178. productLineList.map((item) => {
  179. return {
  180. label: item.name,
  181. value: item.id,
  182. };
  183. }),
  184. ]" @confirm="confirmProductLine" @cancel="showProductLineIdPicker = false"></u-picker>
  185. <search-select :multiple="true" ref="selector1" v-model="checkUsersIds" :data-list="
  186. (form.executeUsers &&
  187. form.executeUsers.map((val) => {
  188. return {
  189. text: val.userName,
  190. value: val.userId,
  191. };
  192. })) ||
  193. []
  194. " title="选择" @confirm="executeIdListChange1">
  195. </search-select>
  196. <!-- <u-picker
  197. :show="showCheckUsersIds"
  198. keyName="label"
  199. mode="multiSelector"
  200. :columns="[
  201. form.executeUsers &&
  202. form.executeUsers.map((item) => {
  203. return {
  204. label: item.userName,
  205. value: item.userId,
  206. };
  207. }),
  208. ]"
  209. @confirm="confirmCheckUsersIds"
  210. @cancel="showCheckUsersIds = false"
  211. ></u-picker> -->
  212. </u-popup>
  213. </template>
  214. <script>
  215. const formBaseData = {
  216. id: null,
  217. workshopArea: "",
  218. workshopAreaId: null,
  219. checkFinishTime: "",
  220. checkStartTime: "",
  221. checkValidity: null,
  222. checkValidityUnit: "",
  223. conclusion: null,
  224. detailList: [],
  225. deviceId: 0,
  226. deviceName: "",
  227. batchNo: "",
  228. executeMethod: 0,
  229. formingNum: 0,
  230. itemType: 0,
  231. produceRoutingId: 0,
  232. produceRoutingName: "",
  233. produceTaskConfigId: 0,
  234. produceTaskId: 0,
  235. produceTaskName: "",
  236. productCode: "",
  237. productModel: "",
  238. productName: "",
  239. recordRulesClassify: null,
  240. recordTemplateStyle: null,
  241. ruleId: 0,
  242. ruleName: "",
  243. reportWorkType: 0,
  244. specification: "",
  245. workOrderCode: "",
  246. workOrderId: 0,
  247. itemTaskName: "",
  248. brandNo: "",
  249. duration: null,
  250. // 执行人
  251. executeUsersIds: [],
  252. executeUsers: [],
  253. showProductLineIdPicker: false,
  254. // 班组id
  255. teamId: "",
  256. groupId: null,
  257. // 物料字段name
  258. pickDetails: [],
  259. // 本次产出明细
  260. outputDetails: [],
  261. recordRulesExecuteMethodId: null,
  262. recordRulesExecuteMethodName: "",
  263. // 产出类型 1-原材料,2-在制品,3.BOM标准产出
  264. outputType: 1,
  265. type: 0,
  266. contactName: "",
  267. contactId: "",
  268. supplierId: "",
  269. supplierName: "",
  270. productLineId: null,
  271. productLineName: "",
  272. };
  273. import {
  274. getById,
  275. producetaskrulerecordSaveOrUpdateAndSubmit,
  276. } from "@/api/recordRules/index";
  277. import {
  278. getTeamPage
  279. } from "@/api/pda/workOrderHandover.js";
  280. import {
  281. getUserPage,
  282. listOrganizations
  283. } from "@/api/common.js";
  284. import {
  285. toTreeData
  286. } from "@/utils/utils.js";
  287. import {
  288. mapGetters
  289. } from "vuex";
  290. import searchSelect from "@/pages/salesServiceManagement/accessory/components/searchSelect.vue";
  291. import dayjs from 'dayjs'
  292. export default {
  293. data() {
  294. return {
  295. visible: false,
  296. executeUsersIds: [],
  297. title: "",
  298. loading: false,
  299. butLoading: false,
  300. checked: false,
  301. teamUserList: [],
  302. teamList: [],
  303. teamAllList: [],
  304. classificationList: [],
  305. showProductLineIdPicker: false,
  306. showCheckUsersIds: false,
  307. executorList: [],
  308. allTeamList: [],
  309. productLineList: [],
  310. dayjs,
  311. currentIndex: "",
  312. form: JSON.parse(JSON.stringify(formBaseData)),
  313. };
  314. },
  315. computed: {
  316. ...mapGetters(["getDictValue"]),
  317. },
  318. components: {
  319. searchSelect,
  320. },
  321. props: {
  322. pageName: "",
  323. },
  324. methods: {
  325. async open(row, type) {
  326. uni.$off("setSelectList");
  327. uni.$on("setSelectList", (data) => {
  328. console.log(data, "data");
  329. if (data && data.length > 0) {
  330. this.form.contactName = data[0].name;
  331. this.form.contactId = data[0].id;
  332. this.form.supplierName = data[0].name;
  333. this.form.supplierId = data[0].id;
  334. }
  335. });
  336. if (type == "edit") {
  337. this.title = "报工";
  338. } else {
  339. this.title = "详情";
  340. }
  341. this.getTreeList();
  342. await this.getOrderDetials(row.id);
  343. this.visible = true;
  344. },
  345. cancel() {
  346. this.form = {
  347. ...JSON.parse(JSON.stringify(formBaseData)),
  348. };
  349. this.visible = false;
  350. },
  351. async getTreeList() {
  352. const data = await listOrganizations({});
  353. let treeList = toTreeData({
  354. data: data || [],
  355. idField: "id",
  356. parentIdField: "parentId",
  357. });
  358. this.classificationList = treeList;
  359. },
  360. selectContactShow(type) {
  361. uni.navigateTo({
  362. url: "/pages/saleManage/components/selectContact?isAll=" +
  363. false +
  364. "&contactType=" +
  365. type,
  366. });
  367. },
  368. confirmProductLine(e) {
  369. this.form.productLineId = e.value[0].value;
  370. this.form.productLineName = e.value[0].label;
  371. this.showProductLineIdPicker = false;
  372. },
  373. closePopup() {
  374. this.cancel();
  375. },
  376. handParent() {
  377. this.$refs.parentListRef.open();
  378. },
  379. changeParent(data) {
  380. this.form.contactName = data.name;
  381. this.form.contactId = data.id;
  382. this.form.supplierName = data.name;
  383. this.form.supplierId = data.id;
  384. },
  385. // 获取工单详情
  386. async getOrderDetials(id) {
  387. try {
  388. const data = await getById(id);
  389. data.detailList = data.detailList.map((i) => {
  390. i.toolNames = i.tools.map((j) => j.toolName).join(",");
  391. if (i.checkUsers && i.checkUsers.length > 0) {
  392. console.log("i.checkUsers", i.checkUsers);
  393. i.checkUsersIds = i.checkUsers.map((j) => j.userId);
  394. }
  395. if (
  396. (!i.checkUsersIds || i.checkUsersIds.length == 0) &&
  397. data.executeUsers.length > 0
  398. ) {
  399. // 默认执行人作为检查人
  400. i.checkUsersIds = data.executeUsers
  401. .filter((i) => i.userId)
  402. .map((j) => j.userId);
  403. i.checkUsers = data.executeUsers
  404. .filter((i) => i.userId)
  405. .map((j) => {
  406. return {
  407. teamId: j.teamId,
  408. teamName: j.teamName,
  409. userId: j.userId,
  410. userName: j.userName,
  411. };
  412. });
  413. }
  414. return i;
  415. });
  416. // this.$util.assignObject(this.form, data);
  417. Object.assign(this.form, data);
  418. this.form.executeUsersIds = this.form.executeUsers
  419. .map((i) => i.userId)
  420. .filter((i) => i); // 过滤掉 undefined
  421. if (this.form.executeUsers.length > 0 && !this.form.type) {
  422. this.form.groupId = this.form.executeUsers[0]?.groupId + "";
  423. this.form.groupName = this.form.executeUsers[0]?.groupName;
  424. if (this.form.groupId) {
  425. this.searchDeptNodeClick(
  426. this.form.groupId,
  427. this.form.groupName,
  428. "init",
  429. );
  430. }
  431. }
  432. if (!this.form.teamId && this.teamList.length > 0) {
  433. this.form.teamId = this.teamList[0].id;
  434. }
  435. this.form.recordRulesClassify += "";
  436. // 加载班组人员列表
  437. if (this.form.teamId && this.form.type) {
  438. await this.getAllTeamList();
  439. const index = this.allTeamList.findIndex(
  440. (item) => item.id == this.form.teamId,
  441. );
  442. this.executorList = this.allTeamList[index].userVOList;
  443. this.productLineList = [];
  444. this.allTeamList[index].factoryWorkstationVOList.forEach((item) => {
  445. if (
  446. !this.productLineList.find((p) => p.id === item.productionLineId)
  447. ) {
  448. this.productLineList.push({
  449. name: item.productionLineName,
  450. id: item.productionLineId,
  451. });
  452. }
  453. });
  454. }
  455. this.$nextTick(() => {
  456. this.loading = false;
  457. });
  458. } catch (error) {
  459. console.log("error", error);
  460. this.loading = false;
  461. }
  462. },
  463. checkTeamList(id) {
  464. const index = this.teamList.findIndex((item) => item.id == id);
  465. this.teamUserList = this.teamAllList[index];
  466. this.form.teamName = this.teamList[index].name;
  467. console.log("this.teamUserList", this.teamUserList);
  468. },
  469. // 批量检查
  470. batchCheck() {
  471. this.form.detailList.forEach((i, index) => {
  472. this.$set(this.form.detailList[index], "checkStatus", 1);
  473. });
  474. },
  475. // 批量合格
  476. batchQualified() {
  477. this.form.detailList.forEach((i, index) => {
  478. this.$set(this.form.detailList[index], "checkResult", 1);
  479. });
  480. },
  481. itemExecuteUsers(index, row) {
  482. this.currentIndex = index;
  483. this.$refs.selector1.open();
  484. },
  485. executeIdListChange1() {
  486. this.$set(
  487. this.form.detailList[this.currentIndex],
  488. "checkUsersIds",
  489. this.checkUsersIds,
  490. );
  491. const checkUsersIds = this.checkUsersIds;
  492. this.checkUsersIds = [];
  493. const checkUsers = checkUsersIds.map((i) => {
  494. const user = this.form.executeUsers.find((item) => item.userId === i);
  495. return user;
  496. });
  497. console.log(checkUsers, "checkUsers");
  498. this.$set(
  499. this.form.detailList[this.currentIndex],
  500. "checkUsers",
  501. checkUsers,
  502. );
  503. },
  504. // 获取审核人列表、巡点检人员
  505. async getUserList(params) {
  506. try {
  507. let data = {
  508. pageNum: 1,
  509. size: -1,
  510. };
  511. // 如果传了参数就是获取部门人员数据
  512. if (params) {
  513. data = Object.assign(data, params);
  514. }
  515. const res = await getUserPage(data);
  516. if (params) {
  517. this.executorList = res.list;
  518. }
  519. } catch (error) {}
  520. },
  521. //选择部门(搜索)
  522. async searchDeptNodeClick(id, name, type) {
  523. this.form.groupId = id;
  524. this.form.groupName = name;
  525. if (id) {
  526. // 根据部门获取人员
  527. const params = {
  528. groupId: id,
  529. };
  530. await this.getUserList(params);
  531. } else {
  532. this.form.groupId = null;
  533. }
  534. if (type != "init") {
  535. this.form.detailList.forEach((detail) => {
  536. detail.checkUsersIds = [];
  537. detail.checkUsers = [];
  538. });
  539. this.form.executeUsers = [];
  540. this.form.executeUsersIds = [];
  541. }
  542. },
  543. // 负责人变更 同步执行人列表
  544. executeIdListChange() {
  545. console.log(this.form.executeUsersIds, "this.form.executeUsersIds");
  546. this.form.executeUsers = this.form.executeUsersIds
  547. .map((userId) => {
  548. const user = this.executorList.find((u) => u.id === userId);
  549. if (!user) return null;
  550. return {
  551. userId: user.id,
  552. userName: user.name,
  553. groupId: user.groupId,
  554. groupName: user.groupName,
  555. };
  556. })
  557. .filter((i) => i);
  558. // 同步详情执行人
  559. this.form.detailList.forEach((detail, index) => {
  560. this.$set(
  561. this.form.detailList[index],
  562. "checkUsersIds",
  563. this.form.executeUsersIds,
  564. );
  565. this.$set(
  566. this.form.detailList[index],
  567. "checkUsers",
  568. this.form.executeUsers,
  569. );
  570. });
  571. console.log("this.form.executeUsers", this.form.detailList);
  572. },
  573. async getAllTeamList() {
  574. const {
  575. list
  576. } = await getTeamPage({
  577. pageNum: 1,
  578. size: -1,
  579. });
  580. console.log("teamAllList 班组", list);
  581. this.allTeamList = list;
  582. },
  583. // 提交
  584. async submit() {
  585. // 验证检查时间和报工时间必填
  586. if (!this.form.checkStartTime) {
  587. this.$refs.uToast.show({
  588. type: "error",
  589. icon: false,
  590. message: `请选择检查时间`,
  591. });
  592. return;
  593. }
  594. if (!this.form.checkFinishTime) {
  595. this.$refs.uToast.show({
  596. type: "error",
  597. icon: false,
  598. message: `请选择报工时间`,
  599. });
  600. return;
  601. }
  602. // 验证报工时间必须大于等于检查时间
  603. const startTime = new Date(this.form.checkStartTime).getTime();
  604. const finishTime = new Date(this.form.checkFinishTime).getTime();
  605. if (finishTime < startTime) {
  606. this.$refs.uToast.show({
  607. type: "error",
  608. icon: false,
  609. message: `报工时间不能早于检查时间`,
  610. });
  611. return;
  612. }
  613. if (this.form.executeUsersIds.length == 0) {
  614. this.$refs.uToast.show({
  615. type: "error",
  616. icon: false,
  617. message: `请选择执行人`,
  618. });
  619. return;
  620. }
  621. // 报工需要验证 缓存不验证 排除 recordTemplateStyle ==3 物料添加 == 4生产统计 模板
  622. if (this.pageName != "productionRecords") {
  623. // 验证检查项目
  624. const detailRequired = this.form.detailList.some((i) => {
  625. return i.checkResult == null || i.checkStatus == null;
  626. });
  627. if (detailRequired) {
  628. this.$refs.uToast.show({
  629. type: "error",
  630. icon: false,
  631. message: `请先完善、检查情况、检查结果`,
  632. });
  633. return;
  634. }
  635. }
  636. this.form.checkStartTime = dayjs(this.form.checkStartTime).format('YYYY-MM-DD HH:mm:ss')
  637. this.form.checkFinishTime = dayjs(this.form.checkFinishTime).format('YYYY-MM-DD HH:mm:ss')
  638. const body = JSON.parse(JSON.stringify(this.form));
  639. try {
  640. await producetaskrulerecordSaveOrUpdateAndSubmit(body);
  641. this.$emit("refresh");
  642. this.closePopup();
  643. } catch (error) {
  644. console.log(error, "dsdsd");
  645. }
  646. },
  647. },
  648. };
  649. </script>
  650. <style scoped lang="scss">
  651. .popup-content {
  652. width: 100vw;
  653. height: calc(100vh - 100px);
  654. background: #fff;
  655. border-radius: 0;
  656. display: flex;
  657. background-color: #eff2f7;
  658. flex-direction: column;
  659. }
  660. .popup-header {
  661. display: flex;
  662. justify-content: space-between;
  663. align-items: center;
  664. padding: 30rpx;
  665. border-bottom: 1rpx solid #e5e5e5;
  666. .popup-title {
  667. font-size: 36rpx;
  668. font-weight: bold;
  669. color: #333;
  670. }
  671. .close-btn {
  672. width: 60rpx;
  673. height: 60rpx;
  674. display: flex;
  675. align-items: center;
  676. justify-content: center;
  677. font-size: 60rpx;
  678. color: #999;
  679. line-height: 1;
  680. }
  681. }
  682. .popup-body {
  683. flex: 1;
  684. overflow-y: auto;
  685. padding: 28rpx;
  686. }
  687. .page {
  688. font-family:
  689. system-ui,
  690. -apple-system,
  691. "Segoe UI",
  692. Roboto,
  693. Helvetica,
  694. sans-serif;
  695. }
  696. .design-section {
  697. /* margin-bottom: 60rpx; */
  698. }
  699. .design-header {
  700. margin-bottom: 20rpx;
  701. padding-left: 8rpx;
  702. }
  703. .design-title {
  704. font-size: 44rpx;
  705. font-weight: 800;
  706. color: #1f2b3c;
  707. display: block;
  708. }
  709. .design-desc {
  710. font-size: 26rpx;
  711. color: #6b7280;
  712. margin-top: 6rpx;
  713. }
  714. /* 卡片白色风格 */
  715. .card-a {
  716. background: #ffffff;
  717. border-radius: 48rpx;
  718. box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.05);
  719. overflow: hidden;
  720. }
  721. .a-header {
  722. padding: 40rpx 32rpx 24rpx;
  723. border-bottom: 2rpx solid #f0f2f5;
  724. }
  725. .a-main-title {
  726. font-size: 36rpx;
  727. font-weight: 800;
  728. background: linear-gradient(135deg, #1f2b3c, #2c3e50);
  729. background-clip: text;
  730. -webkit-background-clip: text;
  731. color: transparent;
  732. letter-spacing: -0.5rpx;
  733. }
  734. .a-sub {
  735. font-size: 24rpx;
  736. color: #8e9aae;
  737. margin-top: 12rpx;
  738. display: flex;
  739. gap: 24rpx;
  740. }
  741. .info-grid {
  742. padding: 30rpx 32rpx;
  743. display: grid;
  744. grid-template-columns: 1fr 1fr;
  745. gap: 28rpx 20rpx;
  746. // background: #fcfdfe;
  747. border-bottom: 2rpx solid #f0f2f5;
  748. }
  749. .info-item {
  750. display: flex;
  751. flex-direction: column;
  752. gap: 8rpx;
  753. }
  754. .info-label {
  755. font-size: 26rpx;
  756. font-weight: 600;
  757. color: #6c7a91;
  758. text-transform: uppercase;
  759. }
  760. .records-area {
  761. padding: 16rpx 28rpx 32rpx;
  762. }
  763. .section-header {
  764. display: flex;
  765. justify-content: space-between;
  766. align-items: center;
  767. margin: 16rpx 0 20rpx 8rpx;
  768. }
  769. .section-title {
  770. font-size: 36rpx;
  771. font-weight: 700;
  772. color: #1f2a44;
  773. display: flex;
  774. align-items: center;
  775. gap: 16rpx;
  776. }
  777. .badge {
  778. background: #eff3fa;
  779. padding: 6rpx 20rpx;
  780. border-radius: 60rpx;
  781. font-size: 24rpx;
  782. font-weight: normal;
  783. color: #2c5f8a;
  784. }
  785. .device-card-a {
  786. background: #f8fbfe;
  787. border-radius: 36rpx;
  788. padding: 20rpx 24rpx;
  789. margin-bottom: 30rpx;
  790. display: flex;
  791. align-items: center;
  792. justify-content: space-between;
  793. flex-wrap: wrap;
  794. border: 2rpx solid #e9edf2;
  795. }
  796. .device-label {
  797. font-weight: 700;
  798. font-size: 28rpx;
  799. color: #1f2a44;
  800. background: #eff3fa;
  801. padding: 8rpx 24rpx;
  802. border-radius: 60rpx;
  803. }
  804. .device-input-a {
  805. flex: 1;
  806. min-width: 280rpx;
  807. background: #ffffff;
  808. border: 2rpx solid #dce3ec;
  809. border-radius: 36rpx;
  810. padding: 16rpx 24rpx;
  811. font-size: 28rpx;
  812. }
  813. .check-item-a {
  814. background: #ffffff;
  815. border-radius: 36rpx;
  816. padding: 24rpx 24rpx;
  817. margin-bottom: 24rpx;
  818. box-shadow:
  819. 0 4rpx 16rpx rgba(0, 0, 0, 0.02),
  820. 0 0 0 2rpx #edf2f7;
  821. }
  822. .item-row1 {
  823. display: flex;
  824. justify-content: space-between;
  825. align-items: baseline;
  826. flex-wrap: wrap;
  827. margin-bottom: 20rpx;
  828. gap: 16rpx;
  829. }
  830. .item-name {
  831. font-weight: 620;
  832. font-size: 30rpx;
  833. color: #1f2a44;
  834. background: #f5f7fb;
  835. padding: 6rpx 20rpx;
  836. border-radius: 50rpx;
  837. }
  838. .item-info {
  839. display: flex;
  840. flex-direction: column;
  841. gap: 8rpx;
  842. }
  843. .item-row-input {
  844. display: flex;
  845. align-items: center;
  846. gap: 16rpx;
  847. margin-bottom: 20rpx;
  848. padding: 0 8rpx;
  849. }
  850. .input-label {
  851. font-size: 28rpx;
  852. color: #555;
  853. font-weight: 500;
  854. white-space: nowrap;
  855. }
  856. .item-input {
  857. // background: #f8fafe;
  858. border: 2rpx solid #e2e8f0;
  859. border-radius: 36rpx;
  860. padding: 12rpx 24rpx;
  861. font-size: 30rpx;
  862. min-height: 60rpx;
  863. flex: 1;
  864. font-family: monospace;
  865. }
  866. .item-actions {
  867. display: flex;
  868. justify-content: space-between;
  869. align-items: center;
  870. flex-wrap: wrap;
  871. gap: 20rpx;
  872. }
  873. .check-status,
  874. .result-group {
  875. display: flex;
  876. align-items: center;
  877. gap: 24rpx;
  878. background: #f8fafe;
  879. padding: 8rpx 24rpx;
  880. border-radius: 60rpx;
  881. font-size: 28rpx;
  882. }
  883. /deep/.result-group {
  884. .u-radio__text {
  885. font-size: 28rpx !important;
  886. }
  887. .u-radio__icon-wrap {
  888. width: 30rpx !important;
  889. height: 30rpx !important;
  890. }
  891. }
  892. .radio-label {
  893. display: flex;
  894. align-items: center;
  895. gap: 8rpx;
  896. }
  897. .batch-bar {
  898. display: flex;
  899. gap: 16rpx;
  900. margin: 16rpx 0 20rpx 8rpx;
  901. }
  902. .btn {
  903. flex: 1;
  904. text-align: center;
  905. border-radius: 80rpx;
  906. font-weight: 700;
  907. font-size: 30rpx;
  908. border: none;
  909. }
  910. .btn-primary {
  911. background: #1e6f5c;
  912. color: white;
  913. box-shadow: 0 4rpx 12rpx rgba(30, 111, 92, 0.2);
  914. }
  915. .btn-secondary {
  916. background: #2c7da0;
  917. color: white;
  918. }
  919. .footnote {
  920. font-size: 22rpx;
  921. color: #8e9aab;
  922. text-align: center;
  923. margin-top: 16rpx;
  924. display: block;
  925. }
  926. /* 修复组件样式 */
  927. radio,
  928. checkbox {
  929. transform: scale(0.9);
  930. margin-right: 6rpx;
  931. }
  932. button:after {
  933. border: none;
  934. }
  935. .info-value {
  936. font-size: 28rpx;
  937. font-weight: 500;
  938. color: #1e2a3a;
  939. // background: #f2f5f9;
  940. padding: 16rpx 20rpx;
  941. border-radius: 24rpx;
  942. border: 2rpx solid #e9edf2;
  943. &.disabled {
  944. color: #999;
  945. background: #f5f5f5;
  946. }
  947. }
  948. .popup-footer {
  949. display: flex;
  950. padding: 20rpx 30rpx;
  951. border-top: 1rpx solid #e5e5e5;
  952. gap: 20rpx;
  953. /deep/ .u-button {
  954. flex: 1;
  955. }
  956. }
  957. /deep/.uni-select {
  958. border-radius: 36rpx;
  959. }
  960. </style>