detailsPage.vue 27 KB

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