index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  1. <template>
  2. <div>
  3. <div v-if="isShow">
  4. <div class="top_fixed">
  5. <div
  6. style="display: flex; align-items: center; margin-right: 10px"
  7. v-if="List.length > 1"
  8. >
  9. <div class="rx-bc">
  10. <div class="name">批量投料时间:</div>
  11. </div>
  12. <el-date-picker
  13. v-model="executorTime"
  14. type="datetime"
  15. value-format="yyyy-MM-dd HH:mm:ss"
  16. placeholder="选择日期"
  17. @change="handleCreate"
  18. >
  19. </el-date-picker>
  20. </div>
  21. <el-button
  22. type="primary"
  23. size="mini"
  24. :loading="loadingBtn"
  25. @click="save(2, 'all')"
  26. >一键投料(报工)</el-button
  27. >
  28. <el-button type="primary" size="mini" @click="removeCacheFn('all')"
  29. >清空缓存</el-button
  30. >
  31. <el-button type="primary" size="mini" @click="save(1, 'all')"
  32. >缓存</el-button
  33. >
  34. </div>
  35. <div class="feed_box" v-if="isLoad">
  36. <div v-for="(item, index) in List" :key="index" class="card_box">
  37. <div class="title_box rx-bc">
  38. <div class="name" v-if="!taskObj.isOrderListData">工单信息 </div>
  39. <div class="name" v-else> </div>
  40. <div class="rx-bc">
  41. <el-button
  42. type="text"
  43. size="mini"
  44. @click="outboundOrder(item.workOrderId, item)"
  45. >出库单</el-button
  46. >
  47. <el-button
  48. type="text"
  49. size="mini"
  50. @click="openPicking(item.workOrderId, item)"
  51. >添加设备</el-button
  52. >
  53. <el-button
  54. type="text"
  55. size="mini"
  56. @click="removeCacheFn(item.workOrderId)"
  57. >清空缓存</el-button
  58. >
  59. <el-button type="text" size="mini" @click="save(1, index)"
  60. >缓存</el-button
  61. >
  62. </div>
  63. </div>
  64. <workOrderBom
  65. :item="item"
  66. v-if="!taskObj.isOrderListData"
  67. ></workOrderBom>
  68. <div>
  69. <div class="title_box rx-bc">
  70. <div class="name">投料时间 </div>
  71. </div>
  72. 投料时间:
  73. <el-date-picker
  74. v-model="item.executorTime"
  75. type="datetime"
  76. value-format="yyyy-MM-dd HH:mm:ss"
  77. placeholder="选择日期"
  78. style="margin-right: 25px; width: 190px"
  79. >
  80. </el-date-picker>
  81. 执行人:
  82. <el-select
  83. v-model="teamId"
  84. placeholder="请选择班组"
  85. filterable
  86. style="width: 120px"
  87. @change="checkTeamList(teamId)"
  88. >
  89. <el-option
  90. v-for="item in teamList"
  91. :label="item.name"
  92. :value="item.id"
  93. :key="item.id"
  94. >
  95. </el-option>
  96. </el-select>
  97. <el-select
  98. v-model="executorIdList"
  99. placeholder="请选择执行人"
  100. filterable
  101. multiple
  102. @change="changeId"
  103. >
  104. <div class="checkboxWrapper">
  105. <el-checkbox v-model="checked" @change="checkChange">
  106. 全选
  107. </el-checkbox>
  108. </div>
  109. <el-option
  110. v-for="item in teamUserList"
  111. :label="item.name"
  112. :value="item.id"
  113. :key="item.id"
  114. >
  115. </el-option>
  116. </el-select>
  117. <!-- -->
  118. </div>
  119. <paramBom
  120. v-if="item.paramDetailList.length != 0"
  121. :list="item.paramDetailList"
  122. ></paramBom>
  123. <!-- 设备信息 -->
  124. <deviceBom
  125. v-if="item.equipmentList.length != 0"
  126. :list="item.equipmentList"
  127. ></deviceBom>
  128. <!-- <productsBom
  129. v-if="
  130. item.product != null &&
  131. item.product != '{}' &&
  132. item.singleReport != 0
  133. "
  134. :itemObj="item"
  135. :productsObj="item.product"
  136. >
  137. </productsBom> -->
  138. <productsBom
  139. v-if="item.product.length != 0 && item.singleReport == 1"
  140. :itemObj="item"
  141. :productsObj="item.product"
  142. >
  143. </productsBom>
  144. <!-- <batchProductsBom
  145. v-if="
  146. item.product != null &&
  147. item.product != '{}' &&
  148. item.singleReport == 0
  149. "
  150. :itemObj="item"
  151. :productsObj="item.product"
  152. >
  153. </batchProductsBom> -->
  154. <batchProductsBom
  155. v-if="item.product.length != 0 && item.singleReport == 0"
  156. :itemObj="item"
  157. :productsObj="item.product"
  158. :isEdit="isEdit"
  159. >
  160. </batchProductsBom>
  161. <modelBom v-if="item.modelList.length != 0" :list="item.modelList">
  162. </modelBom>
  163. <!-- 物料清单 -->
  164. <instanceBom
  165. v-if="item.instanceList.length != 0"
  166. :list="item.instanceList"
  167. :equipmentList="item.equipmentList"
  168. :currentTaskDiagram="item.currentTaskDiagram"
  169. :workInfo="item"
  170. title="物料清单"
  171. >
  172. </instanceBom>
  173. <!-- 备料清单 -->
  174. <instanceBom
  175. v-if="item.sparePartsList.length != 0"
  176. :list="item.sparePartsList"
  177. :equipmentList="item.equipmentList"
  178. :currentTaskDiagram="item.currentTaskDiagram"
  179. :workInfo="item"
  180. title="备料清单"
  181. >
  182. </instanceBom>
  183. <semiProductJobBom
  184. v-if="item.semiProductList.length != 0"
  185. :list="item.semiProductList"
  186. :equipmentList="item.equipmentList"
  187. :currentTaskDiagram="item.currentTaskDiagram"
  188. :item="item"
  189. :isChoose="isChoose"
  190. :isEngrave="isEngrave"
  191. :isDisposal="isDisposal"
  192. title="物料清单"
  193. >
  194. </semiProductJobBom>
  195. <!-- 周转车 -->
  196. <turnoverBom
  197. v-if="item.turnover.length != 0"
  198. :wordItem="item"
  199. :list="item.turnover"
  200. pattern="feed"
  201. >
  202. </turnoverBom>
  203. <aridRegion
  204. v-if="item.aridRegionList.length != 0"
  205. :list="item.aridRegionList"
  206. ></aridRegion>
  207. <palletBom
  208. v-if="item.palletList.length != 0"
  209. :list="item.palletList"
  210. ></palletBom>
  211. <!-- // 包装物料清单 -->
  212. <packingBom
  213. v-if="item.packingList.length != 0"
  214. :list="item.packingList"
  215. ></packingBom>
  216. <revolvingDiskBom
  217. v-if="item.revolvingDiskList.length != 0"
  218. :list="item.revolvingDiskList"
  219. ></revolvingDiskBom>
  220. </div>
  221. </div>
  222. <pickingList
  223. isType="feed"
  224. ref="pickingListRef"
  225. @allSelection="allSelection"
  226. ></pickingList>
  227. </div>
  228. <div v-else>
  229. <el-empty description="批量报工,不需要投料,直接去报工取样"></el-empty>
  230. </div>
  231. <outboundOrderDialog
  232. ref="outboundOrderDialogRef"
  233. @chooseData="chooseData"
  234. />
  235. </div>
  236. </template>
  237. <script>
  238. import { workorderList } from '@/api/produce/workOrder';
  239. import {
  240. batchSave,
  241. feedSaveCache,
  242. feedGetCache,
  243. removeCache
  244. } from '@/api/produce/feeding';
  245. import pickingList from '../picking/pickingList.vue';
  246. import packingBom from './components/packingBom.vue';
  247. import workOrderBom from './components/workOrderBom.vue';
  248. import paramBom from './components/paramBom.vue';
  249. import deviceBom from './components/deviceBom.vue';
  250. import productsBom from './components/productsBom.vue';
  251. import batchProductsBom from './components/batchProductsBom.vue';
  252. import modelBom from './components/modelBom.vue';
  253. import instanceBom from './components/instanceBom.vue';
  254. // import semiProductBom from './components/semiProductBom.vue';
  255. import semiProductJobBom from '@/views/produce/components/jobBooking/components/semiProductJobBom.vue';
  256. import turnoverBom from './components/turnoverBom.vue';
  257. import aridRegion from './components/aridRegion.vue';
  258. import palletBom from './components/palletBom.vue';
  259. import revolvingDiskBom from './components/revolvingDiskBom.vue';
  260. import outboundOrderDialog from './components/outboundOrderDialog.vue';
  261. import { deepClone } from '@/utils';
  262. import { timestampToDateTime } from '@/utils/index.js';
  263. import { parameterGetByCode } from '@/api/system/dictionary-data';
  264. import { getTeam } from '@/api/produce/job.js';
  265. export default {
  266. name: 'feeding',
  267. components: {
  268. pickingList,
  269. packingBom,
  270. workOrderBom,
  271. paramBom,
  272. deviceBom,
  273. productsBom,
  274. modelBom,
  275. instanceBom,
  276. semiProductJobBom,
  277. turnoverBom,
  278. aridRegion,
  279. palletBom,
  280. revolvingDiskBom,
  281. batchProductsBom,
  282. outboundOrderDialog
  283. },
  284. props: {
  285. workListIds: {
  286. type: Array,
  287. default() {
  288. return [];
  289. }
  290. },
  291. feedNeedEquipment: {}
  292. },
  293. computed: {
  294. taskObj() {
  295. return this.$store.state.user.taskObj;
  296. },
  297. clientEnvironmentId() {
  298. return this.$store.state.user.info.clientEnvironmentId;
  299. }
  300. },
  301. watch: {
  302. workListIds: {
  303. handler(val) {
  304. this.getList(val);
  305. console.log('1111122222', val);
  306. },
  307. deep: true,
  308. immediate: true
  309. }
  310. },
  311. data() {
  312. return {
  313. List: [],
  314. idsList: [],
  315. executorTime: '',
  316. isLoad: false,
  317. isShow: true,
  318. loading: null,
  319. loadingBtn: false,
  320. isEdit: false,
  321. isChoose: false,
  322. isEngrave: false,
  323. isDisposal: false,
  324. teamList: [],
  325. teamAllList: [],
  326. teamUserList: [],
  327. executorIdList: [],
  328. teamId: '',
  329. isDefaultExecutor: false,
  330. checked: false
  331. };
  332. },
  333. mounted() {
  334. this.getChooseEngrave();
  335. if (localStorage.getItem('singleUserInfo') == '1') {
  336. const data = JSON.parse(localStorage.getItem('chooseUserInfo'));
  337. this.getTeamList(data.teamId);
  338. } else {
  339. this.getTeamList(this.$store.state.user.info.teamId);
  340. }
  341. // this.getTeamList(this.$store.state.user.info.teamId);
  342. },
  343. methods: {
  344. handleCreate(e) {
  345. if (e) {
  346. const list = JSON.parse(JSON.stringify(this.List));
  347. console.log(list);
  348. list.map((item) => {
  349. item.executorTime = e;
  350. });
  351. this.$set(this, 'List', list);
  352. }
  353. },
  354. getList(ids) {
  355. this.idsList = ids || [];
  356. let param = {
  357. ids: ids,
  358. taskId: this.taskObj.id
  359. };
  360. this.isLoad = false;
  361. workorderList(param)
  362. .then((res) => {
  363. let arr = [];
  364. arr = res.map((m) => {
  365. m.workOrderId = m.id;
  366. m.paramDetailList = m.paramDetailList;
  367. m.instanceList = []; // 物料
  368. // m.equipmentList = []; // 设备
  369. m.modelList = []; // 模具
  370. m.aridRegionList = []; // 干燥区
  371. m.packingList = []; // 包装
  372. m.palletList = []; // 舟皿
  373. m.revolvingDiskList = []; // 周转盘
  374. m.semiProductList = []; //半成品
  375. m.sparePartsList = []; //备品清单
  376. if (m.pickOutInList.length > 0) {
  377. m.pickOutInList.forEach((f) => {
  378. if (f.rootCategoryLevelId == 1) {
  379. m.instanceList.push(f);
  380. } else if (f.rootCategoryLevelId == 4) {
  381. m.modelList.push(f);
  382. } else if (f.rootCategoryLevelId == 5) {
  383. m.modelList.push(f);
  384. } else if (f.rootCategoryLevelId == 6) {
  385. m.sparePartsList.push(f);
  386. } else if (f.rootCategoryLevelId == 11) {
  387. m.aridRegionList.push(f);
  388. } else if (f.rootCategoryLevelId == 13) {
  389. m.packingList.push(f);
  390. } else if (f.rootCategoryLevelId == 8) {
  391. m.palletList.push(f);
  392. } else if (f.rootCategoryLevelId == 26) {
  393. m.revolvingDiskList.push(f);
  394. } else if (
  395. [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
  396. ) {
  397. m.semiProductList.push(f);
  398. }
  399. });
  400. }
  401. if (m.semiProductList.length != 0) {
  402. m.semiProductList.forEach((item) => {
  403. if (!item.confirm) {
  404. item.confirm = '';
  405. }
  406. });
  407. }
  408. // 处理字段
  409. if (m.quality == '') {
  410. m.product = '{}';
  411. }
  412. if (!Object.prototype.hasOwnProperty.call(m, 'product')) {
  413. m.product = '{}';
  414. }
  415. if (m.singleReport == 1) {
  416. m.semiProductList.map((item) => {
  417. item.extInfo.taskId = '';
  418. item.extInfo.taskName = '';
  419. });
  420. }
  421. if (m.singleReport == 0) {
  422. m.product.map((item) => {
  423. item.extInfo.taskId = '';
  424. item.extInfo.taskName = '';
  425. });
  426. }
  427. if (
  428. this.clientEnvironmentId == 3 &&
  429. this.taskObj.type == 6 &&
  430. m.singleReport == 0
  431. ) {
  432. this.isShow = false;
  433. } else {
  434. this.isShow = true;
  435. }
  436. delete m.id;
  437. if (this.taskObj.id) {
  438. m.taskId = this.taskObj.id;
  439. m.taskName = this.taskObj.name;
  440. }
  441. return {
  442. ...m
  443. };
  444. });
  445. console.log(arr, 'arr');
  446. this.List = deepClone(arr);
  447. })
  448. .finally(() => {
  449. this.isLoad = true;
  450. this.getCacheFn();
  451. });
  452. this.$forceUpdate();
  453. },
  454. async getChooseEngrave() {
  455. await parameterGetByCode({
  456. code: 'choose_engrave'
  457. }).then((res) => {
  458. this.isChoose = res.value == '1' ? true : false;
  459. });
  460. await parameterGetByCode({
  461. code: 'batch_update_engrave'
  462. }).then((res) => {
  463. this.isEngrave = res.value == '1' ? true : false;
  464. });
  465. await parameterGetByCode({
  466. code: 'batch_disposal'
  467. }).then((res) => {
  468. this.isDisposal = res.value == '1' ? true : false;
  469. });
  470. await parameterGetByCode({
  471. code: 'default_executor'
  472. }).then((res) => {
  473. this.isDefaultExecutor = res.value == '1' ? true : false;
  474. if (this.isDefaultExecutor) {
  475. this.setDefaultIdList();
  476. }
  477. });
  478. },
  479. setDefaultIdList() {
  480. if (this.teamList.length != 0) {
  481. this.teamId = this.teamList[0].id;
  482. const index = this.teamList.findIndex(
  483. (item) => item.id == this.teamId
  484. );
  485. console.log(this.teamAllList);
  486. this.teamUserList = this.teamAllList[index];
  487. if (this.teamUserList) {
  488. const res = this.teamUserList.find(
  489. (it) => it.id == this.$store.state.user.info.userId
  490. );
  491. this.executorIdList.push(res.id);
  492. }
  493. }
  494. },
  495. changeId() {
  496. if (this.executorIdList.length == this.teamUserList.length) {
  497. this.checked = true;
  498. } else {
  499. this.checked = false;
  500. }
  501. },
  502. checkTeamList(id) {
  503. this.executorIdList = [];
  504. const index = this.teamList.findIndex((item) => item.id == id);
  505. this.teamUserList = this.teamAllList[index];
  506. },
  507. async getTeamList(id) {
  508. const ids = id.split(',');
  509. this.teamList = [];
  510. this.teamUserList = [];
  511. const list = ids.map((item) => getTeam(item));
  512. const dataList = await Promise.all(list);
  513. dataList.forEach((item) => {
  514. this.teamList.push({
  515. name: item.name,
  516. id: item.id
  517. });
  518. this.teamAllList.push(item.userVOList);
  519. });
  520. },
  521. outboundOrder(id, item) {
  522. this.$refs.outboundOrderDialogRef.open(id, item);
  523. },
  524. openPicking(id, item) {
  525. this.$refs.pickingListRef.open(id, item, '选择列表');
  526. },
  527. chooseData(listData) {
  528. this.$set(this.List[0], 'semiProductList', listData);
  529. this.$forceUpdate();
  530. console.log(this.List[0], 'this.List');
  531. },
  532. allSelection(id, selectList) {
  533. this.List.forEach((m) => {
  534. if (m.workOrderId == id) {
  535. let modelList = []; // 模具
  536. let instanceList = []; // 投料
  537. let aridRegionList = []; // 干燥区
  538. let equipmentList = []; // 生产设备
  539. let palletList = []; // 舟皿
  540. let revolvingDiskList = []; // 周转盘
  541. let semiProductList = []; // 半成品
  542. let turnover = []; //周转车
  543. let sparePartsList = []; //备品清单
  544. selectList.forEach((f) => {
  545. if (f.rootCategoryLevelId == 4) {
  546. equipmentList = equipmentList.concat(f);
  547. }
  548. if (f.rootCategoryLevelId == 5) {
  549. modelList = modelList.concat(f);
  550. } else if (f.rootCategoryLevelId == 1) {
  551. instanceList = instanceList.concat(f);
  552. } else if (f.rootCategoryLevelId == 11) {
  553. aridRegionList = aridRegionList.concat(f);
  554. } else if (f.rootCategoryLevelId == 6) {
  555. sparePartsList = sparePartsList.concat(f);
  556. } else if (f.rootCategoryLevelId == 7) {
  557. turnover = turnover.concat(f);
  558. } else if (f.rootCategoryLevelId == 8) {
  559. palletList = palletList.concat(f);
  560. } else if (f.rootCategoryLevelId == 26) {
  561. revolvingDiskList = revolvingDiskList.concat(f);
  562. } else if (
  563. [23, 2, 9, 28].includes(Number(f.rootCategoryLevelId))
  564. ) {
  565. semiProductList = semiProductList.concat(f);
  566. }
  567. });
  568. this.$set(m, 'modelList', modelList);
  569. this.$set(m, 'sparePartsList', sparePartsList);
  570. this.$set(m, 'instanceList', instanceList);
  571. this.$set(m, 'aridRegionList', aridRegionList);
  572. this.$set(m, 'equipmentList', equipmentList);
  573. this.$set(m, 'turnover', turnover);
  574. this.$set(m, 'palletList', palletList);
  575. this.$set(m, 'revolvingDiskList', revolvingDiskList);
  576. this.$set(m, 'semiProductList', semiProductList);
  577. this.$forceUpdate();
  578. }
  579. });
  580. },
  581. checkChange() {
  582. if (this.checked) {
  583. this.executorIdList = [];
  584. this.executorIdList = this.teamUserList.map((item) => item.id);
  585. } else {
  586. this.executorIdList = [];
  587. }
  588. },
  589. getCacheFn() {
  590. let parma = {
  591. workOrderIds: this.idsList,
  592. taskId: this.taskObj.id,
  593. type: 2
  594. };
  595. feedGetCache(parma).then((res) => {
  596. if (res.length == 0) {
  597. return false;
  598. }
  599. let objList = res[0].extInfo.objList;
  600. this.List.forEach((f, index) => {
  601. objList.forEach((o) => {
  602. if (
  603. f.workOrderId == o.workOrderId &&
  604. f.currentTaskDiagram.taskId == o.taskId
  605. ) {
  606. f['instanceList'] = o.instanceList || [];
  607. f['equipmentList'] = o.equipmentList || [];
  608. f['modelList'] = o.modelList || [];
  609. f['sparePartsList'] = o.sparePartsList || [];
  610. f['aridRegionList'] = o.aridRegionList || [];
  611. f['packingList'] = o.packingList || [];
  612. f['palletList'] = o.palletList || [];
  613. f['revolvingDiskList'] = o.revolvingDiskList || [];
  614. f['semiProductList'] = o.semiProductList || [];
  615. this.$set(this.List[index], 'executorTime', o.executorTime);
  616. this.$forceUpdate();
  617. }
  618. });
  619. });
  620. });
  621. },
  622. async save(type, index) {
  623. let arr = this.List.filter((L) => L.executorTime);
  624. if (!arr.length) {
  625. return this.$message.warning('请选择投料时间');
  626. }
  627. if (this.executorIdList.length == 0) {
  628. return this.$message.error('执行人不能为空!');
  629. }
  630. const executorList = [];
  631. this.executorIdList.forEach((item) => {
  632. const data = this.teamUserList.find((it) => it.id == item);
  633. if (data) {
  634. executorList.push({
  635. userId: data.id,
  636. jobNumber: data.jobNumber,
  637. name: data.name
  638. });
  639. }
  640. });
  641. this.List = this.List.map((item) => {
  642. item.executorList = executorList;
  643. return item;
  644. });
  645. // this.List = this.List.map((item) => {
  646. // item.executorList = executorList;
  647. // return item;
  648. // });
  649. let deviceIs = false;
  650. this.List.forEach((f) => {
  651. f.instanceList.forEach((e) => {
  652. if (Object.prototype.hasOwnProperty.call(e, 'type')) {
  653. e.extInfo['type'] = e.type;
  654. }
  655. e.extInfo['isConsumable'] = e.isConsumable;
  656. });
  657. if (this.feedNeedEquipment == 1 && f.equipmentList.length == 0) {
  658. deviceIs = true;
  659. setTimeout(() => {
  660. this.$message.warning({
  661. message: '请工单编号:' + f.code + '添加设备',
  662. key: f.code // 使用当前时间作为key,确保唯一性
  663. });
  664. }, 500);
  665. }
  666. });
  667. //判断投料是否要添加设备
  668. if (deviceIs) {
  669. return;
  670. }
  671. const isCache = await this.checkCache(type);
  672. if (!isCache) {
  673. return false;
  674. }
  675. this.loading = this.$loading({
  676. lock: true,
  677. text: '加载中',
  678. background: 'rgba(0, 0, 0, 0.7)'
  679. });
  680. // this.loadingBtn = true;
  681. batchSave(this.List)
  682. .then((res) => {
  683. // this.loadingBtn = false;
  684. this.loading.close();
  685. this.$message.success('投料成功');
  686. this.getList(this.idsList);
  687. this.executorIdList = [];
  688. this.checked = false;
  689. this.teamId = '';
  690. this.$emit('feedSuccess', 'success');
  691. })
  692. .catch((e) => {
  693. this.loading.close();
  694. // this.loadingBtn = false;
  695. });
  696. },
  697. checkCache(type, index) {
  698. return new Promise((resolve) => {
  699. if (type == 1) {
  700. feedSaveCache(this.List).then((rr) => {
  701. this.$message.success('已经缓存');
  702. });
  703. resolve(false);
  704. } else if (type == 2) {
  705. resolve(true);
  706. }
  707. });
  708. },
  709. removeCacheFn(type) {
  710. this.$confirm('是否清空缓存', '缓存')
  711. .then(() => {
  712. let parma = {
  713. workOrderIds: type == 'all' ? this.idsList : [type],
  714. taskId: this.taskObj.id,
  715. type: 2
  716. };
  717. removeCache(parma).then((res) => {
  718. this.getList(this.idsList);
  719. });
  720. })
  721. .catch(() => {});
  722. }
  723. }
  724. };
  725. </script>
  726. <style scoped lang="scss">
  727. .top_fixed {
  728. width: 100%;
  729. height: 40px;
  730. background: #fff;
  731. display: flex;
  732. align-items: center;
  733. justify-content: flex-end;
  734. }
  735. .feed_box {
  736. // margin-top: 6px;
  737. width: 100%;
  738. height: calc(100vh - 70px - 50px - 80px - 60px);
  739. overflow-y: scroll;
  740. overflow-x: hidden;
  741. }
  742. .card_box {
  743. background: #fff;
  744. padding: 8px;
  745. border-radius: 2px;
  746. }
  747. .checkboxWrapper {
  748. padding: 8px 20px;
  749. border-bottom: 1px solid #ccc;
  750. }
  751. ::v-deep .el-select__tags {
  752. flex-wrap: nowrap;
  753. overflow: auto;
  754. }
  755. /* 输入框最大宽度*/
  756. ::v-deep .el-select__tags-text {
  757. max-width: 90px;
  758. }
  759. /* 底部滚动条的高度*/
  760. ::v-deep .el-select__tags::-webkit-scrollbar {
  761. height: 2px !important;
  762. }
  763. </style>
  764. <style lang="scss">
  765. .mt6 {
  766. margin-top: 6px;
  767. }
  768. .title_box {
  769. padding: 5px 0;
  770. .name {
  771. font-size: 14px;
  772. font-style: normal;
  773. font-weight: 400;
  774. color: #157a2c;
  775. padding-left: 5px;
  776. position: relative;
  777. &:before {
  778. position: absolute;
  779. content: '';
  780. left: 0px;
  781. top: 0px;
  782. bottom: 0px;
  783. width: 2px;
  784. height: 14px;
  785. background: #157a2c;
  786. margin: auto;
  787. }
  788. }
  789. }
  790. .material {
  791. margin-top: 6px;
  792. .content_table {
  793. width: 100%;
  794. border: 1px solid #e3e5e5;
  795. position: relative;
  796. .item {
  797. display: flex;
  798. border-bottom: 1px solid #e3e5e5;
  799. .lable {
  800. width: 72px;
  801. text-align: center;
  802. background-color: #f7f9fa;
  803. font-size: 12px;
  804. border-right: 1px solid #e3e5e5;
  805. flex-shrink: 0;
  806. }
  807. .lable80 {
  808. width: 80px !important;
  809. font-size: 12px;
  810. }
  811. .lable90 {
  812. width: 90px !important;
  813. }
  814. .lable100 {
  815. width: 100px !important;
  816. }
  817. .ww60 {
  818. width: 60px;
  819. }
  820. .content {
  821. width: 250px;
  822. min-height: 32px;
  823. font-size: 14px;
  824. line-height: 14px;
  825. font-style: normal;
  826. font-weight: 400;
  827. padding: 9px 4px;
  828. box-sizing: border-box;
  829. word-wrap: break-word;
  830. flex-grow: 1 !important;
  831. .unit {
  832. padding: 0 2px;
  833. font-size: 12px;
  834. color: #404446;
  835. }
  836. }
  837. .content_num {
  838. display: flex;
  839. align-items: center;
  840. padding: 2px;
  841. --input-background-color: #f0f8f2;
  842. }
  843. .pd2 {
  844. padding: 2px 4px;
  845. }
  846. &:last-child {
  847. border-bottom: none;
  848. }
  849. }
  850. .ww55 {
  851. width: 55%;
  852. }
  853. .ww50 {
  854. width: 50%;
  855. }
  856. .ww45 {
  857. width: 45%;
  858. }
  859. .ww40 {
  860. width: 40%;
  861. }
  862. .ww30 {
  863. width: 30%;
  864. }
  865. .ww33 {
  866. width: 33.33%;
  867. }
  868. .ww20 {
  869. width: 20%;
  870. }
  871. .del_box {
  872. position: absolute;
  873. right: 2px;
  874. top: 2px;
  875. }
  876. .sort_index {
  877. position: absolute;
  878. left: 2px;
  879. top: 2px;
  880. width: 14px;
  881. height: 14px;
  882. line-height: 14px;
  883. text-align: center;
  884. color: #fff;
  885. font-size: 12px;
  886. border-radius: 50%;
  887. background: rgb(21, 122, 44);
  888. }
  889. }
  890. }
  891. </style>