detailsPageEdit.vue 69 KB

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