details.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. <template>
  2. <div>
  3. <!-- <el-card shadow="never" v-loading="loading"> -->
  4. <!-- <search @search="reload" ref="searchRef"> </search> -->
  5. <div>
  6. <el-tabs type="card" v-model="activeName" @tab-click="handleClick">
  7. <el-tab-pane label="委外" name="1"></el-tab-pane>
  8. <el-tab-pane label="请托" name="2"></el-tab-pane>
  9. </el-tabs>
  10. </div>
  11. <!-- 数据表格 -->
  12. <ele-pro-table
  13. ref="table"
  14. :columns="columns"
  15. :datasource="dataList"
  16. cache-key="workOrderTable"
  17. max-height="61vh"
  18. :need-page="false"
  19. v-if="activeName == '1'"
  20. @refresh="refresh"
  21. >
  22. <template v-slot:toolbar>
  23. <div class="rx-sc">
  24. <div class="c_title">委外记录 </div>
  25. <el-button
  26. type="primary"
  27. size="mini"
  28. style="margin: 0 5px"
  29. @click="handleAdd"
  30. >新增</el-button
  31. >
  32. </div>
  33. </template>
  34. <!-- <template v-slot:code="{ row }">
  35. <el-link
  36. type="primary"
  37. :underline="false"
  38. @click="handleDetails(row)"
  39. >{{ row.code }}</el-link
  40. >
  41. </template> -->
  42. <template v-slot:totalWeight="{ row }">
  43. <div v-if="row.totalWeight">{{ row.totalWeight }}</div>
  44. <div v-else>无</div>
  45. </template>
  46. <template v-slot:requireDeliveryTime="{ row }">
  47. <span v-if="row.deliveryMethod == 1">{{
  48. row.requireDeliveryTime
  49. }}</span>
  50. <el-link
  51. v-if="row.deliveryMethod == 2"
  52. type="primary"
  53. :underline="false"
  54. @click.native="handleMethod(row)"
  55. >分批时间</el-link
  56. >
  57. </template>
  58. <template v-slot:isLast="{ row }">
  59. <el-tag v-if="row.isLast == 0">否</el-tag>
  60. <el-tag v-if="row.isLast == 1" type="success">是</el-tag>
  61. </template>
  62. <template v-slot:type="{ row }">
  63. <div v-if="row.type == 1">采购委外</div>
  64. <div v-if="row.type == 2">直接发货委外</div>
  65. <div v-if="row.type == 3">无采购委外</div>
  66. <div v-if="row.type == 4">带料委外</div>
  67. <div v-if="row.type == 5">不带料委外</div>
  68. </template>
  69. <template v-slot:status="{ row }">
  70. <el-tag>{{
  71. row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
  72. }}</el-tag>
  73. </template>
  74. <template v-slot:approvalStatus="{ row }">
  75. <el-tag v-if="row.approvalStatus == 0">未提交</el-tag>
  76. <el-tag v-if="row.approvalStatus == 1" type="warning">审核中</el-tag>
  77. <el-tag v-if="row.approvalStatus == 2" type="success">审核通过</el-tag>
  78. <el-tag v-if="row.approvalStatus == 3" type="danger">审核不通过</el-tag>
  79. </template>
  80. <!-- <template v-slot:status="{ row }">
  81. <el-tag>{{
  82. row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
  83. }}</el-tag>
  84. </template> -->
  85. <template v-slot:outsourceScene="{ row }">
  86. <span>{{ row.outsourceScene | outsourceSceneText }}</span>
  87. </template>
  88. <template v-slot:technicalDrawings="{ row }">
  89. <div v-if="row.technicalDrawings && row.technicalDrawings?.length">
  90. <el-link
  91. v-for="link in row.technicalDrawings"
  92. :key="link.id"
  93. type="primary"
  94. :underline="false"
  95. @click="downloadFile(link)"
  96. >
  97. {{ link.name }}</el-link
  98. >
  99. </div>
  100. </template>
  101. <template v-slot:files="{ row }">
  102. <div v-if="row.files && row.files?.length">
  103. <el-link
  104. v-for="link in row.files"
  105. :key="link.id"
  106. type="primary"
  107. :underline="false"
  108. @click="downloadFile(link)"
  109. >
  110. {{ link.name }}</el-link
  111. >
  112. </div>
  113. </template>
  114. <template v-slot:action="{ row }">
  115. <el-link type="primary" :underline="false" @click="handleDetails(row)">
  116. 详情
  117. </el-link>
  118. <!-- <el-link
  119. type="primary"
  120. v-if="row.status == 1"
  121. :underline="false"
  122. @click="handleFlow(row)"
  123. >
  124. 流程
  125. </el-link> -->
  126. <!--
  127. <el-link
  128. type="primary"
  129. v-if="row.status != 1"
  130. :underline="false"
  131. @click="handleRelease(row)"
  132. >
  133. 提交
  134. </el-link> -->
  135. </template>
  136. </ele-pro-table>
  137. <!-- </el-card> -->
  138. <ele-pro-table
  139. ref="tableTwo"
  140. :columns="colunms1"
  141. :datasource="pleaseData"
  142. cache-key="workOrderTable"
  143. max-height="61vh"
  144. :need-page="false"
  145. v-if="activeName == '2'"
  146. @refresh="refresh"
  147. >
  148. <template v-slot:toolbar>
  149. <div class="rx-sc">
  150. <div class="c_title">请托记录 </div>
  151. <el-button
  152. type="primary"
  153. size="mini"
  154. style="margin: 0 5px"
  155. @click="handleAdd"
  156. >新增</el-button
  157. >
  158. </div>
  159. </template>
  160. <template v-slot:type="{ row }">
  161. <span> {{ getDictValue('请托类型', row.type + '') }}</span>
  162. </template>
  163. <template v-slot:totalCount="{ row }">
  164. <span> {{ row.totalCount }}{{ row.measuringUnit }}</span>
  165. </template>
  166. <template v-slot:status="{ row }">
  167. <el-tag>{{
  168. row.status == 0 ? '未提交' : row.status == 1 ? '已提交' : '已发布'
  169. }}</el-tag>
  170. </template>
  171. <template v-slot:sendStatus="{ row }">
  172. <el-tag v-if="row.sendStatus == 0 || !row.sendStatus">{{
  173. '未发货'
  174. }}</el-tag>
  175. <el-tag v-else-if="row.sendStatus == 1" type="success">{{
  176. '已发货'
  177. }}</el-tag>
  178. <el-tag v-else-if="row.sendStatus == 2" type="success">{{
  179. '已收货'
  180. }}</el-tag>
  181. <el-tag v-else-if="row.sendStatus == 3" type="success">{{
  182. '受托已发'
  183. }}</el-tag>
  184. <el-tag v-else-if="row.sendStatus == 4" type="success">{{
  185. '请托已收'
  186. }}</el-tag>
  187. <el-tag v-else-if="row.sendStatus == 7" type="success">{{
  188. '部分发货'
  189. }}</el-tag>
  190. <el-tag v-else-if="row.sendStatus == 8" type="success">{{
  191. '部分收货'
  192. }}</el-tag>
  193. <el-tag v-else-if="row.sendStatus == 9" type="success">{{
  194. '部分驳回'
  195. }}</el-tag>
  196. </template>
  197. <template v-slot:approvalStatus="{ row }">
  198. <el-tag v-if="row.approvalStatus == 0">未提交</el-tag>
  199. <el-tag v-if="row.approvalStatus == 1" type="warning">审核中</el-tag>
  200. <el-tag v-if="row.approvalStatus == 2" type="success">审核通过</el-tag>
  201. <el-tag v-if="row.approvalStatus == 3" type="danger">审核不通过</el-tag>
  202. </template>
  203. <template v-slot:code="{ row }">
  204. <el-link type="primary" :underline="false" @click="open('detail', row)">
  205. {{ row.code }}
  206. </el-link>
  207. </template>
  208. <template v-slot:action="{ row }">
  209. <el-link
  210. type="primary"
  211. v-if="
  212. row.status == 0 &&
  213. row.approvalStatus != 1 &&
  214. row.approvalStatus != 2
  215. "
  216. :underline="false"
  217. @click="open('edit', row)"
  218. >
  219. 编辑
  220. </el-link>
  221. <el-popconfirm
  222. class="ele-action"
  223. v-if="
  224. row.status == 0 &&
  225. row.approvalStatus != 1 &&
  226. row.approvalStatus != 2
  227. "
  228. title="确定要删除吗?"
  229. @confirm="remove([row.id])"
  230. >
  231. <template v-slot:reference>
  232. <el-link type="danger" :underline="false"> 删除 </el-link>
  233. </template>
  234. </el-popconfirm>
  235. <el-link
  236. type="primary"
  237. :underline="false"
  238. @click="submit(row)"
  239. v-if="
  240. row.status == 0 &&
  241. row.approvalStatus != 1 &&
  242. row.approvalStatus != 2
  243. "
  244. >
  245. 提交
  246. </el-link>
  247. <el-link
  248. type="primary"
  249. :underline="false"
  250. @click="sendGoods(row, 'add')"
  251. v-if="
  252. row.approvalStatus == 2 && (row.sendStatus == 0 || !row.sendStatus || row.sendStatus == 7
  253. || row.sendStatus == 8 || row.sendStatus == 9
  254. )
  255. "
  256. >
  257. 发货
  258. </el-link>
  259. <el-link
  260. type="primary"
  261. :underline="false"
  262. @click="sendGoods(row, 'receipt')"
  263. v-if="row.approvalStatus == 2 && row.sendStatus == 3"
  264. >
  265. 收货
  266. </el-link>
  267. <el-link
  268. type="primary"
  269. :underline="false"
  270. @click="sendGoods(row, 'receipt')"
  271. v-if="row.approvalStatus == 2 && row.sendStatus == 4"
  272. >
  273. 收货详情
  274. </el-link>
  275. <el-link
  276. type="primary"
  277. :underline="false"
  278. @click="sendGoods(row, 'detail')"
  279. v-if="
  280. row.approvalStatus == 2 || row.sendOutQuantity > 0
  281. "
  282. >
  283. 发货详情
  284. </el-link>
  285. <el-link
  286. type="primary"
  287. :underline="false"
  288. @click="handleFlow(row)"
  289. v-if="row.approvalStatus == 1 || row.approvalStatus == 2"
  290. >
  291. 流程
  292. </el-link>
  293. </template>
  294. </ele-pro-table>
  295. <flow ref="flowRef"></flow>
  296. <release ref="releaseRef" @refreshs="releaseRefresh"></release>
  297. <detail ref="detailsRef"></detail>
  298. <timeDialog ref="timeDialogRef"></timeDialog>
  299. <goodsDetail ref="goodsDetailRef" @done="reloads"></goodsDetail>
  300. <Create ref="create" @refresh="reloads" />
  301. </div>
  302. </template>
  303. <script>
  304. import { getList } from '@/api/outsourcing/index.js';
  305. import flow from '../../../outsourcing/components/flow.vue';
  306. import search from '../../../outsourcing/components/search.vue';
  307. import release from '../../../outsourcing/components/release.vue';
  308. import Detail from '../../../outsourcing/components/details.vue';
  309. import dictMixins from '@/mixins/dictMixins';
  310. import timeDialog from '../../../outsourcing/components/timeDialog.vue';
  311. import { getFile } from '@/api/system/file';
  312. import { getList as getPleaseListData } from '@/api/entrust/index';
  313. import { getByCode } from '@/api/system/dictionary-data';
  314. import Create from '@/views/entrust/components/create.vue';
  315. import goodsDetail from '@/views/entrust/components/goodsDetail.vue';
  316. import { remove, submit, warehouseEntry } from '@/api/entrust/index.js';
  317. export default {
  318. components: {
  319. search,
  320. flow,
  321. release,
  322. Detail,
  323. timeDialog,
  324. Create,
  325. goodsDetail
  326. },
  327. props: {
  328. chooseType: {
  329. type: String,
  330. default: '1'
  331. }
  332. },
  333. mixins: [dictMixins],
  334. data() {
  335. return {
  336. loading: false,
  337. code: '',
  338. dataList: [],
  339. workOrderCode: '',
  340. activeName: this.chooseType,
  341. pleaseData: [],
  342. pleaseTypeList: []
  343. };
  344. },
  345. filters: {
  346. outsourceSceneText(text) {
  347. switch (text) {
  348. case 1:
  349. return '首工序委外';
  350. case 2:
  351. return '单工序';
  352. case 3:
  353. return '多工序';
  354. case 4:
  355. return '首工序及多工序';
  356. default:
  357. return '';
  358. }
  359. }
  360. },
  361. computed: {
  362. // 表格列配置
  363. columns() {
  364. return [
  365. {
  366. columnKey: 'index',
  367. label: '序号',
  368. type: 'index',
  369. width: 55,
  370. align: 'center',
  371. showOverflowTooltip: true,
  372. fixed: 'left',
  373. showOverflowTooltip: true
  374. },
  375. {
  376. prop: 'batchNo',
  377. label: '批次号',
  378. align: 'center',
  379. minWidth: 100,
  380. showOverflowTooltip: true
  381. },
  382. {
  383. slot: 'code',
  384. prop: 'code',
  385. label: '委外单编码',
  386. align: 'center',
  387. showOverflowTooltip: true
  388. },
  389. {
  390. prop: 'name',
  391. label: '委外单名称',
  392. align: 'center',
  393. showOverflowTooltip: true
  394. },
  395. {
  396. prop: 'workOrderCode',
  397. label: '工单编码',
  398. align: 'center',
  399. showOverflowTooltip: true
  400. },
  401. {
  402. prop: 'taskName',
  403. label: '委外发起工序',
  404. align: 'center',
  405. showOverflowTooltip: true
  406. },
  407. {
  408. prop: 'taskNames',
  409. label: '委外工序',
  410. align: 'center',
  411. showOverflowTooltip: true
  412. },
  413. {
  414. prop: 'totalCount',
  415. label: '委外数量',
  416. align: 'center',
  417. showOverflowTooltip: true
  418. },
  419. {
  420. prop: 'totalWeight',
  421. slot: 'totalWeight',
  422. label: '委外重量',
  423. align: 'center',
  424. showOverflowTooltip: true
  425. },
  426. {
  427. slot: 'type',
  428. label: '委外类型',
  429. align: 'center',
  430. showOverflowTooltip: true
  431. },
  432. {
  433. prop: 'outsourceScene',
  434. slot: 'outsourceScene',
  435. label: '委外场景',
  436. align: 'center',
  437. showOverflowTooltip: true
  438. },
  439. {
  440. prop: 'supplierName',
  441. label: '委外单位',
  442. align: 'center',
  443. showOverflowTooltip: true
  444. },
  445. {
  446. slot: 'requireDeliveryTime',
  447. label: '预计到货日期',
  448. align: 'center',
  449. width: 100,
  450. showOverflowTooltip: true
  451. },
  452. // {
  453. // prop: 'produceRoutingName',
  454. // label: '工艺路线',
  455. // align: 'center'
  456. // },
  457. {
  458. prop: 'warehouseName',
  459. label: '仓库',
  460. align: 'center',
  461. showOverflowTooltip: true
  462. },
  463. {
  464. prop: 'createTime',
  465. label: '创建时间',
  466. align: 'center',
  467. width: 100,
  468. showOverflowTooltip: true
  469. },
  470. {
  471. slot: 'status',
  472. label: '单据状态',
  473. align: 'center',
  474. showOverflowTooltip: true
  475. },
  476. {
  477. label: '是否尾工序',
  478. slot: 'isLast',
  479. prop: 'isLast',
  480. minWidth: 100
  481. },
  482. {
  483. slot: 'approvalStatus',
  484. label: '审核状态',
  485. align: 'center',
  486. showOverflowTooltip: true
  487. },
  488. {
  489. label: '图片附件',
  490. slot: 'technicalDrawings',
  491. action: 'technicalDrawings',
  492. minWidth: 100,
  493. showOverflowTooltip: true
  494. },
  495. {
  496. label: '附件',
  497. slot: 'files',
  498. action: 'files',
  499. minWidth: 100,
  500. showOverflowTooltip: true
  501. },
  502. {
  503. prop: 'remark',
  504. label: '备注',
  505. align: 'center',
  506. showOverflowTooltip: true
  507. },
  508. {
  509. columnKey: 'action',
  510. label: '操作',
  511. width: 140,
  512. align: 'center',
  513. resizable: false,
  514. fixed: 'right',
  515. slot: 'action',
  516. showOverflowTooltip: true
  517. }
  518. ];
  519. },
  520. colunms1() {
  521. return [
  522. {
  523. columnKey: 'selection',
  524. type: 'selection',
  525. width: 45,
  526. align: 'center',
  527. fixed: 'left'
  528. },
  529. {
  530. columnKey: 'index',
  531. label: '序号',
  532. type: 'index',
  533. width: 55,
  534. align: 'center',
  535. showOverflowTooltip: true,
  536. fixed: 'left'
  537. },
  538. {
  539. prop: 'type',
  540. label: '类型',
  541. width: 55,
  542. align: 'center',
  543. showOverflowTooltip: true,
  544. slot: 'type'
  545. },
  546. {
  547. prop: 'priority',
  548. label: '紧急程度',
  549. width: 90,
  550. align: 'center',
  551. showOverflowTooltip: true,
  552. formatter: (row, column, cellValue) => {
  553. return cellValue == 1 ? '一般' : cellValue == 2 ? '紧急' : '';
  554. }
  555. },
  556. {
  557. prop: 'name',
  558. label: '名称',
  559. width: 130,
  560. showOverflowTooltip: true,
  561. align: 'center'
  562. },
  563. {
  564. prop: 'code',
  565. slot: 'code',
  566. label: '编码',
  567. width: 160,
  568. showOverflowTooltip: true,
  569. align: 'center'
  570. },
  571. {
  572. prop: 'applyFactoriesName',
  573. label: '所属工厂',
  574. align: 'center',
  575. width: 130,
  576. showOverflowTooltip: true
  577. },
  578. {
  579. prop: 'applyDeptName',
  580. label: '请托部门',
  581. align: 'center',
  582. width: 120,
  583. showOverflowTooltip: true
  584. },
  585. {
  586. prop: 'createUserName',
  587. label: '请托人',
  588. align: 'center',
  589. width: 80,
  590. showOverflowTooltip: true
  591. },
  592. {
  593. prop: 'totalCount',
  594. slot: 'totalCount',
  595. label: '请托数量',
  596. align: 'center',
  597. width: 130,
  598. showOverflowTooltip: true
  599. },
  600. {
  601. prop: 'beEntrustedFactoriesName',
  602. label: '受托工厂',
  603. align: 'center',
  604. width: 130,
  605. showOverflowTooltip: true
  606. },
  607. {
  608. prop: 'beEntrustedDeptName',
  609. label: '受托部门',
  610. align: 'center',
  611. width: 120,
  612. showOverflowTooltip: true
  613. },
  614. {
  615. prop: 'productionPlanCode',
  616. label: '计划编号',
  617. align: 'center',
  618. minWidth: 110,
  619. showOverflowTooltip: true
  620. },
  621. {
  622. prop: 'produceRoutingName',
  623. label: '工艺路线',
  624. align: 'center',
  625. showOverflowTooltip: true
  626. },
  627. {
  628. prop: 'bomType',
  629. label: 'BOM分类',
  630. align: 'center',
  631. width: 100,
  632. showOverflowTooltip: true,
  633. formatter: (row) => {
  634. if (row.bomType == 1) {
  635. return '产品(PBOM)';
  636. }
  637. if (row.bomType == 2) {
  638. return '加工(MBOM)';
  639. }
  640. if (row.bomType == 3) {
  641. return '装配(ABOM)';
  642. }
  643. return '';
  644. }
  645. },
  646. {
  647. prop: 'bomCategoryVersions',
  648. label: 'BOM版本',
  649. align: 'center',
  650. width: 100,
  651. showOverflowTooltip: true,
  652. formatter: (row) => {
  653. if (row.bomCategoryName) {
  654. return `${row.bomCategoryName} (V${row.bomCategoryVersions}.0)`;
  655. }
  656. return '';
  657. }
  658. },
  659. {
  660. prop: 'brandNum',
  661. label: '牌号',
  662. align: 'center',
  663. minWidth: 110,
  664. showOverflowTooltip: true
  665. },
  666. {
  667. prop: 'batchNo',
  668. label: '批次号',
  669. align: 'center',
  670. minWidth: 110,
  671. showOverflowTooltip: true
  672. },
  673. {
  674. prop: 'planStartTime',
  675. label: '计划开始时间',
  676. align: 'center',
  677. showOverflowTooltip: true,
  678. minWidth: 130,
  679. sortable: true
  680. },
  681. {
  682. prop: 'planCompleteTime',
  683. label: '计划结束时间',
  684. align: 'center',
  685. showOverflowTooltip: true,
  686. minWidth: 130,
  687. sortable: true
  688. },
  689. {
  690. prop: 'specification',
  691. label: '规格',
  692. align: 'center',
  693. minWidth: 110,
  694. showOverflowTooltip: true
  695. },
  696. {
  697. prop: 'modelType',
  698. label: '型号',
  699. align: 'center',
  700. minWidth: 110,
  701. showOverflowTooltip: true
  702. },
  703. {
  704. prop: 'sendStatus',
  705. slot: 'sendStatus',
  706. label: '发货状态',
  707. align: 'center',
  708. minWidth: 110,
  709. showOverflowTooltip: true
  710. },
  711. {
  712. prop: 'workOrderCode',
  713. label: '生产工单号',
  714. slot: 'workOrderCode',
  715. align: 'center',
  716. minWidth: 110,
  717. showOverflowTooltip: true
  718. },
  719. {
  720. prop: 'planDeliveryTime',
  721. label: '完成时间',
  722. align: 'center',
  723. width: 150,
  724. showOverflowTooltip: true
  725. },
  726. {
  727. prop: 'createTime',
  728. label: '创建时间',
  729. align: 'center',
  730. width: 150,
  731. showOverflowTooltip: true
  732. },
  733. {
  734. prop: 'describes',
  735. label: '需求描述',
  736. align: 'center',
  737. showOverflowTooltip: true
  738. },
  739. {
  740. prop: 'status',
  741. label: '状态',
  742. align: 'center',
  743. slot: 'status',
  744. width: 100
  745. },
  746. {
  747. prop: 'approvalStatus',
  748. label: '审批状态',
  749. align: 'center',
  750. slot: 'approvalStatus',
  751. width: 100
  752. },
  753. {
  754. columnKey: 'action',
  755. label: '操作',
  756. width: 220,
  757. align: 'center',
  758. resizable: false,
  759. fixed: 'right',
  760. slot: 'action',
  761. showOverflowTooltip: true
  762. }
  763. ];
  764. },
  765. clientEnvironmentId() {
  766. return this.$store.state.user.info.clientEnvironmentId;
  767. }
  768. },
  769. created() {
  770. this.requestDict('请托类型');
  771. },
  772. mounted() {
  773. this.getPleaseTypeList();
  774. },
  775. methods: {
  776. statusFormatter(status) {
  777. const obj = this.statusOpt.find((i) => i.value == status);
  778. return obj && obj.label;
  779. },
  780. /* 表格数据源 */
  781. // datasource() {
  782. // return getList({
  783. // pageNum: 1,
  784. // size: -1,
  785. // workOrderCode: this.code
  786. // });
  787. // },
  788. async getPleaseTypeList() {
  789. let res = await getByCode('entrust_type');
  790. if (res?.code == 0) {
  791. let list = res.data.map((item) => {
  792. let key = Object.keys(item)[0];
  793. return { value: key, label: item[key] };
  794. });
  795. this.pleaseTypeList = list;
  796. }
  797. },
  798. remove(id) {
  799. let ids = id || this.selection.map((item) => item.id);
  800. remove(ids).then((res) => {
  801. this.$message.success('删除' + res);
  802. this.reloads();
  803. });
  804. },
  805. submit(item) {
  806. const beEntrustedDeptId = item && item.beEntrustedDeptId;
  807. if (
  808. beEntrustedDeptId === null ||
  809. beEntrustedDeptId === undefined ||
  810. (typeof beEntrustedDeptId === 'string' &&
  811. beEntrustedDeptId.trim() === '')
  812. ) {
  813. this.$message.warning('请先完善请托单的受托部门信息');
  814. return;
  815. }
  816. this.$confirm('是否提交该请托单的审核流程?', '提示', {
  817. confirmButtonText: '确定',
  818. cancelButtonText: '取消',
  819. type: 'warning'
  820. })
  821. .then(() => {
  822. submit({
  823. businessId: item.id,
  824. beEntrustedDeptId
  825. }).then((res) => {
  826. this.$message.success('提交' + res.message);
  827. this.reloads();
  828. });
  829. })
  830. .catch(() => {});
  831. },
  832. getPleaseType(item) {
  833. const data = this.pleaseTypeList.filter((it) => it.value == item.type);
  834. return data.length != 0 ? data[0].label : '';
  835. },
  836. sendGoods(item, type) {
  837. this.$refs.goodsDetailRef.open(item, type);
  838. },
  839. open(type, row) {
  840. this.$refs.create.open(type, row);
  841. },
  842. async getDataList(code) {
  843. this.workOrderCode = code;
  844. await getList({
  845. pageNum: 1,
  846. size: -1,
  847. workOrderCode: this.workOrderCode
  848. }).then((res) => {
  849. console.log(res);
  850. this.dataList = res.list || [];
  851. // this.$forceUpdate();
  852. });
  853. },
  854. async getPleaseData(code) {
  855. this.workOrderCode = code;
  856. await getPleaseListData({
  857. pageNum: 1,
  858. size: -1,
  859. workOrderCode: this.workOrderCode
  860. }).then((res) => {
  861. this.pleaseData = res.list || [];
  862. });
  863. },
  864. downloadFile(file) {
  865. getFile({ objectName: file.storePath }, file.name);
  866. },
  867. handleFlow(row) {
  868. if (!row.processInstanceId) {
  869. return this.$message.warning('暂无流程图');
  870. }
  871. this.$refs.flowRef.open(row.processInstanceId);
  872. },
  873. handleDetails(row) {
  874. this.$refs.detailsRef.open(row);
  875. },
  876. handleMethod(row) {
  877. this.$refs.timeDialogRef.open(row, 'details');
  878. },
  879. reloads() {
  880. this.$nextTick(() => {
  881. this.getPleaseData(this.workOrderCode);
  882. });
  883. },
  884. handleRelease(row) {
  885. this.$refs.releaseRef.open(row);
  886. },
  887. handleClick(tab) {
  888. this.activeName = tab._props.name;
  889. if (this.activeName == '1') {
  890. this.getDataList(this.workOrderCode);
  891. } else if (this.activeName == '2') {
  892. this.getPleaseData(this.workOrderCode);
  893. }
  894. },
  895. openPleaseDetail() {},
  896. /* 刷新表格 */
  897. reload() {
  898. console.log('999');
  899. this.$nextTick(() => {
  900. if (this.activeName == '2') {
  901. this.getPleaseData(this.workOrderCode);
  902. } else {
  903. this.getDataList(this.workOrderCode);
  904. }
  905. });
  906. },
  907. refresh() {
  908. this.$nextTick(() => {
  909. if (this.activeName == '2') {
  910. this.getPleaseData(this.workOrderCode);
  911. } else {
  912. this.getDataList(this.workOrderCode);
  913. }
  914. });
  915. },
  916. handleAdd() {
  917. // this.$refs.releaseRef.open();
  918. this.$emit('outsourcingAdd', 'pick', this.activeName);
  919. },
  920. releaseRefresh() {
  921. this.$refs.table.reload();
  922. }
  923. }
  924. };
  925. </script>
  926. <style lang="scss" scoped></style>