detailsPage.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  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="info" @click="getData" size="small">刷新资料
  11. </el-button>
  12. <el-button type="primary" size="small" :disabled="form.status>0" v-if="detailData.status == 1"
  13. class="el-button--small-yh " @click.stop="openEdit">编辑
  14. </el-button>
  15. <el-button type="primary" @click="editCustomer" :loading="subLoading" v-if="detailData.status != 1"
  16. size="small">保存数据
  17. </el-button>
  18. <el-dropdown style="padding: 0 6px;line-height: 0">
  19. <el-button type="primary" size="small" :loading="subLoading" :disabled="!form.id">
  20. 审核处理<i class="el-icon-arrow-down el-icon--right"></i>
  21. </el-button>
  22. <el-dropdown-menu slot="dropdown">
  23. <el-dropdown-item :disabled="form.status>0" @click.native="auditCheck">提交审核</el-dropdown-item>
  24. <el-dropdown-item v-if="roleName=='admin'" :disabled="form.status<1" @click.native="revokeCheck">撤销审核</el-dropdown-item>
  25. <el-dropdown-item :disabled="form.status<1" @click.native="checkScheduleDialog = true">审核进度
  26. </el-dropdown-item>
  27. <el-dropdown-item v-if="$route.query.check" :disabled="form.status==3" @click.native="check">审批数据
  28. </el-dropdown-item>
  29. </el-dropdown-menu>
  30. </el-dropdown>
  31. </div>
  32. </div>
  33. <div class="customer-main" v-loading="subLoading">
  34. <trade-card title="基础信息">
  35. <avue-form ref="form" class="trading-form" v-model="form" :option="option">
  36. <template slot="purchaserId">
  37. <crop-select ref="purchaser" v-model="form.purchaserId" corpType="KH" :refresh="false"
  38. @getCorpData="getKHData" :disabled="detailData.status == 1"></crop-select>
  39. </template>
  40. <template slot="corpId">
  41. <crop-select ref="corpId" v-model="form.corpId" corpType="GYS" :refresh="false" @getCorpData="getGYSData"
  42. :disabled="detailData.status == 1"></crop-select>
  43. </template>
  44. <template slot="storageId">
  45. <el-cascader v-model="form.storageId" :options="storagetreeList" :show-all-levels="false"
  46. :disabled="detailData.status == 1" :props="{ checkStrictly: true, emitPath: false, label: 'title' }"
  47. clearable @change="storagetreeChange">
  48. </el-cascader>
  49. </template>
  50. <template slot-scope="{column}" slot="purchaserIdLabel">
  51. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{column.label}}</span>
  52. </template>
  53. <template slot-scope="{column}" slot="corpIdLabel">
  54. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{column.label}}</span>
  55. </template>
  56. <template slot-scope="{column}" slot="storageIdLabel">
  57. <span style="color: #409EFF;cursor: pointer" @click.stop="addData('storage')">{{column.label}}</span>
  58. </template>
  59. </avue-form>
  60. </trade-card>
  61. <trade-card title="出库明细">
  62. <avue-crud ref="crud" :data="itemsVOList" :option="tableOption" @row-del="rowDel" @saveColumn="saveColumn"
  63. @resetColumn="resetColumn" :cell-style="cellStyle" @row-save="rowSave" @row-update="addUpdate">
  64. <template slot="menuLeft">
  65. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="detailData.status == 1"
  66. @click.stop="addRow">录入明细
  67. </el-button>
  68. <el-button type="success" icon="el-icon-bottom" size="small" @click.stop="getTemplate">下载模板
  69. </el-button>
  70. <!-- <el-button type="info" icon="el-icon-top" size="small" :disabled="detailData.status == 1"
  71. @click.stop="addRow">导入
  72. </el-button> -->
  73. <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印</el-button>
  74. </template>
  75. <template slot="headerSerial">
  76. <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
  77. :disabled="detailData.status == 1" circle></el-button>
  78. </template>
  79. <template slot="storageIdHeader" slot-scope="{column}">
  80. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{column.label}}</span>
  81. </template>
  82. <template slot="itemIdHeader" slot-scope="{column}">
  83. <span style="color: #409EFF;cursor: pointer" @click.stop="addData(column.prop)">{{column.label}}</span>
  84. </template>
  85. <template slot="oneCode" slot-scope="{ row, index }">
  86. <el-popover placement="right" width="160" trigger="click">
  87. <el-image style="width: 160px; height: 80px" :src="row.oneCode" :fit="fit"></el-image>
  88. <el-button v-if="row.oneCode" type="text" slot="reference">查看</el-button>
  89. </el-popover>
  90. </template>
  91. <template slot="qrCode" slot-scope="{ row, index }">
  92. <el-popover placement="right" width="300" trigger="click">
  93. <el-image style="width: 300px; height: 300px" :src="row.qrCode" :fit="fit"></el-image>
  94. <el-button v-if="row.qrCode" type="text" slot="reference">查看</el-button>
  95. </el-popover>
  96. </template>
  97. <template slot="storageInQuantityForm" slot-scope="{ row,disabled }">
  98. <el-input-number size="small" v-model="row.storageInQuantity" @change="calculateChange(row)"
  99. :controls="false" style="width:100%" placeholder="请输入"></el-input-number>
  100. </template>
  101. <template slot="priceForm" slot-scope="{ row,disabled }">
  102. <el-input-number size="small" v-model="row.price" @change="calculateChange(row)" :controls="false"
  103. style="width:100%" placeholder="请输入"></el-input-number>
  104. </template>
  105. <template slot="menu" slot-scope="{ row, index }">
  106. <div style="display:flex;justify-content: center;">
  107. <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
  108. :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "编辑" }}</el-button>
  109. <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
  110. :disabled="detailData.status == 1">删除</el-button>
  111. <!-- <el-button size="small" icon="el-icon-printer" type="text" @click="rowPrint(row, index)" :disabled="!row.id">
  112. 打印</el-button> -->
  113. <div style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
  114. <el-tooltip effect="dark" content="向上移动" placement="top">
  115. <i v-if="index != 0&&detailData.status != 1" :disabled="detailData.status == 1"
  116. class="el-icon-arrow-up" @click="moveUp(row, index)" style="color:#409EFF;"></i>
  117. </el-tooltip>
  118. <el-tooltip effect="dark" content="向下移动" placement="bottom"> <i
  119. v-if="index != (itemsVOList.length - 1)&&detailData.status != 1" :disabled="detailData.status == 1"
  120. class="el-icon-arrow-down" @click="moveDown(row, index)" style="color:#409EFF;"></i></el-tooltip>
  121. </div>
  122. </div>
  123. </template>
  124. </avue-crud>
  125. </trade-card>
  126. <fee-info ref="feeInfo" :orderFeesList="orderFeesList" :disabled="detailData.status == 1"
  127. feeUrl="/blade-purchase-sales/entranceOrder/removeOrderFees" :optionType="'CMY'" :itemType="'D'"
  128. :inCropId="true" @beforeFinance="beforeFinance" :delType="2" :billingShow="false" />
  129. <!-- <upload-file ref="uploadFile" title="合同附件" :disabled="detailData.status == 1" :orderFilesList="orderFilesList"
  130. delUrl="" /> -->
  131. <containerTitle title="上传附件"></containerTitle>
  132. <c-upload typeUpload="CD" deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
  133. :data="orderFilesList" display :enumerationValue="85.6" :disabled="detailData.status == 1"></c-upload>
  134. <el-dialog append-to-body title="审核进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  135. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  136. <check-schedule :checkId="form.id" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
  137. </check-schedule>
  138. </el-dialog>
  139. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  140. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  141. <check :checkData="checkData" :checkDetail="false" :idList="[]" @choceCheckFun="choceCheckFun">
  142. </check>
  143. </el-dialog>
  144. </div>
  145. </div>
  146. </template>
  147. <script>
  148. import { detail, submit, checkWarehousing, getStoragetree, getStorage, getAllgoods, financingExcess, revokeWarehousing,delItem } from "@/api/purchasingManagement/inStock";
  149. import tableOption from "./config/customerContact.json";
  150. import feeInfo from "@/components/fee-info/main";
  151. import checkSchedule from "../../../components/check/checkSchedule";
  152. import uploadFile from "@/components/upload-file/main";
  153. import { getToken } from "@/util/auth";
  154. import { contrastObj, contrastList, contrastList2 } from "@/util/contrastData";
  155. import { getCurrentDate } from "@/util/date";
  156. import check from "@/components/check/check";
  157. export default {
  158. name: "detailsPageEdit",
  159. data() {
  160. return {
  161. checkData: {},
  162. checkDialog: false,
  163. form: {},
  164. checkScheduleDialog: false,
  165. tableOption: {},
  166. option: {
  167. disabled: false,
  168. menuBtn: false,
  169. labelWidth: 100,
  170. column: [
  171. {
  172. label: "货权人",
  173. prop: "purchaserId",
  174. rules: [
  175. {
  176. required: true,
  177. message: "",
  178. trigger: "blur"
  179. }
  180. ],
  181. span: 6
  182. },
  183. {
  184. label: "出库日期",
  185. prop: "stockTime",
  186. type: "datetime",
  187. format: "yyyy-MM-dd HH:mm:ss",
  188. valueFormat: "yyyy-MM-dd HH:mm:ss",
  189. rules: [
  190. {
  191. required: true,
  192. message: "",
  193. trigger: "blur"
  194. }
  195. ],
  196. span: 6
  197. },
  198. {
  199. label: "仓库",
  200. prop: "storageId",
  201. rules: [
  202. {
  203. required: true,
  204. message: "",
  205. trigger: "blur"
  206. }
  207. ],
  208. span: 6
  209. },
  210. {
  211. label: "提单号",
  212. prop: "billNo",
  213. span: 6
  214. },
  215. {
  216. label: "业务类型",
  217. prop: "businessType",
  218. type: "select",
  219. props: {
  220. label: "dictValue",
  221. value: "dictKey"
  222. },
  223. dicData: [],
  224. span: 6
  225. },
  226. {
  227. label: "车船号",
  228. prop: "vehicleShipNumber",
  229. span: 6
  230. },
  231. {
  232. label: "供应商",
  233. prop: "corpId",
  234. span: 6
  235. },
  236. {
  237. label: "出库单号",
  238. prop: "sysNo",
  239. disabled: true,
  240. span: 6
  241. },
  242. {
  243. label: "审核状态",
  244. prop: "status",
  245. type: "select",
  246. dataType: 'number',
  247. props: {
  248. label: "dictValue",
  249. value: "dictKey"
  250. },
  251. dicData: [],
  252. disabled: true,
  253. span: 6
  254. },
  255. {
  256. label: "备注",
  257. prop: "orderRemark",
  258. type: "textarea",
  259. minRows: 2,
  260. span: 18
  261. },
  262. ]
  263. },
  264. itemsVOList: [],
  265. orderFeesList: [],
  266. orderFilesList: [],
  267. subLoading: false,
  268. pageLoading: false,
  269. batchNo: '',
  270. storagetreeList: [],
  271. oldform: {},
  272. olditemsVOList: [],
  273. oldorderFeesList: [],
  274. oldorderFilesList: [],
  275. roleName:localStorage.getItem("roleName")
  276. };
  277. },
  278. props: {
  279. detailData: {
  280. type: Object
  281. }
  282. },
  283. components: {
  284. feeInfo,
  285. checkSchedule,
  286. uploadFile,
  287. check
  288. },
  289. async created() {
  290. if (this.detailData.status == 1) {
  291. this.option.disabled = true;
  292. }
  293. if (this.detailData.id) {
  294. this.getDetail(this.detailData.id);
  295. }
  296. this.tableOption = await this.getColumnData(
  297. this.getColumnName(191),
  298. tableOption
  299. );
  300. getStoragetree().then(res => {
  301. this.storagetreeList = res.data.data;
  302. })
  303. this.getWorkDicts("approval_status").then(res => {
  304. this.findObject(this.option.column, "status").dicData =
  305. res.data.data;
  306. });
  307. this.getWorkDicts("CMY_business_type").then(res => {
  308. this.findObject(this.option.column, "businessType").dicData =
  309. res.data.data;
  310. });
  311. if (this.$route.query.generateId) {
  312. this.getGenerate(this.$route.query.generateId);
  313. }
  314. this.getAllWorkDicts()
  315. },
  316. methods: {
  317. check() {
  318. this.checkData = this.$route.query.check
  319. this.checkDialog = true
  320. },
  321. //关闭审核
  322. choceCheckFun() {
  323. this.checkDialog = false;
  324. },
  325. getData() {
  326. getAllgoods().then(res => {
  327. this.findObject(this.tableOption.column, "itemId").dicData =
  328. res.data.data;
  329. })
  330. getStoragetree().then(res => {
  331. this.storagetreeList = res.data.data;
  332. })
  333. this.getStorage()
  334. this.$refs.purchaser.refreshData()
  335. this.$refs.corpId.refreshData()
  336. },
  337. getAllWorkDicts() {
  338. getAllgoods().then(res => {
  339. this.findObject(this.tableOption.column, "itemId").dicData =
  340. res.data.data;
  341. })
  342. this.getWorkDicts("unit").then(res => {
  343. this.findObject(this.tableOption.column, "unit").dicData =
  344. res.data.data;
  345. });
  346. },
  347. cellStyle() {
  348. return "padding:0;height:40px;";
  349. },
  350. getStorage() {
  351. getStorage({ storageTypeId: this.form.storageId }).then(res => {
  352. this.findObject(this.tableOption.column, "storageId").dicData = res.data;
  353. })
  354. },
  355. storagetreeChange(row) {
  356. if (row) {
  357. if (this.itemsVOList.length > 0) {
  358. this.getStorage()
  359. this.itemsVOList.forEach(e => {
  360. e.storageId = null
  361. })
  362. this.$message.warning("请重新选择库区!")
  363. }
  364. } else {
  365. if (this.itemsVOList.length > 0) {
  366. this.findObject(this.tableOption.column, "storageId").dicData = []
  367. this.itemsVOList.forEach(e => {
  368. e.storageId = null
  369. })
  370. this.$message.warning("请重新选择库区!")
  371. }
  372. }
  373. },
  374. getKHData(row) {
  375. this.form.purchaser = row.cname
  376. },
  377. getGYSData(row) {
  378. this.form.corpName = row.cname
  379. },
  380. choceScheduleFun() {
  381. this.checkScheduleDialog = false
  382. },
  383. addRow() {
  384. this.$refs["form"].validate((valid, done) => {
  385. done();
  386. if (valid) {
  387. this.itemsVOList.push({ $cellEdit: true });
  388. this.getStorage()
  389. } else {
  390. return false;
  391. }
  392. });
  393. },
  394. rowCell(row, index) {
  395. this.$refs.crud.rowCell(row, index)
  396. },
  397. rowSave(form, done) {
  398. done()
  399. },
  400. addUpdate(form, index, done, loading) {
  401. done()
  402. },
  403. rowDel(row) {
  404. this.$confirm("确定删除数据?", {
  405. confirmButtonText: "确定",
  406. cancelButtonText: "取消",
  407. type: "warning"
  408. }).then(() => {
  409. if (row.id) {
  410. delItem({ itemId: row.id }).then(res => {
  411. this.$message({
  412. type: "success",
  413. message: "删除成功!"
  414. });
  415. this.itemsVOList.splice(row.$index, 1);
  416. });
  417. } else {
  418. this.$message({
  419. type: "success",
  420. message: "删除成功!"
  421. });
  422. this.itemsVOList.splice(row.$index, 1);
  423. }
  424. });
  425. },
  426. getDetail(id) {
  427. this.pageLoading = true;
  428. detail(id)
  429. .then(res => {
  430. this.form = res.data.data;
  431. this.itemsVOList = res.data.data.itemsVOList;
  432. this.orderFeesList = res.data.data.orderFeesList;
  433. this.orderFilesList = res.data.data.orderFilesList;
  434. this.oldform = this.deepClone(res.data.data);
  435. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  436. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  437. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  438. this.getStorage()
  439. })
  440. .finally(() => {
  441. this.pageLoading = false;
  442. });
  443. },
  444. getGenerate(id) {
  445. this.pageLoading = true;
  446. detail(id)
  447. .then(res => {
  448. delete res.data.data.id
  449. delete res.data.data.createTime
  450. delete res.data.data.createUser
  451. delete res.data.data.createUserName
  452. delete res.data.data.sysNo
  453. delete res.data.data.status
  454. res.data.data.stockTime = getCurrentDate()
  455. res.data.data.itemsVOList.forEach(e => {
  456. e.storageInQuantity=e.balanceNumber
  457. delete e.id
  458. })
  459. this.form = res.data.data;
  460. this.itemsVOList = res.data.data.itemsVOList.filter(item => item.isIssue == 1);
  461. this.oldform = this.deepClone(res.data.data);
  462. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList.filter(item => item.isIssue == 1));
  463. this.getStorage()
  464. })
  465. .finally(() => {
  466. this.pageLoading = false;
  467. });
  468. },
  469. //修改提交触发
  470. editCustomer(status) {
  471. this.$refs["form"].validate((valid, done) => {
  472. done();
  473. if (valid) {
  474. for (let i = 0; i < this.itemsVOList.length; i++) {
  475. if (this.itemsVOList[i].$cellEdit) {
  476. return this.$message.error('请保存明细')
  477. }
  478. }
  479. this.itemsVOList.forEach((e, index) => {
  480. e.sort = Number(index) + 1
  481. })
  482. let orderFeesList = this.$refs.feeInfo.submitData();
  483. this.subLoading = true;
  484. let data = {
  485. ...this.form,
  486. billType: 'CK',
  487. itemsVOList: this.itemsVOList,
  488. orderFeesList: orderFeesList,
  489. orderFilesList: this.orderFilesList
  490. };
  491. submit(data).then(res => {
  492. this.form = res.data.data;
  493. this.itemsVOList = res.data.data.itemsVOList;
  494. this.orderFeesList = res.data.data.orderFeesList;
  495. this.orderFilesList = res.data.data.orderFilesList;
  496. this.oldform = this.deepClone(res.data.data);
  497. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  498. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  499. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  500. this.$message({
  501. type: "success",
  502. message: "保存成功!"
  503. });
  504. if (status == "goBack") {
  505. this.$emit("goBack");
  506. }
  507. })
  508. .finally(() => {
  509. this.subLoading = false;
  510. });
  511. } else {
  512. return false;
  513. }
  514. });
  515. },
  516. //请核
  517. auditCheck() {
  518. let orderFeesList = this.$refs.feeInfo.submitData();
  519. if (orderFeesList.length == 0) {
  520. this.$confirm("没有应收费用,是否继续提交?", {
  521. confirmButtonText: "确定",
  522. cancelButtonText: "取消",
  523. type: "warning"
  524. }).then(() => {
  525. financingExcess({ id: this.form.purchaserId }).then(res => {
  526. if (res.data.data == '操作成功') {
  527. this.$confirm("确定审核此订单?", {
  528. confirmButtonText: "确定",
  529. cancelButtonText: "取消",
  530. type: "warning"
  531. }).then(() => {
  532. this.subLoading = true
  533. const data = {
  534. id: this.form.id,
  535. checkType: 'CK',
  536. url: '/salesManagement/outStock/index',
  537. pageStatus: "this.$store.getters.entranceXsStatus",
  538. pageLabel: "出库管理",
  539. checkFlag: 2,
  540. }
  541. checkWarehousing(data).then(res => {
  542. if (res.data.success) {
  543. this.$message.success("操作成功!")
  544. this.viewDisabled = true
  545. this.approverDisabled = true
  546. }
  547. }).finally(() => {
  548. this.subLoading = false
  549. this.getDetail(this.form.id)
  550. })
  551. })
  552. } else {
  553. this.$confirm("此订单余额不足,是否继续确认提交审核?", {
  554. confirmButtonText: "确定",
  555. cancelButtonText: "取消",
  556. type: "warning"
  557. }).then(() => {
  558. this.subLoading = true
  559. const data = {
  560. id: this.form.id,
  561. checkType: 'CK',
  562. url: '/salesManagement/outStock/index',
  563. pageStatus: "this.$store.getters.entranceXsStatus",
  564. pageLabel: "出库管理",
  565. checkFlag: 2,
  566. }
  567. checkWarehousing(data).then(res => {
  568. if (res.data.success) {
  569. this.$message.success("操作成功!")
  570. this.viewDisabled = true
  571. this.approverDisabled = true
  572. }
  573. }).finally(() => {
  574. this.subLoading = false
  575. this.getDetail(this.form.id)
  576. })
  577. })
  578. }
  579. })
  580. })
  581. } else {
  582. financingExcess({ id: this.form.purchaserId }).then(res => {
  583. if (res.data.data == '操作成功') {
  584. this.$confirm("确定审核此订单?", {
  585. confirmButtonText: "确定",
  586. cancelButtonText: "取消",
  587. type: "warning"
  588. }).then(() => {
  589. this.subLoading = true
  590. const data = {
  591. id: this.form.id,
  592. checkType: 'CK',
  593. url: '/salesManagement/outStock/index',
  594. pageStatus: "this.$store.getters.entranceXsStatus",
  595. pageLabel: "出库管理",
  596. checkFlag: 2,
  597. }
  598. checkWarehousing(data).then(res => {
  599. if (res.data.success) {
  600. this.$message.success("操作成功!")
  601. this.viewDisabled = true
  602. this.approverDisabled = true
  603. }
  604. })
  605. }).finally(() => {
  606. this.subLoading = false
  607. this.getDetail(this.form.id)
  608. })
  609. } else {
  610. this.$confirm("此订单余额不足,是否继续确认提交审核?", {
  611. confirmButtonText: "确定",
  612. cancelButtonText: "取消",
  613. type: "warning"
  614. }).then(() => {
  615. this.subLoading = true
  616. const data = {
  617. id: this.form.id,
  618. checkType: 'CK',
  619. url: '/salesManagement/outStock/index',
  620. pageStatus: "this.$store.getters.entranceXsStatus",
  621. pageLabel: "出库管理",
  622. checkFlag: 2,
  623. }
  624. checkWarehousing(data).then(res => {
  625. if (res.data.success) {
  626. this.$message.success("操作成功!")
  627. this.viewDisabled = true
  628. this.approverDisabled = true
  629. }
  630. }).finally(() => {
  631. this.subLoading = false
  632. this.getDetail(this.form.id)
  633. })
  634. })
  635. }
  636. })
  637. }
  638. },
  639. revokeCheck() {
  640. this.$confirm("确定撤销审核此订单?", {
  641. confirmButtonText: "确定",
  642. cancelButtonText: "取消",
  643. type: "warning"
  644. }).then(() => {
  645. let orderFeesList = this.$refs.feeInfo.submitData();
  646. this.subLoading = true;
  647. let data = {
  648. ...this.form,
  649. billType: 'CK',
  650. itemsVOList: this.itemsVOList,
  651. orderFeesList: orderFeesList,
  652. orderFilesList: this.orderFilesList
  653. };
  654. revokeWarehousing(data).then(res => {
  655. if (res.data.success) {
  656. this.$message.success("操作成功!")
  657. }
  658. }).finally(() => {
  659. this.subLoading = false
  660. this.getDetail(this.form.id)
  661. })
  662. })
  663. },
  664. getTemplate() {
  665. window.open(`/api/trade-purchase/woodHarvestingCloud/export-template?${this.website.tokenHeader}=${getToken()}`)
  666. },
  667. //返回列表
  668. backToList() {
  669. let orderFeesList = this.$refs.feeInfo.submitData();
  670. if (
  671. contrastObj(this.form, this.oldform) ||
  672. contrastList(this.itemsVOList, this.olditemsVOList) ||
  673. contrastList2(orderFeesList, this.oldorderFeesList) ||
  674. contrastList(this.orderFilesList, this.oldorderFilesList)
  675. ) {
  676. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  677. confirmButtonText: "确定",
  678. cancelButtonText: "取消",
  679. type: "warning"
  680. })
  681. .then(() => {
  682. this.editCustomer("goBack");
  683. })
  684. .catch(() => {
  685. this.$emit("goBack");
  686. });
  687. } else {
  688. this.$emit("goBack");
  689. }
  690. },
  691. openEdit() {
  692. this.detailData.status = 2;
  693. this.option.disabled = false;
  694. this.$refs.crud.refreshTable();
  695. },
  696. calculateChange(row) {
  697. row.storageAmount = (row.storageInQuantity ? row.storageInQuantity : 0) * (row.price ? row.price : 0)
  698. },
  699. beforeFinance(feesData, callback) {
  700. let params = {}
  701. //暂时默认通过 之后优化
  702. params.valid = true
  703. params.parentId = this.form.id
  704. callback(params)
  705. },
  706. openReport() {
  707. this.$router.push(`/myiframe/urlPath?name=preview-木材库-出库单.ureport.xml&src=${this.website.reportUrl}/preview?_u=blade-木材库-出库单.ureport.xml&id=${this.form.id}`);
  708. },
  709. moveUp(row, index) {
  710. this.itemsVOList[index] = this.itemsVOList.splice(index - 1, 1, row)[0]
  711. },
  712. moveDown(row, index) {
  713. this.itemsVOList[index] = this.itemsVOList.splice(index + 1, 1, row)[0]
  714. },
  715. addData(row) {
  716. if (row == 'purchaserId') {
  717. this.$router.push(`/basicData/customerInformation/index`);
  718. } else if (row == 'corpId') {
  719. this.$router.push(`/basicData/customerManagement/supplierMaterial/index`);
  720. } else if (row == 'storage') {
  721. this.$router.push(`/basicData/basicStorageType/index`);
  722. } else if (row == 'storageId') {
  723. this.$router.push(`/basicData/basicStorageDesc/index`);
  724. } else if (row == 'itemId') {
  725. this.$router.push(`/basicData/commodityType/index`);
  726. }
  727. },
  728. async saveColumn() {
  729. const inSave = await this.saveColumnData(
  730. this.getColumnName(191),
  731. this.tableOption
  732. );
  733. if (inSave) {
  734. this.$nextTick(() => {
  735. this.$refs.crud.doLayout();
  736. });
  737. this.$message.success("保存成功");
  738. //关闭窗口
  739. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  740. }
  741. },
  742. async resetColumn() {
  743. this.tableOption = tableOption;
  744. const inSave = await this.delColumnData(
  745. this.getColumnName(191),
  746. tableOption
  747. );
  748. if (inSave) {
  749. this.$nextTick(() => {
  750. this.$refs.crud.doLayout();
  751. });
  752. this.getAllWorkDicts()
  753. this.getStorage()
  754. this.$message.success("重置成功");
  755. //关闭窗口
  756. setTimeout(() => {
  757. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  758. }, 1000);
  759. }
  760. }
  761. },
  762. watch: {
  763. }
  764. };
  765. </script>
  766. <style lang="scss" scoped>
  767. .trading-form ::v-deep .el-form-item {
  768. margin-bottom: 8px !important;
  769. }
  770. ::v-deep .el-form-item__error {
  771. display: none !important;
  772. }
  773. ::v-deep .select-component {
  774. display: flex !important;
  775. }
  776. ::v-deep .el-table .cell {
  777. padding: 0 2px !important;
  778. }
  779. ::v-deep .avue-crud .el-table .el-form-item__label {
  780. left: -1px;
  781. }
  782. </style>