detailsPageEdit.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960
  1. <template>
  2. <div class="borderless">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <el-button
  11. class="el-button--small-yh add-customer-btn"
  12. type="success" style="right: 140px;">
  13. 复制新单
  14. </el-button>
  15. <el-button
  16. class="el-button--small-yh add-customer-btn"
  17. type="primary"
  18. :disabled="disabled"
  19. @click="editCustomer"
  20. >{{ form.id ? '确认修改' : '确认新增' }}
  21. </el-button>
  22. </div>
  23. <div style="margin-top: 60px">
  24. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  25. <containerTitle title="基础资料"></containerTitle>
  26. <basic-container style="margin-bottom: 10px">
  27. <el-row>
  28. <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
  29. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  30. <!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
  31. <!-- ></avue-input-tree>-->
  32. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  33. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss"/>
  34. <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. </el-row>
  38. </basic-container>
  39. <containerTitle title="商品信息"></containerTitle>
  40. <basic-container style="margin-bottom: 10px">
  41. <avue-crud
  42. :option="customerContact"
  43. v-model="contactsForm"
  44. :data="contactsData"
  45. ref="crudContact"
  46. @row-save="rowSave"
  47. @row-click="handleRowClick"
  48. @row-update="rowUpdate"
  49. @row-del="rowDel"
  50. >
  51. <template slot="code" slot-scope="{row,index}">
  52. <span style="float: left;padding-top: 2px">{{ row.code }}</span>
  53. <el-button type="text" size="mini" style="float: right" @click="commodityChoice(row)">选择</el-button>
  54. </template>
  55. <template slot-scope="{row,index}" slot="menu">
  56. <el-button
  57. type="text"
  58. size="small"
  59. @click="rowCell(row,index)"
  60. >{{ row.$cellEdit ? '保存' : '修改' }}
  61. </el-button>
  62. </template>
  63. <template slot="menuLeft" slot-scope="{size}">
  64. <el-button type="primary"
  65. icon="el-icon-plus"
  66. size="small"
  67. @click="commoditySelection"
  68. >新增
  69. </el-button>
  70. </template>
  71. </avue-crud>
  72. </basic-container>
  73. <containerTitle title="费用明细"></containerTitle>
  74. <basic-container style="margin-bottom: 10px">
  75. <avue-crud
  76. :option="advantageProject"
  77. v-model="advantageProjectForm"
  78. :data="advantageProjectData"
  79. ref="crudProject"
  80. @row-save="rowSaveProject"
  81. @row-update="rowUpdateProject"
  82. @row-del="rowDelProject"
  83. >
  84. <template slot="code" slot-scope="{row,index}">
  85. <span style="float: left;padding-top: 2px">{{ row.code }}</span>
  86. <el-button type="text" size="mini" style="float: right" @click="choice(row)">选择</el-button>
  87. </template>
  88. <template slot-scope="{row,index}" slot="menu">
  89. <el-button
  90. type="text"
  91. size="small"
  92. @click="rowCellTwo(row,index)"
  93. >{{ row.$cellEdit ? '保存' : '修改' }}
  94. </el-button>
  95. </template>
  96. <template slot="menuLeft" slot-scope="{size}">
  97. <el-button type="primary"
  98. icon="el-icon-plus"
  99. size="small"
  100. @click="costIncrease"
  101. >新增
  102. </el-button>
  103. </template>
  104. </avue-crud>
  105. </basic-container>
  106. <containerTitle title="附件上传"></containerTitle>
  107. <basic-container style="margin-bottom: 40px">
  108. <avue-crud
  109. :option="bankOfDeposit"
  110. v-model="bankOfDepositForm"
  111. :data="bankOfDepositData"
  112. @row-save="rowSaveBankOfDeposit"
  113. @row-update="rowUpdateBankOfDeposit"
  114. @row-del="rowDelBankOfDeposit"
  115. ></avue-crud>
  116. </basic-container>
  117. </el-form>
  118. </div>
  119. <el-dialog
  120. title="导入商品"
  121. append-to-body
  122. class="el-dialogDeep"
  123. :visible.sync="dialogVisible"
  124. width="80%"
  125. :close-on-click-modal="false"
  126. :destroy-on-close="true"
  127. :close-on-press-escape="false">
  128. <el-row style="height: 0;">
  129. <el-col :span="5">
  130. <div>
  131. <el-scrollbar>
  132. <basic-container>
  133. <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/>
  134. </basic-container>
  135. </el-scrollbar>
  136. </div>
  137. </el-col>
  138. <el-col :span="19">
  139. <basic-container>
  140. <avue-crud :option="optionTwo"
  141. :table-loading="loading"
  142. :data="data"
  143. ref="crud"
  144. @refresh-change="refreshChange"
  145. @selection-change="selectionChange"
  146. :page.sync="page"
  147. @on-load="onLoad"></avue-crud>
  148. </basic-container>
  149. </el-col>
  150. </el-row>
  151. <span slot="footer" class="dialog-footer">
  152. <el-button @click="dialogVisible = false">取 消</el-button>
  153. <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
  154. <el-button type="primary" @click="importChoice" v-if="commodityData === true"
  155. :disabled="tableData.length !== 1">导入</el-button>
  156. </span>
  157. </el-dialog>
  158. <el-dialog
  159. title="导入费用"
  160. append-to-body
  161. class="el-dialogDeep"
  162. :visible.sync="dialogCost"
  163. width="80%"
  164. :close-on-click-modal="false"
  165. :destroy-on-close="true"
  166. :close-on-press-escape="false">
  167. <el-row style="height: 0;">
  168. <el-col :span="5">
  169. <div>
  170. <el-scrollbar>
  171. <basic-container>
  172. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
  173. </basic-container>
  174. </el-scrollbar>
  175. </div>
  176. </el-col>
  177. <el-col :span="19">
  178. <basic-container>
  179. <avue-crud :option="optionTwoCost"
  180. :table-loading="loadingCost"
  181. :data="dataCost"
  182. ref="crud"
  183. @refresh-change="refreshChangeCost"
  184. @selection-change="selectionChangeCost"
  185. :page.sync="pageCost"
  186. @on-load="onLoadCost">
  187. </avue-crud>
  188. </basic-container>
  189. </el-col>
  190. </el-row>
  191. <span slot="footer" class="dialog-footer">
  192. <el-button @click="dialogCost = false">取 消</el-button>
  193. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  194. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  195. :disabled="tableDataCost.length !== 1">导入</el-button>
  196. </span>
  197. </el-dialog>
  198. <!-- 打印-->
  199. <el-dialog
  200. title="打印单"
  201. append-to-body
  202. class="el-dialogDeep"
  203. :visible.sync="printVisible"
  204. width="100%"
  205. fullscreen
  206. :close-on-click-modal="false"
  207. :close-on-press-escape="false">
  208. <div class="print-div">
  209. <div
  210. style="
  211. display: flex;
  212. flex-direction: column;
  213. justify-content: center;
  214. align-item: center;
  215. font-size: 24px;
  216. margin-bottom: 5px;
  217. width: 100%;
  218. text-align: center;
  219. "
  220. >
  221. <div><b>VITAL INDUSTRIAL GROUP LIMITED</b></div>
  222. <div>NO.37 DONGHAI ROAD, QINGDAO, CHINA</div>
  223. <div>TEL:0086-532-86019080 FAX:0086-532-86019080</div>
  224. <div>
  225. <b>COMMERCIAL INVOICE</b>
  226. <span style="float: right">ORIGINAL</span>
  227. </div>
  228. </div>
  229. <div class="print_table" style="display: flex">
  230. <table
  231. border="0"
  232. cellspacing="0"
  233. cellpadding="0"
  234. style="width: 100%; line-height: 30px"
  235. >
  236. <tr>
  237. <td colspan="5" rowspan="3">MESSERS:</td>
  238. <td colspan="2">INVOICE NO.</td>
  239. <td colspan="3"></td>
  240. </tr>
  241. <tr>
  242. <td colspan="2">DATE</td>
  243. <td colspan="3"></td>
  244. </tr>
  245. <tr>
  246. <td colspan="2">INCOTERM .</td>
  247. <td colspan="3"></td>
  248. </tr>
  249. <tr>
  250. <td colspan="5">PI NO.:</td>
  251. <td colspan="2">DELIVERY PORT</td>
  252. <td colspan="3"></td>
  253. </tr>
  254. <tr>
  255. <td rowspan="2">NO.</td>
  256. <td rowspan="2">DESCRIPTION</td>
  257. <td>THICK</td>
  258. <td>LENGTH</td>
  259. <td>WIDTH</td>
  260. <td rowspan="2">SHEETS</td>
  261. <td rowspan="2">CRATES</td>
  262. <td>UNIT PRICE</td>
  263. <td>TOTAL</td>
  264. <td>T. AMOUNT</td>
  265. </tr>
  266. <tr>
  267. <td>mm</td>
  268. <td>mm</td>
  269. <td>mm</td>
  270. <td>US$/M²</td>
  271. <td>M²</td>
  272. <td>US$</td>
  273. </tr>
  274. <tr>
  275. <td>1</td>
  276. <td></td>
  277. <td></td>
  278. <td></td>
  279. <td></td>
  280. <td></td>
  281. <td></td>
  282. <td></td>
  283. <td></td>
  284. <td></td>
  285. </tr>
  286. <tr>
  287. <td>2</td>
  288. <td></td>
  289. <td></td>
  290. <td></td>
  291. <td></td>
  292. <td></td>
  293. <td></td>
  294. <td></td>
  295. <td></td>
  296. <td></td>
  297. </tr>
  298. <tr>
  299. <td>3</td>
  300. <td></td>
  301. <td></td>
  302. <td></td>
  303. <td></td>
  304. <td></td>
  305. <td></td>
  306. <td></td>
  307. <td></td>
  308. <td></td>
  309. </tr>
  310. <tr>
  311. <td colspan="9" style="text-align: right">FUMIGATION COST:</td>
  312. <td></td>
  313. </tr>
  314. <tr>
  315. <td colspan="9" style="text-align: right">INSURANCE:</td>
  316. <td></td>
  317. </tr>
  318. <tr>
  319. <td colspan="9" style="text-align: right">TOTAL:</td>
  320. <td>0.00</td>
  321. </tr>
  322. </table>
  323. </div>
  324. <div class="print-footer" style="margin-top: 8px">
  325. <div style="font-weight: bold">TOTAL AMOUNT: U.S. DOLLARS NINE THOUSAND FORTY SIX CENTS TWENTY FIVE ONLY.
  326. </div>
  327. </div>
  328. </div>
  329. </el-dialog>
  330. </div>
  331. </template>
  332. <script>
  333. import {
  334. typeSave,
  335. detail,
  336. corpsattn,
  337. corpsbank,
  338. corpsitem,
  339. getList,
  340. getDeptLazyTreeS
  341. } from "@/api/basicData/purchaseOrder"
  342. import customerContact from "./configuration/customerContact.json"
  343. import advantageProject from "./configuration/advantageProject.json"
  344. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  345. import commodity from "./configuration/commodity.json"
  346. import optionTwoCost from "./configuration/mainListCost.json"
  347. import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
  348. export default {
  349. name: "detailsPage",
  350. data() {
  351. return {
  352. form: {},
  353. data: [],
  354. loadingCost: false,
  355. choiceData: false,
  356. commodityData: false,
  357. dataCost: [],
  358. choiceIndex: '',
  359. dialogCost: false,
  360. treeDeptId: '',
  361. treeDeptIdCost: '',
  362. pageCost: {
  363. pageSize: 10,
  364. currentPage: 1,
  365. total: 0
  366. },
  367. page: {
  368. pageSize: 10,
  369. currentPage: 1,
  370. total: 0
  371. },
  372. loading: false,
  373. contactsForm: {},
  374. optionTwo: commodity,
  375. optionTwoCost: optionTwoCost,
  376. treeOptionCost: {
  377. nodeKey: 'id',
  378. lazy: true,
  379. treeLoad: function (node, resolve) {
  380. const parentId = (node.level === 0) ? 0 : node.data.id;
  381. getDeptLazyTree(parentId).then(res => {
  382. resolve(res.data.data.map(item => {
  383. return {
  384. ...item,
  385. leaf: !item.hasChildren
  386. }
  387. }))
  388. });
  389. },
  390. addBtn: false,
  391. menu: false,
  392. size: 'small',
  393. props: {
  394. labelText: '标题',
  395. label: 'title',
  396. value: 'value',
  397. children: 'children'
  398. }
  399. },
  400. treeOption: {
  401. nodeKey: 'id',
  402. lazy: true,
  403. treeLoad: function (node, resolve) {
  404. const parentId = (node.level === 0) ? 0 : node.data.id;
  405. getDeptLazyTreeS(parentId).then(res => {
  406. console.log(res.data.data)
  407. resolve(res.data.data.map(item => {
  408. return {
  409. ...item,
  410. leaf: !item.hasChildren
  411. }
  412. }))
  413. });
  414. },
  415. addBtn: false,
  416. menu: false,
  417. size: 'small',
  418. props: {
  419. labelText: '标题',
  420. label: 'title',
  421. value: 'value',
  422. children: 'children'
  423. }
  424. },
  425. dialogVisible: false,
  426. advantageProjectForm: {},
  427. bankOfDepositForm: {},
  428. contactsData: [],
  429. advantageProjectData: [],
  430. disabled: false,
  431. bankOfDepositData: [],
  432. tableDataCost: [],
  433. dic: [],
  434. tableData: [],
  435. customerContact: customerContact,
  436. advantageProject: advantageProject,
  437. bankOfDeposit: bankOfDeposit,
  438. basicData: {
  439. column: [
  440. {
  441. label: '系统编号',
  442. prop: 'sysNo',
  443. rules: [
  444. {
  445. required: true,
  446. message: ' ',
  447. trigger: 'blur'
  448. }
  449. ]
  450. }, {
  451. label: '来源单号',
  452. prop: 'srcOrderNo',
  453. rules: [
  454. {
  455. required: true,
  456. message: ' ',
  457. trigger: 'blur'
  458. }
  459. ]
  460. }, {
  461. label: ' 银行账号',
  462. prop: 'banks',
  463. rules: [
  464. {
  465. required: true,
  466. message: ' ',
  467. trigger: 'blur'
  468. }
  469. ]
  470. }, {
  471. label: '供应商',
  472. prop: 'corpId',
  473. rules: [
  474. {
  475. required: true,
  476. message: ' ',
  477. trigger: 'blur'
  478. }
  479. ]
  480. }, {
  481. label: '付款方式',
  482. prop: 'paymentType',
  483. rules: [
  484. {
  485. required: true,
  486. message: ' ',
  487. trigger: 'blur'
  488. }
  489. ]
  490. }, {
  491. label: '公司户头',
  492. prop: 'banksAccountName',
  493. rules: [
  494. {
  495. required: true,
  496. message: ' ',
  497. trigger: 'blur'
  498. }
  499. ]
  500. }, {
  501. label: '包装要求',
  502. prop: 'packageRemarks',
  503. rules: [
  504. {
  505. required: true,
  506. message: ' ',
  507. trigger: 'blur'
  508. }
  509. ]
  510. }, {
  511. label: '运费',
  512. prop: 'oceanFreight',
  513. rules: [
  514. {
  515. required: true,
  516. message: ' ',
  517. trigger: 'blur'
  518. }
  519. ]
  520. }, {
  521. label: '要求到货日期',
  522. prop: 'requiredArrivalDate',
  523. type: 'datetime',
  524. rules: [
  525. {
  526. required: true,
  527. message: ' ',
  528. trigger: 'blur'
  529. }
  530. ]
  531. },{
  532. label: "备注",
  533. span: 24,
  534. prop: "orderRemark",
  535. mock: {
  536. type: 'county'
  537. }
  538. }
  539. ]
  540. }
  541. }
  542. },
  543. //初始化查询
  544. created() {
  545. if (this.$route.query.id) {
  546. let id = this.$route.query.id.replace(/\"/g, "")
  547. detail(id).then(res => {
  548. console.log(res.data.data.itemsVOList)
  549. this.form = res.data.data;
  550. this.contactsData = this.form.itemsVOList
  551. this.advantageProjectData = this.form.orderFeesList
  552. this.bankOfDepositData = this.form.orderFilesList
  553. delete this.form.itemsVOList
  554. delete this.form.orderFeesList
  555. delete this.form.orderFilesList
  556. });
  557. }
  558. },
  559. watch: {
  560. '$route'(to, from) {
  561. console.log(to, from);
  562. if (this.$route.query.id) {
  563. let id = JSON.parse(this.$route.query.id).replace(/\"/g, "")
  564. detail(id).then(res => {
  565. console.log(res.data.data)
  566. this.form = res.data.data;
  567. });
  568. } else {
  569. this.form = {}
  570. }
  571. }
  572. },
  573. methods: {
  574. //点击行可编辑
  575. handleRowClick(row, event, column) {
  576. console.log(row.$index)
  577. },
  578. //商品编辑
  579. rowCell(row, index) {
  580. console.log(row)
  581. this.$refs.crudContact.rowCell(row, index)
  582. },
  583. //费用编辑
  584. rowCellTwo(row, index) {
  585. console.log(row)
  586. this.$refs.crudProject.rowCell(row, index)
  587. },
  588. //费用新增触发
  589. costIncrease() {
  590. this.dialogCost = !this.dialogCost
  591. this.choiceData = false
  592. },
  593. //商品新增触发
  594. commoditySelection() {
  595. this.dialogVisible = !this.dialogVisible
  596. this.commodityData = false
  597. },
  598. //点击费用明细选择触发
  599. choice(row) {
  600. this.dialogCost = !this.dialogCost
  601. this.choiceData = true
  602. console.log(row)
  603. this.choiceIndex = row.$index
  604. },
  605. //点击商品明细选择触发
  606. commodityChoice(row) {
  607. this.dialogVisible = !this.dialogVisible
  608. this.commodityData = true
  609. console.log(row)
  610. this.choiceIndexT = row.$index
  611. },
  612. //导入商品触发
  613. importChoice() {
  614. if (this.tableData.length === 1) {
  615. this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
  616. this.contactsData[this.choiceIndexT].code = this.tableData[0].code
  617. this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
  618. this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].specificationAndModel
  619. this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
  620. }
  621. this.dialogVisible = !this.dialogVisible
  622. this.commodityData = false
  623. },
  624. //费用编辑导入触发
  625. choiceCost() {
  626. console.log('1111')
  627. if (this.tableDataCost.length === 1) {
  628. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  629. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  630. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  631. }
  632. this.dialogCost = !this.dialogCost
  633. this.choiceData = false
  634. },
  635. //费用导入触发
  636. importCost() {
  637. console.log('111111')
  638. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  639. if (this.tableDataCost.length > 0) {
  640. for (let item in this.tableDataCost) {
  641. console.log(this.tableDataCost[item])
  642. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  643. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  644. delete this.tableDataCost[item].id
  645. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  646. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  647. }
  648. }
  649. this.tableDataCost = []
  650. this.dialogCost = false
  651. },
  652. //确认导入触发
  653. importGoods() {
  654. // this.contactsData = this.contactsData.concat(this.tableData)
  655. if (this.tableData.length > 0) {
  656. for (let item in this.tableData) {
  657. console.log(this.tableData[item])
  658. this.tableData[item].itemId = this.tableData[item].id
  659. delete this.tableData[item].id
  660. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  661. this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
  662. }
  663. }
  664. this.tableData = []
  665. this.dialogVisible = false
  666. },
  667. //选中触发
  668. selectionChange(list) {
  669. console.log(list);
  670. this.tableData = list
  671. },
  672. //费用选中触发
  673. selectionChangeCost(list) {
  674. console.log(list);
  675. this.tableDataCost = list
  676. },
  677. //导入页左商品类型查询
  678. nodeClick(data) {
  679. this.treeDeptId = data.id;
  680. this.page.currentPage = 1;
  681. this.onLoad(this.page);
  682. },
  683. //导入页左费用类型查询
  684. nodeClickCost(data) {
  685. this.treeDeptIdCost = data.id;
  686. this.pageCost.currentPage = 1;
  687. this.onLoadCost(this.pageCost);
  688. },
  689. //刷新触发
  690. refreshChange() {
  691. this.treeDeptId = '';
  692. this.page.currentPage = 1;
  693. this.onLoad(this.page);
  694. },
  695. //费用刷新触发
  696. refreshChangeCost() {
  697. this.treeDeptIdCost = '';
  698. this.pageCost.currentPage = 1;
  699. this.onLoadCost(this.pageCost);
  700. },
  701. //新增商品信息保存触发
  702. rowSave(row, done, loading) {
  703. console.log(row)
  704. console.log(this.contactsData)
  705. // this.contactsData.push(row)
  706. done()
  707. },
  708. //修改商品信息触发
  709. rowUpdate(row, index, done, loading) {
  710. done(row);
  711. },
  712. //删除商品信息触发
  713. rowDel(row, index, donerowDel) {
  714. this.$confirm("确定将选择数据删除?", {
  715. confirmButtonText: "确定",
  716. cancelButtonText: "取消",
  717. type: "warning"
  718. }).then(() => {
  719. //商品判断是否需要调用删除接口
  720. if (row.id) {
  721. corpsattn(row.id).then(res => {
  722. this.$message({
  723. type: "success",
  724. message: "操作成功!"
  725. });
  726. this.contactsData.splice(index, 1);
  727. })
  728. } else {
  729. this.$message({
  730. type: "success",
  731. message: "操作成功!"
  732. });
  733. this.contactsData.splice(index, 1);
  734. }
  735. })
  736. },
  737. //新增费用明细保存触发
  738. rowSaveProject(row, done, loading) {
  739. // this.advantageProjectData.push(row)
  740. done()
  741. },
  742. //修改费用明细触发
  743. rowUpdateProject(row, index, done, loading) {
  744. done(row);
  745. },
  746. //商品列表查询
  747. onLoad(page, params = {}) {
  748. this.loading = true;
  749. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
  750. console.log(res)
  751. const data = res.data.data;
  752. this.page.total = data.total;
  753. this.data = data.records;
  754. this.loading = false;
  755. });
  756. },
  757. //费用查询
  758. onLoadCost(page, params = {}) {
  759. this.loadingCost = true;
  760. let queryParams = Object.assign({}, params, {
  761. pageSize: page.pageSize,
  762. pageNum: page.currentPage,
  763. parentId: 0,
  764. feesTypeId: this.treeDeptIdCost
  765. })
  766. customerList(queryParams).then(res => {
  767. console.log(res)
  768. const data = res.data.data;
  769. this.pageCost.total = data.total;
  770. this.dataCost = data.records;
  771. this.loadingCost = false;
  772. });
  773. },
  774. //删除费用明细触发
  775. rowDelProject(row, index, donerowDel) {
  776. this.$confirm("确定将选择数据删除?", {
  777. confirmButtonText: "确定",
  778. cancelButtonText: "取消",
  779. type: "warning"
  780. }).then(() => {
  781. //费用判断是否需要调用删除接口
  782. if (row.id) {
  783. corpsitem(row.id).then(res => {
  784. this.$message({
  785. type: "success",
  786. message: "操作成功!"
  787. });
  788. this.advantageProjectData.splice(index, 1);
  789. })
  790. } else {
  791. this.$message({
  792. type: "success",
  793. message: "操作成功!"
  794. });
  795. this.advantageProjectData.splice(index, 1);
  796. }
  797. })
  798. },
  799. //新增附件上传保存触发
  800. rowSaveBankOfDeposit(row, done, loading) {
  801. this.bankOfDepositData.push(row)
  802. done()
  803. },
  804. //修改附件上传触发
  805. rowUpdateBankOfDeposit(row, index, done, loading) {
  806. done(row);
  807. },
  808. //删除附件上传触发
  809. rowDelBankOfDeposit(row, index, donerowDel) {
  810. this.$confirm("确定将选择数据删除?", {
  811. confirmButtonText: "确定",
  812. cancelButtonText: "取消",
  813. type: "warning"
  814. }).then(() => {
  815. //附件判断是否需要调用删除接口
  816. if (row.id) {
  817. corpsbank(row.id).then(res => {
  818. this.$message({
  819. type: "success",
  820. message: "操作成功!"
  821. });
  822. this.bankOfDepositData.splice(index, 1);
  823. })
  824. } else {
  825. this.$message({
  826. type: "success",
  827. message: "操作成功!"
  828. });
  829. this.bankOfDepositData.splice(index, 1);
  830. }
  831. })
  832. },
  833. //修改提交触发
  834. editCustomer() {
  835. console.log(this.form)
  836. this.$refs["form"].validate((valid) => {
  837. if (valid) {
  838. //商品信息
  839. this.form.itemsVOList = this.contactsData
  840. this.form.orderFeesList = this.advantageProjectData
  841. this.form.orderFilesList = this.bankOfDepositData
  842. if (typeof this.form.corpsTypeId == 'object') {
  843. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  844. }
  845. this.disabled = true
  846. this.form.billType = 'CG'
  847. typeSave(this.form).then(res => {
  848. this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
  849. //成功关闭此页面回到列表页
  850. // this.backToList()
  851. })
  852. } else {
  853. return false;
  854. }
  855. });
  856. },
  857. //返回列表
  858. backToList() {
  859. this.$router.$avueRouter.closeTag();
  860. this.$router.push({
  861. path: '/businessManagement/purchaseOrder/index',
  862. query: {}
  863. });
  864. }
  865. }
  866. }
  867. </script>
  868. <style lang="scss" scoped>
  869. .customer-head {
  870. position: fixed;
  871. top: 105px;
  872. width: 100%;
  873. margin-left: -10px;
  874. height: 62px;
  875. background: #ffffff;
  876. box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  877. z-index: 999;
  878. /* display: flex;
  879. justify-content: left; */
  880. }
  881. .customer-back {
  882. cursor: pointer;
  883. line-height: 62px;
  884. font-size: 16px;
  885. color: #323233;
  886. font-weight: 400;
  887. }
  888. .back-icon {
  889. line-height: 64px;
  890. font-size: 20px;
  891. margin-right: 8px;
  892. }
  893. .add-customer-btn {
  894. position: fixed;
  895. right: 36px;
  896. top: 115px;
  897. }
  898. ::v-deep .el-form-item {
  899. margin-bottom: 0;
  900. }
  901. .el-dialogDeep {
  902. ::v-deep .el-dialog {
  903. margin: 1vh auto 0 !important;
  904. padding-bottom: 10px !important;
  905. .el-dialog__body, .el-dialog__footer {
  906. padding-bottom: 0 !important;
  907. padding-top: 0 !important;
  908. }
  909. }
  910. }
  911. .print-div {
  912. color: #000;
  913. }
  914. .print_table {
  915. table {
  916. border-right: 1px solid #000;
  917. border-bottom: 1px solid #000;
  918. font-size: 12px;
  919. margin-bottom: 5px;
  920. }
  921. table td {
  922. border-left: 1px solid #000;
  923. border-top: 1px solid #000;
  924. vertical-align: middle;
  925. padding: 2px;
  926. text-align: center;
  927. }
  928. }
  929. .table {
  930. border-collapse: collapse;
  931. border-spacing: 0;
  932. background-color: transparent;
  933. display: table;
  934. width: 99%;
  935. max-width: 100%;
  936. margin: 0 auto;
  937. }
  938. .table td {
  939. text-align: left;
  940. vertical-align: middle;
  941. font-size: 14px;
  942. color: #000000;
  943. padding: 10.5px 0 10.5px 30px;
  944. //border: 1px solid #000;
  945. }
  946. </style>