detailsPageEdit.vue 48 KB

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