index.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  1. <template>
  2. <div>
  3. <basic-container v-show="show" class="page-crad">
  4. <avue-crud
  5. ref="crud"
  6. :option="option"
  7. :data="dataList"
  8. v-model="form"
  9. :page.sync="page"
  10. :search.sync="search"
  11. @search-change="searchChange"
  12. @current-change="currentChange"
  13. @size-change="sizeChange"
  14. @refresh-change="refreshChange"
  15. @on-load="onLoad"
  16. :table-loading="loading"
  17. @saveColumn="saveColumn"
  18. @resetColumn="resetColumn"
  19. :cell-style="cellStyle"
  20. @selection-change="selectionChange"
  21. @search-criteria-switch="searchCriteriaSwitch"
  22. >
  23. <template slot="createTimeSearch">
  24. <el-date-picker
  25. v-model="search.createTime"
  26. type="daterange"
  27. start-placeholder="开始日期"
  28. end-placeholder="结束日期"
  29. format="yyyy-MM-dd"
  30. value-format="yyyy-MM-dd HH:mm:ss"
  31. :default-time="['00:00:00', '23:59:59']"
  32. >
  33. </el-date-picker>
  34. </template>
  35. <template slot="menuLeft">
  36. <el-button
  37. type="primary"
  38. icon="el-icon-plus"
  39. size="small"
  40. @click.stop="newAdd('new')"
  41. >创建单据
  42. </el-button>
  43. <el-button
  44. type="success"
  45. size="small"
  46. @click.stop="copyDoc()"
  47. :disabled="selectionList.length != 1"
  48. >复制单据
  49. </el-button>
  50. <el-button type="info" size="small" disabled>报表打印</el-button>
  51. <el-button type="warning" size="small" @click="dialogVisible = true;">采购任务</el-button>
  52. </template>
  53. <template slot="corpIdSearch">
  54. <crop-select v-model="search.corpId" corpType="KH"></crop-select>
  55. </template>
  56. <template slot="businesDateSearch">
  57. <el-date-picker
  58. v-model="search.businesDate"
  59. type="daterange"
  60. start-placeholder="开始日期"
  61. end-placeholder="结束日期"
  62. format="yyyy-MM-dd"
  63. value-format="yyyy-MM-dd HH:mm:ss"
  64. :default-time="['00:00:00', '23:59:59']">
  65. </el-date-picker>
  66. </template>
  67. <template slot="plannedDeliveryDateSearch">
  68. <el-date-picker
  69. v-model="search.plannedDeliveryDate"
  70. type="daterange"
  71. start-placeholder="开始日期"
  72. end-placeholder="结束日期"
  73. format="yyyy-MM-dd"
  74. value-format="yyyy-MM-dd HH:mm:ss"
  75. :default-time="['00:00:00', '23:59:59']"
  76. >
  77. </el-date-picker>
  78. </template>
  79. <template slot="requiredDeliveryDateSearch">
  80. <el-date-picker
  81. v-model="search.requiredDeliveryDate"
  82. type="daterange"
  83. start-placeholder="开始日期"
  84. end-placeholder="结束日期"
  85. format="yyyy-MM-dd"
  86. value-format="yyyy-MM-dd HH:mm:ss"
  87. :default-time="['00:00:00', '23:59:59']"
  88. >
  89. </el-date-picker>
  90. </template>
  91. <template slot-scope="scope" slot="corpId">
  92. <span
  93. style="color: #409EFF;cursor: pointer"
  94. @click.stop="editOpen(scope.row, 1)"
  95. >{{ scope.row.strCorpName }}
  96. </span>
  97. </template>
  98. <template slot-scope="scope" slot="orderNo">
  99. <span
  100. style="color: #409EFF;cursor: pointer"
  101. @click.stop="editOpen(scope.row, 1)"
  102. >{{ scope.row.orderNo }}
  103. </span>
  104. </template>
  105. <template slot-scope="scope" slot="fudaPurchaseStatus">
  106. <span class="el-button--text">
  107. {{ scope.row.fudaPurchaseStatus }}
  108. </span>
  109. </template>
  110. <template slot-scope="scope" slot="fudaPurchaseDate">
  111. <span class="el-button--text">
  112. {{ scope.row.fudaPurchaseDate }}
  113. </span>
  114. </template>
  115. <template slot-scope="scope" slot="productionScheduling">
  116. <span class="el-button--text">
  117. {{ scope.row.productionScheduling }}
  118. </span>
  119. </template>
  120. <template slot-scope="scope" slot="createUser">
  121. {{ scope.row.createUserName }}
  122. </template>
  123. <template slot-scope="{ row }" slot="orderQuantity">
  124. <span>{{ row.orderQuantity | IntegerFormat }}</span>
  125. </template>
  126. <template slot-scope="scope" slot="menu">
  127. <el-button
  128. type="text"
  129. icon="el-icon-delete"
  130. size="small"
  131. @click.stop="rowDel(scope.row, scope.index)"
  132. >删除
  133. </el-button>
  134. </template>
  135. </avue-crud>
  136. </basic-container>
  137. <detail-page
  138. @goBack="goBack"
  139. @copyOrder="copyOrder"
  140. :detailData="detailData"
  141. v-if="!show"
  142. ></detail-page>
  143. <el-dialog
  144. title="导入采购任务"
  145. v-if="dialogVisible"
  146. :visible.sync="dialogVisible"
  147. append-to-body
  148. :close-on-click-modal="false"
  149. :close-on-press-escape="false"
  150. :before-close="function() {
  151. dialogVisible = false;params={}
  152. }"
  153. top="1vh"
  154. width="90%">
  155. <span>
  156. <el-row>
  157. <el-col :span="6" style="padding: 0 10px">
  158. <el-scrollbar>
  159. <!-- <avue-tree :option="treeOption" :key="avueTree" :data="treeData" @node-click="nodeClick"/>-->
  160. <!-- {{ treeData }}-->
  161. <el-table
  162. style="width: 100%"
  163. border
  164. size="mini"
  165. ref="singleTable"
  166. highlight-current-row
  167. @current-change="handleCurrentChange"
  168. :data="treeData">
  169. <el-table-column
  170. prop="orderNo"
  171. show-overflow-tooltip
  172. align="center"
  173. label="销售单号">
  174. </el-table-column>
  175. <el-table-column
  176. prop="plannedDeliveryDate"
  177. show-overflow-tooltip
  178. width="105"
  179. align="center"
  180. label="交货日期">
  181. <template slot-scope="{row}">
  182. {{ row.plannedDeliveryDate ? row.plannedDeliveryDate.slice(0, 10) : '' }}
  183. </template>
  184. </el-table-column>
  185. </el-table>
  186. </el-scrollbar>
  187. </el-col>
  188. <el-col :span="18">
  189. <!-- :page.sync="dialogPage"-->
  190. <avue-crud
  191. :data="dialogData"
  192. :option="dialogOption"
  193. :search.sync="params"
  194. ref="dialogCrud"
  195. @resetColumn="resetColumnTwo('dialogCrud','dialogOption','dialogOptionList',2.1)"
  196. @saveColumn="saveColumnTwo('dialogCrud','dialogOption','dialogOptionList',2.1)"
  197. @refresh-change="refreshChangeTwo"
  198. @search-change="searchChangeTwo"
  199. @search-reset="searchReset"
  200. @on-load="dialogOnLoad">
  201. <template slot="menuLeft">
  202. <el-tabs v-model="activeName" @tab-click="tabHandle">
  203. <el-tab-pane label="查询结果" name="searchList"/>
  204. <el-tab-pane label="已选定数据" name="importStaging"/>
  205. </el-tabs>
  206. </template>
  207. <template slot="corpNameSearch">
  208. <crop-select v-model="params.corpId" corpType="GYS"/>
  209. </template>
  210. <template slot="orderQuantity" slot-scope="scope">
  211. <el-input-number v-if="activeName === 'importStaging'" v-model="scope.row.orderQuantity" :precision="2" :min="0.01" :controls="false"></el-input-number>
  212. <span v-else>{{scope.row.orderQuantity}}</span>
  213. </template>
  214. <template slot-scope="scope" slot="menu">
  215. <el-button
  216. type="text"
  217. icon="el-icon-edit"
  218. size="small"
  219. @click.stop="importStagList(scope.row, scope.index)"
  220. v-if="activeName == 'searchList'"
  221. :disabled=" goodsListSave.findIndex(item => item.id == scope.row.id) !== -1 "
  222. >选择
  223. </el-button>
  224. <el-button
  225. type="text"
  226. icon="el-icon-delete"
  227. size="small"
  228. @click.stop="removeStagList(scope.row, scope.index)"
  229. v-else
  230. >移除
  231. </el-button>
  232. </template>
  233. </avue-crud>
  234. </el-col>
  235. </el-row>
  236. </span>
  237. <span slot="footer" class="dialog-footer">
  238. <el-button type="warning" @click="outExport">导出</el-button>
  239. <el-button @click="dialogVisible = false;params={}">取 消</el-button>
  240. <el-button type="primary" :disabled="goodsListSave.length === 0" @click="confirmImport">导 入</el-button>
  241. </span>
  242. </el-dialog>
  243. </div>
  244. </template>
  245. <script>
  246. import option from "./config/mainList.json";
  247. import {
  248. getList,
  249. remove,
  250. gainUser,
  251. listXS,
  252. generatePurchaseBill,
  253. listBYStatus
  254. } from "@/api/exportTrade/purchaseContract";
  255. import detailPage from "./detailsPage.vue";
  256. import {defaultDate} from "@/util/date";
  257. import {IntegerFormat} from "@/util/validate";
  258. import {customerParameter} from "@/enums/management-type";
  259. import {getToken} from "@/util/auth";
  260. export default {
  261. name: "customerInformation",
  262. data() {
  263. return {
  264. search: {
  265. businesDate: defaultDate()
  266. },
  267. treeData: [],
  268. avueTree: false,
  269. treeOption: {
  270. nodeKey: "id",
  271. lazy: true,
  272. treeLoad: function (node, resolve) {
  273. listBYStatus({}).then(res => {
  274. resolve(
  275. res.data.data.map(item => {
  276. return {
  277. ...item,
  278. leaf: !item.hasChildren
  279. };
  280. })
  281. );
  282. });
  283. },
  284. addBtn: false,
  285. menu: false,
  286. size: "small",
  287. props: {
  288. labelText: "标题",
  289. label: "orderNo",
  290. value: "id",
  291. children: "children"
  292. }
  293. },
  294. dialogData: [],
  295. goodsListShow: [],
  296. goodsListSave: [],
  297. params: {},
  298. dialogPage: {
  299. pageSize: 20,
  300. currentPage: 1,
  301. total: 0,
  302. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  303. },
  304. activeName: 'searchList',
  305. dialogOption: {},
  306. dialogOptionList: {
  307. searchShow: true,
  308. searchMenuSpan: 8,
  309. border: true,
  310. index: true,
  311. viewBtn: false,
  312. editBtn: false,
  313. delBtn: false,
  314. addBtn: false,
  315. menuWidth: "100",
  316. headerAlign: "center",
  317. searchIcon: false,
  318. searchIndex: 2,
  319. tip: false,
  320. column: [{
  321. label: "销售单号",
  322. prop: "billNo",
  323. search: true,
  324. searchSpan: 8,
  325. searchOrder:1,
  326. overHidden: true
  327. }, {
  328. label: "销售日期",
  329. prop: "businesDate",
  330. searchProp: "businesDateList",
  331. width: 100,
  332. type: "date",
  333. searchSpan: 8,
  334. searchRange: true,
  335. search: true,
  336. searchDefaultTime: ["00:00:00", "23:59:59"],
  337. format: "yyyy-MM-dd",
  338. valueFormat: "yyyy-MM-dd HH:mm:ss",
  339. overHidden: true
  340. }, {
  341. label: "供应商",
  342. prop: "corpName",
  343. searchSpan: 8,
  344. search: true,
  345. overHidden: true
  346. }, {
  347. label: "交货日期",
  348. prop: "plannedDeliveryDate",
  349. searchProp: "plannedDeliveryDateList",
  350. width: 100,
  351. type: "date",
  352. searchSpan: 8,
  353. searchRange: true,
  354. search: true,
  355. searchDefaultTime: ["00:00:00", "23:59:59"],
  356. format: "yyyy-MM-dd",
  357. valueFormat: "yyyy-MM-dd HH:mm:ss",
  358. overHidden: true
  359. }, {
  360. label: "采购员",
  361. prop: "carry",
  362. overHidden: true
  363. }, {
  364. label: "产品名称",
  365. prop: "cname",
  366. overHidden: true
  367. }, {
  368. label: "产品编号",
  369. prop: "code",
  370. overHidden: true
  371. }, {
  372. label: "产品类别",
  373. prop: "priceCategory",
  374. overHidden: true
  375. }, {
  376. label: "产品型号",
  377. prop: "itemType",
  378. overHidden: true
  379. }, {
  380. label: "数量",
  381. prop: "orderQuantity"
  382. }, {
  383. label: "采购数",
  384. prop: "purchaseQuantity",
  385. overHidden: true
  386. }, {
  387. label: "螺纹",
  388. prop: "remarksOne",
  389. overHidden: true
  390. }, {
  391. label: "介质",
  392. prop: "customTwo",
  393. overHidden: true
  394. }, {
  395. label: "颜色",
  396. prop: "customThree",
  397. overHidden: true
  398. }, {
  399. label: "电压",
  400. prop: "customFour",
  401. overHidden: true
  402. }, {
  403. label: "显示全部",
  404. prop: "showAll",
  405. searchSpan: 8,
  406. searchOrder:2,
  407. overHidden: true,
  408. type: "select",
  409. clearable:false,
  410. search: true,
  411. hide: true,
  412. showColumn: false,
  413. dicData: [{
  414. label: '需采购',
  415. value: 0
  416. }, {
  417. label: '已采购',
  418. value: 1
  419. }],
  420. searchValue: 0
  421. }]
  422. },
  423. dialogVisible: false,
  424. form: {},
  425. option: {},
  426. parentId: 0,
  427. dataList: [],
  428. page: {
  429. pageSize: 20,
  430. currentPage: 1,
  431. total: 0,
  432. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  433. },
  434. totalTwo: 0,
  435. show: true,
  436. detailData: {},
  437. loading: false,
  438. selectionList: []
  439. };
  440. },
  441. components: {detailPage},
  442. async created() {
  443. this.option = await this.getColumnData(this.getColumnName(2), option);
  444. this.dialogOption = await this.getColumnData(this.getColumnName(2.1), this.dialogOptionList);
  445. this.getWorkDicts("payment_term").then(res => {
  446. this.findObject(this.option.column, "paymentType").dicData = res.data.data;
  447. });
  448. gainUser().then(res => {
  449. this.findObject(this.option.column, "createUser").dicData = res.data.data;
  450. });
  451. this.option.height = window.innerHeight - 210;
  452. },
  453. filters: {
  454. IntegerFormat(num) {
  455. return IntegerFormat(num);
  456. }
  457. },
  458. activated() {
  459. if (this.$route.query.check) {
  460. this.detailData = {
  461. check: this.$route.query.check,
  462. id: this.$route.query.check.billId
  463. };
  464. this.show = false;
  465. this.$store.commit("IN_CG_STATUS");
  466. }
  467. },
  468. methods: {
  469. outExport() {
  470. let config = {params: {...this.params}}
  471. if (config.params) {
  472. for (const propName of Object.keys(config.params)) {
  473. const value = config.params[propName];
  474. if (value !== null && typeof (value) !== "undefined") {
  475. if (value instanceof Array) {
  476. for (const key of Object.keys(value)) {
  477. let params = propName + '[' + key + ']';
  478. config.params[params] = value[key]
  479. }
  480. delete config.params[propName]
  481. }
  482. }
  483. }
  484. }
  485. const routeData = this.$router.resolve({
  486. path: '/api/blade-purchase-sales/exportOrder/listXSExport', //跳转目标窗口的地址
  487. query: {
  488. ...config.params //括号内是要传递给新窗口的参数
  489. }
  490. })
  491. window.open(routeData.href.slice(1, routeData.href.length) + '&' + `${this.website.tokenHeader}=${getToken()}`);
  492. },
  493. nodeClick(data) {
  494. this.params.pid = data.id
  495. this.dialogPage.currentPage = 1;
  496. this.dialogOnLoad(this.dialogPage);
  497. },
  498. removeStagList(row, index) {
  499. this.goodsListSave.splice(row.$index, 1);
  500. },
  501. searchCriteriaSwitch(type) {
  502. if (type) {
  503. this.option.height = this.option.height - 139;
  504. } else {
  505. this.option.height = this.option.height + 139;
  506. }
  507. this.$refs.crud.getTableHeight();
  508. },
  509. cellStyle() {
  510. return "padding:0;height:40px;";
  511. },
  512. //删除列表后面的删除按钮触发触发(row, index, done)
  513. rowDel(row, index, done) {
  514. this.$confirm("确定删除数据?", {
  515. confirmButtonText: "确定",
  516. cancelButtonText: "取消",
  517. type: "warning"
  518. }).then(() => {
  519. remove(row.id).then(res => {
  520. if (res.data.code == 200) {
  521. this.$message({
  522. type: "success",
  523. message: "删除成功!"
  524. });
  525. this.onLoad(this.page, this.search);
  526. }
  527. });
  528. });
  529. },
  530. selectionChange(list) {
  531. this.selectionList = list;
  532. },
  533. copyDoc() {
  534. this.selectionList.forEach(e => {
  535. this.detailData = {
  536. id: e.id,
  537. status: "copy"
  538. };
  539. this.show = false;
  540. });
  541. },
  542. copyOrder(id) {
  543. this.show = true;
  544. this.detailData = {
  545. id: id,
  546. status: "copy"
  547. };
  548. this.$nextTick(() => {
  549. this.show = false;
  550. });
  551. },
  552. editOpen(row, status) {
  553. this.detailData = {
  554. id: row.id,
  555. status: status
  556. };
  557. this.show = false;
  558. },
  559. //点击搜索按钮触发
  560. searchChange(params, done) {
  561. if (params.businesDate) {
  562. params.businesStartDate = params.businesDate[0];
  563. params.businesEndDate = params.businesDate[1];
  564. }
  565. if (params.requiredDeliveryDate) {
  566. params.requiredDeliveryStartDate = params.requiredDeliveryDate[0];
  567. params.requiredDeliveryEndDate = params.requiredDeliveryDate[1];
  568. }
  569. delete params.businesDate;
  570. delete params.requiredDeliveryDate;
  571. this.page.currentPage = 1;
  572. this.onLoad(this.page, params);
  573. done();
  574. },
  575. currentChange(val) {
  576. this.page.currentPage = val;
  577. },
  578. sizeChange(val) {
  579. this.page.currentPage = 1;
  580. this.page.pageSize = val;
  581. },
  582. // 标签页切换
  583. tabHandle(data) {
  584. if (data.name == 'searchList') {
  585. this.dialogData = this.goodsListShow;
  586. this.dialogPage.total = this.totalTwo
  587. } else if (data.name == 'importStaging') {
  588. this.goodsListShow = this.dialogData;
  589. this.dialogData = this.goodsListSave;
  590. this.totalTwo = this.dialogPage.total
  591. this.dialogPage.total = 0
  592. }
  593. },
  594. importStagList(row, index) {
  595. this.goodsListSave.push(row);
  596. },
  597. refreshChangeTwo() {
  598. this.dialogOnLoad(this.page);
  599. },
  600. searchChangeTwo(params, done) {
  601. done()
  602. if (!this.params.pid && !this.params.billNo) {
  603. return this.$message.error("请选择左边单号或输入销售单号")
  604. } else {
  605. this.dialogOnLoad(this.page);
  606. }
  607. },
  608. searchReset() {
  609. this.avueTree = !this.avueTree
  610. this.params.showAll = 0
  611. this.$refs.singleTable.setCurrentRow([]);
  612. this.dialogData = []
  613. },
  614. //自定义列保存
  615. async saveColumnTwo(ref, option, optionBack, code) {
  616. /**
  617. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  618. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  619. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  620. */
  621. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  622. if (inSave) {
  623. this.$message.success("保存成功");
  624. //关闭窗口
  625. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  626. }
  627. },
  628. //自定义列重置
  629. async resetColumnTwo(ref, option, optionBack, code) {
  630. this[option] = this[optionBack];
  631. const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
  632. if (inSave) {
  633. this.$message.success("重置成功");
  634. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  635. }
  636. },
  637. confirmImport() {
  638. let ids = this.goodsListSave.map(item => {
  639. return item.id
  640. })
  641. const loading = this.$loading({
  642. lock: true,
  643. text: '加载中',
  644. spinner: 'el-icon-loading',
  645. background: 'rgba(255,255,255,0.7)'
  646. });
  647. generatePurchaseBill(this.goodsListSave).then(res => {
  648. this.$message.success("导入成功")
  649. this.detailData = {
  650. form: res.data.data
  651. };
  652. loading.close()
  653. this.dialogVisible = false
  654. setTimeout(() => {
  655. this.show = false;
  656. }, 200);
  657. }).catch(() => {
  658. loading.close()
  659. })
  660. },
  661. dialogOnLoad(page, params) {
  662. this.dialogLoading = true;
  663. params = {
  664. ...params,
  665. size: page.pageSize,
  666. current: page.currentPage,
  667. ...this.params
  668. }
  669. if (this.params.pid || this.params.billNo) {
  670. listXS(params).then(res => {
  671. this.dialogLoading = false
  672. this.dialogData = res.data.data
  673. // this.dialogPage.total = res.data.data.total
  674. })
  675. }
  676. },
  677. onLoad(page, params) {
  678. if (this.search.businesDate && this.search.businesDate.length > 0) {
  679. params = {
  680. ...params,
  681. orderStartDate: this.search.businesDate[0],
  682. orderEndDate: this.search.businesDate[1]
  683. };
  684. delete params.businesDate;
  685. }
  686. if (this.search.requiredDeliveryDate && this.search.requiredDeliveryDate.length > 0) {
  687. params = {
  688. ...params,
  689. requiredDeliveryStartDate: this.search.requiredDeliveryDate[0],
  690. requiredDeliveryEndDate: this.search.requiredDeliveryDate[1]
  691. };
  692. delete params.requiredDeliveryDate
  693. }
  694. this.loading = true;
  695. getList(page.currentPage, page.pageSize, params)
  696. .then(res => {
  697. this.dataList = res.data.data.records ? res.data.data.records : [];
  698. this.page.total = res.data.data.total;
  699. })
  700. .finally(() => {
  701. this.loading = false;
  702. });
  703. },
  704. refreshChange() {
  705. this.onLoad(this.page, this.search);
  706. },
  707. newAdd(type) {
  708. this.detailData = {
  709. pageType: type
  710. };
  711. this.show = false;
  712. },
  713. goBack() {
  714. this.detailData = this.$options.data().detailData;
  715. this.show = true;
  716. this.onLoad(this.page, this.search);
  717. },
  718. async saveColumn() {
  719. const inSave = await this.saveColumnData(
  720. this.getColumnName(2),
  721. this.option
  722. );
  723. if (inSave) {
  724. this.$nextTick(() => {
  725. this.$refs.crud.doLayout();
  726. });
  727. this.$message.success("保存成功");
  728. //关闭窗口
  729. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  730. }
  731. },
  732. async resetColumn() {
  733. this.option = option;
  734. const inSave = await this.delColumnData(this.getColumnName(2), option);
  735. if (inSave) {
  736. this.$nextTick(() => {
  737. this.$refs.crud.doLayout();
  738. });
  739. this.$message.success("重置成功");
  740. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  741. }
  742. },
  743. handleCurrentChange(val) {
  744. // this.currentRow = val;
  745. this.params.pid = val.id
  746. this.dialogPage.currentPage = 1;
  747. this.dialogOnLoad(this.dialogPage);
  748. }
  749. },
  750. watch: {
  751. option: function () {
  752. this.search.businesDate = defaultDate();
  753. },
  754. dialogVisible: function () {
  755. this.goodsListShow = []
  756. this.goodsListSave = []
  757. this.totalTwo = 0
  758. listBYStatus({}).then(res => {
  759. this.treeData = res.data.data
  760. });
  761. }
  762. }
  763. };
  764. </script>
  765. <style scoped>
  766. ::v-deep .select-component {
  767. display: flex;
  768. }
  769. .page-crad ::v-deep .basic-container__card {
  770. height: 94.2vh;
  771. }
  772. </style>