detailsPageEdit.vue 26 KB

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