detailsPage.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  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">返回列表
  7. </el-button>
  8. </div>
  9. <div class="add-customer-btn">
  10. <el-button type="primary" size="small" :disabled="form.status>0" v-if="form.status < 1"
  11. class="el-button--small-yh " @click.stop="openEdit">编辑
  12. </el-button>
  13. <el-button type="info" @click="getData" size="small">刷新资料
  14. </el-button>
  15. <el-button type="primary" size="small" v-if="form.status == 0"
  16. class="el-button--small-yh " @click.stop="withdraw(0)">提交
  17. </el-button>
  18. <el-button type="primary" size="small" v-if="form.status == 1"
  19. class="el-button--small-yh " @click.stop="withdraw(1)">撤销
  20. </el-button>
  21. <el-button type="primary" size="small" v-if="form.status == 1"
  22. class="el-button--small-yh " @click.stop="withdraw(2)">入库确认
  23. </el-button>
  24. <el-button type="primary" size="small" v-if="form.status == 2"
  25. class="el-button--small-yh " @click.stop="withdraw(3)">入库撤销
  26. </el-button>
  27. <el-button type="primary" @click="editCustomer" :loading="subLoading"
  28. size="small">保存数据
  29. </el-button>
  30. <el-dropdown style="padding: 0 6px;line-height: 0">
  31. <el-button type="primary" size="small" :loading="subLoading" :disabled="!form.id">
  32. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  33. </el-button>
  34. <el-dropdown-menu slot="dropdown">
  35. <el-dropdown-item :disabled="form.status != 2" @click.native="auditCheck">提交审核</el-dropdown-item>
  36. <el-dropdown-item v-if="roleName=='admin'" :disabled="form.status != 5" @click.native="revokeCheck">
  37. 撤销审核
  38. </el-dropdown-item>
  39. <el-dropdown-item :disabled="form.status < 3" @click.native="checkScheduleDialog = true">审核进度
  40. </el-dropdown-item>
  41. <el-dropdown-item v-if="$route.query.check" :disabled="!(form.status > 2 && form.status < 5)"
  42. @click.native="check">审批数据
  43. </el-dropdown-item>
  44. </el-dropdown-menu>
  45. </el-dropdown>
  46. </div>
  47. </div>
  48. <div class="customer-main" v-loading="subLoading">
  49. <trade-card title="基础信息">
  50. <avue-form ref="form" class="trading-form" v-model="form" :option="option">
  51. <template slot="purchaserId">
  52. <crop-select ref="purchaser" v-model="form.purchaserId" corpType="KH" :refresh="false"
  53. @getCorpData="getKHData" :disabled="detailData.status == 1"></crop-select>
  54. </template>
  55. <template slot="corpId">
  56. <crop-select ref="corpId" v-model="form.corpId" corpType="GYS" :refresh="false" @getCorpData="getGYSData"
  57. :disabled="detailData.status == 1"></crop-select>
  58. </template>
  59. <template slot="storageId">
  60. <el-cascader v-model="form.storageId" :options="storagetreeList" :show-all-levels="false"
  61. :disabled="detailData.status == 1"
  62. :props="{ checkStrictly: true, emitPath: false, label: 'title' }"
  63. clearable @change="storagetreeChange">
  64. </el-cascader>
  65. </template>
  66. <template slot-scope="{column}" slot="purchaserIdLabel">
  67. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
  68. </template>
  69. <template slot-scope="{column}" slot="corpIdLabel">
  70. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
  71. </template>
  72. <template slot-scope="{column}" slot="storageIdLabel">
  73. <span style="color: #409EFF;cursor: pointer" @click.stop="addData('storage')">{{ column.label }}</span>
  74. </template>
  75. </avue-form>
  76. </trade-card>
  77. <trade-card title="入库明细">
  78. <avue-crud ref="crud" :data="itemsVOList" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
  79. @resetColumn="resetColumn" :cell-style="cellStyle" @row-save="rowSave" @row-update="addUpdate" @selection-change="selectionChange">
  80. <template slot="menuLeft">
  81. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="detailData.status == 1"
  82. @click.stop="addRow">录入明细
  83. </el-button>
  84. <!-- <el-button type="success" icon="el-icon-bottom" size="small" @click.stop="getTemplate">下载模板</el-button>-->
  85. <el-button type="info" icon="el-icon-top" size="small" :disabled="detailData.status == 1&&form.id"
  86. @click.stop="excelBox = true">导入
  87. </el-button>
  88. <el-button
  89. type="success"
  90. icon="el-icon-printer"
  91. size="small"
  92. :disabled="batchPrinting"
  93. @click.stop="printStackCard()">批量打印
  94. </el-button>
  95. <el-button
  96. type="danger"
  97. icon="el-icon-delete"
  98. size="small"
  99. :disabled="batchDeletion"
  100. @click.stop="batchDeleteDetails()">批量删除
  101. </el-button>
  102. <el-button
  103. type="warning"
  104. icon="el-icon-printer"
  105. size="small"
  106. :disabled="!form.id"
  107. @click.stop="receiptDoc()">入库单
  108. </el-button>
  109. </template>
  110. <template slot="headerSerial">
  111. <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
  112. :disabled="detailData.status == 1" circle></el-button>
  113. </template>
  114. <template slot="storageIdHeader" slot-scope="{column}">
  115. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
  116. </template>
  117. <template slot="itemIdHeader" slot-scope="{column}">
  118. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{ column.label }}</span>
  119. </template>
  120. <template slot="oneCode" slot-scope="{ row, index }">
  121. <el-popover placement="right" width="160" trigger="click">
  122. <el-image style="width: 160px; height: 80px" :src="row.oneCode" :fit="fit"></el-image>
  123. <el-button v-if="row.oneCode" type="text" slot="reference">查看</el-button>
  124. </el-popover>
  125. </template>
  126. <template slot="qrCode" slot-scope="{ row, index }">
  127. <el-popover placement="right" width="300" trigger="click">
  128. <el-image style="width: 300px; height: 300px" :src="row.qrCode" :fit="fit"></el-image>
  129. <el-button v-if="row.qrCode" type="text" slot="reference">查看</el-button>
  130. </el-popover>
  131. </template>
  132. <template slot="storageInQuantityForm" slot-scope="{ row }">
  133. <el-input-number size="small" v-model="row.storageInQuantity" @change="calculateChange(row)"
  134. :controls="false" style="width:100%" placeholder="请输入"></el-input-number>
  135. </template>
  136. <template slot="priceForm" slot-scope="{ row }">
  137. <el-input-number size="small" v-model="row.price" @change="calculateChange(row)" :controls="false"
  138. style="width:100%" placeholder="请输入"></el-input-number>
  139. </template>
  140. <template slot="menu" slot-scope="{ row, index }">
  141. <div style="display:flex;justify-content: center;">
  142. <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
  143. :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "编辑" }}
  144. </el-button>
  145. <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
  146. :disabled="detailData.status == 1">删除
  147. </el-button>
  148. <el-button size="small" icon="el-icon-printer" type="text" @click="rowPrint(row, index)"
  149. :disabled="!row.id">
  150. 打印
  151. </el-button>
  152. <div style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
  153. <el-tooltip effect="dark" content="向上移动" placement="top">
  154. <i v-if="index != 0&&detailData.status != 1" :disabled="disabled || detailData.status == 1"
  155. class="el-icon-arrow-up" @click="moveUp(row, index)" style="color:#409EFF;"></i>
  156. </el-tooltip>
  157. <el-tooltip effect="dark" content="向下移动" placement="bottom"><i
  158. v-if="index != (itemsVOList.length - 1)&&detailData.status != 1" class="el-icon-arrow-down"
  159. @click="moveDown(row, index)" style="color:#409EFF;"></i></el-tooltip>
  160. </div>
  161. </div>
  162. </template>
  163. </avue-crud>
  164. </trade-card>
  165. <fee-info ref="feeInfo" :orderFeesList="orderFeesList" typeName="wood" :corpId="form.purchaserId" :disabled="!(form.status < 3)"
  166. feeUrl="/blade-purchase-sales/entranceOrder/removeOrderFees" :optionType="'CMY'" :itemType="'C'"
  167. :inCropId="true" @beforeFinance="beforeFinance" :delType="2" :billingShow="false" />
  168. <!-- <upload-file ref="uploadFile" title="合同附件" :disabled="detailData.status == 1" :orderFilesList="orderFilesList"
  169. delUrl="" /> -->
  170. <containerTitle title="上传附件"></containerTitle>
  171. <c-upload typeUpload="CD" deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
  172. :data="orderFilesList" display :enumerationValue="85.6" :disabled="!(form.status < 3)"></c-upload>
  173. <el-dialog append-to-body title="审核进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  174. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  175. <check-schedule :checkId="form.id" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
  176. </check-schedule>
  177. </el-dialog>
  178. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  179. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  180. <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
  181. </check>
  182. </el-dialog>
  183. </div>
  184. <el-dialog title="导入" append-to-body :close-on-click-modal="false" :visible.sync="excelBox" width="555px">
  185. <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter" :upload-error="uploadError">
  186. <template slot="excelTemplate">
  187. <el-button type="primary" @click="getTemplate">
  188. 点击下载<i class="el-icon-download el-icon--right"></i>
  189. </el-button>
  190. </template>
  191. </avue-form>
  192. <p style="text-align: center;color: #DC0505">
  193. 温馨提示 第一次导入时请先下载模板
  194. </p>
  195. </el-dialog>
  196. <el-dialog
  197. title="打印"
  198. :visible.sync="dialogVisible"
  199. fullscreen
  200. append-to-body
  201. width="70%">
  202. <div id="printAll">
  203. <div v-for="(item,index) in printList" :key="index" style="page-break-after:always">
  204. <table align="center" style="color: #000000;text-align: center">
  205. <tr>
  206. <th colspan="5">垛卡</th>
  207. </tr>
  208. <tr>
  209. <td>品名:</td>
  210. <td>{{ item.cname }}</td>
  211. <td>等级:</td>
  212. <td>{{ item.grade }}</td>
  213. <td rowspan="3">
  214. <img style="width: 120px;height: 120px;" :src="item.qrCode" alt="">
  215. </td>
  216. </tr>
  217. <tr>
  218. <td>厚度:</td>
  219. <td>{{ item.thickness }}</td>
  220. <td>长度:</td>
  221. <td>{{item.length}}</td>
  222. </tr>
  223. <tr>
  224. <td>备注:</td>
  225. <td colspan="3">{{ item.remarks }}</td>
  226. </tr>
  227. <tr>
  228. <th colspan="6" style="font-size: 28px;">{{item.billNo}}</th>
  229. </tr>
  230. <tr>
  231. <td colspan="5">
  232. <img style="width: 100%;height: 40px;margin: 0 auto" :src="item.oneCode" alt="">
  233. </td>
  234. </tr>
  235. </table>
  236. </div>
  237. </div>
  238. <span slot="footer" class="dialog-footer">
  239. <el-button @click="dialogVisible = false">取 消</el-button>
  240. <el-button type="primary" v-print="'#printAll'">打 印</el-button>
  241. </span>
  242. </el-dialog>
  243. </div>
  244. </template>
  245. <script>
  246. import {
  247. detail,
  248. submit,
  249. checkWarehousing,
  250. getStoragetree,
  251. getStorage,
  252. getAllgoods,
  253. delItem,
  254. revokeWarehousing,
  255. withdraw,
  256. receiptItemPrint, removeBatch
  257. } from "@/api/purchasingManagement/inStock";
  258. import tableOption from "./config/customerContact.json";
  259. import feeInfo from "@/components/fee-info/main";
  260. import checkSchedule from "../../../components/check/checkSchedule";
  261. import uploadFile from "@/components/upload-file/main";
  262. import {getToken} from "@/util/auth";
  263. import {contrastObj, contrastList, contrastList2} from "@/util/contrastData";
  264. import {validatenull} from '@/util/validate'
  265. import check from "@/components/check/check";
  266. import {dateFormat} from "@/util/date";
  267. export default {
  268. name: "detailsPageEdit",
  269. data() {
  270. return {
  271. checkData: {},
  272. checkDialog: false,
  273. dialogVisible: false,
  274. subLoading: false,
  275. batchPrinting:true,
  276. batchDeletion:true,
  277. form: {},
  278. printList:[],
  279. excelBox: false,
  280. excelOption: {
  281. submitBtn: false,
  282. emptyBtn: false,
  283. column: [
  284. {
  285. label: '模板下载',
  286. prop: 'excelTemplate',
  287. formslot: true,
  288. span: 24,
  289. }, {
  290. label: '模板上传',
  291. prop: 'excelFile',
  292. type: 'upload',
  293. drag: true,
  294. loadText: '模板上传中,请稍等',
  295. span: 24,
  296. propsHttp: {
  297. res: 'data'
  298. },
  299. tip: '请上传 .xls,.xlsx 标准格式文件',
  300. action: "/api/trade-purchase/woodHarvestingCloud/import"
  301. }
  302. ]
  303. },
  304. excelForm: {},
  305. checkScheduleDialog: false,
  306. tableOption: {},
  307. selectionList:[],
  308. option: {
  309. disabled: false,
  310. menuBtn: false,
  311. labelWidth: 100,
  312. column: [
  313. {
  314. label: "货权人",
  315. prop: "purchaserId",
  316. rules: [
  317. {
  318. required: true,
  319. message: "",
  320. trigger: "blur"
  321. }
  322. ],
  323. span: 6
  324. },
  325. {
  326. label: "入库日期",
  327. prop: "stockTime",
  328. type: "datetime",
  329. value: dateFormat(new Date(),'yyyy-MM-dd hh:mm:ss'),
  330. format: "yyyy-MM-dd HH:mm",
  331. valueFormat: "yyyy-MM-dd HH:mm:ss",
  332. rules: [
  333. {
  334. required: true,
  335. message: "",
  336. trigger: "blur"
  337. }
  338. ],
  339. span: 6
  340. },
  341. {
  342. label: "箱号",
  343. prop: "caseNo",
  344. span: 6,
  345. blur: (data) => {
  346. for (let item of this.itemsVOList){
  347. item.containerNo = data.value
  348. }
  349. }
  350. },
  351. {
  352. label: "提单号",
  353. prop: "billNo",
  354. rules: [{
  355. required: true,
  356. message: "",
  357. trigger: "blur"
  358. }],
  359. span: 6
  360. },
  361. {
  362. label: "仓库",
  363. prop: "storageId",
  364. rules: [{
  365. required: true,
  366. message: "",
  367. trigger: "blur"
  368. }],
  369. span: 6
  370. },
  371. {
  372. label: "业务类型",
  373. prop: "businessType",
  374. type: "select",
  375. props: {
  376. label: "dictValue",
  377. value: "dictKey"
  378. },
  379. dicData: [],
  380. span: 6
  381. },
  382. {
  383. label: "车船号",
  384. prop: "vehicleShipNumber",
  385. rules: [{
  386. required: false,
  387. message: "",
  388. trigger: "blur"
  389. }],
  390. span: 6
  391. },
  392. {
  393. label: "审核状态",
  394. prop: "status",
  395. type: "select",
  396. dataType: 'number',
  397. props: {
  398. label: "dictValue",
  399. value: "dictKey"
  400. },
  401. dicData: [],
  402. disabled: true,
  403. span: 6
  404. },
  405. {
  406. label: "供应商",
  407. prop: "corpId",
  408. span: 6
  409. },
  410. {
  411. label: "入库单号",
  412. prop: "sysNo",
  413. disabled: true,
  414. span: 6
  415. },
  416. {
  417. label: "库管员",
  418. prop: "stockUser",
  419. span: 6,
  420. dataType: "number",
  421. type: 'select',
  422. dicUrl: "/api/blade-user/MCSelectList",
  423. props: {
  424. label: "realName",
  425. value: "id"
  426. }
  427. },
  428. {
  429. label: "是否融资",
  430. prop: "arrival",
  431. type: "select",
  432. dataType: 'number',
  433. value: 0,
  434. dicData: [
  435. {
  436. label: "是",
  437. value: 1
  438. }, {
  439. label: "否",
  440. value: 0
  441. }
  442. ],
  443. change: (data) => {
  444. if (data.value == 0) {
  445. this.findObject(this.tableOption.column, "price").label = "入库单价"
  446. this.findObject(this.tableOption.column, "price").rules[0].required = false
  447. } else {
  448. this.findObject(this.tableOption.column, "price").label = "*入库单价"
  449. this.findObject(this.tableOption.column, "price").rules[0].required = true
  450. }
  451. },
  452. span: 6
  453. }, {
  454. label: "备注",
  455. prop: "orderRemark",
  456. type: "textarea",
  457. minRows: 1,
  458. span: 24
  459. },
  460. ]
  461. },
  462. itemsVOList: [],
  463. orderFeesList: [],
  464. orderFilesList: [],
  465. pageLoading: false,
  466. batchNo: '',
  467. storagetreeList: [],
  468. oldform: {},
  469. olditemsVOList: [],
  470. oldorderFeesList: [],
  471. oldorderFilesList: [],
  472. roleName: localStorage.getItem("roleName")
  473. };
  474. },
  475. props: {
  476. detailData: {
  477. type: Object
  478. }
  479. },
  480. components: {
  481. feeInfo,
  482. checkSchedule,
  483. uploadFile,
  484. check
  485. },
  486. async created() {
  487. if (this.detailData.status == 1) {
  488. this.option.disabled = true;
  489. }
  490. if (this.detailData.id) {
  491. this.getDetail(this.detailData.id);
  492. }
  493. this.tableOption = await this.getColumnData(
  494. this.getColumnName(189),
  495. tableOption
  496. );
  497. getStoragetree().then(res => {
  498. this.storagetreeList = res.data.data;
  499. })
  500. this.getWorkDicts("financing_status").then(res => {
  501. this.findObject(this.option.column, "status").dicData =
  502. res.data.data;
  503. });
  504. this.getWorkDicts("CMY_business_type").then(res => {
  505. this.findObject(this.option.column, "businessType").dicData =
  506. res.data.data;
  507. });
  508. this.getAllWorkDicts()
  509. },
  510. methods: {
  511. batchDeleteDetails(){
  512. let data = []
  513. for (let item of this.selectionList){
  514. data.push(item.id)
  515. }
  516. removeBatch({ids:data.join(",")}).then(res=>{
  517. for(let item of data){
  518. for (let i in this.itemsVOList){
  519. if (item === this.itemsVOList[i].id){
  520. this.itemsVOList.splice(i, 1);
  521. }
  522. }
  523. }
  524. })
  525. },
  526. printStackCard(){
  527. let data = []
  528. for (let item of this.selectionList){
  529. data.push(item.id)
  530. }
  531. receiptItemPrint({ids:data.join(",")}).then(res=>{
  532. this.printList = res.data.data
  533. this.dialogVisible = true
  534. })
  535. },
  536. selectionChange(list){
  537. this.selectionList = list
  538. if (this.selectionList.length === 0){
  539. this.batchPrinting = true
  540. this.batchDeletion = true
  541. }
  542. for(let item of this.selectionList){
  543. if (item.isIssue == 0 || !item.isIssue) {
  544. this.batchPrinting = true
  545. break
  546. }else {
  547. this.batchPrinting = false
  548. }
  549. }
  550. for(let item of this.selectionList){
  551. if (item.isIssue > 0 || !item.id) {
  552. this.batchDeletion = true
  553. break
  554. }else {
  555. this.batchDeletion = false
  556. }
  557. }
  558. },
  559. check() {
  560. this.checkData = this.$route.query.check
  561. this.checkDialog = true
  562. },
  563. //关闭审核
  564. choceCheckFun() {
  565. this.checkDialog = false;
  566. },
  567. getData() {
  568. getAllgoods().then(res => {
  569. this.findObject(this.tableOption.column, "itemId").dicData =
  570. res.data.data;
  571. })
  572. getStoragetree().then(res => {
  573. this.storagetreeList = res.data.data;
  574. })
  575. this.getStorage()
  576. this.$refs.purchaser.refreshData()
  577. this.$refs.corpId.refreshData()
  578. },
  579. getAllWorkDicts() {
  580. getAllgoods().then(res => {
  581. this.findObject(this.tableOption.column, "itemId").dicData = res.data.data;
  582. })
  583. this.findObject(this.tableOption.column, "itemId").change = (data)=>{
  584. for (let item of this.findObject(this.tableOption.column, "itemId").dicData){
  585. if (data.value == item.id){
  586. this.itemsVOList[data.index].cname = item.cname
  587. }
  588. }
  589. }
  590. this.getWorkDicts("unit").then(res => {
  591. this.findObject(this.tableOption.column, "unit").dicData =
  592. res.data.data;
  593. });
  594. this.getWorkDicts("goods_grade").then(res => {
  595. this.findObject(this.tableOption.column, "grade").dicData =
  596. res.data.data;
  597. });
  598. this.getWorkDicts("brand").then(res => {
  599. this.findObject(this.tableOption.column, "itemType").dicData =
  600. res.data.data;
  601. });
  602. },
  603. cellStyle() {
  604. return "padding:0;height:40px;";
  605. },
  606. getStorage() {
  607. getStorage({storageTypeId: this.form.storageId}).then(res => {
  608. this.findObject(this.tableOption.column, "storageId").dicData = res.data;
  609. })
  610. },
  611. storagetreeChange(row) {
  612. if (row) {
  613. if (this.itemsVOList.length > 0) {
  614. this.getStorage()
  615. this.itemsVOList.forEach(e => {
  616. e.storageId = null
  617. })
  618. this.$message.warning("请重新选择库区!")
  619. }
  620. } else {
  621. if (this.itemsVOList.length > 0) {
  622. this.findObject(this.tableOption.column, "storageId").dicData = []
  623. this.itemsVOList.forEach(e => {
  624. e.storageId = null
  625. })
  626. this.$message.warning("请重新选择库区!")
  627. }
  628. }
  629. },
  630. getKHData(row) {
  631. this.form.purchaser = row.cname
  632. },
  633. getGYSData(row) {
  634. console.log(row)
  635. this.form.corpName = row.cname
  636. },
  637. choceScheduleFun() {
  638. this.checkScheduleDialog = false
  639. },
  640. addRow() {
  641. this.$refs["form"].validate((valid, done) => {
  642. done();
  643. if (valid) {
  644. this.itemsVOList.push({$cellEdit: true, unit: '1',containerNo:this.form.caseNo});
  645. this.getStorage()
  646. } else {
  647. return false;
  648. }
  649. });
  650. },
  651. rowCell(row, index) {
  652. this.$refs.crud.rowCell(row, index)
  653. },
  654. rowSave(form, done) {
  655. done()
  656. },
  657. addUpdate(form, index, done, loading) {
  658. done()
  659. },
  660. rowDel(row) {
  661. this.$confirm("确定删除数据?", {
  662. confirmButtonText: "确定",
  663. cancelButtonText: "取消",
  664. type: "warning"
  665. }).then(() => {
  666. if (row.id) {
  667. delItem({itemId: row.id,type:"RK"}).then(res => {
  668. this.$message.success("删除成功!");
  669. this.itemsVOList.splice(row.$index, 1);
  670. });
  671. } else {
  672. this.$message.success("删除成功!");
  673. this.itemsVOList.splice(row.$index, 1);
  674. }
  675. });
  676. },
  677. getDetail(id) {
  678. this.pageLoading = true;
  679. detail(id)
  680. .then(res => {
  681. this.form = res.data.data;
  682. this.itemsVOList = res.data.data.itemsVOList;
  683. this.orderFeesList = res.data.data.orderFeesList;
  684. this.orderFilesList = res.data.data.orderFilesList;
  685. this.oldform = this.deepClone(res.data.data);
  686. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  687. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  688. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  689. this.getStorage()
  690. })
  691. .finally(() => {
  692. this.pageLoading = false;
  693. });
  694. },
  695. rowPrint(row) {
  696. this.$router.push(`/myiframe/urlPath?name=preview-木材管理-入库垛卡.ureport.xml&src=${this.website.reportUrl}/preview?_u=blade-木材管理-入库垛卡.ureport.xml&id=${row.id}`);
  697. },
  698. receiptDoc(){
  699. this.$router.push(`/myiframe/urlPath?name=preview-木材库-入库单.ureport.xml&src=${this.website.reportUrl}/preview%3F_u%3Dblade-木材库-入库单.ureport.xml&id=${this.form.id}`);
  700. },
  701. //提交撤销
  702. withdraw(type) {
  703. if (type == 0) {
  704. this.$confirm("是否确认提交?", {
  705. confirmButtonText: "确定",
  706. cancelButtonText: "取消",
  707. type: "warning"
  708. }).then(() => {
  709. for (let i = 0; i < this.itemsVOList.length; i++) {
  710. // if (validatenull(this.itemsVOList[i].storageId)) {
  711. // return this.$message.error('请完善第' + (i + 1) + '行的库区')
  712. // }
  713. if (validatenull(this.itemsVOList[i].itemId)) {
  714. return this.$message.error('请完善第' + (i + 1) + '行的品名')
  715. }
  716. // if (validatenull(this.itemsVOList[i].itemType)) {
  717. // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
  718. // }
  719. // if (validatenull(this.itemsVOList[i].grade)) {
  720. // return this.$message.error('请完善第' + (i + 1) + '行的等级')
  721. // }
  722. if (validatenull(this.itemsVOList[i].billNo)) {
  723. return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
  724. }
  725. // if (validatenull(this.itemsVOList[i].sliceNumber)) {
  726. // return this.$message.error('请完善第' + (i + 1) + '行的片数')
  727. // }
  728. if (validatenull(this.itemsVOList[i].storageInQuantity)) {
  729. return this.$message.error('请完善第' + (i + 1) + '行的入库量')
  730. }
  731. // if (validatenull(this.itemsVOList[i].unit)) {
  732. // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
  733. // }
  734. if (this.form.arrival == 1) {
  735. if (validatenull(this.itemsVOList[i].price)) {
  736. return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
  737. }
  738. }
  739. }
  740. this.itemsVOList.forEach((e, index) => {
  741. e.sort = Number(index) + 1
  742. })
  743. let orderFeesList = this.$refs.feeInfo.submitData();
  744. this.subLoading = true;
  745. let data = {
  746. ...this.form,
  747. billType: 'RK',
  748. itemsVOList: this.itemsVOList,
  749. orderFeesList: orderFeesList,
  750. orderFilesList: this.orderFilesList
  751. };
  752. submit(data).then(res => {
  753. this.form = res.data.data;
  754. this.itemsVOList = res.data.data.itemsVOList;
  755. this.orderFeesList = res.data.data.orderFeesList;
  756. this.orderFilesList = res.data.data.orderFilesList;
  757. this.oldform = this.deepClone(res.data.data);
  758. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  759. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  760. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  761. this.$message({
  762. type: "success",
  763. message: "保存成功!"
  764. });
  765. if (!this.detailData.id){
  766. this.detailData.id = res.data.data.id
  767. }
  768. if (this.itemsVOList.length == 0) {
  769. this.subLoading = false
  770. return this.$message({
  771. type: "warning",
  772. message: "无明细不允许提交!"
  773. });
  774. }
  775. withdraw({
  776. id: this.form.id,
  777. type: "RK",
  778. status: 1,
  779. isIssue: 1
  780. }).then(res => {
  781. this.$message({
  782. type: "success",
  783. message: "提交成功!"
  784. });
  785. this.getDetail(this.form.id);
  786. this.subLoading = false;
  787. })
  788. })
  789. })
  790. } else if(type == 2){
  791. this.$confirm("是否确认入库?", {
  792. confirmButtonText: "确定",
  793. cancelButtonText: "取消",
  794. type: "warning"
  795. }).then(() => {
  796. withdraw({
  797. id: this.form.id,
  798. type: "RK",
  799. status: 2,
  800. isIssue: 3,
  801. toolType: 'app'
  802. }).then(res => {
  803. this.$message({
  804. type: "success",
  805. message: "入库成功!"
  806. });
  807. this.getDetail(this.form.id);
  808. this.subLoading = false;
  809. })
  810. })
  811. } else if(type == 3){
  812. this.$confirm("是否确认撤销?", {
  813. confirmButtonText: "确定",
  814. cancelButtonText: "取消",
  815. type: "warning"
  816. }).then(() => {
  817. withdraw({
  818. id: this.form.id,
  819. type: "RK",
  820. status: 1,
  821. isIssue: 1,
  822. toolType: 'app'
  823. }).then(res => {
  824. this.$message({
  825. type: "success",
  826. message: "撤销成功!"
  827. });
  828. this.getDetail(this.form.id);
  829. this.subLoading = false;
  830. })
  831. })
  832. }else {
  833. this.$confirm("是否确认撤销?", {
  834. confirmButtonText: "确定",
  835. cancelButtonText: "取消",
  836. type: "warning"
  837. }).then(() => {
  838. for (let i = 0; i < this.itemsVOList.length; i++) {
  839. // if (validatenull(this.itemsVOList[i].storageId)) {
  840. // return this.$message.error('请完善第' + (i + 1) + '行的库区')
  841. // }
  842. if (validatenull(this.itemsVOList[i].itemId)) {
  843. return this.$message.error('请完善第' + (i + 1) + '行的品名')
  844. }
  845. // if (validatenull(this.itemsVOList[i].itemType)) {
  846. // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
  847. // }
  848. // if (validatenull(this.itemsVOList[i].grade)) {
  849. // return this.$message.error('请完善第' + (i + 1) + '行的等级')
  850. // }
  851. if (validatenull(this.itemsVOList[i].billNo)) {
  852. return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
  853. }
  854. // if (validatenull(this.itemsVOList[i].sliceNumber)) {
  855. // return this.$message.error('请完善第' + (i + 1) + '行的片数')
  856. // }
  857. if (validatenull(this.itemsVOList[i].storageInQuantity)) {
  858. return this.$message.error('请完善第' + (i + 1) + '行的入库量')
  859. }
  860. // if (validatenull(this.itemsVOList[i].unit)) {
  861. // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
  862. // }
  863. if (this.form.arrival == 1) {
  864. if (validatenull(this.itemsVOList[i].price)) {
  865. return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
  866. }
  867. }
  868. }
  869. this.itemsVOList.forEach((e, index) => {
  870. e.sort = Number(index) + 1
  871. })
  872. let orderFeesList = this.$refs.feeInfo.submitData();
  873. this.subLoading = true;
  874. let data = {
  875. ...this.form,
  876. billType: 'RK',
  877. itemsVOList: this.itemsVOList,
  878. orderFeesList: orderFeesList,
  879. orderFilesList: this.orderFilesList
  880. };
  881. submit(data).then(res => {
  882. this.form = res.data.data;
  883. this.itemsVOList = res.data.data.itemsVOList;
  884. this.orderFeesList = res.data.data.orderFeesList;
  885. this.orderFilesList = res.data.data.orderFilesList;
  886. this.oldform = this.deepClone(res.data.data);
  887. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  888. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  889. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  890. this.$message({
  891. type: "success",
  892. message: "保存成功!"
  893. });
  894. if (!this.detailData.id){
  895. this.detailData.id = res.data.data.id
  896. }
  897. withdraw({
  898. id: this.form.id,
  899. type: "RK",
  900. status: 0,
  901. isIssue: 0
  902. }).then(res => {
  903. this.$message({
  904. type: "success",
  905. message: "撤销成功!"
  906. });
  907. this.getDetail(this.form.id);
  908. this.subLoading = false;
  909. })
  910. })
  911. })
  912. }
  913. },
  914. //修改提交触发
  915. editCustomer(status) {
  916. this.$refs["form"].validate((valid, done) => {
  917. done();
  918. if (valid) {
  919. for (let i = 0; i < this.itemsVOList.length; i++) {
  920. // if (validatenull(this.itemsVOList[i].storageId)) {
  921. // return this.$message.error('请完善第' + (i + 1) + '行的库区')
  922. // }
  923. if (validatenull(this.itemsVOList[i].itemId)) {
  924. return this.$message.error('请完善第' + (i + 1) + '行的品名')
  925. }
  926. // if (validatenull(this.itemsVOList[i].itemType)) {
  927. // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
  928. // }
  929. // if (validatenull(this.itemsVOList[i].grade)) {
  930. // return this.$message.error('请完善第' + (i + 1) + '行的等级')
  931. // }
  932. if (validatenull(this.itemsVOList[i].billNo)) {
  933. return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
  934. }
  935. // if (validatenull(this.itemsVOList[i].sliceNumber)) {
  936. // return this.$message.error('请完善第' + (i + 1) + '行的片数')
  937. // }
  938. if (validatenull(this.itemsVOList[i].storageInQuantity)) {
  939. return this.$message.error('请完善第' + (i + 1) + '行的入库量')
  940. }
  941. // if (validatenull(this.itemsVOList[i].unit)) {
  942. // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
  943. // }
  944. if (this.form.arrival == 1) {
  945. if (validatenull(this.itemsVOList[i].price)) {
  946. return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
  947. }
  948. }
  949. }
  950. this.itemsVOList.forEach((e, index) => {
  951. e.sort = Number(index) + 1
  952. })
  953. let orderFeesList = this.$refs.feeInfo.submitData();
  954. this.subLoading = true;
  955. let data = {
  956. ...this.form,
  957. billType: 'RK',
  958. itemsVOList: this.itemsVOList,
  959. orderFeesList: orderFeesList,
  960. orderFilesList: this.orderFilesList
  961. };
  962. submit(data).then(res => {
  963. this.form = res.data.data;
  964. this.itemsVOList = res.data.data.itemsVOList;
  965. this.orderFeesList = res.data.data.orderFeesList;
  966. this.orderFilesList = res.data.data.orderFilesList;
  967. this.oldform = this.deepClone(res.data.data);
  968. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  969. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  970. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  971. this.$message({
  972. type: "success",
  973. message: "保存成功!"
  974. });
  975. if (!this.detailData.id){
  976. this.detailData.id = res.data.data.id
  977. }
  978. this.getDetail(res.data.data.id)
  979. }).finally(() => {
  980. this.subLoading = false;
  981. });
  982. } else {
  983. return false;
  984. }
  985. });
  986. },
  987. //请核
  988. auditCheck() {
  989. let orderFeesList = this.$refs.feeInfo.submitData();
  990. if (orderFeesList.length == 0) {
  991. this.$confirm("没有应付费用,是否继续提交?", {
  992. confirmButtonText: "确定",
  993. cancelButtonText: "取消",
  994. type: "warning"
  995. }).then(() => {
  996. this.$confirm("确定审核此订单?", {
  997. confirmButtonText: "确定",
  998. cancelButtonText: "取消",
  999. type: "warning"
  1000. }).then(() => {
  1001. for (let i = 0; i < this.itemsVOList.length; i++) {
  1002. // if (validatenull(this.itemsVOList[i].storageId)) {
  1003. // return this.$message.error('请完善第' + (i + 1) + '行的库区')
  1004. // }
  1005. if (validatenull(this.itemsVOList[i].itemId)) {
  1006. return this.$message.error('请完善第' + (i + 1) + '行的品名')
  1007. }
  1008. // if (validatenull(this.itemsVOList[i].itemType)) {
  1009. // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
  1010. // }
  1011. // if (validatenull(this.itemsVOList[i].grade)) {
  1012. // return this.$message.error('请完善第' + (i + 1) + '行的等级')
  1013. // }
  1014. if (validatenull(this.itemsVOList[i].billNo)) {
  1015. return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
  1016. }
  1017. // if (validatenull(this.itemsVOList[i].sliceNumber)) {
  1018. // return this.$message.error('请完善第' + (i + 1) + '行的片数')
  1019. // }
  1020. if (validatenull(this.itemsVOList[i].storageInQuantity)) {
  1021. return this.$message.error('请完善第' + (i + 1) + '行的入库量')
  1022. }
  1023. // if (validatenull(this.itemsVOList[i].unit)) {
  1024. // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
  1025. // }
  1026. if (this.form.arrival == 1) {
  1027. if (validatenull(this.itemsVOList[i].price)) {
  1028. return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
  1029. }
  1030. }
  1031. }
  1032. this.itemsVOList.forEach((e, index) => {
  1033. e.sort = Number(index) + 1
  1034. })
  1035. let orderFeesList = this.$refs.feeInfo.submitData();
  1036. this.subLoading = true;
  1037. let data = {
  1038. ...this.form,
  1039. billType: 'RK',
  1040. itemsVOList: this.itemsVOList,
  1041. orderFeesList: orderFeesList,
  1042. orderFilesList: this.orderFilesList
  1043. };
  1044. submit(data).then(res => {
  1045. this.form = res.data.data;
  1046. this.itemsVOList = res.data.data.itemsVOList;
  1047. this.orderFeesList = res.data.data.orderFeesList;
  1048. this.orderFilesList = res.data.data.orderFilesList;
  1049. this.oldform = this.deepClone(res.data.data);
  1050. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  1051. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  1052. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  1053. this.$message({
  1054. type: "success",
  1055. message: "保存成功!"
  1056. });
  1057. if (!this.detailData.id){
  1058. this.detailData.id = res.data.data.id
  1059. }
  1060. const datat = {
  1061. id: this.form.id,
  1062. checkType: 'RK',
  1063. url: '/purchasingManagement/inStock/index',
  1064. pageStatus: "this.$store.getters.entranceXsStatus",
  1065. pageLabel: "入库管理",
  1066. checkFlag: 1,
  1067. }
  1068. checkWarehousing(datat).then(res => {
  1069. if (res.data.success) {
  1070. this.$message.success("操作成功!")
  1071. }
  1072. }).finally(() => {
  1073. this.subLoading = false
  1074. this.getDetail(this.form.id)
  1075. })
  1076. })
  1077. }).catch(()=>{
  1078. this.subLoading = false
  1079. this.getDetail(this.form.id)
  1080. })
  1081. })
  1082. } else {
  1083. this.$confirm("确定审核此订单?", {
  1084. confirmButtonText: "确定",
  1085. cancelButtonText: "取消",
  1086. type: "warning"
  1087. }).then(() => {
  1088. for (let i = 0; i < this.itemsVOList.length; i++) {
  1089. // if (validatenull(this.itemsVOList[i].storageId)) {
  1090. // return this.$message.error('请完善第' + (i + 1) + '行的库区')
  1091. // }
  1092. if (validatenull(this.itemsVOList[i].itemId)) {
  1093. return this.$message.error('请完善第' + (i + 1) + '行的品名')
  1094. }
  1095. // if (validatenull(this.itemsVOList[i].itemType)) {
  1096. // return this.$message.error('请完善第' + (i + 1) + '行的品牌')
  1097. // }
  1098. // if (validatenull(this.itemsVOList[i].grade)) {
  1099. // return this.$message.error('请完善第' + (i + 1) + '行的等级')
  1100. // }
  1101. if (validatenull(this.itemsVOList[i].billNo)) {
  1102. return this.$message.error('请完善第' + (i + 1) + '行的捆包号')
  1103. }
  1104. // if (validatenull(this.itemsVOList[i].sliceNumber)) {
  1105. // return this.$message.error('请完善第' + (i + 1) + '行的片数')
  1106. // }
  1107. if (validatenull(this.itemsVOList[i].storageInQuantity)) {
  1108. return this.$message.error('请完善第' + (i + 1) + '行的入库量')
  1109. }
  1110. // if (validatenull(this.itemsVOList[i].unit)) {
  1111. // return this.$message.error('请完善第' + (i + 1) + '行的入库单位')
  1112. // }
  1113. if (this.form.arrival == 1) {
  1114. if (validatenull(this.itemsVOList[i].price)) {
  1115. return this.$message.error('请完善第' + (i + 1) + '行的入库单价')
  1116. }
  1117. }
  1118. }
  1119. this.itemsVOList.forEach((e, index) => {
  1120. e.sort = Number(index) + 1
  1121. })
  1122. let orderFeesList = this.$refs.feeInfo.submitData();
  1123. this.subLoading = true;
  1124. let data = {
  1125. ...this.form,
  1126. billType: 'RK',
  1127. itemsVOList: this.itemsVOList,
  1128. orderFeesList: orderFeesList,
  1129. orderFilesList: this.orderFilesList
  1130. };
  1131. submit(data).then(res => {
  1132. this.form = res.data.data;
  1133. this.itemsVOList = res.data.data.itemsVOList;
  1134. this.orderFeesList = res.data.data.orderFeesList;
  1135. this.orderFilesList = res.data.data.orderFilesList;
  1136. this.oldform = this.deepClone(res.data.data);
  1137. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  1138. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  1139. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  1140. this.$message({
  1141. type: "success",
  1142. message: "保存成功!"
  1143. });
  1144. if (!this.detailData.id){
  1145. this.detailData.id = res.data.data.id
  1146. }
  1147. const dataT = {
  1148. id: this.form.id,
  1149. checkType: 'RK',
  1150. url: '/purchasingManagement/inStock/index',
  1151. pageStatus: "this.$store.getters.entranceXsStatus",
  1152. pageLabel: "入库管理",
  1153. checkFlag: 1,
  1154. }
  1155. checkWarehousing(dataT).then(res => {
  1156. if (res.data.success) {
  1157. this.$message.success("操作成功!")
  1158. }
  1159. }).finally(() => {
  1160. this.subLoading = false
  1161. this.getDetail(this.form.id)
  1162. })
  1163. })
  1164. }).catch(()=>{
  1165. this.subLoading = false
  1166. this.getDetail(this.form.id)
  1167. })
  1168. }
  1169. },
  1170. revokeCheck() {
  1171. this.$confirm("确定撤销审核此订单?", {
  1172. confirmButtonText: "确定",
  1173. cancelButtonText: "取消",
  1174. type: "warning"
  1175. }).then(() => {
  1176. let orderFeesList = this.$refs.feeInfo.submitData();
  1177. this.subLoading = true;
  1178. let data = {
  1179. ...this.form,
  1180. billType: 'RK',
  1181. itemsVOList: this.itemsVOList,
  1182. orderFeesList: orderFeesList,
  1183. orderFilesList: this.orderFilesList
  1184. };
  1185. revokeWarehousing(data).then(res => {
  1186. if (res.data.success) {
  1187. this.$message.success("操作成功!")
  1188. }
  1189. }).finally(() => {
  1190. this.subLoading = false
  1191. this.getDetail(this.form.id)
  1192. })
  1193. })
  1194. },
  1195. calculateChange(row) {
  1196. row.storageAmount = Number((row.storageInQuantity ? row.storageInQuantity : 0) * (row.price ? row.price : 0)).toFixed(2)
  1197. },
  1198. beforeFinance(feesData, callback) {
  1199. let params = {}
  1200. //暂时默认通过 之后优化
  1201. params.valid = true
  1202. params.parentId = this.form.id
  1203. callback(params)
  1204. },
  1205. getTemplate() {
  1206. window.open(`/api/trade-purchase/woodHarvestingCloud/export-template?${this.website.tokenHeader}=${getToken()}`)
  1207. },
  1208. uploadAfter(res, done, loading, column) {
  1209. if (!res.message) {
  1210. res.forEach(item => {
  1211. this.itemsVOList.push({
  1212. ...item,
  1213. containerNo:this.form.caseNo,
  1214. $cellEdit: false
  1215. })
  1216. })
  1217. this.excelBox = false
  1218. done();
  1219. } else {
  1220. loading()
  1221. }
  1222. },
  1223. addData(row) {
  1224. if (row == 'purchaserId') {
  1225. this.$router.push(`/basicData/customerInformation/index`);
  1226. } else if (row == 'corpId') {
  1227. this.$router.push(`/basicData/customerManagement/supplierMaterial/index`);
  1228. } else if (row == 'storage') {
  1229. this.$router.push(`/basicData/basicStorageType/index`);
  1230. } else if (row == 'storageId') {
  1231. this.$router.push(`/basicData/basicStorageDesc/index`);
  1232. } else if (row == 'itemId') {
  1233. this.$router.push(`/basicData/commodityType/index`);
  1234. }
  1235. },
  1236. //返回列表
  1237. backToList() {
  1238. let orderFeesList = this.$refs.feeInfo.submitData();
  1239. if (
  1240. contrastObj(this.form, this.oldform) ||
  1241. contrastList(this.itemsVOList, this.olditemsVOList) ||
  1242. contrastList2(orderFeesList, this.oldorderFeesList) ||
  1243. contrastList(this.orderFilesList, this.oldorderFilesList)
  1244. ) {
  1245. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1246. confirmButtonText: "确定",
  1247. cancelButtonText: "取消",
  1248. type: "warning"
  1249. })
  1250. .then(() => {
  1251. this.editCustomer("goBack");
  1252. })
  1253. .catch(() => {
  1254. this.$emit("goBack");
  1255. });
  1256. } else {
  1257. this.$emit("goBack");
  1258. }
  1259. },
  1260. openEdit() {
  1261. this.detailData.status = 2;
  1262. this.option.disabled = false;
  1263. this.$refs.crud.refreshTable();
  1264. },
  1265. async saveColumn() {
  1266. const inSave = await this.saveColumnData(
  1267. this.getColumnName(189),
  1268. this.tableOption
  1269. );
  1270. if (inSave) {
  1271. this.$nextTick(() => {
  1272. this.$refs.crud.doLayout();
  1273. });
  1274. this.$message.success("保存成功");
  1275. //关闭窗口
  1276. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1277. }
  1278. },
  1279. moveUp(row, index) {
  1280. this.itemsVOList[index] = this.itemsVOList.splice(index - 1, 1, row)[0]
  1281. },
  1282. moveDown(row, index) {
  1283. this.itemsVOList[index] = this.itemsVOList.splice(index + 1, 1, row)[0]
  1284. },
  1285. async resetColumn() {
  1286. this.tableOption = tableOption;
  1287. const inSave = await this.delColumnData(
  1288. this.getColumnName(189),
  1289. tableOption
  1290. );
  1291. if (inSave) {
  1292. this.$nextTick(() => {
  1293. this.$refs.crud.doLayout();
  1294. });
  1295. this.tableOption.selectable = (row,index)=>{
  1296. return row.status == 0
  1297. }
  1298. this.$message.success("重置成功");
  1299. this.getAllWorkDicts()
  1300. this.getStorage()
  1301. //关闭窗口
  1302. setTimeout(() => {
  1303. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  1304. }, 1000);
  1305. }
  1306. }
  1307. },
  1308. watch: {}
  1309. };
  1310. </script>
  1311. <style lang="scss" scoped>
  1312. .trading-form ::v-deep .el-form-item {
  1313. margin-bottom: 8px !important;
  1314. }
  1315. ::v-deep .el-form-item__error {
  1316. display: none !important;
  1317. }
  1318. ::v-deep .select-component {
  1319. display: flex !important;
  1320. }
  1321. ::v-deep .el-table .cell {
  1322. padding: 0 2px !important;
  1323. }
  1324. ::v-deep .avue-crud .el-table .el-form-item__label {
  1325. left: -1px;
  1326. }
  1327. </style>