detailsPageEdit.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  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. <div class="add-customer-btn">
  11. <el-button
  12. size="small"
  13. class="el-button--small-yh"
  14. :disabled="detailData.seeDisabled || !this.form.id"
  15. type="warning" style="right: 140px;"
  16. @click="applyPayment"
  17. >
  18. 申请货款
  19. </el-button>
  20. <el-button
  21. size="small"
  22. class="el-button--small-yh"
  23. type="success" style="right: 140px;"
  24. @click="copyOrder"
  25. :disabled="detailData.seeDisabled || !this.form.id"
  26. >
  27. 复制新单
  28. </el-button>
  29. <el-button
  30. size="small"
  31. class="el-button--small-yh"
  32. type="primary"
  33. :disabled="disabled || detailData.seeDisabled"
  34. @click="editCustomer(false)"
  35. :loading="saveLoading"
  36. >{{ form.id ? '确认修改' : '确认新增' }}
  37. </el-button>
  38. </div>
  39. </div>
  40. <div class="customer-main">
  41. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  42. <containerTitle title="基础资料"></containerTitle>
  43. <basic-container style="margin-bottom: 10px">
  44. <el-row>
  45. <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
  46. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  47. <!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
  48. <!-- ></avue-input-tree>-->
  49. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  50. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="detailData.seeDisabled"/>
  51. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  52. size="small" type="date" placeholder="选择日期"
  53. :disabled="detailData.seeDisabled"/>
  54. <el-select v-else-if="item.prop === 'paymentType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled">
  55. <el-option v-for="(item,index) in paymentOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  56. </el-select>
  57. <selectComponent v-else-if="item.prop === 'corpId'" v-model="form[item.prop]"
  58. :configuration="configuration" style="width: 100%" :disabled="detailData.seeDisabled"/>
  59. <el-input
  60. v-else-if="item.type == 'number'"
  61. placeholder="请输入"
  62. v-input-limit="2"
  63. size="small"
  64. :disabled="item.disabled || detailData.seeDisabled"
  65. v-model="form[item.prop]"
  66. />
  67. <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
  68. <el-input type="age" v-else v-model="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled"></el-input>
  69. </el-form-item>
  70. </el-col>
  71. </el-row>
  72. </basic-container>
  73. <containerTitle title="商品信息"></containerTitle>
  74. <basic-container style="margin-bottom: 10px">
  75. <avue-crud
  76. :option="customerContact"
  77. v-model="contactsForm"
  78. :data="contactsData"
  79. ref="crudContact"
  80. @row-save="rowSave"
  81. @row-click="handleRowClick"
  82. @row-update="rowUpdate"
  83. @row-del="rowDel"
  84. @selection-change="productSelection"
  85. @saveColumn="saveColumn('goods')"
  86. >
  87. <template slot="cname" slot-scope="{ row }">
  88. <goods-select v-if="row.$cellEdit" v-model="row.cname" @getRow="getGoodsRow($event, row)"
  89. :configuration="goodsConfiguration" @receiveList="receiveGoodList" @returnRow="getRow($event, row)"/>
  90. <span v-else>
  91. <span v-for="item in goodsConfiguration.dicData" v-if="item.cname == row.cname">{{ item.cname }}</span>
  92. </span>
  93. </template>
  94. <template slot="orderQuantity" slot-scope="{ row }">
  95. <el-input
  96. v-if="row.$cellEdit"
  97. v-model="row.orderQuantity"
  98. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")' size="small"
  99. @input="changeContractAmt(row)"
  100. ></el-input>
  101. <span v-else>{{ row.orderQuantity }}</span>
  102. </template>
  103. <template slot="price" slot-scope="{ row }">
  104. <el-input
  105. v-if="row.$cellEdit"
  106. v-model="row.price"
  107. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")' size="small"
  108. @input="changeContractAmt(row)"
  109. ></el-input>
  110. <span v-else>{{ row.price }}</span>
  111. </template>
  112. <template slot="storageQuantity" slot-scope="{ row }">
  113. <el-input
  114. v-if="row.$cellEdit"
  115. v-model="row.storageQuantity"
  116. size="small"
  117. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  118. ></el-input>
  119. <span v-else>{{ row.storageQuantity }}</span>
  120. </template>
  121. <template slot="actualQuantity" slot-scope="{ row }">
  122. <el-input
  123. v-if="row.$cellEdit"
  124. v-model="row.actualQuantity"
  125. size="small"
  126. oninput='this.value=this.value.replace(/[^\-?\d.]/g,"").replace(/^(\-)*(\d+)\.(\d\d).*$/, "$1$2.$3")'
  127. ></el-input>
  128. <span v-else>{{ row.actualQuantity }}</span>
  129. </template>
  130. <template slot="code" slot-scope="{row,index}">
  131. <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
  132. <span>{{ row.code }}</span>
  133. </template>
  134. <template slot-scope="{row,index}" slot="menu">
  135. <el-button
  136. type="text"
  137. size="small"
  138. @click="rowCell(row,index)"
  139. :disabled="detailData.seeDisabled"
  140. >{{ row.$cellEdit ? '保存' : '修改' }}
  141. </el-button>
  142. <el-button
  143. size="small"
  144. icon="el-icon-delete"
  145. type="text"
  146. @click="rowDel(row, index)"
  147. :disabled="detailData.seeDisabled"
  148. v-if="!row.$cellEdit"
  149. >删 除</el-button>
  150. </template>
  151. <template slot="menuLeft" slot-scope="{size}">
  152. <el-button type="primary"
  153. icon="el-icon-plus"
  154. size="small"
  155. @click="commoditySelection"
  156. :disabled="detailData.seeDisabled"
  157. >录入明细
  158. </el-button>
  159. <el-button type="warning"
  160. icon="el-icon-plus"
  161. size="small"
  162. :disabled="selection.length < 1 || detailData.seeDisabled"
  163. @click="getShipmentC">生成收货单
  164. </el-button>
  165. <el-button type="info" :size="size" icon="el-icon-printer">报 表</el-button>
  166. </template>
  167. </avue-crud>
  168. </basic-container>
  169. <containerTitle title="费用明细"></containerTitle>
  170. <basic-container style="margin-bottom: 10px">
  171. <avue-crud
  172. :option="advantageProject"
  173. v-model="advantageProjectForm"
  174. :data="advantageProjectData"
  175. ref="crudProject"
  176. @row-save="rowSaveProject"
  177. @row-update="rowUpdateProject"
  178. @row-del="rowDelProject"
  179. @saveColumn="saveColumn('fees')"
  180. >
  181. <template slot="code" slot-scope="{row,index}">
  182. <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="choice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit">选择</el-button>
  183. <span>{{ row.code }}</span>
  184. </template>
  185. <template slot="corpId" slot-scope="{ row }">
  186. <selectComponent v-if="row.$cellEdit" v-model="row.corpId"
  187. :configuration="configuration" @receiveList="receiveList"/>
  188. <span v-else>
  189. <span v-for="item in configuration.dicData" v-if="item.id == row.corpId">{{ item.cname }}</span>
  190. </span>
  191. </template>
  192. <template slot="amount" slot-scope="{ row }">
  193. <el-input v-if="row.$cellEdit" v-model="row.amount"
  194. size="small" v-input-limit="2"
  195. ></el-input>
  196. <span v-else>{{ row.amount }}</span>
  197. </template>
  198. <template slot="settlmentAmount" slot-scope="{ row }">
  199. <el-input v-if="row.$cellEdit" v-model="row.settlmentAmount"
  200. size="small" v-input-limit="2"
  201. ></el-input>
  202. <span v-else>{{ row.settlmentAmount }}</span>
  203. </template>
  204. <template slot-scope="{row,index}" slot="menu">
  205. <el-button
  206. type="text"
  207. size="small"
  208. @click="rowCellTwo(row,index)"
  209. :disabled="detailData.seeDisabled"
  210. >{{ row.$cellEdit ? '保存' : '修改' }}
  211. </el-button>
  212. <el-button
  213. size="small"
  214. icon="el-icon-delete"
  215. type="text"
  216. @click="rowDelProject(row, index)"
  217. :disabled="detailData.seeDisabled"
  218. v-if="!row.$cellEdit"
  219. >删 除</el-button>
  220. </template>
  221. <template slot="menuLeft" slot-scope="{size}">
  222. <el-button type="primary"
  223. icon="el-icon-plus"
  224. size="small"
  225. @click="costIncrease"
  226. :disabled="detailData.seeDisabled"
  227. >录入明细
  228. </el-button>
  229. </template>
  230. </avue-crud>
  231. </basic-container>
  232. <containerTitle title="附件上传"></containerTitle>
  233. <basic-container style="margin-bottom: 40px">
  234. <avue-crud
  235. :option="bankOfDeposit"
  236. v-model="bankOfDepositForm"
  237. :data="bankOfDepositData"
  238. @row-save="rowSaveBankOfDeposit"
  239. @row-update="rowUpdateBankOfDeposit"
  240. @row-del="rowDelBankOfDeposit"
  241. :upload-after="uploadAfter"
  242. ref="uploadCrud"
  243. >
  244. <template slot="menuLeft">
  245. <el-button
  246. type="primary"
  247. icon="el-icon-plus"
  248. size="small"
  249. @click.stop="$refs.uploadCrud.rowAdd()"
  250. :disabled="detailData.seeDisabled"
  251. >上传</el-button
  252. >
  253. </template>
  254. <template slot="menu" slot-scope="{ row, index }">
  255. <el-button
  256. size="small"
  257. icon="el-icon-edit"
  258. type="text"
  259. @click="$refs.uploadCrud.rowEdit(row, index)"
  260. :disabled="detailData.seeDisabled"
  261. >编 辑</el-button
  262. >
  263. <el-button
  264. size="small"
  265. icon="el-icon-delete"
  266. type="text"
  267. @click="rowDelBankOfDeposit(row, index)"
  268. :disabled="detailData.seeDisabled"
  269. >删 除</el-button
  270. >
  271. </template>
  272. </avue-crud>
  273. </basic-container>
  274. </el-form>
  275. </div>
  276. <el-dialog
  277. title="导入商品"
  278. append-to-body
  279. class="el-dialogDeep"
  280. :visible.sync="dialogVisible"
  281. width="80%"
  282. :close-on-click-modal="false"
  283. :destroy-on-close="true"
  284. :close-on-press-escape="false"
  285. @close="closeGoods">
  286. <el-row :style="{height: rowHeight}">
  287. <el-col :span="5" style="height: 100%;overflow-y: auto">
  288. <div>
  289. <el-scrollbar>
  290. <basic-container>
  291. <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick"/>
  292. </basic-container>
  293. </el-scrollbar>
  294. </div>
  295. </el-col>
  296. <el-col :span="19">
  297. <basic-container>
  298. <avue-crud :option="optionTwo"
  299. :table-loading="loading"
  300. :data="data"
  301. ref="crud"
  302. @refresh-change="refreshChange"
  303. @selection-change="selectionChange"
  304. :page.sync="page"
  305. @search-change="goodsSearch"
  306. @on-load="onLoad"></avue-crud>
  307. </basic-container>
  308. </el-col>
  309. </el-row>
  310. <span slot="footer" class="dialog-footer">
  311. <el-button @click="dialogVisible = false">取 消</el-button>
  312. <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
  313. <el-button type="primary" @click="importChoice" v-if="commodityData === true"
  314. :disabled="tableData.length !== 1">导入</el-button>
  315. </span>
  316. </el-dialog>
  317. <el-dialog
  318. title="导入费用"
  319. append-to-body
  320. class="el-dialogDeep"
  321. :visible.sync="dialogCost"
  322. width="80%"
  323. :close-on-click-modal="false"
  324. :destroy-on-close="true"
  325. :close-on-press-escape="false"
  326. @close="closeFees">
  327. <el-row :style="{height: rowHeight}">
  328. <el-col :span="5" style="height: 100%;overflow-y: auto">
  329. <div>
  330. <el-scrollbar>
  331. <basic-container>
  332. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
  333. </basic-container>
  334. </el-scrollbar>
  335. </div>
  336. </el-col>
  337. <el-col :span="19">
  338. <basic-container>
  339. <avue-crud :option="optionTwoCost"
  340. :table-loading="loadingCost"
  341. :data="dataCost"
  342. ref="crud"
  343. @refresh-change="refreshChangeCost"
  344. @selection-change="selectionChangeCost"
  345. :page.sync="pageCost"
  346. @searchChange="feesSearch"
  347. @on-load="onLoadCost">
  348. </avue-crud>
  349. </basic-container>
  350. </el-col>
  351. </el-row>
  352. <span slot="footer" class="dialog-footer">
  353. <el-button @click="dialogCost = false">取 消</el-button>
  354. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  355. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  356. :disabled="tableDataCost.length !== 1">导入</el-button>
  357. </span>
  358. </el-dialog>
  359. <el-dialog
  360. title="账单"
  361. append-to-body
  362. class="el-dialogDeep"
  363. :visible.sync="applyPaymentDialog"
  364. width="60%"
  365. :close-on-click-modal="false"
  366. :destroy-on-close="true"
  367. :close-on-press-escape="false"
  368. v-dialog-drag
  369. >
  370. <apply-payment
  371. :billType="billType"
  372. :billData="billData"
  373. @choceFun="choceFun"
  374. >
  375. </apply-payment>
  376. </el-dialog>
  377. </div>
  378. </template>
  379. <script>
  380. import {
  381. typeSave,
  382. detail,
  383. corpsattn,
  384. corpsbank,
  385. corpsitem,
  386. getList,
  387. getDeptLazyTreeS,
  388. getSysNo,
  389. generateShipment
  390. } from "@/api/basicData/purchaseOrder"
  391. import customerContact from "./configuration/customerContact.json"
  392. import advantageProject from "./configuration/advantageProject.json"
  393. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  394. import commodity from "./configuration/commodity.json"
  395. import optionTwoCost from "./configuration/mainListCost.json"
  396. import {getDeptLazyTree, customerList} from "@/api/basicData/basicFeesDesc";
  397. import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
  398. import { contrastObj, contrastList } from "@/util/contrastData";
  399. //账单组件
  400. import ApplyPayment from "../../../components/finance/applyPayment";
  401. export default {
  402. name: "detailsPage",
  403. props: {
  404. detailData: {
  405. type: Object,
  406. default: {
  407. seeDisabled: false
  408. }
  409. }
  410. },
  411. components:{
  412. ApplyPayment
  413. },
  414. data() {
  415. return {
  416. configuration: {
  417. multipleChoices: false,
  418. multiple: false,
  419. collapseTags: false,
  420. placeholder: '请点击右边按钮选择',
  421. dicData: []
  422. },
  423. goodsConfiguration: {
  424. multipleChoices: false,
  425. multiple: false,
  426. collapseTags: false,
  427. placeholder: '请点击右边按钮选择',
  428. dicData: []
  429. },
  430. form: {},
  431. data: [],
  432. loadingCost: false,
  433. choiceData: false,
  434. commodityData: false,
  435. dataCost: [],
  436. choiceIndex: '',
  437. dialogCost: false,
  438. treeDeptId: '',
  439. treeDeptIdCost: '',
  440. pageCost: {
  441. pageSize: 10,
  442. currentPage: 1,
  443. total: 0
  444. },
  445. page: {
  446. pageSize: 10,
  447. currentPage: 1,
  448. total: 0
  449. },
  450. loading: false,
  451. contactsForm: {},
  452. optionTwo: commodity,
  453. optionTwoCost: optionTwoCost,
  454. treeDataGoods: [],
  455. treeData: [],
  456. treeOptionCost: {
  457. nodeKey: 'id',
  458. lazy: true,
  459. treeLoad: function (node, resolve) {
  460. const parentId = (node.level === 0) ? 0 : node.data.id;
  461. getDeptLazyTree(parentId).then(res => {
  462. resolve(res.data.data.map(item => {
  463. return {
  464. ...item,
  465. leaf: !item.hasChildren
  466. }
  467. }))
  468. });
  469. },
  470. addBtn: false,
  471. menu: false,
  472. size: 'small',
  473. props: {
  474. labelText: '标题',
  475. label: 'title',
  476. value: 'value',
  477. children: 'children'
  478. }
  479. },
  480. treeOption: {
  481. nodeKey: 'id',
  482. lazy: true,
  483. treeLoad: function (node, resolve) {
  484. const parentId = (node.level === 0) ? 0 : node.data.id;
  485. getDeptLazyTreeS(parentId).then(res => {
  486. console.log(res.data.data)
  487. resolve(res.data.data.map(item => {
  488. return {
  489. ...item,
  490. leaf: !item.hasChildren
  491. }
  492. }))
  493. });
  494. },
  495. addBtn: false,
  496. menu: false,
  497. size: 'small',
  498. props: {
  499. labelText: '标题',
  500. label: 'title',
  501. value: 'value',
  502. children: 'children'
  503. }
  504. },
  505. billType:"申请", //账单类型
  506. billData:{}, //账单需要数据
  507. applyPaymentDialog:false,//生成账单组件
  508. dialogVisible: false,
  509. advantageProjectForm: {},
  510. bankOfDepositForm: {},
  511. contactsData: [],
  512. advantageProjectData: [],
  513. saveLoading: false,
  514. disabled: false,
  515. bankOfDepositData: [],
  516. tableDataCost: [],
  517. dic: [],
  518. tableData: [],
  519. customerContact: {},
  520. advantageProject: {},
  521. bankOfDeposit: bankOfDeposit,
  522. basicData: {
  523. column: [
  524. {
  525. label: '系统编号',
  526. prop: 'sysNo',
  527. disabled: true,
  528. rules: [
  529. {
  530. required: false,
  531. message: ' ',
  532. trigger: 'blur'
  533. }
  534. ]
  535. }, {
  536. label: '来源单号',
  537. prop: 'srcOrderNo',
  538. rules: [
  539. {
  540. required: false,
  541. message: ' ',
  542. trigger: 'blur'
  543. }
  544. ]
  545. }, {
  546. label: ' 银行账号',
  547. prop: 'banks',
  548. rules: [
  549. {
  550. required: true,
  551. message: ' ',
  552. trigger: 'blur'
  553. }
  554. ]
  555. }, {
  556. label: '供应商',
  557. prop: 'corpId',
  558. span: 16,
  559. rules: [
  560. {
  561. required: true,
  562. message: ' ',
  563. trigger: 'blur'
  564. }
  565. ]
  566. }, {
  567. label: '付款方式',
  568. prop: 'paymentType',
  569. rules: [
  570. {
  571. required: true,
  572. message: ' ',
  573. trigger: 'blur'
  574. }
  575. ]
  576. }, {
  577. label: '公司户头',
  578. prop: 'banksAccountName',
  579. rules: [
  580. {
  581. required: false,
  582. message: ' ',
  583. trigger: 'blur'
  584. }
  585. ]
  586. }, {
  587. label: '包装要求',
  588. prop: 'packageRemarks',
  589. rules: [
  590. {
  591. required: true,
  592. message: ' ',
  593. trigger: 'blur'
  594. }
  595. ]
  596. }, {
  597. label: '运费',
  598. prop: 'oceanFreight',
  599. type: 'number',
  600. rules: [
  601. {
  602. required: true,
  603. message: ' ',
  604. trigger: 'blur'
  605. }
  606. ]
  607. }, {
  608. label: '要求到货日期',
  609. prop: 'requiredArrivalDate',
  610. type: 'datetime',
  611. rules: [
  612. {
  613. required: true,
  614. message: ' ',
  615. trigger: 'blur'
  616. }
  617. ]
  618. },{
  619. label: "备注",
  620. span: 24,
  621. prop: "orderRemark",
  622. type: 'textarea',
  623. mock: {
  624. type: 'county'
  625. }
  626. }
  627. ]
  628. },
  629. paymentOption: [],
  630. maxFeeNum: 0,
  631. maxGoodsNum: 0,
  632. selection: [],
  633. oldForm: {
  634. orderStatus: "录入"
  635. },
  636. oldGoodsList: [],
  637. oldFeesList: [],
  638. oldUploadList: [],
  639. // 弹窗高度
  640. rowHeight: '',
  641. // 查询时loading页面
  642. pageLoading: false,
  643. }
  644. },
  645. mounted() {
  646. this.$nextTick(() => {
  647. // 监听浏览器高度变化,改变表格高度
  648. window.onresize = () => {
  649. this.rowHeight = (window.innerHeight - 130) + 'px'
  650. }
  651. })
  652. },
  653. //初始化查询
  654. async created() {
  655. this.rowHeight = (window.innerHeight - 130) + 'px'
  656. this.customerContact = customerContact
  657. console.log(this.customerContact)
  658. // this.customerContact = await this.getColumnData(this.getColumnName(18), customerContact);
  659. this.advantageProject = await this.getColumnData(this.getColumnName(19), advantageProject);
  660. this.getWorkDicts("payment_term").then(res => {
  661. this.paymentOption = res.data.data
  662. })
  663. if (this.detailData.id) {
  664. this.queryData(this.detailData.id)
  665. } else if(this.detailData.copyId) {
  666. this.queryData(this.detailData.copyId, true)
  667. } else {
  668. // let prefix = 'GN-CG'
  669. // getSysNo(prefix).then(res => {
  670. // this.$set(this.form, 'sysNo', res.data.data)
  671. // })
  672. }
  673. },
  674. watch: {
  675. },
  676. methods: {
  677. // 明细查询
  678. queryData(id, isCopy = false) {
  679. detail(id).then(res => {
  680. console.log(res.data.data)
  681. this.form = res.data.data;
  682. if (!this.form.itemsVOList) {
  683. this.contactsData = []
  684. } else {
  685. this.contactsData = this.form.itemsVOList
  686. }
  687. if (!this.form.orderFeesList) {
  688. this.advantageProjectData = []
  689. } else {
  690. this.advantageProjectData = this.form.orderFeesList
  691. }
  692. if (!this.form.orderFilesList) {
  693. this.bankOfDepositData = []
  694. } else {
  695. this.bankOfDepositData = this.form.orderFilesList
  696. }
  697. if (this.form.corpsName) {
  698. this.configuration.dicData = this.form.corpsName
  699. }
  700. let feesData = []
  701. this.advantageProjectData.forEach(item => {
  702. let a = {
  703. cname: item.corpName,
  704. id: item.corpId
  705. }
  706. feesData.push(a)
  707. })
  708. this.configuration.dicData = this.configuration.dicData.concat(feesData)
  709. // 去重
  710. this.removeRepeat()
  711. let goodsData = []
  712. this.form.orderItemsList.forEach(item => {
  713. let a = {
  714. cname: item.cname,
  715. }
  716. goodsData.push(a)
  717. })
  718. this.goodsConfiguration.dicData = [].concat(goodsData)
  719. this.removeGoodsRepeat()
  720. delete this.form.itemsVOList
  721. delete this.form.orderFeesList
  722. delete this.form.orderFilesList
  723. // delete this.form.corpsName
  724. // 获取最大值
  725. let num = []
  726. this.advantageProjectData.forEach(item => {
  727. num.push(item.sort)
  728. })
  729. if (num.length == 0) {
  730. this.maxFeeNum = 0;
  731. } else {
  732. this.maxFeeNum = num.reduce((a, b) => {
  733. return b > a? b: a;
  734. })
  735. }
  736. let goodsNum = []
  737. this.contactsData.forEach(item => {
  738. goodsNum.push(item.sort)
  739. })
  740. if (goodsNum.length == 0) {
  741. this.maxGoodsNum = 0;
  742. } else {
  743. this.maxGoodsNum = goodsNum.reduce((a, b) => {
  744. return b > a? b: a;
  745. })
  746. }
  747. this.oldGoodsList = []
  748. this.oldFeesList = []
  749. this.oldUploadList = []
  750. this.oldForm = Object.assign({}, this.form)
  751. this.oldGoodsList = this.deepClone(this.contactsData)
  752. this.oldFeesList = this.deepClone(this.advantageProjectData)
  753. this.oldUploadList = this.deepClone(this.bankOfDepositData)
  754. if (isCopy) {
  755. delete this.form.sysNo;
  756. delete this.form.id
  757. getSysNo('GN').then(res => {
  758. this.$set(this.form, 'sysNo', res.data.data)
  759. })
  760. this.contactsData.forEach(item => {
  761. delete item.id
  762. delete item.pid
  763. })
  764. this.advantageProjectData.forEach(item => {
  765. delete item.id
  766. delete item.pid
  767. })
  768. this.bankOfDepositData.forEach(item => {
  769. delete item.id
  770. delete item.pid
  771. })
  772. }
  773. }).finally(() => {
  774. this.saveLoading = false
  775. });
  776. },
  777. copyOrder() {
  778. this.queryData(this.form.id, true)
  779. },
  780. getGoodsRow(event,row) {
  781. row.priceCategory = event.goodsTypeName
  782. row.code = event.code
  783. row.typeno = event.typeno
  784. row.itemType = event.typeno
  785. row.itemId = event.id
  786. },
  787. receiveGoodList(data) {
  788. this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.concat(data)
  789. this.removeGoodsRepeat()
  790. },
  791. getRow(event,row) {
  792. row.priceCategory = event[0].goodsTypeName
  793. row.code = event[0].code
  794. row.typeno = event[0].typeno
  795. row.itemType = event[0].typeno
  796. row.itemId = event[0].id
  797. },
  798. removeGoodsRepeat() {
  799. let obj = []
  800. this.goodsConfiguration.dicData = this.goodsConfiguration.dicData.reduce((current,next) => {
  801. obj[next.cname] ? '': obj[next.cname] = true && current.push(next)
  802. return current
  803. }, [])
  804. },
  805. getShipmentC() {
  806. console.log(this.$store.getters.domTakeStatus)
  807. if (this.$store.getters.domTakeStatus) {
  808. this.$alert("收货单存在,请保存发货单再进行操作", "温馨提示", {
  809. confirmButtonText: "确定",
  810. type: "warning",
  811. callback: action => {
  812. console.log(action);
  813. }
  814. });
  815. } else {
  816. this.generateShipmentC();
  817. }
  818. },
  819. //生成收货单
  820. generateShipmentC() {
  821. let lsit = []
  822. if (contrastObj(this.form, this.oldForm) ||
  823. contrastList(this.contactsData, this.oldGoodsList) ||
  824. contrastList(this.advantageProjectData, this.oldFeesList) ||
  825. contrastList(this.bankOfDepositData, this.oldUploadList)
  826. ) {
  827. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  828. confirmButtonText: "确定",
  829. cancelButtonText: "取消",
  830. type: "warning"
  831. }).then(() => {
  832. this.editCustomer(false)
  833. }).catch(() => {
  834. this.$message({
  835. type: 'info',
  836. message: '已取消'
  837. });
  838. // this.selection.forEach(item => {
  839. // lsit.push(item.id)
  840. // })
  841. // // lsit.push(this.selection[item].id)
  842. // let data = {
  843. // id: this.form.id,
  844. // orderItemIds: lsit
  845. // }
  846. // generateShipment(data).then(res => {
  847. // this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
  848. // this.$router.push({
  849. // path: "/businessManagement/receipt/index",
  850. // query: {form: JSON.stringify(res.data.data)},
  851. // });
  852. // })
  853. })
  854. } else {
  855. // lsit.push(this.selection[item].id)
  856. this.selection.forEach(item => {
  857. lsit.push(item.id)
  858. })
  859. let data = {
  860. id: this.form.id,
  861. orderItemIds: lsit
  862. }
  863. generateShipment(data).then(res => {
  864. this.$router.$avueRouter.closeTag("/businessManagement/receipt/index");
  865. this.$router.push({
  866. path: "/businessManagement/receipt/index",
  867. query: {form: JSON.stringify(res.data.data)},
  868. });
  869. })
  870. }
  871. },
  872. //点击行可编辑
  873. handleRowClick(row, event, column) {
  874. console.log(row.$index)
  875. },
  876. //商品编辑
  877. rowCell(row, index) {
  878. console.log(row)
  879. if (row.$cellEdit) {
  880. if (Number(row.orderQuantity) < Number(row.actualQuantity)) {
  881. return this.$message.error('订货数量不能小于发货数量')
  882. }
  883. }
  884. this.$refs.crudContact.rowCell(row, index)
  885. },
  886. //费用编辑
  887. rowCellTwo(row, index) {
  888. console.log(row)
  889. this.$refs.crudProject.rowCell(row, index)
  890. },
  891. //商品选中触发
  892. productSelection(selection) {
  893. this.selection = selection
  894. },
  895. //费用新增触发
  896. costIncrease() {
  897. this.dialogCost = !this.dialogCost
  898. this.choiceData = false
  899. },
  900. //商品新增触发
  901. commoditySelection() {
  902. this.dialogVisible = !this.dialogVisible
  903. this.tableData = []
  904. this.commodityData = false
  905. },
  906. //点击费用明细选择触发
  907. choice(row) {
  908. this.dialogCost = !this.dialogCost
  909. this.choiceData = true
  910. console.log(row)
  911. this.choiceIndex = row.$index
  912. },
  913. //点击商品明细选择触发
  914. commodityChoice(row) {
  915. this.dialogVisible = !this.dialogVisible
  916. this.commodityData = true
  917. console.log(row)
  918. this.choiceIndexT = row.$index
  919. },
  920. //导入商品触发
  921. importChoice() {
  922. if (this.tableData.length === 1) {
  923. this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
  924. this.contactsData[this.choiceIndexT].code = this.tableData[0].code
  925. this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
  926. this.contactsData[this.choiceIndexT].itemType = this.tableData[0].typeno
  927. this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
  928. this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
  929. this.contactsData[this.choiceIndexT].orderQuantity = 0
  930. this.contactsData[this.choiceIndexT].price = 0
  931. this.contactsData[this.choiceIndexT].amount = 0
  932. selectGoodsNum({
  933. goodsId: this.tableData[0].id,
  934. itemType: this.tableData[0].typeno
  935. }).then(res => {
  936. this.contactsData[this.choiceIndexT].storageQuantity = res.data.data
  937. })
  938. }
  939. this.dialogVisible = !this.dialogVisible
  940. this.commodityData = false
  941. },
  942. //费用编辑导入触发
  943. choiceCost() {
  944. if (this.tableDataCost.length === 1) {
  945. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  946. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  947. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  948. }
  949. this.dialogCost = !this.dialogCost
  950. this.choiceData = false
  951. },
  952. //费用导入触发
  953. importCost() {
  954. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  955. if (this.tableDataCost.length > 0) {
  956. for (let item in this.tableDataCost) {
  957. console.log(this.tableDataCost[item])
  958. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  959. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  960. this.tableDataCost[item].sort = this.maxFeeNum + 1
  961. this.maxFeeNum++
  962. delete this.tableDataCost[item].id
  963. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  964. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  965. }
  966. }
  967. this.tableDataCost = []
  968. this.dialogCost = false
  969. },
  970. //确认导入触发
  971. importGoods() {
  972. // this.contactsData = this.contactsData.concat(this.tableData)
  973. if (this.tableData.length > 0) {
  974. for (let item in this.tableData) {
  975. selectGoodsNum({
  976. goodsId: this.tableData[item].id,
  977. itemType: this.tableData[item].typeno
  978. }).then(res => {
  979. this.$set(this.tableData[item], 'storageQuantity', res.data.data)
  980. this.tableData[item].itemId = this.tableData[item].id
  981. this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
  982. delete this.tableData[item].id
  983. this.$set(this.tableData[item], 'itemType', this.tableData[item].typeno)
  984. this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].typeno)
  985. this.$set(this.tableData[item], 'priceType', '一般')
  986. this.$set(this.tableData[item], 'orderQuantity', 0)
  987. this.$set(this.tableData[item], 'actualQuantity', 0)
  988. this.tableData[item].price = 0
  989. this.tableData[item].amount = 0
  990. this.tableData[item].sort = this.maxGoodsNum + 1
  991. this.maxGoodsNum++
  992. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  993. this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
  994. })
  995. }
  996. }
  997. this.dialogVisible = false
  998. },
  999. closeGoods() {
  1000. this.treeDataGoods = [];
  1001. this.treeDeptId = "";
  1002. },
  1003. closeFees() {
  1004. this.treeDeptIdCost = "";
  1005. this.treeData = [];
  1006. },
  1007. //选中触发
  1008. selectionChange(list) {
  1009. console.log(list);
  1010. this.tableData = list
  1011. },
  1012. //费用选中触发
  1013. selectionChangeCost(list) {
  1014. console.log(list);
  1015. this.tableDataCost = list
  1016. },
  1017. //导入页左商品类型查询
  1018. nodeClick(data) {
  1019. this.treeDeptId = data.id;
  1020. this.page.currentPage = 1;
  1021. this.onLoad(this.page);
  1022. },
  1023. //导入页左费用类型查询
  1024. nodeClickCost(data) {
  1025. this.treeDeptIdCost = data.id;
  1026. this.pageCost.currentPage = 1;
  1027. this.onLoadCost(this.pageCost);
  1028. },
  1029. //刷新触发
  1030. refreshChange() {
  1031. this.treeDeptId = '';
  1032. this.page.currentPage = 1;
  1033. this.onLoad(this.page);
  1034. },
  1035. //费用刷新触发
  1036. refreshChangeCost() {
  1037. this.treeDeptIdCost = '';
  1038. this.pageCost.currentPage = 1;
  1039. this.onLoadCost(this.pageCost);
  1040. },
  1041. //新增商品信息保存触发
  1042. rowSave(row, done, loading) {
  1043. console.log(row)
  1044. console.log(this.contactsData)
  1045. // this.contactsData.push(row)
  1046. done()
  1047. },
  1048. //修改商品信息触发
  1049. rowUpdate(row, index, done, loading) {
  1050. done(row);
  1051. },
  1052. //删除商品信息触发
  1053. rowDel(row, index, donerowDel) {
  1054. this.$confirm("确定将选择数据删除?", {
  1055. confirmButtonText: "确定",
  1056. cancelButtonText: "取消",
  1057. type: "warning"
  1058. }).then(() => {
  1059. //商品判断是否需要调用删除接口
  1060. if (row.id) {
  1061. corpsattn(row.id).then(res => {
  1062. this.$message({
  1063. type: "success",
  1064. message: "操作成功!"
  1065. });
  1066. this.contactsData.splice(index, 1);
  1067. })
  1068. } else {
  1069. this.$message({
  1070. type: "success",
  1071. message: "操作成功!"
  1072. });
  1073. this.contactsData.splice(index, 1);
  1074. }
  1075. })
  1076. },
  1077. //新增费用明细保存触发
  1078. rowSaveProject(row, done, loading) {
  1079. // this.advantageProjectData.push(row)
  1080. done()
  1081. },
  1082. //修改费用明细触发
  1083. rowUpdateProject(row, index, done, loading) {
  1084. done(row);
  1085. },
  1086. goodsSearch(params, done) {
  1087. this.onLoad(this.page, params);
  1088. done()
  1089. },
  1090. //商品列表查询
  1091. onLoad(page, params = {}) {
  1092. this.loading = true;
  1093. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
  1094. console.log(res)
  1095. const data = res.data.data;
  1096. this.page.total = data.total;
  1097. this.data = data.records;
  1098. this.loading = false;
  1099. });
  1100. },
  1101. // 费用查询按钮
  1102. feesSearch(params, done) {
  1103. this.onLoadCost(this.pageCost, params)
  1104. done()
  1105. },
  1106. //费用查询
  1107. onLoadCost(page, params = {}) {
  1108. this.loadingCost = true;
  1109. let queryParams = Object.assign({}, params, {
  1110. pageSize: page.pageSize,
  1111. pageNum: page.currentPage,
  1112. parentId: 0,
  1113. feesTypeId: this.treeDeptIdCost
  1114. })
  1115. customerList(queryParams).then(res => {
  1116. console.log(res)
  1117. const data = res.data.data;
  1118. this.pageCost.total = data.total;
  1119. this.dataCost = data.records;
  1120. this.loadingCost = false;
  1121. });
  1122. },
  1123. //删除费用明细触发
  1124. rowDelProject(row, index, donerowDel) {
  1125. this.$confirm("确定将选择数据删除?", {
  1126. confirmButtonText: "确定",
  1127. cancelButtonText: "取消",
  1128. type: "warning"
  1129. }).then(() => {
  1130. //费用判断是否需要调用删除接口
  1131. if (row.id) {
  1132. corpsitem(row.id).then(res => {
  1133. this.$message({
  1134. type: "success",
  1135. message: "操作成功!"
  1136. });
  1137. this.advantageProjectData.splice(index, 1);
  1138. })
  1139. } else {
  1140. this.$message({
  1141. type: "success",
  1142. message: "操作成功!"
  1143. });
  1144. this.advantageProjectData.splice(index, 1);
  1145. }
  1146. })
  1147. },
  1148. //新增附件上传保存触发
  1149. rowSaveBankOfDeposit(row, done, loading) {
  1150. this.bankOfDepositData.push(row)
  1151. done()
  1152. },
  1153. //修改附件上传触发
  1154. rowUpdateBankOfDeposit(row, index, done, loading) {
  1155. done(row);
  1156. },
  1157. //删除附件上传触发
  1158. rowDelBankOfDeposit(row, index, donerowDel) {
  1159. this.$confirm("确定将选择数据删除?", {
  1160. confirmButtonText: "确定",
  1161. cancelButtonText: "取消",
  1162. type: "warning"
  1163. }).then(() => {
  1164. //附件判断是否需要调用删除接口
  1165. if (row.id) {
  1166. corpsbank(row.id).then(res => {
  1167. this.$message({
  1168. type: "success",
  1169. message: "操作成功!"
  1170. });
  1171. this.bankOfDepositData.splice(index, 1);
  1172. })
  1173. } else {
  1174. this.$message({
  1175. type: "success",
  1176. message: "操作成功!"
  1177. });
  1178. this.bankOfDepositData.splice(index, 1);
  1179. }
  1180. })
  1181. },
  1182. uploadAfter(res, done) {
  1183. if (res.originalName) {
  1184. this.bankOfDepositForm.fileName = this.bankOfDepositForm.fileName
  1185. ? this.bankOfDepositForm.fileName
  1186. : res.originalName;
  1187. }
  1188. done();
  1189. },
  1190. // 计算费用
  1191. changeContractAmt(row) {
  1192. let orderQuantity = 0;
  1193. let price = 0;
  1194. if (row.price) {
  1195. price = row.price;
  1196. }
  1197. if (row.orderQuantity) {
  1198. orderQuantity = row.orderQuantity;
  1199. }
  1200. this.$set(row, "amount", Number(orderQuantity) * Number(price)).toFixed(2);
  1201. },
  1202. // 去重
  1203. removeRepeat() {
  1204. let obj = []
  1205. this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
  1206. obj[next.id] ? '': obj[next.id] = true && current.push(next)
  1207. return current
  1208. }, [])
  1209. },
  1210. receiveList(data){
  1211. this.configuration.dicData = this.configuration.dicData.concat(data)
  1212. this.removeRepeat()
  1213. },
  1214. //修改提交触发
  1215. editCustomer(isBack = false) {
  1216. console.log(this.form)
  1217. this.$refs["form"].validate((valid) => {
  1218. if (valid) {
  1219. for (let item in this.contactsData) {
  1220. if (Number(this.contactsData[item].orderQuantity) < Number(this.contactsData[item].actualQuantity)) {
  1221. return this.$message.error('商品信息第'+ (parseInt(item) + 1) + '行订货数量不能小于发货数量')
  1222. }
  1223. }
  1224. //商品信息
  1225. this.form.itemsVOList = this.contactsData
  1226. this.form.orderFeesList = this.advantageProjectData
  1227. this.form.orderFilesList = this.bankOfDepositData
  1228. if (typeof this.form.corpsTypeId == 'object') {
  1229. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1230. }
  1231. this.saveLoading = true
  1232. this.form.billType = 'CG'
  1233. this.$set(this.form, 'tradeType', 'GN')
  1234. typeSave(this.form).then(res => {
  1235. this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
  1236. // this.saveLoading = false
  1237. if (isBack) {
  1238. //成功关闭此页面回到列表页
  1239. this.$emit("goBack");
  1240. } else {
  1241. this.queryData(res.data.data)
  1242. }
  1243. })
  1244. } else {
  1245. return false;
  1246. }
  1247. });
  1248. },
  1249. beforeBillData(type){
  1250. //采购明细提单号 list
  1251. this.billData = {
  1252. srcOrderno:this.form.srcOrderNo,
  1253. itemType:"采购",
  1254. corpsName:this.form.corpsName,
  1255. corpId:this.form.corpId,
  1256. }
  1257. if(type){ //申请货款
  1258. this.billData.srcId = -1
  1259. }
  1260. console.log(this.billData )
  1261. },
  1262. //申请货款
  1263. applyPayment(){
  1264. // if (contrastObj(this.form, this.oldForm) ||
  1265. // contrastList(this.contactsData, this.oldGoodsList) ||
  1266. // contrastList(this.advantageProjectData, this.oldFeesList) ||
  1267. // contrastList(this.bankOfDepositData, this.oldUploadList)
  1268. // ) {
  1269. // this.$confirm("您已改动数据,是否先保存在进行操作!", {
  1270. // confirmButtonText: "保存",
  1271. // cancelButtonText: "取消",
  1272. // type: "warning"
  1273. // }).then(() => {
  1274. // this.editCustomer();
  1275. // })
  1276. // }else{
  1277. this.beforeBillData(true);
  1278. this.applyPaymentDialog = true;
  1279. // }
  1280. },
  1281. //关闭账单
  1282. choceFun(){
  1283. this.applyPaymentDialog = false
  1284. },
  1285. //返回列表
  1286. backToList() {
  1287. if (contrastObj(this.form, this.oldForm) ||
  1288. contrastList(this.contactsData, this.oldGoodsList) ||
  1289. contrastList(this.advantageProjectData, this.oldFeesList) ||
  1290. contrastList(this.bankOfDepositData, this.oldUploadList)
  1291. ) {
  1292. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1293. confirmButtonText: "确定",
  1294. cancelButtonText: "取消",
  1295. type: "warning"
  1296. }).then(() => {
  1297. this.editCustomer(true)
  1298. }).catch(() => {
  1299. this.$emit("goBack");
  1300. })
  1301. } else {
  1302. this.$emit("goBack");
  1303. }
  1304. },
  1305. // 保存列设置
  1306. async saveColumn(name) {
  1307. /**
  1308. * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
  1309. * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
  1310. * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
  1311. */
  1312. if (name == 'goods') {
  1313. const inSave = await this.saveColumnData(
  1314. this.getColumnName(18),
  1315. this.customerContact
  1316. );
  1317. if (inSave) {
  1318. this.$message.success("保存成功");
  1319. //关闭窗口
  1320. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1321. }
  1322. } else if (name === 'fees') {
  1323. const inSave = await this.saveColumnData(
  1324. this.getColumnName(19),
  1325. this.advantageProject
  1326. );
  1327. if (inSave) {
  1328. this.$message.success("保存成功");
  1329. //关闭窗口
  1330. this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
  1331. }
  1332. }
  1333. },
  1334. }
  1335. }
  1336. </script>
  1337. <style lang="scss" scoped>
  1338. .back-icon {
  1339. line-height: 64px;
  1340. font-size: 20px;
  1341. margin-right: 8px;
  1342. }
  1343. //.add-customer-btn {
  1344. // position: fixed;
  1345. // right: 36px;
  1346. // top: 115px;
  1347. //}
  1348. ::v-deep .el-form-item {
  1349. margin-bottom: 0;
  1350. }
  1351. .el-dialogDeep {
  1352. ::v-deep .el-dialog {
  1353. margin: 1vh auto 0 !important;
  1354. padding-bottom: 10px !important;
  1355. .el-dialog__body, .el-dialog__footer {
  1356. padding-bottom: 0 !important;
  1357. padding-top: 0 !important;
  1358. }
  1359. }
  1360. }
  1361. .print-div {
  1362. color: #000;
  1363. }
  1364. .print_table {
  1365. table {
  1366. border-right: 1px solid #000;
  1367. border-bottom: 1px solid #000;
  1368. font-size: 12px;
  1369. margin-bottom: 5px;
  1370. }
  1371. table td {
  1372. border-left: 1px solid #000;
  1373. border-top: 1px solid #000;
  1374. vertical-align: middle;
  1375. padding: 2px;
  1376. text-align: center;
  1377. }
  1378. }
  1379. .table {
  1380. border-collapse: collapse;
  1381. border-spacing: 0;
  1382. background-color: transparent;
  1383. display: table;
  1384. width: 99%;
  1385. max-width: 100%;
  1386. margin: 0 auto;
  1387. }
  1388. .table td {
  1389. text-align: left;
  1390. vertical-align: middle;
  1391. font-size: 14px;
  1392. color: #000000;
  1393. padding: 10.5px 0 10.5px 30px;
  1394. //border: 1px solid #000;
  1395. }
  1396. ::v-deep .el-form-item {
  1397. margin-bottom: 0;
  1398. }
  1399. ::v-deep .el-form-item__content{
  1400. line-height: 32px;
  1401. }
  1402. </style>