index.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. <template>
  2. <div class="app-container">
  3. <basic-container>
  4. <avue-crud
  5. :option="option"
  6. :data="costModifyList"
  7. ref="crud"
  8. @resetColumn="resetColumn('crud','option','optionList',173)"
  9. @saveColumn="saveColumn('crud','option','optionList',173)">
  10. <template slot="menu" slot-scope="scope">
  11. <el-button
  12. size="mini"
  13. type="text"
  14. icon="el-icon-edit"
  15. @click="handleUpdate(scope.row)"
  16. v-hasPermi="['warehouse:modify:query']">查看</el-button>
  17. </template>
  18. </avue-crud>
  19. </basic-container>
  20. <div v-if="false">
  21. <el-form
  22. :model="queryParams"
  23. ref="queryForm"
  24. v-show="showSearch"
  25. label-width="100px"
  26. size="mini"
  27. >
  28. <el-row>
  29. <el-col :span="6">
  30. <el-form-item label-width="100px" label="系统编号" prop="fBillno">
  31. <el-input
  32. v-model="queryParams.fBillno"
  33. placeholder="请输入系统编号"
  34. clearable
  35. size="small"
  36. @keyup.enter.native="handleQuery"
  37. style="max-width: 230px"
  38. />
  39. </el-form-item>
  40. </el-col>
  41. <el-col :span="6">
  42. <el-form-item label-width="100px" label="制单日期" prop="createTime">
  43. <el-date-picker
  44. type="daterange"
  45. value-format="yyyy-MM-dd"
  46. clearable
  47. unlink-panels
  48. style="width: 230px"
  49. range-separator="至"
  50. start-placeholder="开始日期"
  51. end-placeholder="结束日期"
  52. @keyup.enter.native="handleQuery"
  53. v-model="queryParams.createTimeList"
  54. >
  55. </el-date-picker>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="6">
  59. <el-form-item label-width="100px" label="制单人" prop="">
  60. <el-select
  61. v-model="queryParams.createBy"
  62. placeholder="请输入制单人"
  63. clearable
  64. size="small"
  65. filterable
  66. >
  67. <el-option
  68. v-for="(dict, index) in userOptions"
  69. :key="index"
  70. :label="dict.nickName"
  71. :value="dict.userName"
  72. />
  73. </el-select>
  74. </el-form-item>
  75. </el-col>
  76. <el-col :span="6">
  77. <el-form-item label-width="100px" label="原业务类型" prop="fBilltype">
  78. <el-select
  79. v-model="queryParams.fBilltype"
  80. placeholder="请选择原业务类型"
  81. clearable
  82. size="small"
  83. >
  84. <el-option
  85. v-for="(dict, index) in billTypeList"
  86. :key="index.dictValue"
  87. :label="dict.dictLabel"
  88. :value="dict.dictValue"
  89. />
  90. </el-select>
  91. </el-form-item>
  92. </el-col>
  93. </el-row>
  94. <el-collapse-transition>
  95. <div v-show="show">
  96. <el-row>
  97. <el-col :span="6">
  98. <el-form-item label="原客户名称" prop="fCorpid">
  99. <el-select
  100. v-model="queryParams.fCorpid"
  101. placeholder="请输入原客户名称"
  102. clearable
  103. size="small"
  104. filterable
  105. >
  106. <el-option
  107. v-for="(dict, index) in fMblnoOptions"
  108. :key="index.fId"
  109. :label="dict.fName"
  110. :value="dict.fId"
  111. />
  112. </el-select>
  113. </el-form-item>
  114. </el-col>
  115. <!-- <el-col :span="6">-->
  116. <!-- <el-form-item label-width="100px" label="原系统编号" prop="">-->
  117. <!-- <el-input-->
  118. <!-- placeholder="请输入原系统编号"-->
  119. <!-- clearable-->
  120. <!-- size="small"-->
  121. <!-- @keyup.enter.native="handleQuery"-->
  122. <!-- style="max-width: 199px"-->
  123. <!-- v-model="queryParams.fBillno"-->
  124. <!-- />-->
  125. <!-- </el-form-item>-->
  126. <!-- </el-col>-->
  127. <el-col :span="6">
  128. <el-form-item label-width="100px" label="原提单号" prop="">
  129. <el-input
  130. placeholder="请输入原提单号"
  131. clearable
  132. size="small"
  133. @keyup.enter.native="handleQuery"
  134. style="max-width: 199px"
  135. v-model="queryParams.fMblno"
  136. />
  137. </el-form-item>
  138. </el-col>
  139. <el-col :span="6">
  140. <el-form-item label-width="100px" label="原业务日期">
  141. <el-date-picker
  142. type="daterange"
  143. value-format="yyyy-MM-dd"
  144. clearable
  145. style="width: 199px"
  146. range-separator="至"
  147. start-placeholder="开始日期"
  148. end-placeholder="结束日期"
  149. unlink-panels
  150. @keyup.enter.native="handleQuery"
  151. v-model="queryParams.bstimeList"
  152. >
  153. </el-date-picker>
  154. </el-form-item>
  155. </el-col>
  156. </el-row>
  157. </div>
  158. </el-collapse-transition>
  159. </el-form>
  160. <el-row :gutter="10" style="padding-bottom: 10px">
  161. <!-- <el-col :span="1.5">-->
  162. <!-- <el-button-->
  163. <!-- type="primary"-->
  164. <!-- icon="el-icon-plus"-->
  165. <!-- size="mini"-->
  166. <!-- @click="handleAdd"-->
  167. <!-- v-hasPermi="['fleet:plans:add']"-->
  168. <!-- >新增</el-button>-->
  169. <!-- </el-col>-->
  170. <!-- <el-col :span="1.5">-->
  171. <!-- <el-button-->
  172. <!-- type="success"-->
  173. <!-- icon="el-icon-edit"-->
  174. <!-- size="mini"-->
  175. <!-- :disabled="single"-->
  176. <!-- @click="handleUpdate"-->
  177. <!-- v-hasPermi="['warehouseBusiness:inStock:edit']"-->
  178. <!-- >修改-->
  179. <!-- </el-button>-->
  180. <!-- </el-col>-->
  181. <!-- <el-col :span="1.5">-->
  182. <!-- <el-button-->
  183. <!-- type="warning"-->
  184. <!-- icon="el-icon-download"-->
  185. <!-- size="mini"-->
  186. <!-- @click="handleExport"-->
  187. <!-- v-hasPermi="['warehouseBusiness:inStock:export']"-->
  188. <!-- >导出-->
  189. <!-- </el-button>-->
  190. <!-- </el-col>-->
  191. <div class="tabSetting">
  192. <div style="margin-right: 20px">
  193. <el-button
  194. type="cyan"
  195. icon="el-icon-search"
  196. size="mini"
  197. @click="handleQuery"
  198. v-hasPermi="['warehouse:modify:list']"
  199. >搜索
  200. </el-button
  201. >
  202. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  203. >重置
  204. </el-button
  205. >
  206. <el-button
  207. v-show="show"
  208. @click="show = !show"
  209. icon="el-icon-arrow-up"
  210. size="mini"
  211. >展开
  212. </el-button
  213. >
  214. <el-button
  215. v-show="!show"
  216. @click="show = !show"
  217. icon="el-icon-arrow-down"
  218. size="mini"
  219. >展开
  220. </el-button
  221. >
  222. </div>
  223. <right-toolbar
  224. :showSearch.sync="showSearch"
  225. @queryTable="getList"
  226. ></right-toolbar>
  227. <div style="margin: 0 12px">
  228. <el-button
  229. icon="el-icon-setting"
  230. size="mini"
  231. circle
  232. @click="showSetting = !showSetting"
  233. ></el-button>
  234. </div>
  235. </div>
  236. </el-row>
  237. <el-dialog title="自定义列显示" :visible.sync="showSetting" width="700px">
  238. <div>配置排序列数据(拖动调整顺序)</div>
  239. <div style="margin-left: 17px">
  240. <el-checkbox
  241. v-model="allCheck"
  242. label="全选"
  243. @change="allChecked"
  244. ></el-checkbox>
  245. </div>
  246. <div style="padding: 4px; display: flex; justify-content: center">
  247. <draggable
  248. v-model="setRowList"
  249. group="site"
  250. animation="300"
  251. @start="onStart"
  252. @end="onEnd"
  253. handle=".indraggable"
  254. >
  255. <transition-group>
  256. <div
  257. v-for="item in setRowList"
  258. :key="item.surface"
  259. class="listStyle"
  260. >
  261. <div style="width: 500px" class="indraggable">
  262. <div class="progress" :style="{ width: item.width + 'px' }">
  263. <el-checkbox
  264. :label="item.name"
  265. v-model="item.checked"
  266. :true-label="0"
  267. :false-label="1"
  268. >{{ item.name }}
  269. </el-checkbox>
  270. </div>
  271. </div>
  272. <el-input-number
  273. v-model.number="item.width"
  274. controls-position="right"
  275. :min="1"
  276. :max="500"
  277. size="mini"
  278. ></el-input-number>
  279. </div>
  280. </transition-group>
  281. </draggable>
  282. </div>
  283. <span slot="footer" class="dialog-footer">
  284. <el-button @click="showSetting = false">取 消</el-button>
  285. <el-button @click="delRow" type="danger">重 置</el-button>
  286. <el-button type="primary" @click="save()">确 定</el-button>
  287. </span>
  288. </el-dialog>
  289. <el-table
  290. v-loading="loading"
  291. :data="costModifyList"
  292. @selection-change="handleSelectionChange"
  293. style="width: 100%"
  294. ref="table"
  295. :height="tableHeight">
  296. <el-table-column type="selection" width="55" align="center" fixed="left"/>
  297. <el-table-column
  298. v-for="(item, index) in getRowList"
  299. :key="index"
  300. :label="item.name"
  301. :width="item.width"
  302. :prop="item.label"
  303. align="center"
  304. :show-overflow-tooltip="true"
  305. sortable
  306. :fixed="item.fixed"
  307. >
  308. <template slot-scope="scope">
  309. <span v-if="item.label == 'fCorpid'">
  310. {{ scope.row.fCorpid | corpNameFormat(fMblnoOptions) }}
  311. </span>
  312. <span v-else-if="item.label == 'fGoodsid'">
  313. {{ scope.row.fGoodsid | goodsFormat(goodsOptions) }}
  314. </span>
  315. <span v-else-if="item.label == 'fBilltype'">
  316. {{ scope.row.fBilltype | billTypeFormat(billTypeList) }}
  317. </span>
  318. <span v-else-if="item.label == 'fWarehouseid'">
  319. {{ scope.row.fWarehouseid | warehouseFormat(warehouseOptions) }}
  320. </span>
  321. <span v-else>
  322. {{ scope.row[item.label] }}
  323. </span>
  324. </template>
  325. </el-table-column>
  326. <el-table-column
  327. label="操作"
  328. align="center"
  329. class-name="small-padding fixed-width"
  330. fixed="right"
  331. width="150px"
  332. >
  333. <template slot-scope="scope">
  334. <el-button
  335. size="mini"
  336. type="text"
  337. icon="el-icon-edit"
  338. @click="handleUpdate(scope.row)"
  339. v-hasPermi="['warehouse:modify:query']"
  340. >查看
  341. </el-button>
  342. <!-- <el-button
  343. v-if="scope.row.billStatus != 6"
  344. size="mini"
  345. type="text"
  346. icon="el-icon-edit"
  347. @click="handleUpdate(scope.row)"
  348. v-hasPermi="['fleet:plans:edit']"
  349. >修改</el-button
  350. > -->
  351. <!-- <el-button-->
  352. <!-- size="mini"-->
  353. <!-- type="text"-->
  354. <!-- icon="el-icon-delete"-->
  355. <!-- @click="handleDelete(scope.row)"-->
  356. <!-- v-hasPermi="['fleet:plans:remove']"-->
  357. <!-- >删除</el-button-->
  358. <!-- >-->
  359. </template>
  360. </el-table-column>
  361. </el-table>
  362. <pagination
  363. v-show="total > 0"
  364. :total="total"
  365. :page.sync="queryParams.pageNum"
  366. :limit.sync="queryParams.pageSize"
  367. @pagination="getList"
  368. />
  369. </div>
  370. <add-or-update
  371. ref="addOrUpdateRef"
  372. :title="title"
  373. :isDisabled="formDisabled"
  374. :addOrUpdateVisible="addOrUpdateVisible"
  375. @changeShow="showAddOrUpdate"
  376. :form="form"
  377. :feesList="feeList"
  378. :formfeesList="formfeesList"
  379. :goodsOptions="goodsOptions"
  380. :warehouseOptions="warehouseOptions"
  381. :fDc="fDc"
  382. :warehouseId="warehouseId"
  383. :disabledtwo="disabledtwo"
  384. :approVal="approVal"
  385. ></add-or-update>
  386. </div>
  387. </template>
  388. <script>
  389. // import { listCorps } from "@/api/basicdata/corps";
  390. // import { addSet, resetModule, select } from '@/api/system/set';
  391. import Cookies from 'js-cookie';
  392. import draggable from "vuedraggable";
  393. import AddOrUpdate from "./AddOrUpdate";
  394. // import {listWarehouseModify,passWarehouse,detailWarehouseModify} from "@/api/warehouseBusiness/wareHouseModify";
  395. // import {listGoods} from "@/api/basicdata/goods";
  396. // import {
  397. // listWarehouse,
  398. // treeselect,
  399. // listWarehousesss,
  400. // } from "@/api/basicdata/warehouse";
  401. // import { listUser } from "@/api/system/user";
  402. export default {
  403. name: "costModify",
  404. components: {
  405. draggable,
  406. AddOrUpdate
  407. },
  408. data() {
  409. return {
  410. // 表格高度
  411. tableHeight: 'auto',
  412. // 总条数
  413. total: 0,
  414. // 查询参数
  415. queryParams: {
  416. pageNum: 1,
  417. pageSize: 10,
  418. },
  419. showSearch: true,
  420. // 搜索展开/隐藏
  421. show: false,
  422. billTypeList: [],
  423. fMblnoOptions: [],
  424. // 遮罩层
  425. loading: false,
  426. // 主表格数据
  427. costModifyList: [],
  428. option:{},
  429. optionList:{
  430. border: true,
  431. align: 'center',
  432. stripe: true,
  433. index: true,
  434. menu: true,
  435. addBtn: false,
  436. editBtn: false,
  437. delBtn: false,
  438. height: "auto",
  439. searchSpan: 8,
  440. searchIcon: true,
  441. searchIndex: 2,
  442. highlightCurrentRow: true,
  443. column: [{
  444. index: "1",
  445. prop: "fBillno",
  446. label: "系统编号",
  447. width: 100,
  448. search: true,
  449. }, {
  450. index: "2",
  451. prop: "createTime",
  452. label: "制单日期",
  453. width: 100,
  454. search: true,
  455. type:'datetime',
  456. searchRange:true,
  457. unlinkPanels:true,
  458. defaultTime: ['00:00:00', '23:59:59'],
  459. format:'yyyy-MM-dd HH:mm:ss',
  460. valueFormat:'yyyy-MM-dd HH:mm:ss',
  461. }, {
  462. index: "3",
  463. prop: "createBy",
  464. label: "制单人",
  465. width: 100,
  466. type: "select",
  467. search: true,
  468. }, {
  469. index: "4",
  470. prop: "fBilltype",
  471. label: "原业务类型",
  472. width: 150,
  473. type: "select",
  474. search: true,
  475. }, {
  476. index: "5",
  477. prop: "fCorpid",
  478. label: "原客户",
  479. width: 100,
  480. type: "select",
  481. search: true,
  482. }, {
  483. index: "7",
  484. prop: "fMblno",
  485. label: "原提单号",
  486. width: 100,
  487. search: true,
  488. }, {
  489. index: "8",
  490. prop: "fBstime",
  491. label: "原业务日期",
  492. width: 150,
  493. search: true,
  494. type:'datetime',
  495. searchRange:true,
  496. unlinkPanels:true,
  497. defaultTime: ['00:00:00', '23:59:59'],
  498. format:'yyyy-MM-dd HH:mm:ss',
  499. valueFormat:'yyyy-MM-dd HH:mm:ss',
  500. }, {
  501. index: "9",
  502. prop: "fWarehouseid",
  503. label: "原仓库",
  504. width: 100,
  505. type: "select",
  506. }, {
  507. index: "10",
  508. prop: "fGoodsid",
  509. label: "原品名",
  510. width: 100,
  511. }]
  512. },
  513. // 选中数组
  514. ids: [],
  515. // 非多个禁用
  516. multiple: true,
  517. // 非单个禁用
  518. single: true,
  519. // 自定义列弹窗显示
  520. showSetting: false,
  521. //自定义列宽
  522. allCheck: false,
  523. setRowList: [],
  524. getRowList: [],
  525. drag: false,
  526. tableDate: [
  527. {
  528. surface: "1",
  529. label: "fBillno",
  530. name: "系统编号",
  531. checked: 0,
  532. width: 100,
  533. },
  534. {
  535. surface: "2",
  536. label: "createTime",
  537. name: "制单日期",
  538. checked: 0,
  539. width: 100,
  540. },
  541. {
  542. surface: "3",
  543. label: "createBy",
  544. name: "制单人",
  545. checked: 0,
  546. width: 100,
  547. },
  548. {
  549. surface: "4",
  550. label: "fBilltype",
  551. name: "原业务类型",
  552. checked: 0,
  553. width: 150,
  554. },
  555. {
  556. surface: "5",
  557. label: "fCorpid",
  558. name: "原客户",
  559. checked: 0,
  560. width: 100,
  561. },
  562. // {
  563. // surface: "6",
  564. // label: "fBillno",
  565. // name: "原系统编号",
  566. // checked: 0,
  567. // width: 150,
  568. // },
  569. {
  570. surface: "7",
  571. label: "fMblno",
  572. name: "原提单号",
  573. checked: 0,
  574. width: 100,
  575. },
  576. {
  577. surface: "8",
  578. label: "fBstime",
  579. name: "原业务日期",
  580. checked: 0,
  581. width: 150,
  582. },
  583. {
  584. surface: "9",
  585. label: "fWarehouseid",
  586. name: "原仓库",
  587. checked: 0,
  588. width: 100,
  589. },
  590. {
  591. surface: "10",
  592. label: "fGoodsid",
  593. name: "原品名",
  594. checked: 0,
  595. width: 100,
  596. },
  597. // {
  598. // surface: "11",
  599. // label: "mdLoadDate",
  600. // name: "最终审核人",
  601. // checked: 0,
  602. // width: 150,
  603. // },
  604. // {
  605. // surface: "12",
  606. // label: "mdLoadDate",
  607. // name: "最终审核日期",
  608. // checked: 0,
  609. // width: 180,
  610. // },
  611. // {
  612. // surface: "13",
  613. // label: "mdLoadDate",
  614. // name: "审批意见",
  615. // checked: 0,
  616. // width: 100,
  617. // },
  618. ],
  619. // 子组件弹窗title
  620. title: '',
  621. // 子组件弹窗显示开关
  622. addOrUpdateVisible: false,
  623. // 子组件表格是否禁用
  624. formDisabled: true,
  625. form: {},
  626. feeList: [],
  627. formfeesList: [],
  628. goodsOptions: [],
  629. warehouseOptions: [],
  630. fDc: '',
  631. warehouseId: null,
  632. disabledtwo: false,
  633. approVal: false,
  634. userOptions: [],
  635. }
  636. },
  637. async created() {
  638. this.option = await this.getColumnData(this.getColumnName(173), this.optionList);
  639. this.setRowList = this.tableDate;
  640. this.getRowList = this.tableDate;
  641. let i = 0;
  642. this.option.column.forEach(item => {
  643. if (item.search) i++
  644. })
  645. if (i % 3 !== 0) {
  646. const num = 3 - Number(i % 3)
  647. this.option.searchMenuSpan = num * 8;
  648. this.option.searchMenuPosition = "right";
  649. }
  650. this.getRow()
  651. this.getList();
  652. this.getDicts("data_billtype_type").then((response) => {
  653. this.billTypeList = response.data;
  654. });
  655. listCorps().then((response) => {
  656. this.fMblnoOptions = response.rows;
  657. });
  658. listGoods({fStatus: 0, delFlag: 0}).then((response) => {
  659. this.goodsOptions = response.rows;
  660. });
  661. listWarehousesss({fStatus: 0, delFlag: 0}).then((response) => {
  662. this.warehouseOptions = response.rows;
  663. });
  664. listUser().then((response) => {
  665. this.userOptions = response.rows;
  666. });
  667. },
  668. activated() {
  669. if (this.$route.query.data) {
  670. this.reset();
  671. this.warehouseId = this.$route.query.data.form.fId
  672. this.fDc = this.$route.query.data.fDc
  673. this.disabledtwo = false
  674. passWarehouse(this.fDc, this.warehouseId).then(res => {
  675. this.form = res.data.data
  676. this.feeList = res.data.data.tWarehousebillsfees
  677. })
  678. this.$nextTick(() => {
  679. this.openDialog()
  680. this.$refs.addOrUpdateRef.init()
  681. })
  682. }
  683. if (this.$route.query.id) {
  684. let id = this.$route.query.id;
  685. console.log(id)
  686. this.reset();
  687. detailWarehouseModify(id).then(res => {
  688. this.form = res.data
  689. this.feeList = res.data.tWarehousebillsfees
  690. this.formfeesList = res.data.warehousebillsfeesModifyList ? res.data.warehousebillsfeesModifyList : []
  691. })
  692. this.disabledtwo = true
  693. this.title = "查看订单";
  694. this.addOrUpdateVisible = true;
  695. this.form.id = id;
  696. this.formDisabled = true
  697. this.approVal = true
  698. this.$refs.addOrUpdateRef.init()
  699. this.$router.push({query: {}});
  700. }
  701. },
  702. mounted() {
  703. this.$nextTick(() => {
  704. // 监听浏览器高度变化,改变表格高度
  705. window.onresize = () => {
  706. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  707. }
  708. })
  709. },
  710. filters: {
  711. corpNameFormat(row, fMblnoOptions) {
  712. let name;
  713. fMblnoOptions.map((e) => {
  714. if (row == e.fId) {
  715. name = e.fName;
  716. }
  717. });
  718. return name;
  719. },
  720. goodsFormat(row, goodsOptions) {
  721. let name;
  722. goodsOptions.map((e) => {
  723. if (row == e.fId) {
  724. name = e.fName;
  725. }
  726. });
  727. return name;
  728. },
  729. billTypeFormat(row, billTypeList) {
  730. let type;
  731. billTypeList.map((e) => {
  732. if (row == e.dictValue) {
  733. type = e.dictLabel;
  734. }
  735. });
  736. return type;
  737. },
  738. warehouseFormat(row, warehouseOptions) {
  739. let name;
  740. warehouseOptions.map((e) => {
  741. if (row == e.fId) {
  742. name = e.fName;
  743. }
  744. });
  745. return name;
  746. },
  747. },
  748. methods: {
  749. //自定义列保存
  750. async saveColumn(ref,option,optionBack,code) {
  751. /**
  752. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  753. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  754. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  755. */
  756. const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
  757. if (inSave) {
  758. this.$message.success("保存成功");
  759. //关闭窗口
  760. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  761. }
  762. },
  763. //自定义列重置
  764. async resetColumn(ref,option,optionBack,code) {
  765. this[option] = this[optionBack];
  766. const inSave = await this.delColumnData(this.getColumnName(code), this.optionList);
  767. if (inSave) {
  768. this.$message.success("重置成功");
  769. this.$refs[ref].$refs.dialogColumn.columnBox = false;
  770. }
  771. },
  772. openDialog() {
  773. this.formDisabled = true;
  774. this.title = "查看订单";
  775. // this.$nextTick(() => {
  776. // this.$refs.addOrUpdateRef.init();
  777. // })
  778. this.addOrUpdateVisible = true;
  779. },
  780. getList() {
  781. listWarehouseModify(this.queryParams).then(res => {
  782. this.costModifyList = res.rows
  783. this.total = res.total
  784. this.loading = false;
  785. console.log(this.costModifyList)
  786. })
  787. // 根据浏览器高度设置初始高度
  788. setTimeout(() => {
  789. this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 70
  790. }, 300)
  791. },
  792. /** 搜索按钮操作 */
  793. handleQuery() {
  794. this.queryParams.pageNum = 1;
  795. this.queryParams.pageSize = 10;
  796. if (this.queryParams.createTimeList) {
  797. this.queryParams.createTimeList[0] = this.queryParams.createTimeList[0] + " " + "00:00:00"
  798. this.queryParams.createTimeList[1] = this.queryParams.createTimeList[1] + " " + "23:59:59"
  799. }
  800. if (this.queryParams.bstimeList) {
  801. this.queryParams.bstimeList[0] = this.queryParams.bstimeList[0] + " " + "00:00:00"
  802. this.queryParams.bstimeList[1] = this.queryParams.bstimeList[1] + " " + "23:59:59"
  803. }
  804. this.getList();
  805. },
  806. /** 重置按钮操作 */
  807. resetQuery() {
  808. this.queryParams = {
  809. pageNum: 1,
  810. pageSize: 10,
  811. }
  812. this.resetForm("queryForm");
  813. this.handleQuery();
  814. },
  815. // 多选框选中数据
  816. handleSelectionChange(selection) {
  817. this.ids = selection.map((item) => item.id);
  818. this.single = selection.length !== 1;
  819. this.multiple = !selection.length;
  820. },
  821. // 表单重置
  822. reset() {
  823. this.form = {
  824. id: null,
  825. billNo: null,
  826. actId: null,
  827. corpId: null,
  828. transUserName: null,
  829. planUserName: null,
  830. billType: null,
  831. transType: null,
  832. transProp: null,
  833. ifContracted: null,
  834. contractNo: null,
  835. refNo: null,
  836. accstlType: null,
  837. accdays: null,
  838. goodsId: null,
  839. goodsPrice: null,
  840. goodsLossType: null,
  841. goodsLossStd: null,
  842. mblno: null,
  843. ysl: null,
  844. voy: null,
  845. pol: null,
  846. pod: null,
  847. qtyPlan: null,
  848. qtyDisPatch: null,
  849. weightPlan: null,
  850. cntrDesc: null,
  851. carNoList: null,
  852. loadAddr: null,
  853. loadAttn: null,
  854. loadAttntel: null,
  855. loadDate: null,
  856. mdLoadAddr: null,
  857. mdLoadAttn: null,
  858. mdLoadAttnTel: null,
  859. mdLoadDate: null,
  860. unLoadAddr: null,
  861. unLoadAttn: null,
  862. unLoadAttnTel: null,
  863. unLoadDate: null,
  864. routeId: null,
  865. routeDesc: null,
  866. ifWaybill: null,
  867. ifNeedinvDr: null,
  868. postDate: null,
  869. billStatus: 0,
  870. delFlag: null,
  871. createBy: null,
  872. createTime: null,
  873. updateBy: null,
  874. updateTime: null,
  875. remarks: null,
  876. };
  877. this.disabled = false;
  878. this.resetForm("form");
  879. this.relevantAttachments = [];
  880. this.allfMblnoOptions = [];
  881. this.feesList = [];
  882. this.formfeesList = [];
  883. },
  884. /** 查看按钮操作 */
  885. handleUpdate(row) {
  886. this.disabledtwo = true
  887. this.addOrUpdateVisible = true
  888. this.formDisabled = true
  889. // let id = row.fId;
  890. // this.reset();
  891. // detailWarehouseModify(id).then(res => {
  892. // this.form = res.data
  893. // this.warehouseId = res.data.fPid
  894. // this.feeList = res.data.tWarehousebillsfees
  895. // this.formfeesList = res.data.warehousebillsfeesModifyList ? res.data.warehousebillsfeesModifyList : []
  896. // this.$nextTick(() => {
  897. // this.$refs.addOrUpdateRef.init()
  898. // })
  899. // })
  900. // this.disabledtwo = true
  901. // this.title = "查看订单";
  902. // this.addOrUpdateVisible = true;
  903. // this.form.id = id;
  904. // this.formDisabled = true
  905. },
  906. /** 删除按钮操作 */
  907. handleDelete(row) {
  908. const ids = row.id || this.ids;
  909. this.$confirm('是否确认删除订单主编号为"' + ids + '"的数据项?', "警告", {
  910. confirmButtonText: "确定",
  911. cancelButtonText: "取消",
  912. type: "warning",
  913. })
  914. .then(function () {
  915. return delFtmsorderbills(ids);
  916. })
  917. .then(() => {
  918. this.getList();
  919. this.msgSuccess("删除成功");
  920. });
  921. },
  922. // 新增操作
  923. handleAdd() {
  924. this.reset();
  925. this.title = "新增订单";
  926. this.addOrUpdateVisible = true;
  927. this.formDisabled = false;
  928. },
  929. // 监听 子组件弹窗关闭后触发,有子组件调用
  930. showAddOrUpdate(data) {
  931. if (data === "false") {
  932. this.addOrUpdateVisible = false;
  933. // this.$router.push({
  934. // path: "/business/costModify",
  935. // query: {},
  936. // });
  937. // this.getList()
  938. } else {
  939. this.addOrUpdateVisible = true;
  940. }
  941. },
  942. // 导出
  943. handleExport() {
  944. },
  945. //列设置全选
  946. allChecked() {
  947. if (this.allCheck == true) {
  948. this.setRowList.map((e) => {
  949. return (e.checked = 0);
  950. });
  951. } else {
  952. this.setRowList.map((e) => {
  953. return (e.checked = 1);
  954. });
  955. }
  956. },
  957. //开始拖拽事件
  958. onStart() {
  959. this.drag = true;
  960. },
  961. //拖拽结束事件
  962. onEnd() {
  963. this.drag = false;
  964. },
  965. //重置列表
  966. delRow() {
  967. this.data = {
  968. tableName: "费用变更",
  969. userId: Cookies.get("userName"),
  970. };
  971. resetModule(this.data).then((res) => {
  972. if (res.code == 200) {
  973. this.showSetting = false;
  974. this.setRowList = this.tableDate;
  975. console.log(this.setRowList)
  976. this.getRowList = this.tableDate;
  977. }
  978. });
  979. },
  980. //保存列设置
  981. save() {
  982. this.showSetting = false;
  983. this.data = {
  984. tableName: "费用变更",
  985. userId: Cookies.get("userName"),
  986. sysTableSetList: this.setRowList,
  987. };
  988. addSet(this.data).then((res) => {
  989. this.getRowList = this.setRowList.filter((e) => e.checked == 0);
  990. });
  991. },
  992. //查询列数据
  993. getRow() {
  994. let that = this;
  995. this.data = {
  996. tableName: "费用变更",
  997. userId: Cookies.get("userName"),
  998. };
  999. select(this.data).then((res) => {
  1000. if (res.data.length != 0) {
  1001. this.getRowList = res.data.filter((e) => e.checked == 0);
  1002. this.setRowList = res.data;
  1003. this.setRowList = this.setRowList.reduce((res, item) => {
  1004. res.push({
  1005. surface: item.surface,
  1006. label: item.label,
  1007. name: item.name,
  1008. checked: item.checked,
  1009. width: item.width,
  1010. fixed: item.fixed,
  1011. });
  1012. return res;
  1013. }, []);
  1014. }
  1015. });
  1016. },
  1017. }
  1018. }
  1019. </script>
  1020. <style scoped>
  1021. </style>