workOrderReport.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  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. if (this.pageName == 'steamInjectionInspectionRecord'&&!this.form.contactName) {
  603. this.$refs.uToast.show({
  604. type: "error",
  605. icon: false,
  606. message: `请选择甲方检查人!`,
  607. });
  608. return;
  609. }
  610. if (this.pageName == 'solidWasteRecord'&&!this.form.supplierName) {
  611. this.$refs.uToast.show({
  612. type: "error",
  613. icon: false,
  614. message: `请选择处理方!`,
  615. });
  616. return;
  617. }
  618. if (this.pageName == 'qualityTestRecords'&&!this.form.contactName) {
  619. this.$refs.uToast.show({
  620. type: "error",
  621. icon: false,
  622. message: `请选择联合站检查人!`,
  623. });
  624. return;
  625. }
  626. // 验证报工时间必须大于等于检查时间
  627. const startTime = new Date(this.form.checkStartTime).getTime();
  628. const finishTime = new Date(this.form.checkFinishTime).getTime();
  629. if (finishTime < startTime) {
  630. this.$refs.uToast.show({
  631. type: "error",
  632. icon: false,
  633. message: `报工时间不能早于检查时间`,
  634. });
  635. return;
  636. }
  637. if (this.form.executeUsersIds.length == 0) {
  638. this.$refs.uToast.show({
  639. type: "error",
  640. icon: false,
  641. message: `请选择执行人`,
  642. });
  643. return;
  644. }
  645. // 报工需要验证 缓存不验证 排除 recordTemplateStyle ==3 物料添加 == 4生产统计 模板
  646. if (this.pageName != "productionRecords") {
  647. // 验证检查项目
  648. const detailRequired = this.form.detailList.some((i) => {
  649. return i.checkResult == null || i.checkStatus == null;
  650. });
  651. if (detailRequired) {
  652. this.$refs.uToast.show({
  653. type: "error",
  654. icon: false,
  655. message: `请先完善、检查情况、检查结果`,
  656. });
  657. return;
  658. }
  659. }
  660. this.form.checkStartTime = dayjs(this.form.checkStartTime).format('YYYY-MM-DD HH:mm:ss')
  661. this.form.checkFinishTime = dayjs(this.form.checkFinishTime).format('YYYY-MM-DD HH:mm:ss')
  662. const body = JSON.parse(JSON.stringify(this.form));
  663. try {
  664. await producetaskrulerecordSaveOrUpdateAndSubmit(body);
  665. this.$emit("refresh");
  666. this.closePopup();
  667. } catch (error) {
  668. console.log(error, "dsdsd");
  669. }
  670. },
  671. },
  672. };
  673. </script>
  674. <style scoped lang="scss">
  675. .popup-content {
  676. width: 100vw;
  677. height: calc(100vh - 100px);
  678. background: #fff;
  679. border-radius: 0;
  680. display: flex;
  681. background-color: #eff2f7;
  682. flex-direction: column;
  683. }
  684. .popup-header {
  685. display: flex;
  686. justify-content: space-between;
  687. align-items: center;
  688. padding: 30rpx;
  689. border-bottom: 1rpx solid #e5e5e5;
  690. .popup-title {
  691. font-size: 36rpx;
  692. font-weight: bold;
  693. color: #333;
  694. }
  695. .close-btn {
  696. width: 60rpx;
  697. height: 60rpx;
  698. display: flex;
  699. align-items: center;
  700. justify-content: center;
  701. font-size: 60rpx;
  702. color: #999;
  703. line-height: 1;
  704. }
  705. }
  706. .popup-body {
  707. flex: 1;
  708. overflow-y: auto;
  709. padding: 28rpx;
  710. }
  711. .page {
  712. font-family:
  713. system-ui,
  714. -apple-system,
  715. "Segoe UI",
  716. Roboto,
  717. Helvetica,
  718. sans-serif;
  719. }
  720. .design-section {
  721. /* margin-bottom: 60rpx; */
  722. }
  723. .design-header {
  724. margin-bottom: 20rpx;
  725. padding-left: 8rpx;
  726. }
  727. .design-title {
  728. font-size: 44rpx;
  729. font-weight: 800;
  730. color: #1f2b3c;
  731. display: block;
  732. }
  733. .design-desc {
  734. font-size: 26rpx;
  735. color: #6b7280;
  736. margin-top: 6rpx;
  737. }
  738. /* 卡片白色风格 */
  739. .card-a {
  740. background: #ffffff;
  741. border-radius: 48rpx;
  742. box-shadow: 0 12rpx 40rpx rgba(0, 0, 0, 0.05);
  743. overflow: hidden;
  744. }
  745. .a-header {
  746. padding: 40rpx 32rpx 24rpx;
  747. border-bottom: 2rpx solid #f0f2f5;
  748. }
  749. .a-main-title {
  750. font-size: 36rpx;
  751. font-weight: 800;
  752. background: linear-gradient(135deg, #1f2b3c, #2c3e50);
  753. background-clip: text;
  754. -webkit-background-clip: text;
  755. color: transparent;
  756. letter-spacing: -0.5rpx;
  757. }
  758. .a-sub {
  759. font-size: 24rpx;
  760. color: #8e9aae;
  761. margin-top: 12rpx;
  762. display: flex;
  763. gap: 24rpx;
  764. }
  765. .info-grid {
  766. padding: 30rpx 32rpx;
  767. display: grid;
  768. grid-template-columns: 1fr 1fr;
  769. gap: 28rpx 20rpx;
  770. // background: #fcfdfe;
  771. border-bottom: 2rpx solid #f0f2f5;
  772. }
  773. .info-item {
  774. display: flex;
  775. flex-direction: column;
  776. gap: 8rpx;
  777. }
  778. .info-label {
  779. font-size: 26rpx;
  780. font-weight: 600;
  781. color: #6c7a91;
  782. text-transform: uppercase;
  783. }
  784. .records-area {
  785. padding: 16rpx 28rpx 32rpx;
  786. }
  787. .section-header {
  788. display: flex;
  789. justify-content: space-between;
  790. align-items: center;
  791. margin: 16rpx 0 20rpx 8rpx;
  792. }
  793. .section-title {
  794. font-size: 36rpx;
  795. font-weight: 700;
  796. color: #1f2a44;
  797. display: flex;
  798. align-items: center;
  799. gap: 16rpx;
  800. }
  801. .badge {
  802. background: #eff3fa;
  803. padding: 6rpx 20rpx;
  804. border-radius: 60rpx;
  805. font-size: 24rpx;
  806. font-weight: normal;
  807. color: #2c5f8a;
  808. }
  809. .device-card-a {
  810. background: #f8fbfe;
  811. border-radius: 36rpx;
  812. padding: 20rpx 24rpx;
  813. margin-bottom: 30rpx;
  814. display: flex;
  815. align-items: center;
  816. justify-content: space-between;
  817. flex-wrap: wrap;
  818. border: 2rpx solid #e9edf2;
  819. }
  820. .device-label {
  821. font-weight: 700;
  822. font-size: 28rpx;
  823. color: #1f2a44;
  824. background: #eff3fa;
  825. padding: 8rpx 24rpx;
  826. border-radius: 60rpx;
  827. }
  828. .device-input-a {
  829. flex: 1;
  830. min-width: 280rpx;
  831. background: #ffffff;
  832. border: 2rpx solid #dce3ec;
  833. border-radius: 36rpx;
  834. padding: 16rpx 24rpx;
  835. font-size: 28rpx;
  836. }
  837. .check-item-a {
  838. background: #ffffff;
  839. border-radius: 36rpx;
  840. padding: 24rpx 24rpx;
  841. margin-bottom: 24rpx;
  842. box-shadow:
  843. 0 4rpx 16rpx rgba(0, 0, 0, 0.02),
  844. 0 0 0 2rpx #edf2f7;
  845. }
  846. .item-row1 {
  847. display: flex;
  848. justify-content: space-between;
  849. align-items: baseline;
  850. flex-wrap: wrap;
  851. margin-bottom: 20rpx;
  852. gap: 16rpx;
  853. }
  854. .item-name {
  855. font-weight: 620;
  856. font-size: 30rpx;
  857. color: #1f2a44;
  858. background: #f5f7fb;
  859. padding: 6rpx 20rpx;
  860. border-radius: 50rpx;
  861. }
  862. .item-info {
  863. display: flex;
  864. flex-direction: column;
  865. gap: 8rpx;
  866. }
  867. .item-row-input {
  868. display: flex;
  869. align-items: center;
  870. gap: 16rpx;
  871. margin-bottom: 20rpx;
  872. padding: 0 8rpx;
  873. }
  874. .input-label {
  875. font-size: 28rpx;
  876. color: #555;
  877. font-weight: 500;
  878. white-space: nowrap;
  879. }
  880. .item-input {
  881. // background: #f8fafe;
  882. border: 2rpx solid #e2e8f0;
  883. border-radius: 36rpx;
  884. padding: 12rpx 24rpx;
  885. font-size: 30rpx;
  886. min-height: 60rpx;
  887. flex: 1;
  888. font-family: monospace;
  889. }
  890. .item-actions {
  891. display: flex;
  892. justify-content: space-between;
  893. align-items: center;
  894. flex-wrap: wrap;
  895. gap: 20rpx;
  896. }
  897. .check-status,
  898. .result-group {
  899. display: flex;
  900. align-items: center;
  901. gap: 24rpx;
  902. background: #f8fafe;
  903. padding: 8rpx 24rpx;
  904. border-radius: 60rpx;
  905. font-size: 28rpx;
  906. }
  907. /deep/.result-group {
  908. .u-radio__text {
  909. font-size: 28rpx !important;
  910. }
  911. .u-radio__icon-wrap {
  912. width: 30rpx !important;
  913. height: 30rpx !important;
  914. }
  915. }
  916. .radio-label {
  917. display: flex;
  918. align-items: center;
  919. gap: 8rpx;
  920. }
  921. .batch-bar {
  922. display: flex;
  923. gap: 16rpx;
  924. margin: 16rpx 0 20rpx 8rpx;
  925. }
  926. .btn {
  927. flex: 1;
  928. text-align: center;
  929. border-radius: 80rpx;
  930. font-weight: 700;
  931. font-size: 30rpx;
  932. border: none;
  933. }
  934. .btn-primary {
  935. background: #1e6f5c;
  936. color: white;
  937. box-shadow: 0 4rpx 12rpx rgba(30, 111, 92, 0.2);
  938. }
  939. .btn-secondary {
  940. background: #2c7da0;
  941. color: white;
  942. }
  943. .footnote {
  944. font-size: 22rpx;
  945. color: #8e9aab;
  946. text-align: center;
  947. margin-top: 16rpx;
  948. display: block;
  949. }
  950. /* 修复组件样式 */
  951. radio,
  952. checkbox {
  953. transform: scale(0.9);
  954. margin-right: 6rpx;
  955. }
  956. button:after {
  957. border: none;
  958. }
  959. .info-value {
  960. font-size: 28rpx;
  961. font-weight: 500;
  962. color: #1e2a3a;
  963. // background: #f2f5f9;
  964. padding: 16rpx 20rpx;
  965. border-radius: 24rpx;
  966. border: 2rpx solid #e9edf2;
  967. &.disabled {
  968. color: #999;
  969. background: #f5f5f5;
  970. }
  971. }
  972. .popup-footer {
  973. display: flex;
  974. padding: 20rpx 30rpx;
  975. border-top: 1rpx solid #e5e5e5;
  976. gap: 20rpx;
  977. /deep/ .u-button {
  978. flex: 1;
  979. }
  980. }
  981. /deep/.uni-select {
  982. border-radius: 36rpx;
  983. }
  984. </style>