detailsPage.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  6. @click="backToList(0)">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button class="el-button&#45;&#45;small-yh" type="primary" size="small" v-if="editButton"
  11. @click="confirmEditing">编辑
  12. </el-button>
  13. <el-button class="el-button--small-yh" type="primary" size="small" :disabled="isSave" @click="editCustomer">保存数据
  14. </el-button>
  15. <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '已出库'" @click="revoke"
  16. :disabled="isSave">撤销出库
  17. </el-button>
  18. <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;"
  19. v-if="form.statusName == '待出库' || form.statusName == '撤销出库'" @click="complete" :disabled="isSave">出库完成
  20. </el-button>
  21. </div>
  22. </div>
  23. <div style="margin-top: 50px">
  24. <trade-card title="基础信息">
  25. <avue-form :option="optionForm" v-model="form" ref="form"></avue-form>
  26. </trade-card>
  27. <trade-card title="明细信息">
  28. <el-tabs v-model="activeName" type="card">
  29. <el-tab-pane label="出库明细" name="sale_detail">
  30. <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts" :data="form.shipItemsList"
  31. :key="key" @row-save="rowSave" @row-update="rowUpdate"
  32. @resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)"
  33. @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 270.1)">
  34. <template slot-scope="scope" slot="menuLeft">
  35. <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
  36. </template>
  37. <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  38. <!--<el-button :size="size" :disabled="disabled || isAddDisabled" :type="type"-->
  39. <!-- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="rowEdit(row, index)">编辑-->
  40. <!--</el-button>-->
  41. <el-popover placement="left" width="500" trigger="hover">
  42. <el-table :row-style="{ height: '20px', padding: '0px', fontSize: '12px' }"
  43. :cell-style="{ padding: '0px', fontSize: '12px' }" :data="row.recordList"
  44. :header-cell-style="tableHeaderCellStyle" border stripe height="300px" style="width: 100%">
  45. <el-table-column property="srcOrd" label="单号">
  46. <template slot-scope="{row}">
  47. <span style="color: #409EFF;cursor: pointer" @click.stop="Jump(row)">{{ row.srcOrd }}
  48. </span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column property="amount" label="金额"></el-table-column>
  52. <el-table-column property="createUserName" label="制单人"></el-table-column>
  53. <el-table-column property="createTime" label="制单日期"></el-table-column>
  54. </el-table>
  55. <el-button slot="reference" :size="size" :disabled="!row.id" :type="type" icon="el-icon-view"
  56. style="margin-right: 8px;">
  57. 查看记录
  58. </el-button>
  59. </el-popover>
  60. <el-button :size="size" :disabled="disabled || isDisabled" :type="type"
  61. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="rowEdit(row, index)">
  62. {{ row.$cellEdit ? '保存' : '编辑' }}
  63. </el-button>
  64. <el-button icon="el-icon-delete" :size="size" :disabled="disabled || isDisabled" :type="type"
  65. @click="rowDelBox(row, index)">删除
  66. </el-button>
  67. </template>
  68. </avue-crud>
  69. </el-tab-pane>
  70. <el-tab-pane label="订单信息" name="payment_details">
  71. <avue-crud :option="optionPaymentDetails" v-model="formContacts" ref="payment_details" :data="form.shipVOList"
  72. :key="key" @row-save="rowSave" @row-update="rowUpdate"
  73. @resetColumn="resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)"
  74. @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 270.2)">
  75. </avue-crud>
  76. </el-tab-pane>
  77. <el-tab-pane label="历史记录" name="outbound_records">
  78. <avue-crud :option="optionOutboundRecords" v-model="formContacts" ref="outbound_records"
  79. :data="form.historyList" :key="key" @row-save="rowSave" @row-update="rowUpdate"
  80. @resetColumn="resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)"
  81. @saveColumn="saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 270.3)">
  82. </avue-crud>
  83. </el-tab-pane>
  84. </el-tabs>
  85. </trade-card>
  86. <containerTitle title="上传附件"></containerTitle>
  87. <c-upload v-loading="loadingBtn" typeUpload="LT" :disabled="isAddDisabled"
  88. deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="filesList" display
  89. :enumerationValue="35.1"></c-upload>
  90. <report-dialog :switchDialog="switchDialog" :reportId="form.id" @onClose="onClose()"></report-dialog>
  91. </div>
  92. </div>
  93. </template>
  94. <script>
  95. import { getDetails, tradingBox, submit, warehousingComplete, revokeOutboundCompleted } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
  96. import { dateFormat } from "@/util/date";
  97. import reportDialog from "@/components/report-dialog/main";
  98. import { dotList } from "@/api/tirePartsMall/purchasingManagement/warehouseEntryOrder";
  99. export default {
  100. name: "detailsPage",
  101. data() {
  102. return {
  103. // 上传附件的需要参数
  104. loadingBtn: false,
  105. filesList: [],
  106. switchDialog: false,
  107. activeName: "sale_detail",
  108. editButton: true,
  109. isSave: true,
  110. disabled: false,
  111. isDisabled: false,
  112. isAddDisabled: false,
  113. form: {
  114. shipItemsList: [],
  115. shipVOList: [],
  116. historyList: []
  117. },
  118. key: 0,
  119. optionForm: {
  120. disabled: false,
  121. menuBtn: false,
  122. span: 8,
  123. column: [{
  124. label: '业务对象',
  125. disabled: false,
  126. prop: "customerId",
  127. type: 'select',
  128. props: {
  129. label: 'cname',
  130. value: 'id'
  131. },
  132. dicUrl: '/api/blade-sales-part/corpsDesc/listAll?corpType=KH&enableOrNot=1',
  133. rules: [{
  134. required: true,
  135. message: " ",
  136. trigger: "blur"
  137. }]
  138. }, {
  139. label: '仓库',
  140. prop: "storageId",
  141. disabled: false,
  142. type: 'select',
  143. props: {
  144. label: 'cname',
  145. value: 'id'
  146. },
  147. dicUrl: '/api/blade-sales-part/storageDesc/listAll',
  148. rules: [{
  149. required: true,
  150. message: " ",
  151. trigger: "blur"
  152. }]
  153. }, {
  154. label: '库管',
  155. prop: "stockClerkId",
  156. type: 'select',
  157. disabled: false,
  158. props: {
  159. label: 'realName',
  160. value: 'id'
  161. },
  162. dicUrl: '/api/blade-user/stockClerkList',
  163. rules: [{
  164. required: true,
  165. message: " ",
  166. trigger: "blur"
  167. }]
  168. },
  169. {
  170. label: '业务日期',
  171. prop: "businesDate",
  172. searchProp: "businesDateList",
  173. disabled: false,
  174. type: "datetime",
  175. value: dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss'),
  176. format: "yyyy-MM-dd HH:mm",
  177. valueFormat: "yyyy-MM-dd HH:mm:ss",
  178. rules: [
  179. {
  180. required: true,
  181. message: "",
  182. trigger: "blur"
  183. }
  184. ]
  185. },
  186. {
  187. label: '入库单号',
  188. disabled: false,
  189. prop: "billno",
  190. rules: [
  191. {
  192. required: true,
  193. message: " ",
  194. trigger: "blur"
  195. }
  196. ],
  197. },
  198. {
  199. label: '来源单号',
  200. prop: "ordNo",
  201. disabled: true
  202. },
  203. {
  204. label: '配送方式',
  205. prop: "shipType",
  206. type: 'select',
  207. disabled: false,
  208. props: {
  209. label: 'dictValue',
  210. value: 'dictKey'
  211. },
  212. dicUrl: '/api/blade-system/dict-biz/dictionary?code=deliveryMethod'
  213. },
  214. {
  215. label: '货运公司',
  216. prop: "logisticsCorpName",
  217. type: 'select',
  218. disabled: false,
  219. props: {
  220. label: 'dictValue',
  221. value: 'dictKey'
  222. },
  223. dicUrl: '/api/blade-system/dict-biz/dictionary?code=tyre_express_company'
  224. },
  225. {
  226. label: '货运单号',
  227. prop: "expressNo",
  228. disabled: false
  229. },
  230. {
  231. label: '订单数量',
  232. prop: "goodsTotalNum",
  233. disabled: true,
  234. rules: [
  235. {
  236. required: true,
  237. message: " ",
  238. trigger: "blur"
  239. }
  240. ]
  241. },
  242. {
  243. label: '出库数量',
  244. prop: "sendTotalNum",
  245. disabled: true,
  246. },
  247. {
  248. label: '备注',
  249. prop: "remarks",
  250. type: 'textarea',
  251. disabled: false,
  252. span: 16,
  253. minRows: 1
  254. }]
  255. },
  256. formContacts: {},
  257. optionContacts: {},
  258. optionContactsBack: {
  259. align: 'center',
  260. index: true,
  261. addBtnText: "录入明细",
  262. updateBtnText: '保存',
  263. refreshBtn: false,
  264. dialogDrag: true,
  265. addBtn: true,
  266. span: 8,
  267. height: 300,
  268. addRowBtn: false,
  269. editBtn: false,
  270. delBtn: false,
  271. menuWidth: 200,
  272. dialogTop: 25,
  273. dialogWidth: "80%",
  274. showSummary: true,
  275. saveBtn: false, // 表格弹窗保存按钮
  276. cellBtn: false, // 行编辑
  277. sumColumnList: [
  278. {
  279. name: 'goodsNum',
  280. type: 'sum',
  281. }, {
  282. name: 'sendNum',
  283. type: 'sum',
  284. }],
  285. column: [{
  286. label: '商品名称',
  287. prop: 'goodsId',
  288. disabled: true,
  289. width: 200,
  290. overHidden: true,
  291. hide: true,
  292. type: 'select',
  293. props: {
  294. label: 'cname',
  295. value: 'id'
  296. },
  297. dicUrl: '/api/blade-sales-part/goodsDesc/goodsListAll'
  298. }, {
  299. label: '商品名称',
  300. prop: 'goodsName',
  301. disabled: true,
  302. width: 200,
  303. overHidden: true,
  304. }, {
  305. label: '商品编码',
  306. disabled: true,
  307. prop: 'goodsNo',
  308. width: 100
  309. }, {
  310. label: '品牌',
  311. prop: 'brandId',
  312. disabled: true,
  313. width: 100,
  314. overHidden: true,
  315. type: 'select',
  316. props: {
  317. label: 'cname',
  318. value: 'id'
  319. },
  320. dicUrl: '/api/blade-sales-part/brandDesc/listAll?type=PP&enableOrNot=1'
  321. }, {
  322. label: '规格型号',
  323. prop: 'propertyName',
  324. disabled: true,
  325. width: 100
  326. }, {
  327. label: '花纹',
  328. prop: 'pattern',
  329. disabled: true,
  330. width: 100
  331. }, {
  332. label: '商品描述',
  333. prop: 'goodsDescription',
  334. disabled: true,
  335. }, {
  336. label: '批次号',
  337. prop: 'dot',
  338. cell: true,
  339. type: 'select',
  340. disabled: true,
  341. dicData: [],
  342. props: {
  343. label: "dot",
  344. value: "dot"
  345. },
  346. dicUrl: "/api/blade-sales-part/stockDesc/dotList",
  347. }, {
  348. label: '单位',
  349. prop: 'units',
  350. type: "select",
  351. disabled: true,
  352. props: {
  353. label: "dictValue",
  354. value: "dictValue"
  355. },
  356. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit"
  357. }, {
  358. label: '库存',
  359. prop: 'inventory',
  360. }, {
  361. label: '出库数量',
  362. prop: 'goodsNum',
  363. disabled: false,
  364. disabled: true,
  365. }, {
  366. label: '发货数量',
  367. prop: 'sendNum',
  368. cell: true,
  369. disabled: false,
  370. }, {
  371. label: '备注',
  372. prop: 'remarks'
  373. }]
  374. },
  375. optionPaymentDetails: {},
  376. optionPaymentDetailsBack: {
  377. align: 'center',
  378. index: true,
  379. addBtnText: "录入明细",
  380. refreshBtn: false,
  381. dialogDrag: true,
  382. addBtn: false,
  383. span: 8,
  384. height: 600,
  385. addRowBtn: false,
  386. editBtn: false,
  387. delBtn: false,
  388. menuWidth: 140,
  389. dialogTop: 25,
  390. dialogWidth: "80%",
  391. menu: false,
  392. column: [{
  393. label: '出库单号',
  394. prop: 'billno',
  395. overHidden: true,
  396. }, {
  397. label: '来源单号',
  398. prop: 'ordNo',
  399. overHidden: true,
  400. }, {
  401. label: '业务来源',
  402. prop: 'bsType',
  403. overHidden: true,
  404. }, {
  405. label: '地址',
  406. prop: 'recAddress',
  407. overHidden: true,
  408. }, {
  409. label: '联系人',
  410. prop: 'contacts',
  411. overHidden: true,
  412. }, {
  413. label: '电话',
  414. prop: 'phone',
  415. overHidden: true,
  416. }, {
  417. label: '备注',
  418. prop: 'remarks',
  419. overHidden: true,
  420. }]
  421. },
  422. optionOutboundRecords: {},
  423. optionOutboundRecordsBack: {
  424. align: 'center',
  425. index: true,
  426. addBtnText: "录入明细",
  427. refreshBtn: false,
  428. dialogDrag: true,
  429. addBtn: false,
  430. span: 8,
  431. height: 600,
  432. addRowBtn: false,
  433. editBtn: false,
  434. delBtn: false,
  435. menuWidth: 140,
  436. dialogTop: 25,
  437. dialogWidth: "80%",
  438. menu: false,
  439. column: [{
  440. label: '操作人',
  441. prop: 'operatorName',
  442. overHidden: true,
  443. }, {
  444. label: '状态',
  445. prop: 'operateStatus',
  446. overHidden: true,
  447. }, {
  448. label: '时间',
  449. prop: 'operateTime',
  450. overHidden: true,
  451. }]
  452. }
  453. }
  454. },
  455. components: {
  456. reportDialog
  457. },
  458. props: {
  459. onLoad: Object,
  460. detailData: Object
  461. },
  462. async created() {
  463. this.optionContacts = await this.getColumnData(this.getColumnName(270.1), this.optionContactsBack);
  464. this.optionPaymentDetails = await this.getColumnData(this.getColumnName(270.2), this.optionPaymentDetailsBack);
  465. this.optionOutboundRecords = await this.getColumnData(this.getColumnName(270.3), this.optionOutboundRecordsBack);
  466. this.key++
  467. if (this.onLoad.id && this.detailData.id) {
  468. console.log(1);
  469. this.refresh(this.onLoad.id, true)
  470. this.$set(this.optionForm, 'disabled', true)
  471. } else if (this.onLoad.id) {
  472. console.log(2);
  473. this.refresh(this.onLoad.id, true)
  474. }
  475. if (this.detailData.id) {
  476. this.refresh()
  477. }
  478. if (this.$route.query.srcId) {
  479. this.refresh(this.$route.query.srcId)
  480. }
  481. this.$store.commit("DOMIO_IN_DETAIL");
  482. },
  483. activated() {
  484. if (this.detailData.id) {
  485. this.refresh()
  486. }
  487. this.$store.commit("DOMIO_IN_DETAIL");
  488. },
  489. methods: {
  490. // 撤销出库
  491. revoke() {
  492. this.$refs["form"].validate((valid, done) => {
  493. done();
  494. if (valid) {
  495. const loading = this.$loading({
  496. lock: true,
  497. text: '加载中',
  498. spinner: 'el-icon-loading',
  499. background: 'rgba(255,255,255,0.7)'
  500. });
  501. revokeOutboundCompleted({
  502. ...this.form,
  503. bizTypeName: "FHGD"
  504. }).then(res => {
  505. this.$message.success("撤销成功");
  506. this.refresh(res.data.data.id)
  507. loading.close();
  508. }).finally(() => {
  509. loading.close();
  510. });
  511. }
  512. })
  513. },
  514. rowEdit(row, index) {
  515. if (this.form.statusName == '待出库') {
  516. this.optionContacts.column.forEach(its => {
  517. if (its.prop == 'dot') {
  518. this.$set(its, 'disabled', false)
  519. }
  520. })
  521. }
  522. dotList({
  523. storageId: this.form.storageId,
  524. goodsId: row.goodsId
  525. }).then(res => {
  526. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data
  527. // 增加监听数据改变更改库存数量
  528. this.findObject(this.optionContacts.column, "dot").change = (data) => {
  529. for (let item of data.column.dicData) {
  530. if (item.dot == data.value) {
  531. this.$set(row, 'inventory', item.balanceQuantity)
  532. }
  533. }
  534. }
  535. })
  536. if (row.$cellEdit) {
  537. this.$set(row, '$cellEdit', false)
  538. } else {
  539. this.$set(row, '$cellEdit', true)
  540. }
  541. // this.$refs.formContacts.rowEdit(row, index)
  542. },
  543. complete() {
  544. console.log(this.form.id);
  545. this.$refs["form"].validate((valid, done) => {
  546. done();
  547. if (valid) {
  548. const loading = this.$loading({
  549. lock: true,
  550. text: '加载中',
  551. spinner: 'el-icon-loading',
  552. background: 'rgba(255,255,255,0.7)'
  553. });
  554. this.form.shipItemsList.forEach(item => {
  555. item.goodsName = item.$goodsId
  556. })
  557. submit({
  558. ...this.form,
  559. bizTypeName: "FHGD"
  560. }).then(res => {
  561. warehousingComplete({
  562. ...this.form,
  563. bizTypeName: "FHGD"
  564. }).then(res => {
  565. this.$message.success("出库完成");
  566. this.refresh(res.data.data.id)
  567. loading.close();
  568. }).finally(() => {
  569. loading.close();
  570. });
  571. })
  572. } else {
  573. this.$message.error('请选择库管')
  574. }
  575. })
  576. },
  577. Jump(row) {
  578. if (this.$store.getters.financingStatus) {
  579. this.$alert("融资采购(L)已存在,请关闭融资采购(L)再进行操作", "温馨提示", {
  580. confirmButtonText: "确定",
  581. type: "warning",
  582. });
  583. } else {
  584. this.$router.$avueRouter.closeTag("/tirePartsMall/purchasingManagement/financingProcurement/index");
  585. this.$router.push({
  586. path: "/tirePartsMall/purchasingManagement/financingProcurement/index",
  587. query: {
  588. srcId: row.srcId
  589. },
  590. });
  591. }
  592. },
  593. //修改提交触发
  594. editCustomer() {
  595. this.$refs["form"].validate((valid, done) => {
  596. done();
  597. if (valid) {
  598. const loading = this.$loading({
  599. lock: true,
  600. text: '加载中',
  601. spinner: 'el-icon-loading',
  602. background: 'rgba(255,255,255,0.7)'
  603. });
  604. console.log(this.form)
  605. // 判断处理
  606. for (let index in this.form.shipItemsList) {
  607. this.form.shipItemsList[index].goodsName = this.form.shipItemsList[index].$goodsId
  608. if (Number(this.form.shipItemsList[index].sendNum) > Number(this.form.shipItemsList[index].inventory)) {
  609. this.$message.warning(`序号${index + 1}的实际数量不能大于库存`);
  610. loading.close();
  611. return
  612. }
  613. }
  614. // this.form.shipItemsList.forEach(item => {
  615. // item.goodsName = item.$goodsId
  616. // })
  617. // this.goodsName;
  618. submit({
  619. ...this.form,
  620. bizTypeName: "FHGD",
  621. filesList: this.filesList
  622. }).then(res => {
  623. this.$message.success("保存成功");
  624. this.refresh(res.data.data.id)
  625. loading.close();
  626. }).finally(() => {
  627. loading.close();
  628. });
  629. } else {
  630. return false;
  631. }
  632. });
  633. },
  634. refresh(id, type) {
  635. this.$set(this.optionContactsBack, 'addBtn', false)
  636. this.$set(this.optionContacts, 'addBtn', false)
  637. this.isDisabled = true
  638. const loading = this.$loading({
  639. lock: true,
  640. text: '加载中',
  641. spinner: 'el-icon-loading',
  642. background: 'rgba(255,255,255,0.7)'
  643. })
  644. if (!this.detailData.id) {
  645. getDetails({ id: id }).then(res => {
  646. if (res.data.data.statusName == '已出库') {
  647. this.$set(this.optionForm, 'disabled', true)
  648. this.isAddDisabled = true
  649. this.optionContacts.column.forEach(item => {
  650. if (item.prop == 'sendNum') {
  651. item.disabled = true
  652. }
  653. })
  654. }
  655. this.isAddDisabled = true
  656. if (res.data.data.statusName == '待出库') {
  657. this.isAddDisabled = true
  658. this.isDisabled = true
  659. }
  660. this.form = res.data.data
  661. this.filesList = res.data.data.filesList
  662. this.$nextTick(() => {
  663. this.$refs.formContacts.refreshTable()
  664. })
  665. loading.close();
  666. }).catch(() => {
  667. loading.close();
  668. })
  669. } else {
  670. getDetails({ id: this.detailData.id }).then(res => {
  671. if (res.data.data.statusName == '已出库') {
  672. this.$set(this.optionForm, 'disabled', true)
  673. this.isAddDisabled = true
  674. this.optionContacts.column.forEach(item => {
  675. if (item.prop == 'sendNum') {
  676. item.disabled = true
  677. }
  678. })
  679. }
  680. this.isAddDisabled = true
  681. if (res.data.data.statusName == '待出库') {
  682. this.isAddDisabled = true
  683. this.isDisabled = true
  684. }
  685. this.form = res.data.data
  686. this.filesList = res.data.data.filesList
  687. this.$nextTick(() => {
  688. this.$refs.formContacts.refreshTable()
  689. })
  690. loading.close();
  691. }).catch(() => {
  692. loading.close();
  693. })
  694. }
  695. },
  696. rowDelBox(row, index) {
  697. this.$confirm("确定将选择数据删除?", {
  698. confirmButtonText: "确定",
  699. cancelButtonText: "取消",
  700. type: "warning"
  701. }).then(() => {
  702. if (row.id) {
  703. tradingBox(row.id).then(res => {
  704. this.form.shipItemsList.splice(index, 1);
  705. this.$message.success("操作成功!");
  706. });
  707. } else {
  708. this.form.shipItemsList.splice(index, 1);
  709. this.$message.success("操作成功!");
  710. }
  711. }
  712. )
  713. ;
  714. },
  715. rowSave(form, done, loading) {
  716. done(form)
  717. },
  718. rowUpdate(form, index, done, loading) {
  719. done(form)
  720. },
  721. //打印
  722. handlePrint() {
  723. this.switchDialog = !this.switchDialog;
  724. },
  725. onClose(val) {
  726. this.switchDialog = val;
  727. },
  728. //编辑
  729. confirmEditing() {
  730. if (this.form.statusName == '待出库' || this.form.statusName == '待入库' || this.form.statusName == '撤销出库') {
  731. this.isDisabled = false
  732. this.isSave = false
  733. this.$set(this.optionForm, 'disabled', false)
  734. this.optionForm.column.forEach(item => {
  735. if (item.prop == 'storageId'
  736. || item.prop == 'remarks'
  737. || item.prop == 'createTime'
  738. || item.prop == 'stockClerkId'
  739. || item.prop == 'shipType'
  740. || item.prop == 'logisticsCorpName'
  741. || item.prop == 'expressNo') {
  742. item.disabled = false
  743. } else {
  744. item.disabled = true
  745. }
  746. })
  747. this.isAddDisabled = false
  748. this.optionContactsBack.column.forEach(its => {
  749. if (its.prop == 'dot') {
  750. this.$set(its, 'disabled', false)
  751. }
  752. })
  753. } else {
  754. this.$set(this.optionForm, 'disabled', false)
  755. this.isAddDisabled = true
  756. this.isSave = false
  757. // this.optionForm.column.forEach(item => {
  758. // if (item.prop == 'remarks') {
  759. // item.disabled = false
  760. // } else {
  761. // item.disabled = true
  762. // }
  763. // })
  764. this.optionForm.column.forEach(item => {
  765. item.disabled = true
  766. })
  767. // this.isAddDisabled = false
  768. }
  769. },
  770. //自定义列保存
  771. async saveColumnTwo(ref, option, optionBack, code) {
  772. /**
  773. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  774. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  775. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  776. */
  777. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  778. if (inSave) {
  779. this.$message.success("保存成功");
  780. //关闭窗口
  781. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  782. }
  783. },
  784. //自定义列重置
  785. async resetColumnTwo(ref, option, optionBack, code) {
  786. this[option] = this[optionBack];
  787. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  788. if (inSave) {
  789. this.$message.success("重置成功");
  790. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  791. }
  792. },
  793. backToList(type) {
  794. this.$emit("backToList", type);
  795. // this.$store.commit("DOMIO_OUT_DETAIL");
  796. },
  797. // 表头样式
  798. tableHeaderCellStyle({ row, column, rowIndex, columnIndex }) {
  799. return "padding:4px 0px;fontSize:12px;color:#000;background:#ecf5ff;textAlign:center"
  800. },
  801. }
  802. }
  803. </script>
  804. <style lang="scss" scoped>
  805. ::v-deep .el-form-item {
  806. margin-bottom: 8px !important;
  807. }
  808. </style>