detailsPage.vue 28 KB

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