detailsPageEdit.vue 49 KB

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