detailsPageEdit.vue 69 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021
  1. <template>
  2. <div class="borderless" v-loading="pageLoading">
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <!-- <i class="back-icon el-icon-arrow-left"></i><i style="font-style:normal">返回管理列表</i>-->
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <div class="add-customer-btn">
  11. <el-button
  12. v-if="detailData.seeDisabled"
  13. size="small"
  14. @click="editHandle"
  15. type="primary"
  16. >编 辑</el-button>
  17. <el-button
  18. class="el-button--small-yh"
  19. type="primary"
  20. size="small"
  21. :disabled="detailData.seeDisabled"
  22. v-if="form.deliveryStatus == '已到货'"
  23. :loading="saveLoading"
  24. @click="cancelArrival"
  25. >撤销到货</el-button>
  26. <el-button
  27. class="el-button--small-yh"
  28. type="primary"
  29. size="small"
  30. :disabled="detailData.seeDisabled || arrivalDisabled"
  31. v-if="form.deliveryStatus == '已发货'"
  32. :loading="saveLoading"
  33. @click="confirmArrival"
  34. >确认到货</el-button>
  35. <el-button
  36. class="el-button--small-yh"
  37. type="primary"
  38. @click="revokeOutGoods"
  39. size="small"
  40. v-if="form.deliveryStatus == '已发货'"
  41. :loading="saveLoading"
  42. :disabled="detailData.seeDisabled || arrivalDisabled"
  43. >撤销发货</el-button>
  44. <el-button
  45. class="el-button--small-yh"
  46. type="primary"
  47. @click="sendOutGoods"
  48. size="small"
  49. v-if="form.deliveryStatus == '录入'"
  50. :loading="saveLoading"
  51. :disabled="detailData.seeDisabled || !form.id || arrivalDisabled"
  52. >确认发货</el-button>
  53. <el-button
  54. class="el-button--small-yh"
  55. size="small"
  56. type="success" @click="copyOrder"
  57. :loading="saveLoading"
  58. :disabled="detailData.seeDisabled || !form.id || arrivalDisabled">
  59. 复制单据
  60. </el-button>
  61. <el-button
  62. class="el-button--small-yh"
  63. type="primary"
  64. :disabled="disabled || detailData.seeDisabled || arrivalDisabled"
  65. @click="editCustomer(false)"
  66. :loading="saveLoading"
  67. size="small"
  68. >保 存
  69. </el-button>
  70. </div>
  71. </div>
  72. <div class="customer-main">
  73. <el-form :model="form" ref="form" label-width="130px" class="demo-ruleForm">
  74. <containerTitle title="基础资料"></containerTitle>
  75. <basic-container style="margin-bottom: 10px">
  76. <el-row>
  77. <el-col v-for="(item,index) in basicData.column" :key="index" :span="item.span?item.span:8">
  78. <el-form-item :label="item.label" :prop="item.prop" :rules="item.rules">
  79. <!-- <avue-input-tree v-if="item.prop === 'corpsTypeId'" leaf-only multiple :props="{label:'title'}" v-model="form[item.prop]" placeholder="请选择内容" type="tree" :dic="dic"-->
  80. <!-- ></avue-input-tree>-->
  81. <el-date-picker v-if="item.type === 'datetime'" style="width: 100%;" v-model="form[item.prop]"
  82. size="small" type="datetime" placeholder="选择日期" value-format="yyyy-MM-dd HH:mm:ss" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"/>
  83. <el-date-picker v-else-if="item.type === 'date'" style="width: 100%;" v-model="form[item.prop]"
  84. size="small" type="date" placeholder="选择日期"
  85. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"/>
  86. <crop-select
  87. v-else-if="item.prop === 'corpId'"
  88. v-model="form[item.prop]"
  89. corpType="KH"
  90. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled || form.srcOrderNo"
  91. style="width: 100%"
  92. @getCorpData="returnBack"
  93. ></crop-select>
  94. <crop-select
  95. v-else-if="item.prop === 'salesCompany'"
  96. v-model="form[item.prop]"
  97. corpType="GS"
  98. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  99. @getCorpData="getGSName"
  100. ></crop-select>
  101. <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 || arrivalDisabled || deliverDisabled">
  102. <el-option v-for="(item,index) in statusOption" :key="index" :label="item.dictValue" :value="item.dictValue" size="small"></el-option>
  103. </el-select>
  104. <el-select v-else-if="item.prop === 'warehouseType'" v-model="form[item.prop]" placeholder="请选择" clearable filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled">
  105. <el-option v-for="(item,index) in warehouseTypeOption" :key="index" :label="item.dictValue" :value="item.dictValue"></el-option>
  106. </el-select>
  107. <warehouse-select v-else-if="item.prop === 'storageId'" v-model="form[item.prop]"
  108. :configuration="configurationWarehouse" style="width: 100%" :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"/>
  109. <el-select v-else-if="item.prop === 'chargeMember'"
  110. v-model="form[item.prop]" placeholder="请选择"
  111. filterable
  112. size="small"
  113. style="width: 100%;"
  114. :disabled="detailData.seeDisabled">
  115. <el-option v-for="(item,index) in userList" :key="index" :label="item.realName" :value="item.realName"></el-option>
  116. </el-select>
  117. <el-input
  118. v-else-if="item.type == 'number'"
  119. placeholder="请输入"
  120. v-input-limit="2"
  121. size="small"
  122. :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  123. v-model.trim="form[item.prop]"
  124. />
  125. <el-input type="textarea" v-else-if="item.type === 'textarea'" v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled"></el-input>
  126. <el-input type="age" v-else v-model.trim="form[item.prop]" size="small" autocomplete="off" :disabled="item.disabled || detailData.seeDisabled || arrivalDisabled || deliverDisabled"></el-input>
  127. </el-form-item>
  128. </el-col>
  129. </el-row>
  130. </basic-container>
  131. <containerTitle title="商品信息"></containerTitle>
  132. <basic-container style="margin-bottom: 10px">
  133. <avue-crud
  134. :option="customerContact"
  135. v-model="contactsForm"
  136. :data="goodsShowData"
  137. ref="crudContact"
  138. @row-save="rowSave"
  139. @row-click="handleRowClick"
  140. @row-update="rowUpdate"
  141. @row-del="rowDel"
  142. @saveColumn="saveColumn('goods')"
  143. @resetColumn="resetColumn"
  144. :cell-style="goodsRowClassName"
  145. >
  146. <template slot="code" slot-scope="{row,index}">
  147. <!-- <el-button type="text" size="mini" style="padding:4px 10px;float:left" @click="commodityChoice(row)" :disabled="detailData.seeDisabled || !row.$cellEdit || arrivalDisabled || deliverDisabled">选择</el-button>-->
  148. <span>{{ row.code }}</span>
  149. </template>
  150. <template slot-scope="{row,index}" slot="menu">
  151. <el-button
  152. type="text"
  153. size="small"
  154. @click="rowCell(row,index)"
  155. :disabled="detailData.seeDisabled || arrivalDisabled"
  156. >{{ row.$cellEdit ? '保存' : '修改' }}
  157. </el-button>
  158. <el-button
  159. size="small"
  160. icon="el-icon-delete"
  161. type="text"
  162. @click="rowDel(row, index)"
  163. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  164. v-if="!row.$cellEdit"
  165. >删 除</el-button>
  166. </template>
  167. <template slot="menuLeft" slot-scope="{size}">
  168. <el-tabs v-model="goodsActives" @tab-click="handleClick">
  169. <el-tab-pane label="商品" name="goods" :key="'first'" :disabled="goodsDisabled">
  170. </el-tab-pane>
  171. <el-tab-pane label="赠品" name="gift" :key="'second'" :disabled="goodsDisabled">
  172. </el-tab-pane>
  173. </el-tabs>
  174. <el-button type="primary"
  175. icon="el-icon-plus"
  176. size="small"
  177. @click="marketDialog = true"
  178. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  179. v-if="goodsActives == 'goods'"
  180. >录入明细
  181. </el-button>
  182. <el-button type="primary"
  183. icon="el-icon-plus"
  184. size="small"
  185. @click="commoditySelection"
  186. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  187. v-if="goodsActives == 'gift'"
  188. >录入明细
  189. </el-button>
  190. <el-button type="info" :size="size" icon="el-icon-printer" @click.stop="openReport()">报 表</el-button>
  191. <el-button
  192. type="warning"
  193. icon="el-icon-refresh"
  194. size="small"
  195. @click="resetStock"
  196. >库存刷新</el-button>
  197. </template>
  198. <template slot="actualQuantity" slot-scope="{ row }">
  199. <el-input
  200. v-if="row.$cellEdit"
  201. v-model.trim="row.actualQuantity"
  202. v-input-limit="0"
  203. @change="actualQuantityChange(row)"
  204. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  205. ></el-input>
  206. <span v-else>{{ row.actualQuantity | IntegerFormat }}</span>
  207. </template>
  208. <!-- 到货数量-->
  209. <template slot="arrivalQuantity" slot-scope="{ row }">
  210. <el-input
  211. v-if="row.$cellEdit"
  212. v-model.trim="row.arrivalQuantity"
  213. v-input-limit="0"
  214. @input="arrivalQuantityChange(row)"
  215. ></el-input>
  216. <span v-else>{{ row.arrivalQuantity | IntegerFormat }}</span>
  217. </template>
  218. <template slot="corpId" slot-scope="{ row, index }">
  219. <crop-select
  220. v-if="row.$cellEdit"
  221. v-model="row.corpId"
  222. :cropIndex="index"
  223. corpType="GYS"
  224. @getCorpData="getcorpId"
  225. :disabled="detailData.seeDisabled || arrivalDisabled || deliverDisabled"
  226. ></crop-select>
  227. <span v-else>{{ row.corpName }}</span>
  228. </template>
  229. </avue-crud>
  230. </basic-container>
  231. <fee-info
  232. ref="feeInfo"
  233. :orderFeesList="advantageProjectData"
  234. :disabled="detailData.seeDisabled || arrivalDisabled"
  235. :srcType="3"
  236. optionType="GN"
  237. itemType="发货"
  238. feeUrl="/blade-deliver-goods/deliveryfees/update"
  239. @beforeFinance="beforeFinance"
  240. :corpId="form.corpId"
  241. />
  242. <containerTitle title="附件上传"></containerTitle>
  243. <c-upload
  244. :data="bankOfDepositData"
  245. deleteUrl="/api/blade-deliver-goods/deliveryfiles/update"
  246. />
  247. </el-form>
  248. </div>
  249. <el-dialog
  250. title="导入商品"
  251. append-to-body
  252. class="el-dialogDeep"
  253. :visible.sync="dialogVisible"
  254. width="80%"
  255. :close-on-click-modal="false"
  256. :destroy-on-close="true"
  257. :close-on-press-escape="false"
  258. @close="closeGoods">
  259. <el-row :style="{height: rowHeight}">
  260. <el-col :span="5" style="height: 100%;overflow-y: auto">
  261. <div>
  262. <el-scrollbar>
  263. <basic-container>
  264. <avue-tree :option="treeOption" :data="treeDataGoods" @node-click="nodeClick"/>
  265. </basic-container>
  266. </el-scrollbar>
  267. </div>
  268. </el-col>
  269. <el-col :span="19">
  270. <basic-container>
  271. <avue-crud :option="optionTwo"
  272. :table-loading="loading"
  273. :data="data"
  274. ref="crud"
  275. @refresh-change="refreshChange"
  276. @selection-change="selectionChange"
  277. :page.sync="page"
  278. @search-change="goodsSearch"
  279. @on-load="onLoad"></avue-crud>
  280. </basic-container>
  281. </el-col>
  282. </el-row>
  283. <span slot="footer" class="dialog-footer">
  284. <el-button @click="dialogVisible = false">取 消</el-button>
  285. <el-button type="primary" @click="importGoods" v-if="commodityData !== true">导入</el-button>
  286. <el-button type="primary" @click="importChoice" v-if="commodityData === true"
  287. :disabled="tableData.length !== 1">导入</el-button>
  288. </span>
  289. </el-dialog>
  290. <el-dialog
  291. title="导入费用"
  292. append-to-body
  293. class="el-dialogDeep"
  294. :visible.sync="dialogCost"
  295. width="80%"
  296. :close-on-click-modal="false"
  297. :destroy-on-close="true"
  298. :close-on-press-escape="false"
  299. @close="closeFees">
  300. <el-row :style="{height: rowHeight}">
  301. <el-col :span="5" style="height: 100%;overflow-y: auto">
  302. <div>
  303. <el-scrollbar>
  304. <basic-container>
  305. <avue-tree :option="treeOptionCost" :data="treeData" @node-click="nodeClickCost"/>
  306. </basic-container>
  307. </el-scrollbar>
  308. </div>
  309. </el-col>
  310. <el-col :span="19">
  311. <basic-container>
  312. <avue-crud :option="optionTwoCost"
  313. :table-loading="loadingCost"
  314. :data="dataCost"
  315. ref="crud"
  316. @refresh-change="refreshChangeCost"
  317. @selection-change="selectionChangeCost"
  318. :page.sync="pageCost"
  319. @searchChange="feesSearch"
  320. @on-load="onLoadCost">
  321. </avue-crud>
  322. </basic-container>
  323. </el-col>
  324. </el-row>
  325. <span slot="footer" class="dialog-footer">
  326. <el-button @click="dialogCost = false">取 消</el-button>
  327. <el-button type="primary" @click="importCost" v-if="choiceData !== true">导入</el-button>
  328. <el-button type="primary" @click="choiceCost" v-if="choiceData === true"
  329. :disabled="tableDataCost.length !== 1">导入</el-button>
  330. </span>
  331. </el-dialog>
  332. <!-- 导入销售明细-->
  333. <el-dialog
  334. title="导入销售"
  335. append-to-body
  336. class="el-dialogDeep"
  337. :visible.sync="marketDialog"
  338. width="60%"
  339. :close-on-click-modal="false"
  340. :destroy-on-close="true"
  341. :modal-append-to-body='false'
  342. :close-on-press-escape="false"
  343. v-dialog-drag>
  344. <market-detail
  345. @importMarket="importMarket"
  346. @close="closeMarkeDialog"
  347. systemType="GN"
  348. >
  349. </market-detail>
  350. </el-dialog>
  351. <report-dialog
  352. :switchDialog="switchDialog"
  353. :reportId="form.id"
  354. reportName="客户收货确认"
  355. @onClose="onClose()"
  356. ></report-dialog>
  357. </div>
  358. </template>
  359. <script>
  360. import {
  361. typeSave, detail,
  362. corpstypeTree,
  363. corpsattn,
  364. corpsbank,
  365. corpsitem,
  366. // getList,
  367. sendOutGoods,
  368. revokeOutGoods,
  369. confirmArrival,
  370. cancelArrival
  371. } from "@/api/basicData/deliveryNotice"
  372. import {getList} from "@/api/basicData/commodityType";
  373. import customerContact from "./configuration/customerContact.json"
  374. import advantageProject from "./configuration/advantageProject.json"
  375. import bankOfDeposit from "./configuration/bankOfDeposit.json"
  376. import commodity from "./configuration/commodity.json"
  377. import optionTwoCost from "./configuration/mainListCost.json"
  378. import {getDeptLazyTree,getDeptLazyTreeTwo, customerList} from "@/api/basicData/basicFeesDesc";
  379. import {customerList as wareHouseType} from "@/api/basicData/basicStorageType"
  380. import {customerList as selectWareHouse} from "@/api/basicData/basicStorageDesc"
  381. import {selectGoodsNum} from "@/api/basicData/inventoryAccount"
  382. import { contrastObj, contrastList } from "@/util/contrastData";
  383. import marketDetail from "@/components/procurement/market";
  384. import feeInfo from "@/components/fee-info/main";
  385. import {
  386. isDiscount,
  387. isPercentage,
  388. micrometerFormat,
  389. IntegerFormat
  390. } from "@/util/validate";
  391. import reportDialog from "@/components/report-dialog/main";
  392. import { gainUser } from "@/api/basicData/customerInquiry";
  393. export default {
  394. name: "detailsPage",
  395. props: {
  396. detailData: {
  397. type: Object
  398. }
  399. },
  400. components: {
  401. marketDetail,
  402. feeInfo,
  403. reportDialog,
  404. },
  405. data() {
  406. return {
  407. configuration: {
  408. multipleChoices: false,
  409. multiple: false,
  410. collapseTags: false,
  411. placeholder: '请点击右边按钮选择',
  412. dicData: []
  413. },
  414. companyConfiguration: {
  415. multipleChoices: false,
  416. multiple: false,
  417. collapseTags: false,
  418. placeholder: '请点击右边按钮选择',
  419. dicData: []
  420. },
  421. configurationWarehouse: {
  422. multipleChoices: false,
  423. multiple: false,
  424. collapseTags: false,
  425. placeholder: "请点击右边按钮选择",
  426. dicData: [],
  427. clearable: true,
  428. },
  429. form: {},
  430. data: [],
  431. loadingCost: false,
  432. choiceData: false,
  433. commodityData: false,
  434. dataCost: [],
  435. treeDataGoods: [],
  436. treeData: [],
  437. choiceIndex: '',
  438. dialogCost: false,
  439. treeDeptId: '',
  440. treeDeptIdCost: '',
  441. pageCost: {
  442. pageSize: 10,
  443. currentPage: 1,
  444. total: 0
  445. },
  446. page: {
  447. pageSize: 10,
  448. currentPage: 1,
  449. total: 0
  450. },
  451. loading: false,
  452. contactsForm: {},
  453. optionTwo: commodity,
  454. optionTwoCost: optionTwoCost,
  455. treeOptionCost: {
  456. nodeKey: 'id',
  457. lazy: true,
  458. treeLoad: function (node, resolve) {
  459. const parentId = (node.level === 0) ? 0 : node.data.id;
  460. getDeptLazyTree(parentId).then(res => {
  461. resolve(res.data.data.map(item => {
  462. return {
  463. ...item,
  464. leaf: !item.hasChildren
  465. }
  466. }))
  467. });
  468. },
  469. addBtn: false,
  470. menu: false,
  471. size: 'small',
  472. props: {
  473. labelText: '标题',
  474. label: 'title',
  475. value: 'value',
  476. children: 'children'
  477. }
  478. },
  479. treeOption: {
  480. nodeKey: 'id',
  481. lazy: true,
  482. treeLoad: function (node, resolve) {
  483. const parentId = (node.level === 0) ? 0 : node.data.id;
  484. getDeptLazyTreeTwo(parentId).then(res => {
  485. resolve(res.data.data.map(item => {
  486. return {
  487. ...item,
  488. leaf: !item.hasChildren
  489. }
  490. }))
  491. });
  492. },
  493. addBtn: false,
  494. menu: false,
  495. size: 'small',
  496. props: {
  497. labelText: '标题',
  498. label: 'title',
  499. value: 'value',
  500. children: 'children'
  501. }
  502. },
  503. dialogVisible: false,
  504. advantageProjectForm: {},
  505. bankOfDepositForm: {},
  506. contactsData: [],
  507. advantageProjectData: [],
  508. disabled: false,
  509. saveLoading: false,
  510. bankOfDepositData: [],
  511. tableDataCost: [],
  512. dic: [],
  513. tableData: [],
  514. customerContact: {},
  515. advantageProject: {},
  516. bankOfDeposit: bankOfDeposit,
  517. basicData: {
  518. column: [
  519. {
  520. label: '系统编号',//发货通知(点击)
  521. prop: 'sysNo',
  522. disabled: true,
  523. rules: [
  524. {
  525. required: false,
  526. message: ' ',
  527. trigger: 'blur'
  528. }
  529. ]
  530. }, {
  531. label: '客户名称',
  532. prop: 'corpId',
  533. span: 16,
  534. rules: [
  535. {
  536. required: true,
  537. message: ' ',
  538. trigger: 'blur'
  539. }
  540. ]
  541. }, {
  542. label: '单据状态',
  543. prop: 'deliveryStatus',
  544. disabled: true,
  545. rules: [
  546. {
  547. required: true,
  548. message: ' ',
  549. trigger: 'blur'
  550. }
  551. ]
  552. }, {
  553. label: '所属公司',
  554. prop: 'salesCompany', //salesCompany
  555. span: 16,
  556. rules: [
  557. {
  558. required: true,
  559. message: ' ',
  560. trigger: 'blur'
  561. }
  562. ]
  563. }, {
  564. label: '仓库类型',
  565. prop: 'warehouseType',//字典表
  566. rules: [
  567. {
  568. required: true,
  569. message: ' ',
  570. trigger: 'blur'
  571. }
  572. ]
  573. }, {
  574. label: '仓库名称',
  575. prop: 'storageId',
  576. span: 16,
  577. rules: [
  578. {
  579. required: true,
  580. message: ' ',
  581. trigger: 'blur'
  582. }
  583. ]
  584. },{
  585. label: '匹配订单号',
  586. prop: 'srcOrderNo',
  587. disabled:true,
  588. rules: [
  589. {
  590. required: false,
  591. message: ' ',
  592. trigger: 'blur'
  593. }
  594. ]
  595. }, {
  596. label: '出库金额',
  597. prop: 'deliveryAmount',
  598. disabled: false,
  599. rules: [
  600. {
  601. required: false,
  602. message: ' ',
  603. trigger: 'blur'
  604. }
  605. ]
  606. }, {
  607. label: '出库数量',
  608. prop: 'totalQuantity',
  609. disabled: false,
  610. rules: [
  611. {
  612. required: false,
  613. message: ' ',
  614. trigger: 'blur'
  615. }
  616. ]
  617. }, {
  618. label: '出库日期',
  619. prop: 'businessDate',
  620. type: 'datetime',
  621. rules: [
  622. {
  623. required: true,
  624. message: ' ',
  625. trigger: 'blur'
  626. }
  627. ]
  628. }, {
  629. label: '制单时间',
  630. type: 'datetime',
  631. prop: 'createTime',
  632. disabled: true,
  633. rules: [
  634. {
  635. required: false,
  636. message: ' ',
  637. trigger: 'blur'
  638. }
  639. ]
  640. }, {
  641. label: '费用合计',
  642. prop: 'totalCost',
  643. rules: [
  644. {
  645. required: false,
  646. message: ' ',
  647. trigger: 'blur'
  648. }
  649. ]
  650. },{
  651. label: '收货地址',
  652. prop: 'arrivalAddress',
  653. rules: [
  654. {
  655. required: false,
  656. message: ' ',
  657. trigger: 'blur'
  658. }
  659. ]
  660. }, {
  661. label: '收货人',
  662. prop: 'arrivalContact',
  663. rules: [
  664. {
  665. required: false,
  666. message: ' ',
  667. trigger: 'blur'
  668. }
  669. ]
  670. }, {
  671. label: '收货电话',
  672. prop: 'arrivalTel',
  673. rules: [
  674. {
  675. required: false,
  676. message: ' ',
  677. trigger: 'blur'
  678. }
  679. ]
  680. }, {
  681. label: '包装要求',
  682. prop: 'packageRemarks',
  683. rules: [
  684. {
  685. required: false,
  686. message: ' ',
  687. trigger: 'blur'
  688. }
  689. ]
  690. },{
  691. label: '赠送积分',
  692. prop: 'presenterIntegral',
  693. disabled: true,
  694. rules: [
  695. {
  696. required: false,
  697. message: ' ',
  698. trigger: 'blur'
  699. }
  700. ]
  701. },{
  702. label: '兑换积分',
  703. prop: 'convertIntegral',
  704. disabled: true,
  705. rules: [
  706. {
  707. required: false,
  708. message: ' ',
  709. trigger: 'blur'
  710. }
  711. ]
  712. }, {
  713. label: '产生返利',
  714. prop: 'createProfit',
  715. disabled: false,
  716. type: 'number',
  717. rules: [
  718. {
  719. required: false,
  720. message: ' ',
  721. trigger: 'blur'
  722. }
  723. ]
  724. },{
  725. label: '业务员',
  726. prop: 'chargeMember',
  727. rules: [
  728. {
  729. required: false,
  730. message: ' ',
  731. trigger: 'change'
  732. }
  733. ]
  734. },{
  735. label: "备注",
  736. span: 24,
  737. type: 'textarea',
  738. prop: "otherRemarks",
  739. mock: {
  740. type: 'county'
  741. }
  742. }
  743. ]
  744. },
  745. statusOption: [],
  746. warehouseTypeOption: [],
  747. // 仓库类型
  748. warehouseType: [],
  749. // 仓库名称
  750. warehouseName: [],
  751. maxFeeNum: 0,
  752. maxGoodsNum: 0,
  753. oldForm: {
  754. orderStatus: "录入"
  755. },
  756. oldGoodsList: [],
  757. oldGiftList: [],
  758. oldFeesList: [],
  759. oldUploadList: [],
  760. // 导入销售订单明细
  761. marketDialog: false,
  762. // 弹窗高度
  763. rowHeight: '',
  764. // 查询时loading页面
  765. pageLoading: false,
  766. goodsActives: 'goods',
  767. // 用于判断 tab是否是当前
  768. saveActives: '',
  769. goodsDisabled: false,
  770. // 赠品信息数据
  771. giftData: [],
  772. // 商品信息展示数据
  773. goodsShowData: [],
  774. // 确认收货禁用
  775. deliverDisabled: false,
  776. // 确认到货禁用
  777. arrivalDisabled: false,
  778. switchDialog: false,
  779. userList: [],
  780. }
  781. },
  782. mounted() {
  783. this.$nextTick(() => {
  784. // 监听浏览器高度变化,改变表格高度
  785. window.onresize = () => {
  786. this.rowHeight = (window.innerHeight - 130) + 'px'
  787. }
  788. })
  789. },
  790. filters: {
  791. IntegerFormat(num) {
  792. return IntegerFormat(num);
  793. },
  794. decimalFormat(num) {
  795. return num ? Number(num).toFixed(2) : "0.00";
  796. },
  797. },
  798. //初始化查询
  799. async created() {
  800. this.rowHeight = (window.innerHeight - 130) + 'px'
  801. this.customerContact = await this.getColumnData(this.getColumnName(21), customerContact);
  802. this.advantageProject = await this.getColumnData(this.getColumnName(22), advantageProject);
  803. this.getWorkDicts("order_status").then(res => {
  804. this.statusOption = res.data.data
  805. })
  806. this.getWorkDicts("warehouseType").then(res => {
  807. this.warehouseTypeOption = res.data.data
  808. })
  809. this.$set(this.form,'deliveryStatus','录入')
  810. this.$set(this.form, 'presenterIntegral' , 0)
  811. this.$set(this.form, 'convertIntegral' , 0)
  812. this.$set(this.form, 'createProfit' , 0)
  813. wareHouseType().then(res => {
  814. this.warehouseType = res.data.data.records
  815. this.warehouseType.forEach(item => {
  816. this.$set(item, 'label', item.cname)
  817. this.$set(item, 'value', item.id)
  818. if (item.hasChildren) {
  819. this.$set(item, 'children', [])
  820. }
  821. })
  822. let result = [], temp = {}
  823. for(let i = 0; i < this.warehouseType.length;i++) {
  824. temp[this.warehouseType[i].id] = this.warehouseType[i]
  825. }
  826. for (let j = 0;j < this.warehouseType.length;j++) {
  827. let current = this.warehouseType[j]
  828. let tempCurrentParent = temp[current.parentId]
  829. if (tempCurrentParent) {
  830. if (!tempCurrentParent["children"]) {
  831. tempCurrentParent["children"] = []
  832. }
  833. tempCurrentParent["children"].push(current)
  834. } else {
  835. result.push(current)
  836. }
  837. }
  838. this.warehouseType = result
  839. });
  840. selectWareHouse().then(res => {
  841. this.warehouseName = res.data.data.records
  842. })
  843. gainUser().then(res => {
  844. this.userList = res.data.data;
  845. });
  846. if (this.detailData.id) {
  847. let id = this.detailData.id
  848. this.queryData(id)
  849. }else if (this.detailData.form){
  850. this.form = JSON.parse(this.detailData.form);
  851. delete this.form.createTime
  852. delete this.form.id
  853. delete this.form.sysNo
  854. this.$set(this.form, 'deliveryStatus', '录入')
  855. this.$set(this.form, 'srcOrderNo', this.form.orgOrderNo)
  856. this.$set(this.form, 'arrivalContact', this.form.corpAttn)
  857. this.$set(this.form, 'arrivalTel', this.form.corpTel)
  858. this.form.orderItemsList.forEach(item => {
  859. this.$set(item, 'contractNumber', this.form.orgOrderNo)
  860. })
  861. this.contactsData = this.form.orderItemsList.filter(item => {
  862. return item.goodType == 0
  863. })
  864. this.giftData = this.form.orderItemsList.filter(item => {
  865. return item.goodType == 1
  866. })
  867. this.giftData.forEach(item => {
  868. this.$set(item, 'deliveryAmount', item.amount)
  869. this.$set(item, 'specificationAndModel', item.itemType)
  870. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  871. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  872. this.$set(item, "srcId", item.id)
  873. this.$set(item, 'actualQuantity', item.orderQuantity)
  874. delete item.id
  875. delete item.pid
  876. delete item.createTime
  877. delete item.createUser
  878. delete item.status
  879. delete item.updateTime
  880. delete item.updateUser
  881. })
  882. this.goodsShowData = this.giftData;
  883. this.goodsActives = 'goods';
  884. this.handleClick({name: this.goodsActives})
  885. // this.contactsData = this.form.orderItemsList
  886. delete this.form.orderItemsList
  887. this.configuration.dicData = this.form.corpName
  888. delete this.form.corpName
  889. this.$set(this.form, 'salesCompany', this.form.belongToCorpId)
  890. delete this.form.belongToCorpList
  891. this.$set(this.form, 'deliveryAmount', 0)
  892. this.$set(this.form, 'totalQuantity', 0)
  893. this.$set(this.form, 'totalCost', 0)
  894. this.advantageProjectData = this.form.orderFeesList;
  895. delete this.form.orderFeesList
  896. this.advantageProjectData.forEach(item => {
  897. delete item.createDept
  898. delete item.createTime
  899. delete item.createUser
  900. delete item.id
  901. delete item.isDeleted
  902. delete item.pid
  903. delete item.status
  904. delete item.tenantId
  905. delete item.updateTime
  906. delete item.updateUser
  907. })
  908. this.contactsData.forEach(item => {
  909. this.$set(item, 'specificationAndModel', item.itemType)
  910. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  911. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  912. this.$set(item, "srcId", item.id)
  913. this.$set(item, "actualQuantity", (Number(item.orderQuantity) - Number(item.actualQuantity)))
  914. this.$set(item, "arrivalQuantity", item.actualQuantity)
  915. this.$set(item, "deliveryAmount", item.amount)
  916. this.$set(item, "purchaseTotalAmount", (Number(item.purchaseAmount) * Number(item.actualQuantity)))
  917. item.purchaseTotalAmount = item.purchaseTotalAmount.toFixed(2)
  918. this.$set(item, "inventoryNumber", item.storageQuantity)
  919. this.form.deliveryAmount += Number(item.deliveryAmount)
  920. this.form.totalQuantity += Number(item.actualQuantity)
  921. this.form.totalCost += Number(item.deliveryAmount)
  922. // 出库数量和出库金额的比例
  923. this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
  924. delete item.id
  925. delete item.pid
  926. delete item.createTime
  927. delete item.createUser
  928. delete item.status
  929. delete item.updateTime
  930. delete item.updateUser
  931. })
  932. } else if (this.detailData.copyId) {
  933. let id = this.detailData.copyId
  934. this.queryData(id, true)
  935. }
  936. this.oldForm = Object.assign({}, this.form)
  937. },
  938. watch: {
  939. },
  940. methods: {
  941. queryData(id, isCopy = false, type) {
  942. this.pageLoading = true
  943. detail(id).then(res => {
  944. this.form = res.data.data;
  945. if (this.form.deliveryStatus == '已发货') {
  946. this.deliverDisabled = true;
  947. this.arrivalDisabled = false;
  948. } else if (this.form.deliveryStatus == '已到货') {
  949. this.arrivalDisabled = true;
  950. this.deliverDisabled = false;
  951. } else {
  952. this.arrivalDisabled = false;
  953. this.deliverDisabled = false;
  954. }
  955. if (this.deliverDisabled) {
  956. this.customerContact.column.forEach(item => {
  957. if (item.prop == 'arrivalQuantity') {
  958. item.disabled = false
  959. } else {
  960. item.disabled = true
  961. }
  962. })
  963. } else {
  964. this.customerContact.column.forEach(item => {
  965. item.disabled = false
  966. })
  967. }
  968. // this.contactsData = this.form.deliveryItemsList
  969. this.contactsData = this.form.deliveryItemsList.filter(item => {
  970. return item.goodType == 0
  971. })
  972. this.giftData = this.form.deliveryItemsList.filter(item => {
  973. return item.goodType == 1
  974. })
  975. this.giftData.forEach(item => {
  976. this.$set(item, 'deliveryAmount', item.amount)
  977. })
  978. this.goodsShowData = this.giftData;
  979. this.goodsActives = 'goods';
  980. this.handleClick({name: this.goodsActives})
  981. this.advantageProjectData = this.form.deliveryFeesList
  982. this.bankOfDepositData = this.form.deliveryFilesList
  983. this.configuration.dicData = this.form.corpName
  984. this.form.deliveryAmount = 0
  985. this.form.totalQuantity = 0
  986. this.contactsData.forEach(item => {
  987. this.form.deliveryAmount += Number(item.deliveryAmount)
  988. this.form.totalQuantity += Number(item.actualQuantity)
  989. // 出库金额和出库数量的比例
  990. this.$set(item, 'scale', (item.deliveryAmount / item.actualQuantity))
  991. })
  992. if (this.form.companyName) {
  993. this.companyConfiguration.dicData = this.companyConfiguration.dicData.concat(this.form.companyName)
  994. }
  995. if (this.form.storageMap) {
  996. this.configurationWarehouse.dicData = this.form.storageMap
  997. }
  998. let feesData = []
  999. this.form.deliveryFeesList.forEach(item => {
  1000. let a = {
  1001. cname: item.corpName,
  1002. id: item.corpId
  1003. }
  1004. feesData.push(a)
  1005. })
  1006. this.configuration.dicData = this.configuration.dicData.concat(feesData)
  1007. // 去重
  1008. this.removeRepeat()
  1009. delete this.form.deliveryItemsList
  1010. delete this.form.deliveryFeesList
  1011. delete this.form.deliveryFilesList
  1012. delete this.form.corpName
  1013. delete this.form.companyName
  1014. // 获取最大值
  1015. let num = []
  1016. this.advantageProjectData.forEach(item => {
  1017. num.push(item.sort)
  1018. })
  1019. if (num.length == 0) {
  1020. this.maxFeeNum = 0;
  1021. } else {
  1022. this.maxFeeNum = num.reduce((a, b) => {
  1023. return b > a? b: a;
  1024. })
  1025. }
  1026. let goodsNum = []
  1027. this.contactsData.forEach(item => {
  1028. goodsNum.push(item.sort)
  1029. })
  1030. if (goodsNum.length == 0) {
  1031. this.maxGoodsNum = 0;
  1032. } else {
  1033. this.maxGoodsNum = goodsNum.reduce((a, b) => {
  1034. return b > a? b: a;
  1035. })
  1036. }
  1037. this.oldGoodsList = []
  1038. this.oldGiftList = []
  1039. this.oldFeesList = []
  1040. this.oldUploadList = []
  1041. this.oldForm = Object.assign({}, this.form)
  1042. this.oldGoodsList = this.deepClone(this.contactsData)
  1043. this.oldGiftList = this.deepClone(this.giftData)
  1044. this.oldFeesList = this.deepClone(this.advantageProjectData)
  1045. this.oldUploadList = this.deepClone(this.bankOfDepositData)
  1046. if (isCopy) {
  1047. delete this.form.sysNo
  1048. delete this.form.id
  1049. this.contactsData.forEach(item => {
  1050. delete item.id
  1051. delete item.pid
  1052. delete item.itemId
  1053. })
  1054. this.goodsShowData.forEach(item => {
  1055. delete item.id
  1056. delete item.pid
  1057. delete item.itemId
  1058. })
  1059. this.giftData.forEach(item => {
  1060. delete item.id
  1061. delete item.pid
  1062. delete item.itemId
  1063. })
  1064. this.advantageProjectData.forEach(item => {
  1065. delete item.id
  1066. delete item.pid
  1067. })
  1068. this.bankOfDepositData.forEach(item => {
  1069. delete item.id
  1070. delete item.pid
  1071. })
  1072. this.form.deliveryStatus = '录入'
  1073. }
  1074. if (type == '发货') {
  1075. this.$nextTick(() => {
  1076. this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
  1077. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1078. this.form.deliveryFilesList = this.bankOfDepositData
  1079. if (typeof this.form.corpsTypeId == 'object') {
  1080. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1081. }
  1082. this.pageLoading = true
  1083. this.saveActives = ''
  1084. sendOutGoods(this.form).then(res => {
  1085. this.$message.success('发货成功')
  1086. this.queryData(res.data.data.id)
  1087. }).finally(() => {
  1088. this.pageLoading = false
  1089. })
  1090. })
  1091. } else if (type == '到货') {
  1092. if (this.goodsActives == 'gift') {
  1093. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1094. } else {
  1095. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1096. }
  1097. this.pageLoading = true
  1098. this.saveActives = ''
  1099. confirmArrival(this.form).then(res => {
  1100. this.$message.success('已确认到货')
  1101. this.queryData(this.form.id)
  1102. }).catch(() => {
  1103. this.pageLoading = false
  1104. })
  1105. }
  1106. }).finally(() => {
  1107. this.saveLoading = false
  1108. this.pageLoading = false
  1109. });
  1110. },
  1111. getcorpId(row) {
  1112. this.contactsData[row.index].corpId = row.id;
  1113. this.contactsData[row.index].corpName = row.cname;
  1114. },
  1115. // 出库数量变化时调用
  1116. actualQuantityChange(row) {
  1117. // if (row.scale) {
  1118. // row.deliveryAmount = Number(row.actualQuantity) * Number(row.scale)
  1119. // }
  1120. if (this.goodsActives == 'goods') {
  1121. if (Number(row.actualQuantity) < Number(row.arrivalQuantity)) {
  1122. row.arrivalQuantity = row.actualQuantity
  1123. row.purchaseTotalAmount = (Number(row.arrivalQuantity) * Number(row.purchaseAmount)).toFixed(2)
  1124. row.deliveryAmount = (Number(row.arrivalQuantity) * Number(row.price)).toFixed(2)
  1125. }
  1126. this.form.deliveryAmount = 0
  1127. this.form.totalQuantity = 0
  1128. this.contactsData.forEach(item => {
  1129. this.form.deliveryAmount += Number(item.deliveryAmount)
  1130. this.form.totalQuantity += Number(item.actualQuantity)
  1131. })
  1132. } else {
  1133. row.integral = Number(row.integralMultiples) * Number(row.actualQuantity)
  1134. this.$set(this.form, 'convertIntegral' , 0)
  1135. this.goodsShowData.forEach(item => {
  1136. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1137. })
  1138. }
  1139. },
  1140. // 到货数量变化计算
  1141. arrivalQuantityChange(row) {
  1142. if (this.goodsActives == 'goods') {
  1143. if (Number(row.arrivalQuantity) > Number(row.actualQuantity)) {
  1144. this.$message.error('到货数量不能超过出库数量')
  1145. row.arrivalQuantity = 0
  1146. }
  1147. row.purchaseTotalAmount = (Number(row.arrivalQuantity) * Number(row.purchaseAmount)).toFixed(2)
  1148. row.deliveryAmount = (Number(row.arrivalQuantity) * Number(row.price)).toFixed(2)
  1149. row.integral = Number(row.integralMultiples) * Number(row.arrivalQuantity)
  1150. this.$set(this.form, 'presenterIntegral' , 0)
  1151. this.goodsShowData.forEach(item => {
  1152. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1153. })
  1154. } else {
  1155. }
  1156. },
  1157. // 类别变换时触发
  1158. warehouseTreeChange(id) {
  1159. this.warehouseName = []
  1160. if (this.firstComing) {
  1161. if (!this.form.storageId) {
  1162. this.$set(this.form, 'storageId', null)
  1163. } else {
  1164. this.form.storageId = null
  1165. }
  1166. }
  1167. let data = {
  1168. storageTypeId: id
  1169. }
  1170. selectWareHouse(data).then(res => {
  1171. this.warehouseName = res.data.data.records
  1172. })
  1173. this.firstComing = true
  1174. },
  1175. //点击行可编辑
  1176. handleRowClick(row, event, column) {
  1177. },
  1178. //商品编辑
  1179. rowCell(row, index) {
  1180. this.$refs.crudContact.rowCell(row, index)
  1181. },
  1182. //费用编辑
  1183. rowCellTwo(row, index) {
  1184. this.$refs.crudProject.rowCell(row, index)
  1185. },
  1186. //费用新增触发
  1187. costIncrease() {
  1188. this.dialogCost = !this.dialogCost
  1189. this.choiceData = false
  1190. },
  1191. //商品新增触发
  1192. commoditySelection() {
  1193. this.dialogVisible = !this.dialogVisible
  1194. this.tableData = []
  1195. this.commodityData = false
  1196. },
  1197. //点击费用明细选择触发
  1198. choice(row) {
  1199. this.dialogCost = !this.dialogCost
  1200. this.choiceData = true
  1201. this.choiceIndex = row.$index
  1202. },
  1203. //点击商品明细选择触发
  1204. commodityChoice(row) {
  1205. this.dialogVisible = !this.dialogVisible
  1206. this.commodityData = true
  1207. this.choiceIndexT = row.$index
  1208. },
  1209. //导入商品触发
  1210. importChoice() {
  1211. if (this.tableData.length === 1) {
  1212. this.contactsData[this.choiceIndexT].cname = this.tableData[0].cname
  1213. this.contactsData[this.choiceIndexT].code = this.tableData[0].code
  1214. this.contactsData[this.choiceIndexT].typeno = this.tableData[0].typeno
  1215. this.contactsData[this.choiceIndexT].specificationAndModel = this.tableData[0].typeno
  1216. this.contactsData[this.choiceIndexT].itemId = this.tableData[0].id
  1217. this.contactsData[this.choiceIndexT].priceCategory = this.tableData[0].goodsTypeName
  1218. selectGoodsNum({
  1219. goodsId: this.tableData[0].id,
  1220. itemType: this.tableData[0].typeno,
  1221. tradeType: 'GN'
  1222. }).then(res => {
  1223. this.contactsData[this.choiceIndexT].storageQuantity = res.data.data
  1224. })
  1225. }
  1226. this.dialogVisible = !this.dialogVisible
  1227. this.commodityData = false
  1228. },
  1229. //费用编辑导入触发
  1230. choiceCost() {
  1231. if (this.tableDataCost.length === 1) {
  1232. this.advantageProjectData[this.choiceIndex].feeName = this.tableDataCost[0].cname
  1233. this.advantageProjectData[this.choiceIndex].itemId = this.tableDataCost[0].id
  1234. this.advantageProjectData[this.choiceIndex].code = this.tableDataCost[0].code
  1235. }
  1236. this.dialogCost = !this.dialogCost
  1237. this.choiceData = false
  1238. },
  1239. //费用导入触发
  1240. importCost() {
  1241. // this.advantageProjectForm = this.advantageProjectForm.concat(this.tableDataCost)
  1242. if (this.tableDataCost.length > 0) {
  1243. for (let item in this.tableDataCost) {
  1244. this.tableDataCost[item].itemId = this.tableDataCost[item].id
  1245. this.tableDataCost[item].feeName = this.tableDataCost[item].cname
  1246. this.tableDataCost[item].sort = this.maxFeeNum + 1
  1247. this.maxFeeNum++
  1248. delete this.tableDataCost[item].id
  1249. this.$refs.crudProject.rowCellAdd(this.tableDataCost[item]);
  1250. this.$refs.crudProject.rowCell(this.tableDataCost[item], this.advantageProjectForm.length - 1)
  1251. }
  1252. }
  1253. this.tableDataCost = []
  1254. this.dialogCost = false
  1255. },
  1256. //确认导入触发
  1257. importGoods() {
  1258. // this.contactsData = this.contactsData.concat(this.tableData)
  1259. if (this.tableData.length > 0) {
  1260. for (let item in this.tableData) {
  1261. selectGoodsNum({
  1262. goodsId: this.tableData[item].id,
  1263. itemType: this.tableData[item].typeno,
  1264. tradeType: 'GN'
  1265. }).then(res =>{
  1266. this.tableData[item].storageQuantity = res.data.data
  1267. this.$set(this.tableData[item], 'specificationAndModel', this.tableData[item].typeno)
  1268. this.tableData[item].itemId = this.tableData[item].id
  1269. this.tableData[item].priceCategory = this.tableData[item].goodsTypeName
  1270. delete this.tableData[item].goodsTypeName
  1271. delete this.tableData[item].id
  1272. delete this.tableData[item].status
  1273. delete this.tableData[item].isDeleted
  1274. this.$set(this.tableData[item], 'inventoryNumber', 0)
  1275. this.$set(this.tableData[item], 'actualQuantity', 0)
  1276. this.$set(this.tableData[item], 'inventoryAmount', 0)
  1277. this.$set(this.tableData[item], 'deliveryAmount', 0)
  1278. this.tableData[item].price = 0
  1279. this.tableData[item].amount = 0
  1280. if (this.goodsActives == "goods") {
  1281. this.$set(this.tableData[item], 'goodType', 0)
  1282. this.arrivalQuantityChange(this.tableData[item])
  1283. } else {
  1284. this.$set(this.tableData[item], 'goodType', 1)
  1285. this.$set(this.tableData[item], 'integralMultiples', this.tableData[item].integral)
  1286. this.actualQuantityChange(this.tableData[item])
  1287. }
  1288. this.$set(this.tableData[item], 'integral', '0')
  1289. this.tableData[item].sort = this.maxGoodsNum + 1
  1290. this.maxGoodsNum++
  1291. this.$refs.crudContact.rowCellAdd(this.tableData[item]);
  1292. this.$refs.crudContact.rowCell(this.tableData[item], this.contactsData.length - 1)
  1293. if (this.goodsActives == "goods") {
  1294. this.arrivalQuantityChange(this.tableData[item])
  1295. } else {
  1296. this.actualQuantityChange(this.tableData[item])
  1297. }
  1298. })
  1299. }
  1300. }
  1301. this.dialogVisible = false
  1302. },
  1303. closeGoods() {
  1304. this.treeDataGoods = [];
  1305. this.treeDeptId = "";
  1306. },
  1307. closeFees() {
  1308. this.treeDeptIdCost = "";
  1309. this.treeData = [];
  1310. },
  1311. //选中触发
  1312. selectionChange(list) {
  1313. this.tableData = list
  1314. },
  1315. //费用选中触发
  1316. selectionChangeCost(list) {
  1317. this.tableDataCost = list
  1318. },
  1319. //导入页左商品类型查询
  1320. nodeClick(data) {
  1321. this.treeDeptId = data.id;
  1322. this.page.currentPage = 1;
  1323. this.onLoad(this.page);
  1324. },
  1325. //导入页左费用类型查询
  1326. nodeClickCost(data) {
  1327. this.treeDeptIdCost = data.id;
  1328. this.pageCost.currentPage = 1;
  1329. this.onLoadCost(this.pageCost);
  1330. },
  1331. //刷新触发
  1332. refreshChange() {
  1333. this.treeDeptId = '';
  1334. this.page.currentPage = 1;
  1335. this.onLoad(this.page);
  1336. },
  1337. //费用刷新触发
  1338. refreshChangeCost() {
  1339. this.treeDeptIdCost = '';
  1340. this.pageCost.currentPage = 1;
  1341. this.onLoadCost(this.pageCost);
  1342. },
  1343. //新增商品信息保存触发
  1344. rowSave(row, done, loading) {
  1345. // this.contactsData.push(row)
  1346. done()
  1347. },
  1348. //修改商品信息触发
  1349. rowUpdate(row, index, done, loading) {
  1350. done(row);
  1351. },
  1352. //删除商品信息触发
  1353. rowDel(row, index, donerowDel) {
  1354. this.$confirm("确定将选择数据删除?", {
  1355. confirmButtonText: "确定",
  1356. cancelButtonText: "取消",
  1357. type: "warning"
  1358. }).then(() => {
  1359. //商品判断是否需要调用删除接口
  1360. if (row.id) {
  1361. corpsattn(row.id).then(res => {
  1362. this.$message({
  1363. type: "success",
  1364. message: "操作成功!"
  1365. });
  1366. this.goodsShowData.splice(index, 1);
  1367. // 删除时主表积分跟着改变
  1368. if (this.goodsActives == 'goods') {
  1369. this.form.presenterIntegral = 0;
  1370. this.goodsShowData.forEach(item => {
  1371. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1372. })
  1373. } else {
  1374. this.form.convertIntegral = 0;
  1375. this.goodsShowData.forEach(item => {
  1376. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1377. })
  1378. }
  1379. })
  1380. } else {
  1381. this.$message({
  1382. type: "success",
  1383. message: "操作成功!"
  1384. });
  1385. this.goodsShowData.splice(index, 1);
  1386. // 删除时主表积分跟着改变
  1387. if (this.goodsActives == 'goods') {
  1388. this.form.presenterIntegral = 0;
  1389. this.goodsShowData.forEach(item => {
  1390. this.form.presenterIntegral = (Number(this.form.presenterIntegral) + Number(item.integral)).toFixed(2)
  1391. })
  1392. } else {
  1393. this.form.convertIntegral = 0;
  1394. this.goodsShowData.forEach(item => {
  1395. this.form.convertIntegral = (Number(this.form.convertIntegral) + Number(item.integral)).toFixed(2)
  1396. })
  1397. }
  1398. }
  1399. })
  1400. },
  1401. //新增费用明细保存触发
  1402. rowSaveProject(row, done, loading) {
  1403. // this.advantageProjectData.push(row)
  1404. done()
  1405. },
  1406. //修改费用明细触发
  1407. rowUpdateProject(row, index, done, loading) {
  1408. done(row);
  1409. },
  1410. goodsSearch(params, done) {
  1411. this.treeDeptId = '';
  1412. this.onLoad(this.page, params);
  1413. done()
  1414. },
  1415. //商品列表查询
  1416. onLoad(page, params = {}) {
  1417. this.loading = true;
  1418. getList(page.currentPage, page.pageSize, Object.assign(params, this.query), this.treeDeptId).then(res => {
  1419. const data = res.data.data;
  1420. this.page.total = data.total;
  1421. this.data = data.records;
  1422. this.loading = false;
  1423. });
  1424. },
  1425. // 费用查询按钮
  1426. feesSearch(params, done) {
  1427. this.treeDeptIdCost = '';
  1428. this.onLoadCost(this.pageCost, params)
  1429. done()
  1430. },
  1431. //费用查询
  1432. onLoadCost(page, params = {}) {
  1433. this.loadingCost = true;
  1434. let queryParams = Object.assign({}, params, {
  1435. pageSize: page.pageSize,
  1436. pageNum: page.currentPage,
  1437. parentId: 0,
  1438. feesTypeId: this.treeDeptIdCost
  1439. })
  1440. customerList(queryParams).then(res => {
  1441. const data = res.data.data;
  1442. this.pageCost.total = data.total;
  1443. this.dataCost = data.records;
  1444. this.loadingCost = false;
  1445. });
  1446. },
  1447. //删除费用明细触发
  1448. rowDelProject(row, index, donerowDel) {
  1449. this.$confirm("确定将选择数据删除?", {
  1450. confirmButtonText: "确定",
  1451. cancelButtonText: "取消",
  1452. type: "warning"
  1453. }).then(() => {
  1454. //费用判断是否需要调用删除接口
  1455. if (row.id) {
  1456. corpsitem(row.id).then(res => {
  1457. this.$message({
  1458. type: "success",
  1459. message: "操作成功!"
  1460. });
  1461. this.advantageProjectData.splice(index, 1);
  1462. })
  1463. } else {
  1464. this.$message({
  1465. type: "success",
  1466. message: "操作成功!"
  1467. });
  1468. this.advantageProjectData.splice(index, 1);
  1469. }
  1470. })
  1471. },
  1472. // 去重
  1473. removeRepeat() {
  1474. let obj = []
  1475. this.configuration.dicData = this.configuration.dicData.reduce((current,next) => {
  1476. obj[next.id] ? '': obj[next.id] = true && current.push(next)
  1477. return current
  1478. }, [])
  1479. },
  1480. //
  1481. receiveList(data){
  1482. this.configuration.dicData = this.configuration.dicData.concat(data)
  1483. this.removeRepeat()
  1484. },
  1485. //修改提交触发
  1486. editCustomer(isBack = false, type) {
  1487. this.$refs["form"].validate((valid) => {
  1488. if (valid) {
  1489. //商品信息
  1490. this.contactsData.forEach(item => {
  1491. this.$set(item, 'contractAmount', item.deliveryAmount)
  1492. })
  1493. if (this.goodsActives == 'gift') {
  1494. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1495. } else {
  1496. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1497. }
  1498. this.form.deliveryItemsList.forEach(item => {
  1499. if (item.orderNo) {
  1500. this.$set(item, 'contractNumber', item.orderNo)
  1501. this.$set(item, 'srcOrderNo', item.orderNo)
  1502. }
  1503. this.$set(item, 'contractAmount', item.deliveryAmount)
  1504. })
  1505. this.form.deliveryItemsList = this.contactsData.concat(this.giftData)
  1506. // this.form.deliveryFeesList = this.advantageProjectData
  1507. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1508. this.form.deliveryFilesList = this.bankOfDepositData
  1509. if (typeof this.form.corpsTypeId == 'object') {
  1510. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1511. }
  1512. this.saveLoading = true
  1513. this.form.billType = 'FH'
  1514. // 如果有id解锁,没有跳过
  1515. // !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
  1516. typeSave(this.form).then(res => {
  1517. this.$message({type: "success", message: this.form.id ? "修改成功!" : "新增成功!"});
  1518. // this.$set(this.detailData, 'seeDisabled', true);
  1519. if (isBack) {
  1520. //成功关闭此页面回到列表页
  1521. this.$emit("goBack");
  1522. this.leaveDetailsKey(this.$route.name)
  1523. } else {
  1524. this.saveActives = ''
  1525. this.queryData(res.data.data.id, false, type)
  1526. }
  1527. }).catch(() => {
  1528. this.pageLoading = false
  1529. this.saveLoading = false
  1530. })
  1531. } else {
  1532. return false;
  1533. }
  1534. });
  1535. },
  1536. //复制新单
  1537. copyOrder() {
  1538. this.queryData(this.form.id, true)
  1539. },
  1540. //返回列表
  1541. backToList() {
  1542. let getGoodsList = []
  1543. let getGiftList = []
  1544. let getFeeList = this.$refs.feeInfo.submitData()
  1545. if (this.goodsActives == 'gift') {
  1546. getGiftList = this.goodsShowData
  1547. getGoodsList = this.contactsData
  1548. } else {
  1549. getGoodsList = this.goodsShowData
  1550. getGiftList = this.giftData
  1551. }
  1552. if (contrastObj(this.form, this.oldForm) ||
  1553. contrastList(getGoodsList, this.oldGoodsList) ||
  1554. contrastList(getGiftList, this.oldGiftList) ||
  1555. contrastList(getFeeList, this.oldFeesList) ||
  1556. contrastList(this.bankOfDepositData, this.oldUploadList)
  1557. ) {
  1558. this.$confirm("数据发生变化未有提交记录, 是否提交?", "提示", {
  1559. confirmButtonText: "确定",
  1560. cancelButtonText: "取消",
  1561. type: "warning"
  1562. }).then(() => {
  1563. this.editCustomer(true)
  1564. }).catch(() => {
  1565. !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
  1566. this.$emit("goBack");
  1567. this.leaveDetailsKey(this.$route.name)
  1568. })
  1569. } else {
  1570. !this.detailData.seeDisabled && this.form.id && this.unLock({moduleName: 'fh',tableName: 'business_delivery', billId: this.form.id})
  1571. this.$emit("goBack");
  1572. this.leaveDetailsKey(this.$route.name)
  1573. }
  1574. },
  1575. // 确认发货
  1576. sendOutGoods() {
  1577. this.$refs["form"].validate((valid) => {
  1578. if (valid) {
  1579. if (this.contactsData.length == 0) {
  1580. return this.$message.error('商品信息为空')
  1581. }
  1582. let getGoodsList = []
  1583. let getGiftList = []
  1584. let getFeeList = this.$refs.feeInfo.submitData()
  1585. if (this.goodsActives == 'gift') {
  1586. getGiftList = this.goodsShowData
  1587. getGoodsList = this.contactsData
  1588. } else {
  1589. getGoodsList = this.goodsShowData
  1590. getGiftList = this.giftData
  1591. }
  1592. if (contrastObj(this.form, this.oldForm) ||
  1593. contrastList(getGoodsList, this.oldGoodsList) ||
  1594. contrastList(getGiftList, this.oldGiftList) ||
  1595. contrastList(getFeeList, this.oldFeesList) ||
  1596. contrastList(this.bankOfDepositData, this.oldUploadList)
  1597. ) {
  1598. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1599. confirmButtonText: "确定",
  1600. cancelButtonText: "取消",
  1601. type: "warning"
  1602. }).then(async () => {
  1603. await this.editCustomer(false, '发货')
  1604. }).catch(() => {
  1605. this.$message.info('已取消')
  1606. })
  1607. } else {
  1608. //商品信息
  1609. if (this.goodsActives == 'gift') {
  1610. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1611. } else {
  1612. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1613. }
  1614. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1615. this.form.deliveryFilesList = this.bankOfDepositData
  1616. if (typeof this.form.corpsTypeId == 'object') {
  1617. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1618. }
  1619. this.pageLoading = true
  1620. this.saveActives = ''
  1621. this.saveLoading = true
  1622. sendOutGoods(this.form).then(res => {
  1623. this.$message.success('发货成功')
  1624. this.queryData(res.data.data.id)
  1625. }).finally(() => {
  1626. this.pageLoading = false
  1627. this.saveLoading = false
  1628. })
  1629. }
  1630. } else {
  1631. return false;
  1632. }
  1633. });
  1634. },
  1635. // 撤销发货
  1636. revokeOutGoods() {
  1637. this.$refs["form"].validate((valid) => {
  1638. if (valid) {
  1639. //商品信息
  1640. if (this.goodsActives == 'gift') {
  1641. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1642. } else {
  1643. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1644. }
  1645. this.form.deliveryFeesList = this.$refs.feeInfo.submitData()
  1646. this.form.deliveryFilesList = this.bankOfDepositData
  1647. if (typeof this.form.corpsTypeId == 'object') {
  1648. this.form.corpsTypeId = this.form.corpsTypeId.join(",")
  1649. }
  1650. this.pageLoading = true
  1651. this.saveLoading = true
  1652. this.saveActives = ''
  1653. revokeOutGoods(this.form).then(res => {
  1654. this.$message.success('撤销成功')
  1655. this.queryData(res.data.data.id)
  1656. }).finally(() => {
  1657. this.pageLoading = false
  1658. this.saveLoading = false
  1659. })
  1660. } else {
  1661. return false;
  1662. }
  1663. });
  1664. },
  1665. // 确认到货
  1666. confirmArrival() {
  1667. let getGoodsList = []
  1668. let getGiftList = []
  1669. let getFeeList = this.$refs.feeInfo.submitData()
  1670. if (this.goodsActives == 'gift') {
  1671. getGiftList = this.goodsShowData
  1672. getGoodsList = this.contactsData
  1673. } else {
  1674. getGoodsList = this.goodsShowData
  1675. getGiftList = this.giftData
  1676. }
  1677. if (contrastObj(this.form, this.oldForm) ||
  1678. contrastList(getGoodsList, this.oldGoodsList) ||
  1679. contrastList(getGiftList, this.oldGiftList) ||
  1680. contrastList(getFeeList, this.oldFeesList) ||
  1681. contrastList(this.bankOfDepositData, this.oldUploadList)
  1682. ) {
  1683. this.$confirm("数据发生变化未有提交记录, 是否保存?", "提示", {
  1684. confirmButtonText: "确定",
  1685. cancelButtonText: "取消",
  1686. type: "warning"
  1687. }).then(() => {
  1688. this.editCustomer(false, '到货')
  1689. }).catch(() => {
  1690. this.$message.info('已取消')
  1691. })
  1692. } else {
  1693. if (this.goodsActives == 'gift') {
  1694. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1695. } else {
  1696. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1697. }
  1698. this.pageLoading = true
  1699. this.saveLoading = true
  1700. this.saveActives = ''
  1701. confirmArrival(this.form).then(res => {
  1702. this.$message.success('已确认到货')
  1703. this.queryData(this.form.id)
  1704. }).catch(() => {
  1705. this.pageLoading = false
  1706. this.saveLoading = false
  1707. })
  1708. }
  1709. },
  1710. // 撤销到货
  1711. cancelArrival() {
  1712. if (this.goodsActives == 'gift') {
  1713. this.form.deliveryItemsList = this.goodsShowData.concat(this.contactsData)
  1714. } else {
  1715. this.form.deliveryItemsList = this.goodsShowData.concat(this.giftData)
  1716. }
  1717. this.pageLoading = true
  1718. this.saveActives = ''
  1719. cancelArrival(this.form).then(res => {
  1720. this.$message.success('撤销到货成功')
  1721. this.queryData(this.form.id)
  1722. }).catch(() => {
  1723. this.pageLoading = false
  1724. })
  1725. },
  1726. // 导入销售明细
  1727. importMarket(list) {
  1728. list.forEach(item => {
  1729. item.cname = item.cname
  1730. this.$set(item, 'specificationAndModel', item.itemType)
  1731. if (this.goodsActives == 'goods') {
  1732. this.$set(item, 'deliveryAmount', item.amount)
  1733. } else {
  1734. this.$set(item, 'deliveryAmount', 0)
  1735. }
  1736. this.$set(item, 'actualQuantity', item.orderQuantity)
  1737. this.$set(item, 'inventoryNumber', item.storageQuantity)
  1738. this.$set(item, 'integral', 0)
  1739. this.$set(item, 'orgOrderNo', this.form.orgOrderNo)
  1740. this.$set(item, 'srcOrderNo', this.form.srcOrderNo)
  1741. this.$set(item, 'arrivalQuantity', item.actualQuantity)
  1742. this.$set(item, "srcId", item.id)
  1743. this.$set(item, "purchaseTotalAmount", (Number(item.purchaseAmount) * Number(item.actualQuantity)))
  1744. item.purchaseTotalAmount = item.purchaseTotalAmount.toFixed(2)
  1745. if (this.goodsActives == "goods") {
  1746. this.$set(item, 'goodType', 0)
  1747. } else {
  1748. this.$set(item, 'goodType', 1)
  1749. }
  1750. delete item.id
  1751. delete item.createTime
  1752. delete item.createUser
  1753. delete item.pid
  1754. this.arrivalQuantityChange(item)
  1755. this.$refs.crudContact.rowCellAdd(item);
  1756. this.arrivalQuantityChange(item)
  1757. })
  1758. this.marketDialog = false;
  1759. },
  1760. // 关闭销售弹窗
  1761. closeMarkeDialog() {
  1762. this.marketDialog = false;
  1763. },
  1764. // 保存列设置
  1765. async saveColumn(name) {
  1766. if (name == 'goods') {
  1767. const inSave = await this.saveColumnData(
  1768. this.getColumnName(21),
  1769. this.customerContact
  1770. );
  1771. if (inSave) {
  1772. this.$message.success("保存成功");
  1773. //关闭窗口
  1774. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1775. }
  1776. } else if (name === 'fees') {
  1777. const inSave = await this.saveColumnData(
  1778. this.getColumnName(22),
  1779. this.advantageProject
  1780. );
  1781. if (inSave) {
  1782. this.$message.success("保存成功");
  1783. //关闭窗口
  1784. this.$refs.crudProject.$refs.dialogColumn.columnBox = false;
  1785. }
  1786. }
  1787. },
  1788. async resetColumn() {
  1789. this.customerContact = customerContact
  1790. const inSave = await this.delColumnData(
  1791. this.getColumnName(21),
  1792. customerContact
  1793. );
  1794. if (inSave) {
  1795. this.$message.success("重置成功");
  1796. //关闭窗口
  1797. this.$refs.crudContact.$refs.dialogColumn.columnBox = false;
  1798. }
  1799. },
  1800. // 商品表格加色
  1801. goodsRowClassName({row, column, rowIndex, columnIndex}) {
  1802. if (Number(row.actualQuantity) > Number(row.inventoryNumber) && column.property == 'inventoryNumber') {
  1803. return "color: #fff;background:#a4cf57"
  1804. }
  1805. return '';
  1806. },
  1807. // 库存刷新
  1808. resetStock() {
  1809. this.contactsData.forEach(item => {
  1810. selectGoodsNum({
  1811. goodsId: item.itemId,
  1812. itemType: item.itemType? item.itemType: item.typeno,
  1813. tradeType: 'GN',
  1814. storageId: this.form.storageId
  1815. }).then(res => {
  1816. item.inventoryNumber = res.data.data
  1817. })
  1818. })
  1819. this.$message.success('刷新成功')
  1820. },
  1821. // 商品信息标签页切换
  1822. handleClick(data) {
  1823. if (this.saveActives == data.name) return
  1824. this.saveActives = data.name
  1825. this.goodsDisabled = true
  1826. if (data.name == 'goods') {
  1827. this.giftData = this.goodsShowData
  1828. // 显示
  1829. this.customerContact.column.forEach(item => {
  1830. if (item.prop == 'integralMultiples') item.label = '积分倍数'
  1831. if (item.prop == 'integral') item.label = '赠送积分'
  1832. if (item.prop == 'actualQuantity') item.label = '出库数量'
  1833. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1834. || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight'
  1835. || item.prop == 'inventoryNumber' || item.prop == 'inventoryAmount'
  1836. || item.prop == 'arrivalQuantity'
  1837. ) {
  1838. item.hide = false;
  1839. item.showColumn = true;
  1840. }
  1841. })
  1842. this.goodsShowData = this.contactsData;
  1843. setTimeout(() => {
  1844. this.goodsDisabled = false
  1845. },500)
  1846. } else {
  1847. // 隐藏字段
  1848. this.contactsData = this.goodsShowData
  1849. this.customerContact.column.forEach(item => {
  1850. if (item.prop == 'integralMultiples') item.label = '积分单价'
  1851. if (item.prop == 'integral') item.label = '兑换积分'
  1852. if (item.prop == 'actualQuantity') item.label = '数量'
  1853. if (item.prop == 'priceType' || item.prop == 'code' || item.prop == 'typeno' || item.prop == 'corpId'
  1854. || item.prop == 'packageRemarks' || item.prop == 'invoiceWeight' || item.prop == 'inventoryNumber'
  1855. || item.prop == 'inventoryAmount' || item.prop == 'arrivalQuantity'
  1856. ) {
  1857. item.hide = true;
  1858. item.showColumn = false;
  1859. }
  1860. })
  1861. this.goodsShowData = this.giftData;
  1862. setTimeout(() => {
  1863. this.goodsDisabled = false
  1864. },500)
  1865. }
  1866. },
  1867. // 报表
  1868. openReport() {
  1869. this.switchDialog =! this.switchDialog;
  1870. },
  1871. onClose(val) {
  1872. this.switchDialog = val;
  1873. },
  1874. //费用明细回调
  1875. beforeFinance(feesData,callback){
  1876. this.advantageProjectData = feesData;
  1877. let params = {}
  1878. //暂时默认通过 之后优化
  1879. params.valid = true
  1880. params.parentId = this.form.id
  1881. params.srcOrderno = this.form.orderNo
  1882. callback(params)
  1883. },
  1884. // 编辑
  1885. editHandle() {
  1886. const data = {
  1887. moduleName: 'fh',
  1888. tableName: 'business_delivery',
  1889. billId: this.form.id,
  1890. no: localStorage.getItem('browserID'),
  1891. billNo: this.form.sysNo
  1892. }
  1893. this.saveLoading = true
  1894. this.checkLock(data).then(res => {
  1895. if (res.data.code == 200) {
  1896. this.onLock(data).then(response => {
  1897. this.saveActives = ''
  1898. this.queryData(this.form.id)
  1899. this.inDetailsKey(this.$route.name, {
  1900. moduleName: 'fh',
  1901. tableName: 'business_delivery',
  1902. billId: this.form.id,
  1903. })
  1904. this.detailData.seeDisabled = false;
  1905. })
  1906. }
  1907. }).catch(error => {
  1908. }).finally(() => {
  1909. this.saveLoading = false
  1910. })
  1911. },
  1912. returnBack(data) {
  1913. if (data.belongtocompany) {
  1914. // this.form.salesCompany = data.belongtocompany
  1915. }
  1916. },
  1917. getGSName(row) {
  1918. this.form.belongCompany = row.cname
  1919. },
  1920. }
  1921. }
  1922. </script>
  1923. <style lang="scss" scoped>
  1924. //.customer-head {
  1925. // position: fixed;
  1926. // top: 105px;
  1927. // width: 100%;
  1928. // margin-left: -10px;
  1929. // height: 62px;
  1930. // background: #ffffff;
  1931. // box-shadow: 0 4px 12px 0px rgba(232, 232, 235, 1);
  1932. // z-index: 999;
  1933. //}
  1934. //
  1935. //.customer-back {
  1936. // cursor: pointer;
  1937. // line-height: 62px;
  1938. // font-size: 16px;
  1939. // color: #323233;
  1940. // font-weight: 400;
  1941. //}
  1942. .back-icon {
  1943. line-height: 64px;
  1944. font-size: 20px;
  1945. margin-right: 8px;
  1946. }
  1947. //.add-customer-btn {
  1948. // position: fixed;
  1949. // right: 36px;
  1950. // top: 115px;
  1951. //}
  1952. ::v-deep .el-form-item {
  1953. margin-bottom: 0;
  1954. }
  1955. .el-dialogDeep {
  1956. ::v-deep .el-dialog {
  1957. margin: 1vh auto 0 !important;
  1958. padding-bottom: 10px !important;
  1959. .el-dialog__body, .el-dialog__footer {
  1960. padding-bottom: 0 !important;
  1961. padding-top: 0 !important;
  1962. }
  1963. }
  1964. }
  1965. .print-div {
  1966. color: #000;
  1967. }
  1968. .print_table {
  1969. table {
  1970. border-right: 1px solid #000;
  1971. border-bottom: 1px solid #000;
  1972. font-size: 12px;
  1973. margin-bottom: 5px;
  1974. }
  1975. table td {
  1976. border-left: 1px solid #000;
  1977. border-top: 1px solid #000;
  1978. vertical-align: middle;
  1979. padding: 2px;
  1980. text-align: center;
  1981. }
  1982. }
  1983. .table {
  1984. border-collapse: collapse;
  1985. border-spacing: 0;
  1986. background-color: transparent;
  1987. display: table;
  1988. width: 99%;
  1989. max-width: 100%;
  1990. margin: 0 auto;
  1991. }
  1992. .table td {
  1993. text-align: left;
  1994. vertical-align: middle;
  1995. font-size: 14px;
  1996. color: #000000;
  1997. padding: 10.5px 0 10.5px 30px;
  1998. //border: 1px solid #000;
  1999. }
  2000. ::v-deep .el-form-item {
  2001. margin-bottom: 0;
  2002. }
  2003. ::v-deep .el-form-item__content{
  2004. line-height: 32px;
  2005. }
  2006. </style>