outsourceList.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973
  1. <template>
  2. <!-- 委外下一步 -->
  3. <div class="card">
  4. <div class="c_header_title">
  5. <div class="c_title">委外记录</div>
  6. </div>
  7. <div class="card_box">
  8. <el-descriptions>
  9. <el-descriptions-item label="委外名称">{{
  10. outObj.name
  11. }}</el-descriptions-item>
  12. <el-descriptions-item label="委外类型">{{
  13. outObj.type == 4 ? '带料委外' : '无料委外'
  14. }}</el-descriptions-item>
  15. <!-- <el-descriptions-item label="直接入库">{{ outObj.isInWarehouse == 1 ? '是' : '否' }}</el-descriptions-item> -->
  16. <el-descriptions-item label="直接入库">{{ '是' }}</el-descriptions-item>
  17. </el-descriptions>
  18. </div>
  19. <el-tabs v-model="activeName">
  20. <el-tab-pane label="物品清单" name="0">
  21. <div class="materialList">
  22. <div class="u-reset">
  23. <el-button
  24. type="primary"
  25. size="small"
  26. class="u-reset-button"
  27. @click="openPicking(2, 'goods')"
  28. v-if="clientEnvironmentId == 3"
  29. >
  30. 添加
  31. </el-button>
  32. </div>
  33. <!-- <div class="u-reset" style="display: flex;" v-if="clientEnvironmentId != 2">
  34. <el-checkbox color="#fff" v-model="checkedAll" :checked="seletedAll" @change="_seletedAll">全选
  35. </el-checkbox>
  36. <div class="gxList">勾选:<span style="color: #157A2C">{{ checkListLen || 0 }}个</span></div>
  37. </div>
  38. <div v-for="(item, index) in pickOutInList" :key="index">
  39. <div class="listBox rx-bs">
  40. <div class="listBox-sel">
  41. <el-checkbox v-model="item.checked" color="#fff"
  42. @change="e => selectVal(e, item, index)"
  43. v-if='(item.rootCategoryLevelId != 11 || (item.rootCategoryLevelId == 11 && item.status != 1)) && clientEnvironmentId != 2'
  44. >
  45. </el-checkbox>
  46. </div>
  47. <div class="listBox-con">
  48. <div class="listBox-top rx-bc">
  49. <div> {{ item.name }}</div>
  50. <div class="code">
  51. {{ item.rootCategoryLevelId == 4 ? item.codeNumber : item.code }}
  52. </div>
  53. </div>
  54. <div class="listBox-bottom rx">
  55. <div v-for="(itm, index) in tableH(item.rootCategoryLevelId)" :key="index"
  56. class="items" v-if="!itm.formatter">
  57. <span>{{ itm.label }}</span>{{ item[itm.prop] }}
  58. </div>
  59. <div class="items"
  60. v-if='(item.rootCategoryLevelId == 1 && item.isConsumable == 1) && item.rootCategoryLevelId != 11 && item.rootCategoryLevelId != 4'>
  61. <span>可用库存:</span>{{ item.availableCountBase }} {{ item.unit }}
  62. </div>
  63. <div class="items"
  64. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0)'>
  65. <span>刻码:</span>{{ item.extInfo.engrave }}
  66. </div>
  67. <div class="items"
  68. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0)'>
  69. <span>物料代号:</span>{{ item.extInfo.materielCode }}
  70. </div>
  71. <div class="items"
  72. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0)'>
  73. <span>客户代号:</span>{{ item.extInfo.clientCode }}
  74. </div>
  75. <div class="items" style="width: 15%;"
  76. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 0)'>
  77. <span>重量:</span>{{ item.extInfo.newWeight }} {{ item.extInfo.weightUnit }}
  78. </div>
  79. <div class="items" style="width: 15%;"
  80. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 1)'>
  81. <span>数量:</span>{{ item.feedQuantity }}
  82. </div>
  83. <div class="items" style="width: 15%;"
  84. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 1)'>
  85. <span>重量:</span>{{ item.weight || 0 }} {{ item.weightUnit }}
  86. </div>
  87. <div class="items"
  88. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 1)'>
  89. <span>规格:</span> {{ item.specification }}
  90. </div>
  91. <div class="items"
  92. v-if='([1, 2, 9, 23].includes(Number(item.rootCategoryLevelId)) && item.isConsumable == 1)'>
  93. <span>型号:</span> {{ item.modelType }}
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div> -->
  99. <el-table
  100. ref="pickOutRef"
  101. class="table_content"
  102. :max-height="600"
  103. :data="pickOutInList"
  104. tooltip-effect="dark"
  105. style="width: 100%; margin-top: 10px"
  106. stripe
  107. border
  108. @selection-change="selectionPickOut"
  109. >
  110. <el-table-column align="center" type="selection" width="55">
  111. </el-table-column>
  112. <el-table-column label="序号" type="index" width="55">
  113. <template slot-scope="{ row, $index }">
  114. {{ $index + 1 }}
  115. </template>
  116. </el-table-column>
  117. <el-table-column
  118. label="编码"
  119. type="code"
  120. minWidth="110"
  121. show-overflow-tooltip
  122. >
  123. <template slot-scope="{ row, $index }">
  124. {{ row.categoryCode }}
  125. </template>
  126. </el-table-column>
  127. <el-table-column
  128. label="名称"
  129. type="name"
  130. minWidth="110"
  131. show-overflow-tooltip
  132. >
  133. <template slot-scope="{ row, $index }">
  134. {{ row.name }}
  135. <!-- ({{
  136. row.rootCategoryLevelId == 2
  137. ? '在制品'
  138. : row.rootCategoryLevelId == 23
  139. ? '半成品'
  140. : row.rootCategoryLevelId == 9
  141. ? '产品'
  142. : item.rootCategoryLevelId == 28
  143. ? '废品'
  144. : ''
  145. }}) -->
  146. </template>
  147. </el-table-column>
  148. <el-table-column
  149. label="型号"
  150. type="modelType"
  151. show-overflow-tooltip
  152. >
  153. <template slot-scope="{ row, $index }">
  154. {{ row.modelType }}
  155. </template>
  156. </el-table-column>
  157. <el-table-column
  158. label="规格"
  159. type="specification"
  160. show-overflow-tooltip
  161. >
  162. <template slot-scope="{ row, $index }">
  163. {{ row.specification }}
  164. </template>
  165. </el-table-column>
  166. <el-table-column label="牌号" type="brandNum" show-overflow-tooltip>
  167. <template slot-scope="{ row, $index }">
  168. {{ row.brandNum }}
  169. </template>
  170. </el-table-column>
  171. <el-table-column
  172. label="数量"
  173. type="feedQuantity"
  174. show-overflow-tooltip
  175. >
  176. <template slot-scope="{ row, $index }">
  177. <el-input
  178. v-model="row.feedQuantity"
  179. v-if="row.isSelection == '1'"
  180. @input="inputNum(row, $index)"
  181. ></el-input>
  182. <span v-else> {{ row.feedQuantity }}</span>
  183. </template>
  184. <!-- <template slot-scope="{ row, $index }" v-else>
  185. {{ row.feedQuantity }}
  186. </template> -->
  187. </el-table-column>
  188. <el-table-column
  189. label="重量"
  190. type="weightUnit"
  191. width="120"
  192. show-overflow-tooltip
  193. >
  194. <template slot-scope="{ row, $index }">
  195. {{ row.newWeight || 0 }} {{ row.weightUnit }}
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="刻码" type="engrave" show-overflow-tooltip>
  199. <template slot-scope="{ row, $index }">
  200. {{ row.extInfo.engrave }}
  201. </template>
  202. </el-table-column>
  203. <el-table-column
  204. label="物料代号"
  205. type="materielCode"
  206. show-overflow-tooltip
  207. >
  208. <template slot-scope="{ row, $index }">
  209. {{ row.extInfo.materielCode }}
  210. </template>
  211. </el-table-column>
  212. <el-table-column
  213. label="客户代号"
  214. type="clientCode"
  215. show-overflow-tooltip
  216. >
  217. <template slot-scope="{ row, $index }">
  218. {{ row.extInfo.clientCode }}
  219. </template>
  220. </el-table-column>
  221. <el-table-column label="操作" show-overflow-tooltip fixed="right">
  222. <template slot-scope="{ row, $index }">
  223. <el-button type="text" @click="deleteData(row, $index)"
  224. >删除</el-button
  225. >
  226. </template>
  227. </el-table-column>
  228. </el-table>
  229. </div>
  230. </el-tab-pane>
  231. <el-tab-pane label="带料清单" name="1">
  232. <div class="materialList">
  233. <div class="u-reset">
  234. <el-button
  235. type="primary"
  236. size="small"
  237. class="u-reset-button"
  238. @click="openPicking(2, 'belting')"
  239. >
  240. 添加
  241. </el-button>
  242. </div>
  243. <div v-for="(item, index) in bomMaterialList" :key="index">
  244. <label class="listBox rx-bs">
  245. <div class="listBox-con">
  246. <div class="listBox-bottom rx">
  247. <div class="items"> <span>序号</span>{{ index + 1 }} </div>
  248. <div class="items" :title="item.name">
  249. <span>名称</span>{{ item.name }}
  250. </div>
  251. <div class="items" :title="item.code">
  252. <span>编码</span>{{ item.code }}
  253. </div>
  254. <div v-if="clientEnvironmentId == 3">
  255. <el-button type="text" @click="convertList(item, index)"
  256. >转物品清单</el-button
  257. >
  258. <el-button
  259. type="text"
  260. style="color: red"
  261. @click="deleteBomMaterial(item, index)"
  262. >删除</el-button
  263. >
  264. </div>
  265. <div
  266. v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
  267. :key="index"
  268. class="items"
  269. v-if="!itm.formatter"
  270. >
  271. <span>{{ itm.label }}</span
  272. >{{ item[itm.prop] }}
  273. </div>
  274. <div
  275. class="items"
  276. v-if="item.isDemandQuantity && clientEnvironmentId != 2"
  277. style="width: 15%"
  278. >
  279. <span>数量</span
  280. >{{
  281. checkListLen == 0
  282. ? item.demandQuantity
  283. : item.count * (checkListLen || 1)
  284. }}
  285. </div>
  286. <div
  287. class="items content_num"
  288. v-if="!item.isDemandQuantity && clientEnvironmentId != 2"
  289. style="width: 15%"
  290. >
  291. <span>数量</span>
  292. <input
  293. style="width: 90% !important"
  294. v-model="item.demandQuantity"
  295. />
  296. </div>
  297. <div
  298. class="items"
  299. v-if="item.isDemandQuantity && clientEnvironmentId == 2"
  300. style="width: 15%"
  301. >
  302. <span>数量</span
  303. >{{ item.count * (outObj.formedNumLast || 1) }}
  304. </div>
  305. <div
  306. class="items content_num"
  307. v-if="!item.isDemandQuantity && clientEnvironmentId == 2"
  308. style="width: 15%"
  309. >
  310. <span>数量</span>
  311. <input
  312. style="width: 90% !important"
  313. v-model="item.demandQuantity"
  314. />
  315. </div>
  316. </div>
  317. </div>
  318. </label>
  319. </div>
  320. </div>
  321. </el-tab-pane>
  322. <el-tab-pane label="产出清单" name="2">
  323. <div class="materialList">
  324. <div class="u-reset">
  325. <el-button
  326. type="primary"
  327. size="small"
  328. class="u-reset-button"
  329. @click="openPicking(3, 'output')"
  330. >
  331. 添加
  332. </el-button>
  333. </div>
  334. <div v-for="(item, index) in standardOutputList" :key="index">
  335. <label class="listBox rx-bs">
  336. <div class="listBox-con">
  337. <div class="listBox-bottom rx">
  338. <div class="items" style="width: 15%">
  339. <span>序号</span>{{ index + 1 }}
  340. </div>
  341. <div class="items"> <span>名称</span>{{ item.name }} </div>
  342. <div class="items"> <span>编码</span>{{ item.code }} </div>
  343. <div
  344. v-for="(itm, index) in tableH(item.rootCategoryLevelId)"
  345. :key="index"
  346. class="items"
  347. v-if="!itm.formatter"
  348. >
  349. <span>{{ itm.label }}</span
  350. >{{ item[itm.prop] }}
  351. </div>
  352. <div class="items content_num">
  353. <span>数量</span>
  354. <input
  355. style="width: 30% !important"
  356. v-model="item.demandQuantity"
  357. />
  358. </div>
  359. <div>
  360. <el-button
  361. type="text"
  362. @click="deleteOutput(index)"
  363. style="color: red"
  364. >删除</el-button
  365. >
  366. </div>
  367. </div>
  368. </div>
  369. </label>
  370. </div>
  371. </div>
  372. </el-tab-pane>
  373. </el-tabs>
  374. <div class="operate_box">
  375. <el-button
  376. size="small"
  377. class="u-reset-button"
  378. @click="close"
  379. style="margin-left: 10px"
  380. >
  381. 取消
  382. </el-button>
  383. <el-button
  384. type="primary"
  385. size="small"
  386. class="u-reset-button"
  387. @click="handOK(0)"
  388. >
  389. 确认
  390. </el-button>
  391. <el-button
  392. type="primary"
  393. size="small"
  394. class="u-reset-button"
  395. @click="handOK(1)"
  396. >
  397. 提交
  398. </el-button>
  399. </div>
  400. <pickingList
  401. ref="pickingListRef"
  402. isType="weiwai"
  403. @allSelection="allSelection"
  404. ></pickingList>
  405. </div>
  406. </template>
  407. <script>
  408. import {
  409. // checkOutsourceMaterial,
  410. applyoutsourceSave
  411. // getWarehouseList
  412. } from '@/api/produce/index.js';
  413. import { tableHeader } from '@/utils/dict/common.js';
  414. // import {
  415. // EventBus
  416. // } from '@/utils/eventBus.js'
  417. import pickingList from './pickingList.vue';
  418. export default {
  419. components: { pickingList },
  420. data() {
  421. return {
  422. checkListLen: 0,
  423. checkedAll: true,
  424. checkList: [],
  425. mode: 'center',
  426. show: false,
  427. topHight: 20 || 20,
  428. activeName: '0',
  429. outObj: {
  430. name: '111',
  431. type: 4,
  432. isInWarehouse: 1
  433. },
  434. tabList: [
  435. {
  436. name: '物品清单'
  437. },
  438. {
  439. name: '带料清单'
  440. },
  441. {
  442. name: '产出清单'
  443. }
  444. ],
  445. actTab: '物品清单',
  446. datapickOutInList: [],
  447. bomMaterialList: [],
  448. pickOutInList: [],
  449. materialList: [],
  450. standardOutputList: [],
  451. isFirstTask: null,
  452. isLoading: null,
  453. // clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo")
  454. // .clientEnvironmentId, // *1 主环境-601环境 2 soll-索尔环境 3 tg-碳谷环境
  455. seletedAll: false, //全选状态
  456. checkListLen: 0,
  457. warehouseList: [],
  458. pickOutInListSelect: [],
  459. selectionIds: []
  460. };
  461. },
  462. created() {
  463. // EventBus.$on('outEvent', this.handleEvent);
  464. // this.outsourceMaterialFn()
  465. },
  466. computed: {
  467. clientEnvironmentId() {
  468. return this.$store.state.user.info.clientEnvironmentId;
  469. }
  470. },
  471. props: {
  472. outsourceFormVal: {
  473. type: Object,
  474. default: () => {}
  475. }
  476. },
  477. watch: {
  478. outsourceFormVal: {
  479. handler(val) {
  480. console.log(val, 'outsourceFormVal');
  481. this.outsourceMaterialFn(val);
  482. this.outObj = val;
  483. },
  484. deep: true,
  485. immediate: true
  486. }
  487. },
  488. methods: {
  489. // open(obj) {
  490. // // this.outObj = obj;
  491. // this.actTab = '物品清单';
  492. // // this.outsourceMaterialFn()
  493. // // this.getWarehouseFn()
  494. // },
  495. allSelection(e, item, type) {
  496. if (e == 2) {
  497. if (type == 'goods') {
  498. item.map((it) => {
  499. it.isSelection = '1';
  500. it.categoryCode = it.code;
  501. it.feedQuantity = 1;
  502. it.categoryId = it.id;
  503. it.newWeight = it.weight;
  504. this.pickOutInList.push(this.deepCopy(it));
  505. });
  506. this.selectionData();
  507. } else {
  508. if (item.length) {
  509. item.map((v) => {
  510. this.bomMaterialList.push(v);
  511. });
  512. }
  513. }
  514. } else if (e == 3) {
  515. if (item.length) {
  516. this.standardOutputList = item;
  517. }
  518. }
  519. },
  520. // selectionData(ids) {
  521. // this.$nextTick(() => {
  522. // this.tableData.forEach((row) => {
  523. // if (ids.includes(row.id)) {
  524. // this.$refs.table.toggleRowSelection(row, true);
  525. // }
  526. // });
  527. // });
  528. // },
  529. deepCopy(obj, hash = new WeakMap()) {
  530. if (obj === null) return null;
  531. if (obj instanceof Date) return new Date(obj);
  532. if (obj instanceof RegExp) return new RegExp(obj);
  533. if (typeof obj !== 'object' && typeof obj !== 'function') return obj;
  534. if (hash.has(obj)) return hash.get(obj);
  535. const result = Array.isArray(obj) ? [] : {};
  536. hash.set(obj, result);
  537. return Object.keys(obj).reduce((acc, key) => {
  538. acc[key] = this.deepCopy(obj[key], hash);
  539. return acc;
  540. }, result);
  541. },
  542. openPicking(id, type) {
  543. this.$refs.pickingListRef.open(id, type);
  544. },
  545. outsourceMaterialFn(res) {
  546. let _arr = [];
  547. _arr = [...res.pickOutInList, ...res.materialList];
  548. this.pickOutInList = _arr.reduce((acc, item) => {
  549. const existingItem = acc.find((existing) => existing.id === item.id);
  550. if (!existingItem) {
  551. item.isSelection = '2';
  552. acc.push(item);
  553. }
  554. return acc;
  555. }, []);
  556. this.bomMaterialList = res.bomMaterialList.map((m) => {
  557. return {
  558. ...m,
  559. isDemandQuantity: true
  560. };
  561. });
  562. this.pickOutInList.map((v) => {
  563. v.checked = true;
  564. });
  565. this.checkListLen = this.pickOutInList.length;
  566. this.standardOutputList = res.standardOutputList;
  567. // let param = {
  568. // taskId: this.outObj.taskId,
  569. // taskIds: this.outObj.taskIds,
  570. // workOrderId: this.outObj.workOrderId
  571. // }
  572. // checkOutsourceMaterial(param).then(res => {
  573. // let _arr = []
  574. // _arr = [...res.pickOutInList, ...res.materialList]
  575. // this.pickOutInList = _arr.reduce((acc, item) => {
  576. // const existingItem = acc.find(existing => existing.id === item.id);
  577. // if (!existingItem) {
  578. // acc.push(item);
  579. // }
  580. // return acc;
  581. // }, []);
  582. // this.bomMaterialList = res.bomMaterialList.map((m) => {
  583. // return {
  584. // ...m,
  585. // isDemandQuantity: true
  586. // }
  587. // })
  588. // this.standardOutputList = res.standardOutputList
  589. // this.$forceUpdate()
  590. // })
  591. this.$nextTick(() => {
  592. this.$refs.pickOutRef.toggleAllSelection();
  593. });
  594. },
  595. inputNum(item, index) {
  596. if (item.feedQuantity) {
  597. const totalWeight = Number(item.feedQuantity) * Number(item.weight);
  598. this.$set(this.pickOutInList[index], 'newWeight', totalWeight);
  599. this.$forceUpdate();
  600. } else {
  601. this.$set(this.pickOutInList[index], 'newWeight', item.weight);
  602. this.$forceUpdate();
  603. }
  604. },
  605. // 仓库
  606. getWarehouseFn() {
  607. getWarehouseList().then((res) => {
  608. this.warehouseList = res;
  609. });
  610. },
  611. deleteData(item, index) {
  612. this.pickOutInList.splice(index, 1);
  613. },
  614. handTab(item) {
  615. this.actTab = item.name;
  616. },
  617. //关闭弹窗
  618. close() {
  619. this.$emit('closeForm');
  620. },
  621. handleEvent({ message }) {
  622. if (message.pid == 3) {
  623. this.standardOutputList = message.memoList;
  624. } else {
  625. if (message.pid == 2) {
  626. this.bomMaterialList = message.memoList;
  627. }
  628. }
  629. },
  630. tableH(type) {
  631. return tableHeader(type);
  632. },
  633. //勾选
  634. selectVal(e, val, index) {
  635. this.$forceUpdate();
  636. this.pickOutInList[index] = val;
  637. this.$set(this, 'pickOutInList', this.pickOutInList);
  638. this.checkListLen = this.pickOutInList.filter(
  639. (f) => f.checked == true
  640. ).length;
  641. },
  642. _seletedAll() {
  643. console.log(this.seletedAll, this.pickOutInList, 'this.seletedAll');
  644. // this.seletedAll true 是全选
  645. if (!this.seletedAll) {
  646. // 非全选
  647. this.seletedAll = true;
  648. this.checkListLen = 0;
  649. this.pickOutInList.map((item) => {
  650. item.checked = false;
  651. });
  652. this.$set(this, 'pickOutInList', this.pickOutInList);
  653. } else {
  654. this.seletedAll = false;
  655. this.pickOutInList.map((item) => {
  656. item.checked = true;
  657. });
  658. this.$set(this, 'pickOutInList', this.pickOutInList);
  659. }
  660. this.checkListLen = this.pickOutInList.filter(
  661. (f) => f.checked == true
  662. ).length;
  663. },
  664. selectionPickOut(val) {
  665. this.pickOutInListSelect = val;
  666. },
  667. deleteOutput(index) {
  668. this.standardOutputList.splice(index, 1);
  669. },
  670. deleteBomMaterial(item, index) {
  671. this.bomMaterialList.splice(index, 1);
  672. },
  673. convertList(item, index) {
  674. if (item.demandQuantity) {
  675. item.categoryCode = item.code;
  676. item.feedQuantity = item.demandQuantity;
  677. item.isSelection = '1';
  678. item.categoryId = item.id;
  679. item.newWeight = item.weight;
  680. this.pickOutInList.push(item);
  681. this.selectionData();
  682. this.bomMaterialList.splice(index, 1);
  683. this.$forceUpdate();
  684. } else {
  685. return this.$message({
  686. message: '请输入转换数量',
  687. type: 'warning'
  688. });
  689. }
  690. },
  691. selectionData() {
  692. this.$nextTick(() => {
  693. this.$refs.pickOutRef.toggleAllSelection();
  694. });
  695. },
  696. scrolltolower() {},
  697. addPicking(id) {
  698. const storageKey = Date.now() + '';
  699. let arr = null;
  700. if (id == 3) {
  701. arr = [
  702. {
  703. standardOutputList: this.standardOutputList
  704. }
  705. ];
  706. } else {
  707. arr = [
  708. {
  709. bomMaterialList: this.bomMaterialList
  710. }
  711. ];
  712. }
  713. // uni.setStorageSync(storageKey, arr);
  714. // uni.navigateTo({
  715. // url: `/pages/pda/workOrder/search/index?id=${id}&storageKey=${storageKey}&isType=zdy&taskId=${this.outObj.taskId}&classIds=[1,23,9]`
  716. // })
  717. },
  718. handOK(isRelease) {
  719. // isRelease? 0 提交 2提交并发布
  720. if (this.checkListLen > 0 && !this.outObj.warehouseId) {
  721. return this.$message({
  722. message: '请选择仓库',
  723. type: 'warning'
  724. });
  725. }
  726. // 环境判断
  727. let _pickOutInList = [];
  728. if (this.clientEnvironmentId == 2) {
  729. _pickOutInList = this.pickOutInList;
  730. } else {
  731. // _pickOutInList = this.pickOutInList.filter(f => f.checked == true)
  732. _pickOutInList = this.pickOutInListSelect;
  733. }
  734. for (let i = 0; i < _pickOutInList.length; i++) {
  735. if (
  736. !_pickOutInList[i].feedQuantity &&
  737. _pickOutInList[i].isSelection == '1'
  738. ) {
  739. this.$message.warning('物品数量不能为空');
  740. return;
  741. }
  742. }
  743. let param = {
  744. ...this.outObj,
  745. isRelease: isRelease,
  746. bomMaterialList: this.bomMaterialList,
  747. pickOutInList: _pickOutInList,
  748. materialList: this.materialList,
  749. standardOutputList: this.standardOutputList
  750. };
  751. this.isLoading = this.$loading({
  752. lock: true,
  753. text: '加载中',
  754. background: 'rgba(0, 0, 0, 0.7)'
  755. });
  756. applyoutsourceSave(param)
  757. .then((res) => {
  758. this.$emit('outScucc');
  759. this.isLoading.close();
  760. return this.$message({
  761. message: '提交成功',
  762. type: 'scuccess'
  763. });
  764. this.checkListLen = 0;
  765. })
  766. .catch(() => {
  767. this.isLoading.close();
  768. });
  769. }
  770. }
  771. };
  772. </script>
  773. <style lang="scss" scoped>
  774. .c_header_title {
  775. display: flex;
  776. align-items: center;
  777. margin-bottom: 0;
  778. height: 58px;
  779. margin-bottom: 10px;
  780. box-sizing: border-box;
  781. border-bottom: 1px solid var(--border-color-lighter);
  782. }
  783. .operate_box {
  784. display: flex;
  785. flex-direction: row-reverse;
  786. padding: 15px;
  787. box-shadow: 0px -2px 15px 0px rgba(0, 0, 0, 0.1);
  788. }
  789. .c_title {
  790. color: #157a2c;
  791. font-size: 16px;
  792. font-weight: bold;
  793. }
  794. .materialList {
  795. height: 50vh;
  796. overflow: auto;
  797. }
  798. .card {
  799. width: 100%;
  800. padding: 0 20px;
  801. }
  802. .u-reset {
  803. width: 100%;
  804. padding: 5px;
  805. text-align: right;
  806. }
  807. .listBox-con {
  808. width: 100%;
  809. }
  810. .gxList {
  811. margin-left: 10px;
  812. }
  813. .listBox-sel {
  814. margin: 0 10px;
  815. }
  816. .listBox-top {
  817. display: flex;
  818. padding: 15px;
  819. font-size: 14px;
  820. font-weight: bold;
  821. border-bottom: 1px solid #ddd;
  822. }
  823. .listBox-bottom {
  824. display: flex;
  825. width: 100%;
  826. flex-wrap: wrap;
  827. margin-bottom: 0;
  828. }
  829. .listBox {
  830. display: flex;
  831. align-items: center;
  832. border: 1px solid #ddd;
  833. margin-bottom: 20px;
  834. }
  835. .items {
  836. font-size: 12px;
  837. width: 25%;
  838. display: flex;
  839. align-items: center;
  840. white-space: nowrap;
  841. overflow: hidden;
  842. text-overflow: ellipsis;
  843. // border: 1px solid #ddd;
  844. // border-bottom: 1px solid #ddd;
  845. // border-right: 0;
  846. span {
  847. display: block;
  848. padding: 10px;
  849. margin-right: 5px;
  850. color: #157a2c;
  851. background-color: #f7f9fa;
  852. }
  853. }
  854. ::v-deep .el-input--medium .el-input__inner {
  855. height: 26px;
  856. line-height: 26px;
  857. }
  858. </style>