detailsPage.vue 28 KB

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