detailsPageEdit.vue 47 KB

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