noUpload.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. <template>
  2. <el-dialog
  3. title="导入"
  4. :visible.sync="visible"
  5. width="85%"
  6. v-dialogDrag
  7. :append-to-body="true"
  8. :close-on-click-modal="false"
  9. :before-close="closeDialog"
  10. >
  11. <!-- 列设置-->
  12. <el-dialog title="提示" :visible.sync="showSetting" width="700px" v-dialogDrag append-to-body>
  13. <template slot="title">
  14. <div class="avue-crud__dialog__header">
  15. <span class="el-dialog__title">
  16. <span
  17. style="display:inline-block;width:3px;height:20px;margin-right:5px; float: left;margin-top:2px"></span>
  18. </span>
  19. </div>
  20. </template>
  21. <div>配置排序列数据(拖动调整顺序)</div>
  22. <div style="margin-left: 17px">
  23. <el-checkbox
  24. v-model="allCheck"
  25. label="全选"
  26. @change="allChecked"
  27. ></el-checkbox>
  28. </div>
  29. <div style="padding: 4px; display: flex; justify-content: center">
  30. <draggable
  31. v-model="setRowList"
  32. group="site"
  33. animation="300"
  34. @start="onStart"
  35. @end="onEnd"
  36. handle=".indraggable"
  37. >
  38. <transition-group>
  39. <div
  40. v-for="item in setRowList"
  41. :key="item.surface"
  42. class="listStyle"
  43. >
  44. <div style="width: 500px" class="indraggable">
  45. <div class="progress" :style="{ width: item.width + 'px' }">
  46. <el-checkbox
  47. :label="item.name"
  48. v-model="item.checked"
  49. :true-label="0"
  50. :false-label="1"
  51. >{{ item.name }}
  52. </el-checkbox>
  53. </div>
  54. </div>
  55. <el-input-number
  56. v-model.number="item.width"
  57. controls-position="right"
  58. :min="1"
  59. :max="500"
  60. size="mini"
  61. ></el-input-number>
  62. </div>
  63. </transition-group>
  64. </draggable>
  65. </div>
  66. <span slot="footer" class="dialog-footer">
  67. <el-button @click="showSetting = false">取 消</el-button>
  68. <el-button @click="delRow" type="danger">重 置</el-button>
  69. <el-button type="primary" @click="save()">确 定</el-button>
  70. </span>
  71. </el-dialog>
  72. <div style="margin: 0 10px;float: right">
  73. <el-button
  74. icon="el-icon-setting"
  75. size="mini"
  76. circle
  77. @click="showSetting = !showSetting"
  78. ></el-button>
  79. </div>
  80. <el-table
  81. ref="table"
  82. :data="dataList"
  83. tooltip-effect="dark"
  84. stripe
  85. v-loading="loading"
  86. @selection-change="handleSelection"
  87. :height="tableHeight"
  88. >
  89. <el-table-column type="selection" width="50" align="center" fixed/>
  90. <el-table-column
  91. label="序号"
  92. type="index"
  93. width="50"
  94. fixed
  95. align="center"
  96. />
  97. <el-table-column
  98. v-for="(item, index) in getRowList"
  99. :key="index"
  100. :label="item.name"
  101. :width="item.width"
  102. :prop="item.label"
  103. align="center"
  104. :fixed="item.fixed"
  105. sortable
  106. >
  107. <template slot-scope="scope">
  108. <span v-if="item.label == 'fBsdate'">
  109. <el-date-picker
  110. v-model="scope.row.fBsdate"
  111. type="date"
  112. style="width: 100%"
  113. value-format="timestamp"
  114. placeholder="入库日期"
  115. @change="dateSelected(scope,'fBsdate')"
  116. >
  117. </el-date-picker>
  118. </span>
  119. <span v-else-if="item.label == 'fGoodsid'">
  120. <el-select
  121. filterable
  122. v-model="scope.row.fGoodsid"
  123. style="width: 100%"
  124. placeholder="请选择品名"
  125. @change="dateSelected(scope,'fGoodsid')"
  126. >
  127. <el-option
  128. v-for="(item, index) in goodsOptions"
  129. :key="index.fId"
  130. :label="item.fName"
  131. :value="item.fId"
  132. ></el-option>
  133. </el-select>
  134. </span>
  135. <span v-else-if="item.label == 'fBusinessType'">
  136. <el-select
  137. filterable
  138. v-model="scope.row.fBusinessType"
  139. style="width: 100%"
  140. placeholder="请选择商品属性"
  141. @change="dateSelected(scope,'fBusinessType')"
  142. >
  143. <el-option
  144. v-for="(item, index) in fStorageTypeOptions"
  145. :key="index.dictValue"
  146. :label="item.dictLabel"
  147. :value="item.dictValue"
  148. />
  149. </el-select>
  150. </span>
  151. <span v-else-if="item.label == 'fMarks'">
  152. <el-input
  153. v-model="scope.row.fMarks"
  154. style="width: 100%"
  155. placeholder="请填写属性描述"
  156. @change="dateSelected(scope,'fMarks')"
  157. />
  158. </span>
  159. <span v-else-if="item.label == 'fWarehouseInformation'">
  160. <el-input
  161. placeholder="请选择"
  162. v-model="scope.row.fWarehouseInformation"
  163. @focus="getTreeselect(scope)"
  164. >
  165. </el-input>
  166. </span>
  167. <span v-else-if="item.label == 'fQty'">
  168. <el-input
  169. v-input-limit="0"
  170. v-model.number="scope.row.fQty"
  171. style="width: 100%"
  172. placeholder="件数"
  173. @input="importComputer(scope.row)"
  174. />
  175. </span>
  176. <span v-else-if="item.label == 'fGrossweight'">
  177. <el-input
  178. v-model.number="scope.row.fGrossweight"
  179. v-input-limit="2"
  180. style="width: 100%"
  181. placeholder="毛重"
  182. />
  183. </span>
  184. <span v-else-if="item.label == 'fNetweight'">
  185. <el-input
  186. v-model.number="scope.row.fNetweight"
  187. v-input-limit="2"
  188. style="width: 100%"
  189. placeholder="净重"
  190. />
  191. </span>
  192. <span v-else-if="item.label == 'fPackagespecs'">
  193. <el-input
  194. v-model="scope.row.fPackagespecs"
  195. style="width: 100%"
  196. placeholder="包装规格"
  197. @change="dateSelected(scope,'fPackagespecs')"
  198. />
  199. </span>
  200. <!-- <span v-else-if="item.label == 'fCntrno'">-->
  201. <!-- <el-input-->
  202. <!-- v-model="scope.row.fCntrno"-->
  203. <!-- style="width: 100%"-->
  204. <!-- placeholder="箱号"-->
  205. <!-- v-Alphabet-->
  206. <!-- @change="unRepeat(scope.row.fCntrno, scope.$index)"-->
  207. <!-- />-->
  208. <!-- </span>-->
  209. <span v-else-if="item.label == 'fTruckno'">
  210. <el-input
  211. v-model="scope.row.fTruckno"
  212. style="width: 100%"
  213. placeholder="车号"
  214. v-Alphabet
  215. />
  216. </span>
  217. <span v-else>{{ scope.row[item.label] }}</span>
  218. </template>
  219. </el-table-column>
  220. <el-table-column
  221. label="操作"
  222. width="80px"
  223. fixed="right">
  224. <template slot-scope="{row, $index}">
  225. <el-button
  226. @click.native.prevent="deleteRow($index)"
  227. size="small"
  228. >移除
  229. </el-button>
  230. </template>
  231. </el-table-column>
  232. </el-table>
  233. <el-dialog
  234. title="选择库位"
  235. :data="treeselectList"
  236. :visible.sync="choiceWarehouse"
  237. width="30%"
  238. :close-on-click-modal="false"
  239. append-to-body
  240. >
  241. <treeselect
  242. v-model="treeselectList.fWarehouselocid"
  243. @select="getAlltree"
  244. :options="fWarehouseidOptions"
  245. :show-count="true"
  246. :disable-branch-nodes="true"
  247. placeholder="请选择归属库区"
  248. />
  249. <span slot="footer" class="dialog-footer">
  250. <el-button @click="choiceWarehouse = false">取 消</el-button>
  251. <el-button type="primary" @click="confirm">确 定</el-button>
  252. </span>
  253. </el-dialog>
  254. <span slot="footer" class="dialog-footer">
  255. <el-button @click="visible = false" :loading="buttonLoading">取 消</el-button>
  256. <el-button type="primary" @click="importData" :loading="buttonLoading">确 定</el-button>
  257. </span>
  258. </el-dialog>
  259. </template>
  260. <script>
  261. import Cookies from "js-cookie";
  262. import {addSet, resetModule, select} from '@/api/system/set';
  263. import draggable from "vuedraggable";
  264. import {getToken} from "@/utils/auth";
  265. import {listGoods} from "@/api/basicdata/goods";
  266. import {treeselect} from "@/api/basicdata/warehouse";
  267. import {getCrawler} from "@/api/warehouseBusiness/warehouseInStock"
  268. import axios from "axios";
  269. import Treeselect from "@riophae/vue-treeselect";
  270. export default {
  271. name: "noUpload",
  272. components: {
  273. draggable,
  274. Treeselect
  275. },
  276. props: {
  277. oldList: {
  278. type: Array,
  279. default: []
  280. },
  281. form: {
  282. type: Object
  283. },
  284. },
  285. data() {
  286. return {
  287. visible: false,
  288. dataList: [],
  289. loading: false,
  290. buttonLoading: false,
  291. tableHeight: '200',
  292. selection: [],
  293. goodsOptions: [],
  294. fStorageTypeOptions: [],
  295. fWarehouseidOptions: [],
  296. treeselectList: {
  297. fWarehouselocid: null,
  298. },
  299. choiceWarehouse: false,
  300. TreeIndex: null,
  301. bigDataToken: null,
  302. page: {
  303. pageNum: 1,
  304. pageSize: 10,
  305. total: 0,
  306. },
  307. // 设置列开关
  308. showSetting: false,
  309. setRowList: [],
  310. getRowList: [],
  311. showfCustomno: null,
  312. //自定义列宽
  313. allCheck: false,
  314. drag: false,
  315. tableDate: [
  316. {
  317. surface: "1",
  318. label: "fBsdate",
  319. name: "入库日期",
  320. checked: 0,
  321. width: 160,
  322. },
  323. {
  324. surface: "2",
  325. label: "fGoodsid",
  326. name: "品名",
  327. checked: 0,
  328. width: 100,
  329. },
  330. {
  331. surface: "3",
  332. label: "fBusinessType",
  333. name: "货物属性",
  334. checked: 0,
  335. width: 100,
  336. },
  337. {
  338. surface: "4",
  339. label: "fMarks",
  340. name: "属性详情",
  341. checked: 0,
  342. width: 100,
  343. },
  344. {
  345. surface: "5",
  346. label: "fWarehouseInformation",
  347. name: "库区",
  348. checked: 0,
  349. width: 100,
  350. },
  351. {
  352. surface: "6",
  353. label: "fQty",
  354. name: "件数",
  355. checked: 0,
  356. width: 100,
  357. },
  358. {
  359. surface: "7",
  360. label: "fGrossweight",
  361. name: "毛重(kg)",
  362. checked: 0,
  363. width: 130,
  364. },
  365. {
  366. surface: "8",
  367. label: "fNetweight",
  368. name: "净重(kg)",
  369. checked: 0,
  370. width: 130,
  371. },
  372. {
  373. surface: "9",
  374. label: "fPackagespecs",
  375. name: "包装规格",
  376. checked: 0,
  377. width: 100,
  378. },
  379. {
  380. surface: "10",
  381. label: "fCntrno",
  382. name: "箱号",
  383. checked: 0,
  384. width: 100,
  385. },
  386. {
  387. surface: "11",
  388. label: "fSealno",
  389. name: "封号",
  390. checked: 0,
  391. width: 180,
  392. },
  393. {
  394. surface: "12",
  395. label: "fTruckno",
  396. name: "车号",
  397. checked: 0,
  398. width: 100,
  399. },
  400. ],
  401. }
  402. },
  403. created() {
  404. this.setRowList = this.tableDate;
  405. this.getRowList = this.tableDate;
  406. this.getRow();
  407. listGoods({fStatus: 0, delFlag: 0}).then((response) => {
  408. this.goodsOptions = response.rows;
  409. });
  410. treeselect(this.form.fWarehouseid).then((response) => {
  411. this.fWarehouseidOptions = response.data;
  412. });
  413. this.getDicts("storage_type").then((response) => {
  414. this.fStorageTypeOptions = response.data;
  415. });
  416. },
  417. mounted() {
  418. this.$nextTick(() => {
  419. // 监听浏览器高度变化,改变表格高度
  420. window.onresize = () => {
  421. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 200
  422. }
  423. })
  424. },
  425. methods: {
  426. // 打开
  427. async init() {
  428. this.dataList = []
  429. await this.getConfigKey("bigData.token").then((response) => {
  430. this.bigDataToken = response.msg;
  431. });
  432. this.getList()
  433. this.visible = true;
  434. },
  435. // 关闭弹窗
  436. closeDialog() {
  437. this.visible = false;
  438. this.detailList = []
  439. this.$emit("closeDialog")
  440. },
  441. getList() {
  442. this.loading = true;
  443. axios({
  444. // url: 'http://192.168.1.114:9002/crawler/' + this.form.fMblno,
  445. url: 'https://crawler.tubaosoft.com/prod-api/crawler/data',
  446. method: 'post',
  447. data: {
  448. token: this.bigDataToken,
  449. param: this.form.fMblno,
  450. size: this.page.pageSize,
  451. page: this.page.pageNum
  452. },
  453. headers: {
  454. "Content-Type":'application/json'
  455. }
  456. }
  457. ).then(res => {
  458. if (res.data.code == 500) {
  459. return this.$message.error(res.data.msg)
  460. }
  461. //SEAL_NO 铅封号
  462. //CONTAINER_NO 箱号
  463. //CARGO_QUANTITY 件数
  464. //TOTAL_GROSS_WEIGHT 重量
  465. //BILL_OF_LADING_NO 提单号
  466. // CGMX 车号(出港明细)
  467. res.data.data[0].data.map(e => {
  468. e.fMblno = e.TDH? e.TDH: null;
  469. e.fSealno = e.QFH1? e.QFH1: null;
  470. e.fCntrno = e.XH? e.XH: null;
  471. if (e.CGMX.length < 3) e.CGMX = null; //车号长度小于3 为无效值
  472. e.fTruckno = e.CGMX? e.CGMX: null;
  473. })
  474. this.dataList = res.data.data[0].data
  475. // if (res.data.data[1].data.length == 0) {
  476. // // XH 箱号
  477. // // QFH1 铅封号
  478. // //TDH 提单号
  479. // res.data.data[0].data.map(e => {
  480. // e.fMblno = e.TDH;
  481. // e.fSealno = e.QFH1;
  482. // e.fCntrno = e.XH;
  483. // })
  484. // this.dataList = res.data.data[0].data
  485. // } else {
  486. // res.data.data[1].data.map(e => {
  487. // e.fMblno = e.BILL_OF_LADING_NO;
  488. // e.fSealno = e.SEAL_NO;
  489. // // e.fQty = e.CARGO_QUANTITY;
  490. // // e.fGrossweight = e.TOTAL_GROSS_WEIGHT;
  491. // // e.fNetweight = e.TOTAL_GROSS_WEIGHT;
  492. // e.fCntrno = e.CONTAINER_NO;
  493. // })
  494. // if (res.data.data[1].data.length == 1) {
  495. // res.data.data[1].data.map(e => {
  496. // e.fQty = e.CARGO_QUANTITY;
  497. // e.fGrossweight = e.TOTAL_GROSS_WEIGHT;
  498. // e.fNetweight = e.TOTAL_GROSS_WEIGHT;
  499. // })
  500. // } else {
  501. // res.data.data[1].data.map(e => {
  502. // e.fQty = '';
  503. // e.fGrossweight = '';
  504. // e.fNetweight = '';
  505. // })
  506. // }
  507. // this.dataList = res.data.data[1].data
  508. // }
  509. if (this.dataList.length > 0) {
  510. this.dataList.map(e => {
  511. this.$set(e, 'fBsdate', this.form.fBsdate);
  512. this.$set(e, 'fGoodsid', this.form.fGoodsid);
  513. this.$set(e, 'fPlanqty', this.form.fPlanqty);
  514. this.$set(e, 'fPlangrossweight', this.form.fPlangrossweight);
  515. this.$set(e, 'fPlannetweight', this.form.fPlannetweight);
  516. this.$set(e, 'fBillstatus', 10)
  517. })
  518. }
  519. setTimeout(() => {
  520. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 200
  521. }, 300)
  522. this.loading = false;
  523. }).finally(() => {
  524. this.loading = false;
  525. })
  526. },
  527. handleSelection(list) {
  528. this.selection = list
  529. },
  530. dateSelected(scope, name) {
  531. if (name === 'fBsdate') {
  532. this.dataList.forEach(item => {
  533. if (!item.fBsdate) this.$set(item, 'fBsdate', scope.row.fBsdate)
  534. })
  535. } else if (name === 'fGoodsid') {
  536. this.dataList.forEach(item => {
  537. if (!item.fGoodsid) this.$set(item, 'fGoodsid', scope.row.fGoodsid)
  538. })
  539. } else if (name === 'fBusinessType') {
  540. this.dataList.forEach(item => {
  541. if (!item.fBusinessType) this.$set(item, 'fBusinessType', scope.row.fBusinessType)
  542. })
  543. } else if (name === 'fMarks') {
  544. this.dataList.forEach(item => {
  545. if (!item.fMarks) this.$set(item, 'fMarks', scope.row.fMarks)
  546. })
  547. } else if (name === 'fQty') {
  548. this.dataList.forEach(item => {
  549. if (!item.fQty) this.$set(item, 'fQty', scope.row.fQty)
  550. })
  551. } else if (name === 'fGrossweight') {
  552. this.dataList.forEach(item => {
  553. if (!item.fGrossweight) this.$set(item, 'fGrossweight', scope.row.fGrossweight)
  554. })
  555. } else if (name === 'fNetweight') {
  556. this.dataList.forEach(item => {
  557. if (!item.fNetweight) this.$set(item, 'fNetweight', scope.row.fNetweight)
  558. })
  559. } else if (name === 'fPackagespecs') {
  560. this.dataList.forEach(item => {
  561. if (!item.fPackagespecs) this.$set(item, 'fPackagespecs', scope.row.fPackagespecs)
  562. })
  563. }
  564. },
  565. getTreeselect(row) {
  566. this.treeselectList.fWarehouselocid = row.row.fWarehouselocid
  567. ? row.row.fWarehouselocid
  568. : null;
  569. this.TreeIndex = row.$index;
  570. this.choiceWarehouse = true;
  571. },
  572. getAlltree(tree) {
  573. this.information = tree.fWarehouseInformation;
  574. },
  575. confirm() {
  576. this.$set(
  577. this.dataList[this.TreeIndex],
  578. "fWarehouseInformation",
  579. this.information
  580. );
  581. this.$set(
  582. this.dataList[this.TreeIndex],
  583. "fWarehouselocid",
  584. this.treeselectList.fWarehouselocid
  585. );
  586. this.dataList.forEach(item => {
  587. if (!item.fWarehouseInformation) {
  588. this.$set(
  589. item,
  590. "fWarehouseInformation",
  591. this.information
  592. );
  593. this.$set(
  594. item,
  595. "fWarehouselocid",
  596. this.treeselectList.fWarehouselocid
  597. );
  598. }
  599. })
  600. this.choiceWarehouse = false;
  601. },
  602. unRepeat(row, index) {
  603. this.oldList.map((e) => {
  604. if (row == e.fCntrno) {
  605. this.dataList[index].fCntrno = null;
  606. this.$message.error("该箱号和明细表上的存在重复");
  607. }
  608. });
  609. this.dataList.map((e, i) => {
  610. if (index != i) {
  611. if (row && row == e.fCntrno) {
  612. this.dataList[index].fCntrno = null;
  613. this.$message.error("该箱号存在重复");
  614. }
  615. }
  616. });
  617. },
  618. importData() {
  619. if (this.dataList.length == 0) {
  620. return this.$message.error('表格未有数据,请关闭')
  621. }
  622. if (this.selection.length == 0) {
  623. return this.$message.error('请选择导入的数据')
  624. }
  625. for (let item in this.selection) {
  626. if (this.selection[item].fBsdate == null) {
  627. return this.$message.error(
  628. "请选择选中的第" + (Number(item) + 1) + "行的入库日期"
  629. );
  630. }
  631. if (this.selection[item].fGoodsid == null) {
  632. return this.$message.error(
  633. "请选择选中的第" + (Number(item) + 1) + "行的品名"
  634. );
  635. }
  636. if (this.selection[item].fBusinessType == null) {
  637. return this.$message.error(
  638. "请选择选中的第" + (Number(item) + 1) + "行的货物属性"
  639. );
  640. }
  641. if (this.selection[item].fMarks == null) {
  642. return this.$message.error(
  643. "请输入选中的第" + (Number(item) + 1) + "行的属性详情"
  644. );
  645. }
  646. if (this.selection[item].fQty == null) {
  647. return this.$message.error(
  648. "请输入选中的第" + (Number(item) + 1) + "行的件数"
  649. );
  650. }
  651. if (this.selection[item].fGrossweight == null) {
  652. return this.$message.error(
  653. "请输入选中的第" + (Number(item) + 1) + "行的毛重"
  654. );
  655. }
  656. if (this.selection[item].fNetweight == null) {
  657. return this.$message.error(
  658. "请输入选中的第" + (Number(item) + 1) + "行的净重"
  659. );
  660. }
  661. }
  662. this.buttonLoading = true;
  663. axios({
  664. url: 'https://crawler.tubaosoft.com/prod-api/crawler/charge',
  665. method: 'post',
  666. data: {
  667. token: this.bigDataToken,
  668. param: this.form.fMblno,
  669. },
  670. }).then(res => {
  671. if (res.data.code == 500) {
  672. return this.$message.error(res.data.msg)
  673. }
  674. this.$emit('addDetailList', this.selection)
  675. this.buttonLoading = false;
  676. this.visible = false;
  677. }).finally(() => {
  678. this.buttonLoading = false;
  679. })
  680. },
  681. deleteRow(index) {
  682. this.dataList.splice(index, 1)
  683. },
  684. importComputer(row) {
  685. this.playcomputer(row);
  686. },
  687. playcomputer(row) {
  688. let Num1 = Number(this.form.fPlannetweight) / Number(this.form.fPlanqty);
  689. let Num2 =
  690. Number(this.form.fPlangrossweight) / Number(this.form.fPlanqty);
  691. row.fNetweight = Number(
  692. (row.fQty * Num1).toFixed(4)
  693. );
  694. row.fGrossweight = Number(
  695. (row.fQty * Num2).toFixed(4)
  696. );
  697. },
  698. //列设置全选
  699. allChecked() {
  700. if (this.allCheck == true) {
  701. this.setRowList.map((e) => {
  702. return (e.checked = 0);
  703. });
  704. } else {
  705. this.setRowList.map((e) => {
  706. return (e.checked = 1);
  707. });
  708. }
  709. },
  710. //开始拖拽事件
  711. onStart() {
  712. this.drag = true;
  713. },
  714. //拖拽结束事件
  715. onEnd() {
  716. this.drag = false;
  717. },
  718. //重置列表
  719. delRow() {
  720. this.data = {
  721. tableName: "单号导入",
  722. userId: Cookies.get("userName"),
  723. };
  724. resetModule(this.data).then((res) => {
  725. if (res.code == 200) {
  726. this.showSetting = false;
  727. this.setRowList = this.tableDate;
  728. console.log(this.setRowList)
  729. this.getRowList = this.tableDate;
  730. }
  731. });
  732. },
  733. //保存列设置
  734. save() {
  735. this.showSetting = false;
  736. this.data = {
  737. tableName: "单号导入",
  738. userId: Cookies.get("userName"),
  739. sysTableSetList: this.setRowList,
  740. };
  741. addSet(this.data).then((res) => {
  742. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  743. });
  744. },
  745. //查询列数据
  746. getRow() {
  747. let that = this;
  748. this.data = {
  749. tableName: "单号导入",
  750. userId: Cookies.get("userName"),
  751. };
  752. select(this.data).then((res) => {
  753. if (res.data.length != 0) {
  754. this.getRowList = res.data.filter((e) => e.checked == 0);
  755. this.setRowList = res.data;
  756. this.setRowList = this.setRowList.reduce((res, item) => {
  757. res.push({
  758. surface: item.surface,
  759. label: item.label,
  760. name: item.name,
  761. checked: item.checked,
  762. width: item.width,
  763. fixed: item.fixed,
  764. });
  765. return res;
  766. }, []);
  767. }
  768. });
  769. },
  770. },
  771. }
  772. </script>
  773. <style scoped>
  774. </style>