detailsPageEdit.vue 41 KB

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