detailsPage.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  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 {validatenull } from '@/util/validate'
  157. import check from "@/components/check/check";
  158. export default {
  159. name: "detailsPageEdit",
  160. data() {
  161. return {
  162. checkData: {},
  163. checkDialog: false,
  164. form: {},
  165. checkScheduleDialog: false,
  166. tableOption: {},
  167. option: {
  168. disabled: false,
  169. menuBtn: false,
  170. labelWidth: 100,
  171. column: [
  172. {
  173. label: "货权人",
  174. prop: "purchaserId",
  175. rules: [
  176. {
  177. required: true,
  178. message: "",
  179. trigger: "blur"
  180. }
  181. ],
  182. span: 6
  183. },
  184. {
  185. label: "出库日期",
  186. prop: "stockTime",
  187. type: "datetime",
  188. format: "yyyy-MM-dd HH:mm:ss",
  189. valueFormat: "yyyy-MM-dd HH:mm:ss",
  190. rules: [
  191. {
  192. required: true,
  193. message: "",
  194. trigger: "blur"
  195. }
  196. ],
  197. span: 6
  198. },
  199. {
  200. label: "仓库",
  201. prop: "storageId",
  202. rules: [
  203. {
  204. required: true,
  205. message: "",
  206. trigger: "blur"
  207. }
  208. ],
  209. span: 6
  210. },
  211. {
  212. label: "提单号",
  213. prop: "billNo",
  214. span: 6
  215. },
  216. {
  217. label: "业务类型",
  218. prop: "businessType",
  219. type: "select",
  220. props: {
  221. label: "dictValue",
  222. value: "dictKey"
  223. },
  224. dicData: [],
  225. span: 6
  226. },
  227. {
  228. label: "车船号",
  229. prop: "vehicleShipNumber",
  230. span: 6
  231. },
  232. {
  233. label: "供应商",
  234. prop: "corpId",
  235. span: 6
  236. },
  237. {
  238. label: "出库单号",
  239. prop: "sysNo",
  240. disabled: true,
  241. span: 6
  242. },
  243. {
  244. label: "审核状态",
  245. prop: "status",
  246. type: "select",
  247. dataType: 'number',
  248. props: {
  249. label: "dictValue",
  250. value: "dictKey"
  251. },
  252. dicData: [],
  253. disabled: true,
  254. span: 6
  255. },
  256. {
  257. label: "备注",
  258. prop: "orderRemark",
  259. type: "textarea",
  260. minRows: 2,
  261. span: 18
  262. },
  263. ]
  264. },
  265. itemsVOList: [],
  266. orderFeesList: [],
  267. orderFilesList: [],
  268. subLoading: false,
  269. pageLoading: false,
  270. batchNo: '',
  271. storagetreeList: [],
  272. oldform: {},
  273. olditemsVOList: [],
  274. oldorderFeesList: [],
  275. oldorderFilesList: [],
  276. roleName:localStorage.getItem("roleName")
  277. };
  278. },
  279. props: {
  280. detailData: {
  281. type: Object
  282. }
  283. },
  284. components: {
  285. feeInfo,
  286. checkSchedule,
  287. uploadFile,
  288. check
  289. },
  290. async created() {
  291. if (this.detailData.status == 1) {
  292. this.option.disabled = true;
  293. }
  294. if (this.detailData.id) {
  295. this.getDetail(this.detailData.id);
  296. }
  297. this.tableOption = await this.getColumnData(
  298. this.getColumnName(191),
  299. tableOption
  300. );
  301. getStoragetree().then(res => {
  302. this.storagetreeList = res.data.data;
  303. })
  304. this.getWorkDicts("approval_status").then(res => {
  305. this.findObject(this.option.column, "status").dicData =
  306. res.data.data;
  307. });
  308. this.getWorkDicts("CMY_business_type").then(res => {
  309. this.findObject(this.option.column, "businessType").dicData =
  310. res.data.data;
  311. });
  312. if (this.$route.query.generateId) {
  313. this.getGenerate(this.$route.query.generateId);
  314. }
  315. this.getAllWorkDicts()
  316. },
  317. methods: {
  318. check() {
  319. this.checkData = this.$route.query.check
  320. this.checkDialog = true
  321. },
  322. //关闭审核
  323. choceCheckFun() {
  324. this.checkDialog = false;
  325. },
  326. getData() {
  327. getAllgoods().then(res => {
  328. this.findObject(this.tableOption.column, "itemId").dicData =
  329. res.data.data;
  330. })
  331. getStoragetree().then(res => {
  332. this.storagetreeList = res.data.data;
  333. })
  334. this.getStorage()
  335. this.$refs.purchaser.refreshData()
  336. this.$refs.corpId.refreshData()
  337. },
  338. getAllWorkDicts() {
  339. getAllgoods().then(res => {
  340. this.findObject(this.tableOption.column, "itemId").dicData =
  341. res.data.data;
  342. })
  343. this.getWorkDicts("unit").then(res => {
  344. this.findObject(this.tableOption.column, "unit").dicData =
  345. res.data.data;
  346. });
  347. },
  348. cellStyle() {
  349. return "padding:0;height:40px;";
  350. },
  351. getStorage() {
  352. getStorage({ storageTypeId: this.form.storageId }).then(res => {
  353. this.findObject(this.tableOption.column, "storageId").dicData = res.data;
  354. })
  355. },
  356. storagetreeChange(row) {
  357. if (row) {
  358. if (this.itemsVOList.length > 0) {
  359. this.getStorage()
  360. this.itemsVOList.forEach(e => {
  361. e.storageId = null
  362. })
  363. this.$message.warning("请重新选择库区!")
  364. }
  365. } else {
  366. if (this.itemsVOList.length > 0) {
  367. this.findObject(this.tableOption.column, "storageId").dicData = []
  368. this.itemsVOList.forEach(e => {
  369. e.storageId = null
  370. })
  371. this.$message.warning("请重新选择库区!")
  372. }
  373. }
  374. },
  375. getKHData(row) {
  376. this.form.purchaser = row.cname
  377. },
  378. getGYSData(row) {
  379. this.form.corpName = row.cname
  380. },
  381. choceScheduleFun() {
  382. this.checkScheduleDialog = false
  383. },
  384. addRow() {
  385. this.$refs["form"].validate((valid, done) => {
  386. done();
  387. if (valid) {
  388. this.itemsVOList.push({ $cellEdit: true });
  389. this.getStorage()
  390. } else {
  391. return false;
  392. }
  393. });
  394. },
  395. rowCell(row, index) {
  396. this.$refs.crud.rowCell(row, index)
  397. },
  398. rowSave(form, done) {
  399. done()
  400. },
  401. addUpdate(form, index, done, loading) {
  402. done()
  403. },
  404. rowDel(row) {
  405. this.$confirm("确定删除数据?", {
  406. confirmButtonText: "确定",
  407. cancelButtonText: "取消",
  408. type: "warning"
  409. }).then(() => {
  410. if (row.id) {
  411. delItem({ itemId: row.id }).then(res => {
  412. this.$message({
  413. type: "success",
  414. message: "删除成功!"
  415. });
  416. this.itemsVOList.splice(row.$index, 1);
  417. });
  418. } else {
  419. this.$message({
  420. type: "success",
  421. message: "删除成功!"
  422. });
  423. this.itemsVOList.splice(row.$index, 1);
  424. }
  425. });
  426. },
  427. getDetail(id) {
  428. this.pageLoading = true;
  429. detail(id)
  430. .then(res => {
  431. this.form = res.data.data;
  432. this.itemsVOList = res.data.data.itemsVOList;
  433. this.orderFeesList = res.data.data.orderFeesList;
  434. this.orderFilesList = res.data.data.orderFilesList;
  435. this.oldform = this.deepClone(res.data.data);
  436. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  437. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  438. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  439. this.getStorage()
  440. })
  441. .finally(() => {
  442. this.pageLoading = false;
  443. });
  444. },
  445. getGenerate(id) {
  446. this.pageLoading = true;
  447. detail(id)
  448. .then(res => {
  449. delete res.data.data.id
  450. delete res.data.data.createTime
  451. delete res.data.data.createUser
  452. delete res.data.data.createUserName
  453. delete res.data.data.sysNo
  454. delete res.data.data.status
  455. res.data.data.stockTime = getCurrentDate()
  456. res.data.data.itemsVOList.forEach(e => {
  457. e.storageInQuantity=e.balanceNumber
  458. delete e.id
  459. })
  460. this.form = res.data.data;
  461. this.itemsVOList = res.data.data.itemsVOList.filter(item => item.isIssue == 1);
  462. this.oldform = this.deepClone(res.data.data);
  463. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList.filter(item => item.isIssue == 1));
  464. this.getStorage()
  465. })
  466. .finally(() => {
  467. this.pageLoading = false;
  468. });
  469. },
  470. //修改提交触发
  471. editCustomer(status) {
  472. this.$refs["form"].validate((valid, done) => {
  473. done();
  474. if (valid) {
  475. for (let i = 0; i < this.itemsVOList.length; i++) {
  476. if(validatenull(this.itemsVOList[i].storageId)){
  477. return this.$message.error('请完善第'+(i+1)+'行的库区')
  478. }
  479. if(validatenull(this.itemsVOList[i].itemId)){
  480. return this.$message.error('请完善第'+(i+1)+'行的品名')
  481. }
  482. if(validatenull(this.itemsVOList[i].itemType)){
  483. return this.$message.error('请完善第'+(i+1)+'行的品牌')
  484. }
  485. if(validatenull(this.itemsVOList[i].grade)){
  486. return this.$message.error('请完善第'+(i+1)+'行的等级')
  487. }
  488. if(validatenull(this.itemsVOList[i].billNo)){
  489. return this.$message.error('请完善第'+(i+1)+'行的捆包号')
  490. }
  491. if(validatenull(this.itemsVOList[i].sliceNumber)){
  492. return this.$message.error('请完善第'+(i+1)+'行的片数')
  493. }
  494. if(validatenull(this.itemsVOList[i].storageInQuantity)){
  495. return this.$message.error('请完善第'+(i+1)+'行的入库量')
  496. }
  497. if(validatenull(this.itemsVOList[i].unit)){
  498. return this.$message.error('请完善第'+(i+1)+'行的入库单位')
  499. }
  500. if(validatenull(this.itemsVOList[i].price)){
  501. return this.$message.error('请完善第'+(i+1)+'行的入库单价')
  502. }
  503. }
  504. this.itemsVOList.forEach((e, index) => {
  505. e.sort = Number(index) + 1
  506. })
  507. let orderFeesList = this.$refs.feeInfo.submitData();
  508. this.subLoading = true;
  509. let data = {
  510. ...this.form,
  511. billType: 'CK',
  512. itemsVOList: this.itemsVOList,
  513. orderFeesList: orderFeesList,
  514. orderFilesList: this.orderFilesList
  515. };
  516. submit(data).then(res => {
  517. this.form = res.data.data;
  518. this.itemsVOList = res.data.data.itemsVOList;
  519. this.orderFeesList = res.data.data.orderFeesList;
  520. this.orderFilesList = res.data.data.orderFilesList;
  521. this.oldform = this.deepClone(res.data.data);
  522. this.olditemsVOList = this.deepClone(res.data.data.itemsVOList);
  523. this.oldorderFeesList = this.deepClone(res.data.data.orderFeesList);
  524. this.oldorderFilesList = this.deepClone(res.data.data.orderFilesList);
  525. this.$message({
  526. type: "success",
  527. message: "保存成功!"
  528. });
  529. if (status == "goBack") {
  530. this.$emit("goBack");
  531. }
  532. })
  533. .finally(() => {
  534. this.subLoading = false;
  535. });
  536. } else {
  537. return false;
  538. }
  539. });
  540. },
  541. //请核
  542. auditCheck() {
  543. let orderFeesList = this.$refs.feeInfo.submitData();
  544. if (orderFeesList.length == 0) {
  545. this.$confirm("没有应收费用,是否继续提交?", {
  546. confirmButtonText: "确定",
  547. cancelButtonText: "取消",
  548. type: "warning"
  549. }).then(() => {
  550. financingExcess({ id: this.form.purchaserId }).then(res => {
  551. if (res.data.data == '操作成功') {
  552. this.$confirm("确定审核此订单?", {
  553. confirmButtonText: "确定",
  554. cancelButtonText: "取消",
  555. type: "warning"
  556. }).then(() => {
  557. this.subLoading = true
  558. const data = {
  559. id: this.form.id,
  560. checkType: 'CK',
  561. url: '/salesManagement/outStock/index',
  562. pageStatus: "this.$store.getters.entranceXsStatus",
  563. pageLabel: "出库管理",
  564. checkFlag: 2,
  565. }
  566. checkWarehousing(data).then(res => {
  567. if (res.data.success) {
  568. this.$message.success("操作成功!")
  569. this.viewDisabled = true
  570. this.approverDisabled = true
  571. }
  572. }).finally(() => {
  573. this.subLoading = false
  574. this.getDetail(this.form.id)
  575. })
  576. })
  577. } else {
  578. this.$confirm(res.data.data, {
  579. confirmButtonText: "确定",
  580. cancelButtonText: "取消",
  581. type: "warning"
  582. }).then(() => {
  583. this.subLoading = true
  584. const data = {
  585. id: this.form.id,
  586. checkType: 'CK',
  587. url: '/salesManagement/outStock/index',
  588. pageStatus: "this.$store.getters.entranceXsStatus",
  589. pageLabel: "出库管理",
  590. checkFlag: 2,
  591. }
  592. checkWarehousing(data).then(res => {
  593. if (res.data.success) {
  594. this.$message.success("操作成功!")
  595. this.viewDisabled = true
  596. this.approverDisabled = true
  597. }
  598. }).finally(() => {
  599. this.subLoading = false
  600. this.getDetail(this.form.id)
  601. })
  602. })
  603. }
  604. })
  605. })
  606. } else {
  607. financingExcess({ id: this.form.purchaserId }).then(res => {
  608. if (res.data.data == '操作成功') {
  609. this.$confirm("确定审核此订单?", {
  610. confirmButtonText: "确定",
  611. cancelButtonText: "取消",
  612. type: "warning"
  613. }).then(() => {
  614. this.subLoading = true
  615. const data = {
  616. id: this.form.id,
  617. checkType: 'CK',
  618. url: '/salesManagement/outStock/index',
  619. pageStatus: "this.$store.getters.entranceXsStatus",
  620. pageLabel: "出库管理",
  621. checkFlag: 2,
  622. }
  623. checkWarehousing(data).then(res => {
  624. if (res.data.success) {
  625. this.$message.success("操作成功!")
  626. this.viewDisabled = true
  627. this.approverDisabled = true
  628. }
  629. })
  630. }).finally(() => {
  631. this.subLoading = false
  632. this.getDetail(this.form.id)
  633. })
  634. } else {
  635. this.$confirm(res.data.data, {
  636. confirmButtonText: "确定",
  637. cancelButtonText: "取消",
  638. type: "warning"
  639. }).then(() => {
  640. this.subLoading = true
  641. const data = {
  642. id: this.form.id,
  643. checkType: 'CK',
  644. url: '/salesManagement/outStock/index',
  645. pageStatus: "this.$store.getters.entranceXsStatus",
  646. pageLabel: "出库管理",
  647. checkFlag: 2,
  648. }
  649. checkWarehousing(data).then(res => {
  650. if (res.data.success) {
  651. this.$message.success("操作成功!")
  652. this.viewDisabled = true
  653. this.approverDisabled = true
  654. }
  655. }).finally(() => {
  656. this.subLoading = false
  657. this.getDetail(this.form.id)
  658. })
  659. })
  660. }
  661. })
  662. }
  663. },
  664. revokeCheck() {
  665. this.$confirm("确定撤销审核此订单?", {
  666. confirmButtonText: "确定",
  667. cancelButtonText: "取消",
  668. type: "warning"
  669. }).then(() => {
  670. let orderFeesList = this.$refs.feeInfo.submitData();
  671. this.subLoading = true;
  672. let data = {
  673. ...this.form,
  674. billType: 'CK',
  675. itemsVOList: this.itemsVOList,
  676. orderFeesList: orderFeesList,
  677. orderFilesList: this.orderFilesList
  678. };
  679. revokeWarehousing(data).then(res => {
  680. if (res.data.success) {
  681. this.$message.success("操作成功!")
  682. }
  683. }).finally(() => {
  684. this.subLoading = false
  685. this.getDetail(this.form.id)
  686. })
  687. })
  688. },
  689. getTemplate() {
  690. window.open(`/api/trade-purchase/woodHarvestingCloud/export-template?${this.website.tokenHeader}=${getToken()}`)
  691. },
  692. //返回列表
  693. backToList() {
  694. let orderFeesList = this.$refs.feeInfo.submitData();
  695. if (
  696. contrastObj(this.form, this.oldform) ||
  697. contrastList(this.itemsVOList, this.olditemsVOList) ||
  698. contrastList2(orderFeesList, this.oldorderFeesList) ||
  699. contrastList(this.orderFilesList, this.oldorderFilesList)
  700. ) {
  701. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  702. confirmButtonText: "确定",
  703. cancelButtonText: "取消",
  704. type: "warning"
  705. })
  706. .then(() => {
  707. this.editCustomer("goBack");
  708. })
  709. .catch(() => {
  710. this.$emit("goBack");
  711. });
  712. } else {
  713. this.$emit("goBack");
  714. }
  715. },
  716. openEdit() {
  717. this.detailData.status = 2;
  718. this.option.disabled = false;
  719. this.$refs.crud.refreshTable();
  720. },
  721. calculateChange(row) {
  722. row.storageAmount = Number((row.storageInQuantity ? row.storageInQuantity : 0) * (row.price ? row.price : 0)).toFixed(2)
  723. },
  724. beforeFinance(feesData, callback) {
  725. let params = {}
  726. //暂时默认通过 之后优化
  727. params.valid = true
  728. params.parentId = this.form.id
  729. callback(params)
  730. },
  731. openReport() {
  732. this.$router.push(`/myiframe/urlPath?name=preview-木材库-出库单.ureport.xml&src=${this.website.reportUrl}/preview?_u=blade-木材库-出库单.ureport.xml&id=${this.form.id}`);
  733. },
  734. moveUp(row, index) {
  735. this.itemsVOList[index] = this.itemsVOList.splice(index - 1, 1, row)[0]
  736. },
  737. moveDown(row, index) {
  738. this.itemsVOList[index] = this.itemsVOList.splice(index + 1, 1, row)[0]
  739. },
  740. addData(row) {
  741. if (row == 'purchaserId') {
  742. this.$router.push(`/basicData/customerInformation/index`);
  743. } else if (row == 'corpId') {
  744. this.$router.push(`/basicData/customerManagement/supplierMaterial/index`);
  745. } else if (row == 'storage') {
  746. this.$router.push(`/basicData/basicStorageType/index`);
  747. } else if (row == 'storageId') {
  748. this.$router.push(`/basicData/basicStorageDesc/index`);
  749. } else if (row == 'itemId') {
  750. this.$router.push(`/basicData/commodityType/index`);
  751. }
  752. },
  753. async saveColumn() {
  754. const inSave = await this.saveColumnData(
  755. this.getColumnName(191),
  756. this.tableOption
  757. );
  758. if (inSave) {
  759. this.$nextTick(() => {
  760. this.$refs.crud.doLayout();
  761. });
  762. this.$message.success("保存成功");
  763. //关闭窗口
  764. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  765. }
  766. },
  767. async resetColumn() {
  768. this.tableOption = tableOption;
  769. const inSave = await this.delColumnData(
  770. this.getColumnName(191),
  771. tableOption
  772. );
  773. if (inSave) {
  774. this.$nextTick(() => {
  775. this.$refs.crud.doLayout();
  776. });
  777. this.getAllWorkDicts()
  778. this.getStorage()
  779. this.$message.success("重置成功");
  780. //关闭窗口
  781. setTimeout(() => {
  782. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  783. }, 1000);
  784. }
  785. }
  786. },
  787. watch: {
  788. }
  789. };
  790. </script>
  791. <style lang="scss" scoped>
  792. .trading-form ::v-deep .el-form-item {
  793. margin-bottom: 8px !important;
  794. }
  795. ::v-deep .el-form-item__error {
  796. display: none !important;
  797. }
  798. ::v-deep .select-component {
  799. display: flex !important;
  800. }
  801. ::v-deep .el-table .cell {
  802. padding: 0 2px !important;
  803. }
  804. ::v-deep .avue-crud .el-table .el-form-item__label {
  805. left: -1px;
  806. }
  807. </style>