detailsPage.vue 87 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button
  6. type="danger"
  7. style="border: none; background: none; color: red"
  8. icon="el-icon-arrow-left"
  9. @click="backToList(0)"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="add-customer-btn">
  14. <el-button
  15. class="el-button&#45;&#45;small-yh"
  16. :disabled="isEditButton"
  17. style="margin-left: 6px"
  18. type="primary"
  19. size="small"
  20. v-if="editButton"
  21. @click="confirmEditing"
  22. >编 辑
  23. </el-button>
  24. <el-button
  25. class="el-button--small-yh"
  26. v-else
  27. style="margin-left: 6px"
  28. type="primary"
  29. size="small"
  30. :disabled="editDis"
  31. @click="editCustomer"
  32. >保 存
  33. </el-button>
  34. <el-button
  35. class="el-button--small-yh"
  36. style="margin-left: 6px"
  37. type="success"
  38. size="small"
  39. :disabled="editButton"
  40. @click="orderConfirmation"
  41. v-if="form.status == '待确认'"
  42. >
  43. 订单确认
  44. </el-button>
  45. <el-button
  46. class="el-button--small-yh"
  47. style="margin-left: 6px"
  48. type="danger"
  49. size="small"
  50. :disabled="editButton"
  51. v-if="form.status == '待发货'"
  52. @click="revokeOrderConfirmation"
  53. >
  54. 撤销订单确认
  55. </el-button>
  56. <el-button
  57. v-if="form.id"
  58. class="el-button--small-yh"
  59. style="margin-left: 6px"
  60. type="info"
  61. size="small"
  62. :disabled="form.status != '已发货' || form.returnsNumber == form.goodsTotalNum || editButton"
  63. @click="getReturns"
  64. >
  65. 销售退货
  66. </el-button>
  67. <el-dropdown style="padding: 0 6px; line-height: 0">
  68. <el-button v-show="form.id" type="danger" :loading="buttonLoading" :disabled="form.id" size="small">
  69. 售 后<i class="el-icon-arrow-down el-icon--right"></i>
  70. </el-button>
  71. <el-dropdown-menu slot="dropdown">
  72. <el-dropdown-item @click.native="applySettlement('申请')" :disabled="isApplySettlement"
  73. >申请退款
  74. </el-dropdown-item>
  75. <!-- <el-dropdown-item @click.native="confirmRefundBtn('确认')" :disabled="isConfirmRefundBtn">确认退款
  76. </el-dropdown-item>-->
  77. <el-dropdown-item @click.native="revocationRequest('撤销')" :disabled="isRevocationRequest"
  78. >撤销请核
  79. </el-dropdown-item>
  80. </el-dropdown-menu>
  81. </el-dropdown>
  82. </div>
  83. </div>
  84. <div style="margin-top: 50px">
  85. <trade-card title="基础信息">
  86. <avue-form :option="optionForm" v-model="form" ref="form">
  87. <tempalte slot="customerName" slot-scope="{ row }">
  88. <search-query
  89. :datalist="customerData"
  90. :selectValue="form.customerName"
  91. :clearable="true"
  92. :buttonIf="false"
  93. :filterable="true"
  94. :remote="true"
  95. :disabled="editDis || form.orderItemsList.length"
  96. placeholder="请选择店铺名称"
  97. :forParameter="{ key: 'id', label: 'cname', value: 'cname' }"
  98. @corpFocus="KHgetListfun"
  99. @remoteMethod="KHgetListfun"
  100. @corpChange="KHcorpChange"
  101. @corpClear="KHClear"
  102. >
  103. </search-query>
  104. </tempalte>
  105. <template slot-scope="{ row, index }" slot="contacts">
  106. <el-select
  107. v-model="form.contacts"
  108. placeholder="请选择"
  109. size="small"
  110. style="width: 60%"
  111. clearable
  112. filterable
  113. allow-create
  114. default-first-option
  115. @change="contactsChange($event)"
  116. :disabled="editDis"
  117. >
  118. <el-option v-for="item in contactsOption" :key="item.id" :label="item.contacts" :value="item.contacts" />
  119. </el-select>
  120. </template>
  121. <tempalte slot="salerName">
  122. <dic-select
  123. v-model="form.salerName"
  124. placeholder="业务员"
  125. key="id"
  126. label="name"
  127. url="/blade-user/salerList"
  128. :filterable="true"
  129. @selectChange="dicChange('salerName', $event)"
  130. :disabled="editDis"
  131. >
  132. </dic-select>
  133. </tempalte>
  134. </avue-form>
  135. </trade-card>
  136. <trade-card title="明细信息">
  137. <el-tabs v-model="activeName" type="card">
  138. <el-tab-pane label="销售明细" name="sale_detail">
  139. <avue-crud
  140. :option="optionContacts"
  141. v-model="formContacts"
  142. ref="formContacts"
  143. :data="form.orderItemsList"
  144. :key="key"
  145. @row-save="rowSave"
  146. @row-update="rowUpdate"
  147. @row-close="rowClose"
  148. :before-close="beforeClose"
  149. @selection-change="selectionContacts"
  150. >
  151. <template slot-scope="{ scope, row }" slot="menuLeft">
  152. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="editDis" @click="rowAdd(row, 1)"
  153. >添加商品</el-button
  154. >
  155. <el-button
  156. type="success"
  157. size="small"
  158. :disabled="editDis"
  159. icon="el-icon-bottom"
  160. @click="excelDialogfun('名称')"
  161. >按名称导入
  162. </el-button>
  163. <el-button
  164. type="success"
  165. size="small"
  166. :disabled="editDis"
  167. icon="el-icon-bottom"
  168. @click="excelDialogfun('code')"
  169. >按Code导入
  170. </el-button>
  171. <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
  172. <el-button type="danger" plain size="small" @click="batchDelete" :disabled="editDis"
  173. >一键删除</el-button
  174. >
  175. <el-button type="primary" plain size="small" @click="quickCopy">快捷复制</el-button>
  176. <el-popover width="600" trigger="click">
  177. <avue-crud :data="inventoryData" :option="inventoryOption"></avue-crud>
  178. <el-button
  179. type="primary"
  180. plain
  181. size="small"
  182. slot="reference"
  183. @click="viewInventory"
  184. :disabled="selectionMultilist.length != 1"
  185. >查看库存</el-button
  186. >
  187. </el-popover>
  188. <el-button type="primary" icon="el-icon-plus" size="small" :disabled="editDis" @click="rowAdd(row, 2)"
  189. >无库存商品</el-button
  190. >
  191. <el-popover width="600" trigger="click">
  192. <avue-crud :data="inventoryData2" :option="inventoryOption2">
  193. <template slot-scope="{ row }" slot="menu">
  194. <el-button
  195. type="text"
  196. icon="el-icon-getDetail"
  197. size="small"
  198. :disabled="row.storageId != form.storageId"
  199. @click.stop="synchronous(row)"
  200. >更新库存
  201. </el-button>
  202. </template>
  203. </avue-crud>
  204. <el-button
  205. type="primary"
  206. plain
  207. size="small"
  208. slot="reference"
  209. @click="viewInventory2"
  210. :disabled="selectionMultilist.length != 1 || isAddBtn"
  211. >同步库存</el-button
  212. >
  213. </el-popover>
  214. </template>
  215. <template slot="goodsId" slot-scope="{ row }">
  216. {{ row.goodsName }}
  217. </template>
  218. <tempalte slot-scope="{ row, index }" slot="reservoirArea">
  219. <dic-select
  220. v-if="row.$cellEdit"
  221. v-model="row.reservoirArea"
  222. placeholder="库区"
  223. label="cname"
  224. :key="form.storageId"
  225. @selectChange="rowDicChange('reservoirArea', $event, row)"
  226. :url="'/gubersail-admin/warehouse/list?current=1&size=5&storageId=' + form.storageId"
  227. :filterable="true"
  228. :remote="true"
  229. dataName="cname"
  230. res="records"
  231. >
  232. </dic-select>
  233. <span v-else>{{ row.reservoirArea }}</span>
  234. </tempalte>
  235. <template slot="goodsNum" slot-scope="{ row }">
  236. <el-input-number
  237. v-if="row.$cellEdit"
  238. size="small"
  239. v-model="row.goodsNum"
  240. :precision="numberDecimal"
  241. :controls="false"
  242. @change="goodsNumblurfun(row)"
  243. :max="Number(row.inventory)"
  244. style="width: 100%"
  245. ></el-input-number>
  246. <span v-else>{{ row.goodsNum }}</span>
  247. </template>
  248. <template slot="price" slot-scope="{ row }">
  249. <el-input v-if="row.$cellEdit" size="small" v-model="row.price" style="width: 100%"></el-input>
  250. <span v-else>{{ row.price }}</span>
  251. </template>
  252. <template slot="dot" slot-scope="{ row }">
  253. <el-select
  254. v-if="row.$cellEdit"
  255. v-model="row.dot"
  256. filterable
  257. default-first-option
  258. @focus="picihaolistfun(row.goodsId)"
  259. @change="dotchangefun($event, row)"
  260. size="small"
  261. >
  262. <el-option
  263. v-for="(item, index) in picihaolist"
  264. :key="index"
  265. :label="item.dot"
  266. :value="item.dot"
  267. ></el-option>
  268. </el-select>
  269. <span v-else>{{ row.dot }}</span>
  270. </template>
  271. <template slot="subTotalMoney" slot-scope="{ row }">{{ row.goodsNum * row.price }}</template>
  272. <template slot="remarks" slot-scope="{ row }">
  273. <el-input v-if="!mingxibaocun" size="small" v-model="row.remarks" style="width: 100%"></el-input>
  274. <span v-else>{{ row.remarks }}</span>
  275. </template>
  276. <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
  277. <el-button size="small" type="text" icon="el-icon-edit" :disabled="editDis" @click="rowEdit(row)">{{
  278. row.$cellEdit ? "保存" : "编辑"
  279. }}</el-button>
  280. <el-button
  281. icon="el-icon-delete"
  282. :size="size"
  283. :disabled="editDis"
  284. :type="type"
  285. @click="rowDelBox(row, index, 'orderItemsList')"
  286. >删除
  287. </el-button>
  288. </template>
  289. </avue-crud>
  290. <el-dialog
  291. title="导入明细"
  292. append-to-body
  293. :visible.sync="excelBox"
  294. v-if="excelBox"
  295. width="555px"
  296. :close-on-click-modal="false"
  297. v-dialog-drag
  298. >
  299. <avue-form
  300. :option="excelOption"
  301. v-model="excelForm"
  302. table-loading="excelLoading"
  303. :upload-before="uploadBefore"
  304. :upload-after="uploadAfter"
  305. >
  306. <template slot="excelTemplate">
  307. <el-button type="primary" @click="derivation">
  308. 点击下载<i class="el-icon-download el-icon--right"></i>
  309. </el-button>
  310. </template>
  311. </avue-form>
  312. <p style="text-align: center; color: #dc0505">温馨提示 第一次导入时请先下载模板</p>
  313. </el-dialog>
  314. </el-tab-pane>
  315. <el-tab-pane label="支付明细" name="payment_details">
  316. <avue-crud
  317. :option="optionPaymentDetails"
  318. v-model="formContacts"
  319. ref="payment_details"
  320. :data="dataList"
  321. @row-save="rowSave"
  322. @row-update="rowUpdate"
  323. @resetColumn="
  324. resetColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)
  325. "
  326. @saveColumn="saveColumnTwo('payment_details', 'optionPaymentDetails', 'optionPaymentDetailsBack', 269.2)"
  327. >
  328. <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  329. <el-button :size="size" :disabled="disabled" :type="type"
  330. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  331. @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
  332. </el-button>
  333. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  334. @click="rowDelBox(row, index, 'paymentRecordsList')">删除
  335. </el-button>
  336. </template> -->
  337. </avue-crud>
  338. </el-tab-pane>
  339. <el-tab-pane label="出库记录" name="outbound_records">
  340. <avue-crud
  341. :option="optionOutboundRecords"
  342. v-model="formContacts"
  343. ref="outbound_records"
  344. :data="form.outboundRecordsList"
  345. @row-save="rowSave"
  346. @row-update="rowUpdate"
  347. @resetColumn="
  348. resetColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)
  349. "
  350. @saveColumn="
  351. saveColumnTwo('outbound_records', 'optionOutboundRecords', 'optionOutboundRecordsBack', 269.3)
  352. "
  353. >
  354. <!-- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
  355. <el-button :size="size" :disabled="disabled" :type="type"
  356. :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
  357. @click="$refs.formContacts.rowCell(row, index)">{{ row.$cellEdit ? '确认' : '修改' }}
  358. </el-button>
  359. <el-button icon="el-icon-delete" :size="size" :disabled="disabled" :type="type"
  360. @click="rowDelBox(row, index)">删除
  361. </el-button>
  362. </template> -->
  363. </avue-crud>
  364. </el-tab-pane>
  365. </el-tabs>
  366. </trade-card>
  367. <report-dialog
  368. :switchDialog="switchDialog"
  369. :reportName="reportName"
  370. :reportId="form.id"
  371. @onClose="onClose()"
  372. ></report-dialog>
  373. <el-dialog
  374. append-to-body
  375. title="审批"
  376. class="el-dialogDeep"
  377. :visible.sync="checkDialog"
  378. width="50%"
  379. :close-on-click-modal="false"
  380. :destroy-on-close="true"
  381. :close-on-press-escape="false"
  382. v-dialog-drag
  383. >
  384. <check
  385. :checkData="checkData"
  386. :checkDetail="true"
  387. :idList="[]"
  388. @operationType="operationType"
  389. @choceCheckFun="choceCheckFun"
  390. >
  391. </check>
  392. </el-dialog>
  393. <el-dialog
  394. append-to-body
  395. title="审批进度"
  396. class="el-dialogDeep"
  397. :visible.sync="checkScheduleDialog"
  398. width="40%"
  399. :close-on-click-modal="false"
  400. :destroy-on-close="true"
  401. :close-on-press-escape="false"
  402. v-dialog-drag
  403. >
  404. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun"></check-schedule>
  405. </el-dialog>
  406. </div>
  407. <el-dialog
  408. title="选择商品"
  409. append-to-body
  410. class="el-dialogDeep"
  411. :visible.sync="dialogVisible"
  412. width="80%"
  413. :close-on-click-modal="false"
  414. :destroy-on-close="true"
  415. :close-on-press-escape="false"
  416. @close="closeGoods"
  417. >
  418. <el-row :style="{ height: rowHeight }">
  419. <el-col :span="5">
  420. <div>
  421. <el-scrollbar>
  422. <basic-container>
  423. <avue-tree
  424. style="height: 60vh; overflow-y: auto"
  425. :option="treeOption"
  426. :data="treeDataGoods"
  427. @node-click="nodeClick"
  428. />
  429. </basic-container>
  430. </el-scrollbar>
  431. </div>
  432. </el-col>
  433. <el-col :span="19">
  434. <basic-container>
  435. <avue-crud
  436. :option="optionTwo"
  437. :table-loading="loading"
  438. :data="goodsListShow"
  439. ref="crud"
  440. :search.sync="SelectSearch"
  441. @getDetail-change="refreshChange"
  442. @selection-change="selectionChange"
  443. @search-change="goodsSearch"
  444. :page.sync="page"
  445. @on-load="onLoadfun"
  446. @resetColumn="resetCrud"
  447. @saveColumn="saveCrud"
  448. >
  449. <template slot="menuLeft">
  450. <el-tabs v-model="activeNameTabs" @tab-click="tabHandle">
  451. <el-tab-pane label="查询结果" name="searchList" />
  452. <el-tab-pane label="已选定数据" name="importStaging" />
  453. </el-tabs>
  454. </template>
  455. <template slot="goodsNum" slot-scope="{ row }">
  456. <el-input-number
  457. v-model="row.goodsNum"
  458. size="small"
  459. :controls="false"
  460. :precision="numberDecimal"
  461. @input="amountChange($event, row)"
  462. style="width: 100%"
  463. />
  464. </template>
  465. <template slot="dot" slot-scope="{ row }">
  466. <!--使用allow-create属性即可通过在输入框中输入文字来创建新的条目。注意此时filterable必须为真。-->
  467. <!--本例还使用了default-first-option属性, 在该属性打开的情况下,按下回车就可以选中当前选项列表中的第一个选项,-->
  468. <!--无需使用鼠标或键盘方向键进行定位。-->
  469. <!--allow-create filterable default-first-option-->
  470. <el-select
  471. v-model="row.dot"
  472. filterable
  473. default-first-option
  474. size="small"
  475. @focus="picihaolistfun(row.id)"
  476. @change="dotchangefun($event, row)"
  477. >
  478. <el-option
  479. v-for="(item, index) in picihaolist"
  480. :key="index"
  481. :label="item.dot"
  482. :value="item.dot"
  483. ></el-option>
  484. </el-select>
  485. <!--<span v-else>{{ row.dot }}</span>-->
  486. </template>
  487. <template slot="price" slot-scope="{ row }">
  488. <el-input-number v-model="row.price" size="small" :controls="false" style="width: 100%" />
  489. </template>
  490. <template slot-scope="scope" slot="menu">
  491. <el-button
  492. type="text"
  493. icon="el-icon-edit"
  494. size="small"
  495. @click.stop="importStagList(scope.row, scope.index)"
  496. v-if="activeNameTabs == 'searchList'"
  497. :disabled="goodsListSave.findIndex((item) => item.id == scope.row.id) !== -1"
  498. >选择
  499. </el-button>
  500. <el-button
  501. type="text"
  502. icon="el-icon-delete"
  503. size="small"
  504. @click.stop="removeStagList(scope.row, scope.index)"
  505. v-else
  506. >移除
  507. </el-button>
  508. </template>
  509. <template slot="inventory" slot-scope="scope">
  510. <span style="color: #489fef">
  511. {{ Number(scope.row.inventory) }}
  512. </span>
  513. </template>
  514. </avue-crud>
  515. </basic-container>
  516. </el-col>
  517. </el-row>
  518. <span slot="footer" class="dialog-footer">
  519. <el-button @click="dialogVisible = false" :loading="saveLoading">取 消</el-button>
  520. <el-button type="primary" @click="importGoods" v-if="commodityData !== true" :loading="saveLoading"
  521. >导入</el-button
  522. >
  523. <!--<el-button type="primary" @click="importChoice" v-if="commodityData === true" :loading="saveLoading"-->
  524. <!-- :disabled="tableData.length !== 1">导入</el-button>-->
  525. </span>
  526. </el-dialog>
  527. </div>
  528. </template>
  529. <script>
  530. // @ts-nocheck
  531. import { getDetails as getCustom } from "@/api/basicData/customerInformation";
  532. import { getDetails as getDetailsGods } from "@/api/basicData/commodityInformation";
  533. import {
  534. getDetails,
  535. submit,
  536. generateShipTask,
  537. tradingBox,
  538. delOrderItem,
  539. checkOrder,
  540. confirmRefund,
  541. revokeCheckOrder,
  542. goodsListXs,
  543. revokeGenerateShipTask,
  544. goodsPageXs,
  545. getGoodAllList,
  546. generateReturns,
  547. whetherExistenceFinancing,
  548. checkOrderRW,
  549. revokeCheckOrderRW,
  550. getParamservice,
  551. orderConfirmation,
  552. revokeOrderConfirmation,
  553. } from "@/api/salesManagement/saleOrder.js";
  554. import { dotList, goodsDetail } from "@/api/purchasingManagement/warehouseEntryOrder.js";
  555. import { dateFormat } from "@/util/date";
  556. import { number } from "echarts";
  557. import { getCorpTypes } from "@/api/basicData/commodityInformation";
  558. import { getWorkDicts } from "@/api/system/dictbiz";
  559. import { getList as KHgetList } from "@/api/basicData/customerInformation";
  560. import { getToken } from "@/util/auth";
  561. import { isProcurement } from "@/api/basicData/configuration.js";
  562. import { getList as inventoryList } from "@/api/salesManagement/inventory";
  563. import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
  564. import dicSelect from "@/components/dicSelect/main.vue";
  565. export default {
  566. name: "detailsPage",
  567. data() {
  568. return {
  569. editDis: true,
  570. inventoryData2: [],
  571. numberDecimal: 0,
  572. goodsType: 1,
  573. inventoryOption: {
  574. header: false,
  575. menu: false,
  576. column: [
  577. {
  578. label: "商品名称",
  579. prop: "cname",
  580. overHidden: true,
  581. },
  582. {
  583. label: "仓库",
  584. prop: "storageName",
  585. overHidden: true,
  586. },
  587. {
  588. label: "库存数量",
  589. prop: "balanceQuantity",
  590. overHidden: true,
  591. },
  592. {
  593. label: "批次号",
  594. prop: "dot",
  595. overHidden: true,
  596. },
  597. ],
  598. },
  599. inventoryOption2: {
  600. header: false,
  601. menu: true,
  602. menuWidth: 90,
  603. editBtn: false,
  604. delBtn: false,
  605. column: [
  606. {
  607. label: "商品名称",
  608. prop: "cname",
  609. overHidden: true,
  610. },
  611. {
  612. label: "仓库",
  613. prop: "storageName",
  614. overHidden: true,
  615. },
  616. {
  617. label: "库存数量",
  618. prop: "balanceQuantity",
  619. overHidden: true,
  620. },
  621. {
  622. label: "批次号",
  623. prop: "dot",
  624. overHidden: true,
  625. },
  626. ],
  627. },
  628. inventoryData: [],
  629. excelBox: false,
  630. reportName: "", // 打印传的名字
  631. SelectSearch: {}, // 添加商品检索
  632. // 编辑还是保存
  633. mingxibaocun: true,
  634. // 批次号请求到的数据
  635. picihaolist: [],
  636. // 添加商品弹窗
  637. dialogVisible: false,
  638. // 弹窗高度
  639. rowHeight: "",
  640. // 左侧选择搜索
  641. treeDataGoods: [],
  642. treeDeptId: "",
  643. page: {
  644. pageSize: 10,
  645. currentPage: 1,
  646. total: 0,
  647. pageSizes: [10, 50, 100, 300, 500],
  648. },
  649. pageList: {
  650. pageSize: 10,
  651. currentPage: 1,
  652. total: 0,
  653. },
  654. // 左侧选择
  655. treeOption: {
  656. addBtn: false,
  657. menu: false,
  658. size: "small",
  659. props: {
  660. labelText: "标题",
  661. label: "title",
  662. value: "id",
  663. },
  664. },
  665. templateUrl: "", // 模板url
  666. // 表格需要的配置
  667. optionTwo: {
  668. align: "center",
  669. height: "400",
  670. calcHeight: 80,
  671. stripe: true,
  672. tip: false,
  673. addBtn: false,
  674. searchShow: true,
  675. searchShowBtn: false,
  676. menu: true,
  677. viewBtn: false,
  678. editBtn: false,
  679. delBtn: false,
  680. menuWidth: 80,
  681. searchSpan: 8,
  682. searchMenuSpan: 8,
  683. searchMenuPosition: "right",
  684. border: true,
  685. index: true,
  686. selection: true,
  687. dialogClickModal: false,
  688. searchIcon: true,
  689. searchIndex: 2,
  690. column: [
  691. {
  692. label: "商品名称",
  693. prop: "cname",
  694. search: true,
  695. width: 100,
  696. overHidden: true,
  697. },
  698. {
  699. label: "商品编号",
  700. prop: "code",
  701. search: true,
  702. width: 100,
  703. overHidden: true,
  704. },
  705. {
  706. label: "数量",
  707. prop: "goodsNum",
  708. overHidden: true,
  709. width: 120,
  710. },
  711. {
  712. label: "单价",
  713. prop: "price",
  714. overHidden: true,
  715. width: 120,
  716. rules: [
  717. {
  718. required: true,
  719. message: " ",
  720. trigger: "blur",
  721. },
  722. ],
  723. },
  724. {
  725. label: "批次号",
  726. prop: "dot",
  727. width: "150",
  728. type: "select",
  729. disabled: true,
  730. allowCreate: true,
  731. filterable: true,
  732. dicData: [],
  733. props: {
  734. label: "dot",
  735. value: "dot",
  736. },
  737. dicUrl: "/api/gubersail-admin/tireStockDesc/dotList",
  738. overHidden: true,
  739. },
  740. {
  741. label: "是否批次号",
  742. prop: "whether",
  743. width: 100,
  744. type: "select",
  745. search: true,
  746. dicData: [
  747. {
  748. label: "否",
  749. value: "0",
  750. },
  751. {
  752. label: "是",
  753. value: "1",
  754. },
  755. ],
  756. },
  757. {
  758. label: "库存",
  759. prop: "inventory",
  760. addDisabled: false,
  761. multiple: true,
  762. overHidden: true,
  763. },
  764. {
  765. label: "规格型号",
  766. prop: "specificationAndModel",
  767. width: "120",
  768. slot: true,
  769. overHidden: true,
  770. search: true,
  771. },
  772. {
  773. label: "公司",
  774. prop: "salesCompanyName",
  775. slot: true,
  776. width: "120",
  777. overHidden: true,
  778. },
  779. {
  780. label: "商品分类",
  781. prop: "goodsTypeName",
  782. slot: true,
  783. overHidden: true,
  784. },
  785. {
  786. label: "品牌",
  787. prop: "brandName",
  788. slot: true,
  789. overHidden: true,
  790. },
  791. {
  792. label: "花纹",
  793. prop: "brandItem",
  794. width: "120",
  795. slot: true,
  796. overHidden: true,
  797. search: true,
  798. },
  799. {
  800. label: "是否静音棉",
  801. prop: "originalFactory",
  802. type: "select",
  803. search: true,
  804. hide: false,
  805. showColumn: true,
  806. width: 120,
  807. dicData: [
  808. {
  809. label: "否",
  810. value: "0",
  811. },
  812. {
  813. label: "是",
  814. value: "1",
  815. },
  816. ],
  817. },
  818. {
  819. label: "是否防爆",
  820. prop: "explosionProof",
  821. type: "select",
  822. search: true,
  823. hide: false,
  824. showColumn: true,
  825. width: 120,
  826. dicData: [
  827. {
  828. label: "否",
  829. value: 0,
  830. },
  831. {
  832. label: "是",
  833. value: 1,
  834. },
  835. ],
  836. },
  837. {
  838. label: "是否自修补",
  839. prop: "selfRecovery",
  840. type: "select",
  841. search: true,
  842. hide: false,
  843. showColumn: true,
  844. width: 120,
  845. dicData: [
  846. {
  847. label: "否",
  848. value: "0",
  849. },
  850. {
  851. label: "是",
  852. value: "1",
  853. },
  854. ],
  855. },
  856. {
  857. label: "共享公司",
  858. prop: "sharedCompany",
  859. slot: true,
  860. width: "120",
  861. overHidden: true,
  862. },
  863. ],
  864. },
  865. loading: false,
  866. // 商品列表数据合计
  867. goodsListShow: [],
  868. // 商品列表暂存
  869. goodsListSave: [],
  870. saveLoading: false,
  871. commodityData: false,
  872. surplusRouteQuantityOption: [],
  873. tableData: [],
  874. // tabs切换
  875. activeNameTabs: "searchList",
  876. data: [],
  877. courierCompaniesList: [],
  878. inventory: 0,
  879. isStatus: 1,
  880. goodsIdoptions: [],
  881. dataList: [],
  882. dicUrlWithCustomId: "",
  883. sharedCompanyId: 0,
  884. isAddBtn: true, // 添加商品的是否禁用
  885. isSaveBtn: false, // 大保存的是否禁用
  886. viewDisabled: false, // 大审批的是否禁用
  887. isAdd: false, // 表格按钮的是否点击
  888. editButton: true, // 大编辑大隐藏显示
  889. isEditButton: false, // 大编辑是否禁用
  890. goods: [],
  891. isDisabled: false, // 表格删除的是否禁用
  892. isDisabledTask: false, // 撤销任务和生成任务的是否禁用
  893. contactsOption: [],
  894. isContacts: false, // 表单的联系人是否禁用
  895. checkData: {},
  896. buttonText: "生成任务", // 生成任务和撤销任务文本
  897. buttonColor: "success", // 初始颜色为success 生成任务和撤销任务颜色状态
  898. checkScheduleDialog: false, // 审批进度的弹窗开启关闭
  899. isApplySettlement: true, // 申请退款的是否禁用
  900. isConfirmRefundBtn: true, // 确认退款的是否禁用
  901. isExamineBtn: true, // 审批是否禁用
  902. isRevocationRequest: true, // 撤销审核是否禁用
  903. checkDialog: false, // 审核弹窗的开启关闭
  904. checkId: "",
  905. batchNo: "",
  906. switchDialog: false, // 打印弹窗的开启和关闭
  907. activeName: "sale_detail",
  908. disabled: false, // 表格按钮的禁用
  909. key: 0,
  910. form: {
  911. orderItemsList: [],
  912. paymentRecordsList: [],
  913. outboundRecordsList: [],
  914. freight: 5,
  915. },
  916. excelOption: {
  917. submitBtn: false,
  918. emptyBtn: false,
  919. column: [
  920. {
  921. label: "模板下载",
  922. prop: "excelTemplate",
  923. formslot: true,
  924. span: 24,
  925. },
  926. {
  927. label: "导入明细",
  928. prop: "excelFile",
  929. type: "upload",
  930. drag: true,
  931. loadText: "上传中,请稍等",
  932. accept: ".xls,.xlsx",
  933. span: 24,
  934. propsHttp: {
  935. res: "data",
  936. },
  937. tip: "请上传 .xls,.xlsx 标准格式文件",
  938. action: "/api/gubersail-admin/ship/import-item",
  939. },
  940. ],
  941. },
  942. customerData: [], // 店铺名称数据
  943. optionForm: {
  944. menuBtn: false,
  945. span: 8,
  946. disabled: false,
  947. column: [
  948. {
  949. label: "店铺名称",
  950. prop: "customerName",
  951. disabled: false,
  952. formslot: true,
  953. rules: [
  954. {
  955. required: true,
  956. message: " ",
  957. trigger: "blur",
  958. },
  959. ],
  960. },
  961. {
  962. label: "业务员",
  963. disabled: false,
  964. prop: "salerName",
  965. rules: [
  966. {
  967. required: true,
  968. message: " ",
  969. trigger: "blur",
  970. },
  971. ],
  972. },
  973. // {
  974. // label: "仓库",
  975. // prop: "storageId",
  976. // type: "select",
  977. // disabled: false,
  978. // placeholder: "仓库为空即为异地销售",
  979. // props: {
  980. // label: "cname",
  981. // value: "id",
  982. // },
  983. // dicUrl: "/api/gubersail-admin/storageDesc/listAll",
  984. // // rules: [{
  985. // // required: true,
  986. // // message: " ",
  987. // // trigger: "blur"
  988. // // }]
  989. // },
  990. {
  991. label: "联系人",
  992. type: "select",
  993. prop: "contacts",
  994. disabled: false,
  995. allowCreate: true,
  996. filterable: true,
  997. dicData: [],
  998. props: {
  999. label: "address",
  1000. value: "id",
  1001. },
  1002. dicUrl: "/api/gubersail-admin/corpsAddr/corpIdByAddr?pid={{key}}",
  1003. },
  1004. {
  1005. label: "电话",
  1006. disabled: false,
  1007. prop: "phone",
  1008. },
  1009. {
  1010. label: "收货地址",
  1011. prop: "recAddress",
  1012. type: "select",
  1013. allowCreate: true,
  1014. filterable: true,
  1015. disabled: false,
  1016. props: {
  1017. label: "address",
  1018. value: "address",
  1019. },
  1020. dicUrl: "/api/gubersail-admin/corpsAddr/corpIdByAddr?pid={{key}}",
  1021. },
  1022. {
  1023. label: "业务日期",
  1024. prop: "businesDate",
  1025. searchProp: "businesDateList",
  1026. disabled: false,
  1027. type: "datetime",
  1028. value: dateFormat(new Date(), "yyyy-MM-dd"),
  1029. format: "yyyy-MM-dd",
  1030. valueFormat: "yyyy-MM-dd",
  1031. rules: [
  1032. {
  1033. required: true,
  1034. message: "",
  1035. trigger: "blur",
  1036. },
  1037. ],
  1038. },
  1039. {
  1040. label: "收款方式",
  1041. prop: "receivableType",
  1042. type: "select",
  1043. disabled: false,
  1044. dicUrl: "/api/blade-system/dict-biz/dictionary?code=receivableType",
  1045. props: {
  1046. label: "dictValue",
  1047. value: "dictValue",
  1048. },
  1049. value: "网络支付",
  1050. },
  1051. {
  1052. label: "业务来源",
  1053. prop: "businessSource",
  1054. disabled: true,
  1055. },
  1056. {
  1057. label: "配送方式",
  1058. type: "select",
  1059. prop: "shipType",
  1060. disabled: false,
  1061. dicUrl: "/api/blade-system/dict-biz/dictionary?code=deliveryMethod",
  1062. props: {
  1063. label: "dictValue",
  1064. value: "dictValue",
  1065. },
  1066. value: "物流",
  1067. },
  1068. {
  1069. label: "货运公司",
  1070. type: "select",
  1071. prop: "logisticsCorpName",
  1072. allowCreate: true,
  1073. filterable: true,
  1074. disabled: false,
  1075. dicUrl: "/api/blade-system/dict-biz/dictionary?code=tyre_express_company",
  1076. props: {
  1077. label: "dictValue",
  1078. value: "dictValue",
  1079. },
  1080. },
  1081. {
  1082. label: "货运单号",
  1083. disabled: false,
  1084. prop: "expressNo",
  1085. },
  1086. {
  1087. label: "成本",
  1088. prop: "cost",
  1089. display: false,
  1090. disabled: true,
  1091. },
  1092. {
  1093. label: "毛利",
  1094. prop: "grossProfit",
  1095. display: false,
  1096. disabled: true,
  1097. },
  1098. {
  1099. label: "销售金额",
  1100. prop: "salesAmount",
  1101. disabled: true,
  1102. },
  1103. {
  1104. label: "运费",
  1105. prop: "freight",
  1106. disabled: true,
  1107. },
  1108. {
  1109. label: "总金额",
  1110. prop: "totalMoney",
  1111. disabled: true,
  1112. },
  1113. {
  1114. label: "余额抵扣",
  1115. prop: "paymentRecoveredBalance",
  1116. overHidden: true,
  1117. disabled: true,
  1118. },
  1119. {
  1120. label: "已收金额",
  1121. prop: "paymentAmountTl",
  1122. disabled: true,
  1123. },
  1124. {
  1125. label: "单据编号",
  1126. prop: "ordNo",
  1127. disabled: true,
  1128. },
  1129. {
  1130. label: "来源单号",
  1131. prop: "srcOrdNo",
  1132. disabled: true,
  1133. },
  1134. {
  1135. label: "退货数量",
  1136. prop: "returnsNumber",
  1137. disabled: true,
  1138. },
  1139. {
  1140. label: "退货金额",
  1141. prop: "returnsAmount",
  1142. disabled: true,
  1143. },
  1144. {
  1145. label: "出库日期",
  1146. prop: "deliveryBusinesDate",
  1147. disabled: true,
  1148. type: "datetime",
  1149. format: "yyyy-MM-dd",
  1150. valueFormat: "yyyy-MM-dd HH:mm:ss",
  1151. },
  1152. {
  1153. label: "备注",
  1154. prop: "remarks",
  1155. type: "textarea",
  1156. disabled: false,
  1157. span: 16,
  1158. minRows: 1,
  1159. },
  1160. ],
  1161. },
  1162. formContacts: {},
  1163. optionContacts: {
  1164. disabled: false,
  1165. goodsId: "",
  1166. border: true,
  1167. align: "center",
  1168. index: true,
  1169. addBtnText: "添加商品",
  1170. updateBtnText: "保存",
  1171. refreshBtn: false,
  1172. dialogDrag: true,
  1173. addBtn: false,
  1174. span: 8,
  1175. height: 500,
  1176. // addRowBtn: false,
  1177. editBtn: false,
  1178. delBtn: false,
  1179. menuWidth: 140,
  1180. dialogTop: 25,
  1181. dialogWidth: "80%",
  1182. summaryText: "合计",
  1183. showSummary: true,
  1184. selection: true,
  1185. sumColumnList: [
  1186. {
  1187. name: "goodsNum",
  1188. type: "sum",
  1189. },
  1190. {
  1191. name: "sendNum",
  1192. type: "sum",
  1193. },
  1194. {
  1195. name: "profit",
  1196. type: "sum",
  1197. },
  1198. {
  1199. name: "subTotalMoney",
  1200. type: "sum",
  1201. },
  1202. {
  1203. name: "thisAmount",
  1204. type: "sum",
  1205. },
  1206. {
  1207. name: "costprie",
  1208. type: "sum",
  1209. },
  1210. {
  1211. name: "grossProfit",
  1212. type: "sum",
  1213. },
  1214. {
  1215. name: "returnsNumber",
  1216. type: "sum",
  1217. },
  1218. {
  1219. name: "returnsAmount",
  1220. type: "sum",
  1221. },
  1222. ],
  1223. column: [
  1224. {
  1225. label: "商品名称",
  1226. prop: "goodsId",
  1227. width: 250,
  1228. disabled: false,
  1229. remote: true,
  1230. overHidden: true,
  1231. hide: true,
  1232. type: "select",
  1233. dicData: [],
  1234. props: {
  1235. label: "goodsName",
  1236. value: "goodsId",
  1237. },
  1238. // dicUrl: '/api/gubersail-admin/goodsDesc/goodsListAll?cname={{key}}'
  1239. dicUrl: `/api/gubersail-admin/goodsDesc/goodsListXs?cname={{key}}&customId=&enableOrNot=1&stock=${this.goodsId}`,
  1240. // dicUrl: "/api/gubersail-admin/goodsDesc/goodsListXs?cname={{key}}"
  1241. },
  1242. {
  1243. label: "商品名称",
  1244. prop: "goodsName",
  1245. width: 250,
  1246. disabled: false,
  1247. remote: true,
  1248. overHidden: true,
  1249. },
  1250. {
  1251. label: "发货仓库",
  1252. prop: "storageName",
  1253. width: 120,
  1254. overHidden: true,
  1255. },
  1256. {
  1257. label: "库区",
  1258. prop: "reservoirArea",
  1259. width: 120,
  1260. overHidden: true,
  1261. },
  1262. {
  1263. label: "库存",
  1264. prop: "inventory",
  1265. width: 250,
  1266. disabled: false,
  1267. remote: true,
  1268. overHidden: true,
  1269. },
  1270. {
  1271. label: "数量",
  1272. prop: "goodsNum",
  1273. overHidden: true,
  1274. // cell: true,
  1275. width: 100,
  1276. rules: [
  1277. {
  1278. required: true,
  1279. message: " ",
  1280. trigger: "blur",
  1281. },
  1282. // {
  1283. // validator: (rule, value, callback) => {
  1284. // console.log(this.formContacts.inventory);
  1285. // if (value < 0) {
  1286. // callback(new Error("数量不能小于0"));
  1287. // } else if (Number(value) > Number(this.formContacts.inventory)) {
  1288. // callback(new Error("数量不能大于库存"));
  1289. // } else {
  1290. // callback();
  1291. // }
  1292. // },
  1293. // trigger: "blur",
  1294. // },
  1295. ],
  1296. },
  1297. {
  1298. label: "价格",
  1299. prop: "price",
  1300. overHidden: true,
  1301. width: 100,
  1302. cell: true,
  1303. rules: [
  1304. {
  1305. required: true,
  1306. message: " ",
  1307. trigger: "blur",
  1308. },
  1309. {
  1310. validator: (rule, value, callback) => {
  1311. if (value < 0) {
  1312. callback(new Error("价格不能小于0"));
  1313. } else {
  1314. callback();
  1315. }
  1316. },
  1317. trigger: "blur",
  1318. },
  1319. ],
  1320. },
  1321. {
  1322. label: "库存",
  1323. prop: "inventory",
  1324. overHidden: true,
  1325. hide: true,
  1326. width: 100,
  1327. },
  1328. {
  1329. label: "批次号",
  1330. prop: "dot",
  1331. cell: true,
  1332. type: "select",
  1333. width: 120,
  1334. allowCreate: true,
  1335. filterable: true,
  1336. dicData: [],
  1337. props: {
  1338. label: "dot",
  1339. value: "dot",
  1340. },
  1341. dicUrl: "/api/gubersail-admin/tireStockDesc/dotList",
  1342. overHidden: true,
  1343. },
  1344. // {
  1345. // label: '单号',
  1346. // prop: 'poNo',
  1347. // overHidden: true,
  1348. // disabled: false,
  1349. // width: 100
  1350. // },
  1351. {
  1352. label: "商品编码",
  1353. prop: "goodsNo",
  1354. overHidden: true,
  1355. disabled: false,
  1356. width: 100,
  1357. },
  1358. {
  1359. label: "品牌",
  1360. prop: "brandName",
  1361. disabled: false,
  1362. width: 100,
  1363. overHidden: true,
  1364. },
  1365. {
  1366. label: "规格型号",
  1367. prop: "propertyName",
  1368. overHidden: true,
  1369. disabled: false,
  1370. width: 100,
  1371. },
  1372. {
  1373. label: "花纹",
  1374. prop: "pattern",
  1375. overHidden: true,
  1376. disabled: false,
  1377. width: 100,
  1378. },
  1379. {
  1380. label: "商品描述",
  1381. prop: "goodsDescription",
  1382. disabled: false,
  1383. overHidden: true,
  1384. width: 100,
  1385. },
  1386. {
  1387. label: "单位",
  1388. prop: "units",
  1389. type: "select",
  1390. disabled: false,
  1391. props: {
  1392. label: "dictValue",
  1393. value: "dictValue",
  1394. },
  1395. dicUrl: "/api/blade-system/dict-biz/dictionary?code=unit",
  1396. overHidden: true,
  1397. width: 100,
  1398. },
  1399. {
  1400. label: "发货数量",
  1401. prop: "sendNum",
  1402. overHidden: true,
  1403. width: 100,
  1404. disabled: true,
  1405. editDisplay: false,
  1406. addDisplay: false,
  1407. },
  1408. // {
  1409. // label: '利润',
  1410. // prop: 'profit',
  1411. // overHidden: true,
  1412. // width: 100
  1413. // },
  1414. {
  1415. label: "小计",
  1416. prop: "subTotalMoney",
  1417. overHidden: true,
  1418. width: 100,
  1419. disabled: true,
  1420. editDisplay: false,
  1421. addDisplay: false,
  1422. },
  1423. // {
  1424. // label: '返利',
  1425. // prop: 'thisAmount',
  1426. // overHidden: true,
  1427. // width: 100
  1428. // },
  1429. {
  1430. label: "成本",
  1431. prop: "costprie",
  1432. overHidden: true,
  1433. width: 100,
  1434. disabled: true,
  1435. editDisplay: false,
  1436. addDisplay: false,
  1437. },
  1438. {
  1439. label: "毛利",
  1440. prop: "grossProfit",
  1441. overHidden: true,
  1442. width: 100,
  1443. disabled: true,
  1444. editDisplay: false,
  1445. addDisplay: false,
  1446. },
  1447. {
  1448. label: "返利后单价",
  1449. prop: "rebatePrice",
  1450. overHidden: true,
  1451. width: 100,
  1452. disabled: true,
  1453. editDisplay: false,
  1454. addDisplay: false,
  1455. hide: false,
  1456. showColumn: true,
  1457. },
  1458. {
  1459. label: "返利后成本价",
  1460. prop: "rebateCostprie",
  1461. overHidden: true,
  1462. width: 100,
  1463. disabled: true,
  1464. editDisplay: false,
  1465. addDisplay: false,
  1466. hide: false,
  1467. showColumn: true,
  1468. },
  1469. {
  1470. label: "返利后利润",
  1471. prop: "rebateProfit",
  1472. overHidden: true,
  1473. width: 100,
  1474. disabled: true,
  1475. editDisplay: false,
  1476. addDisplay: false,
  1477. hide: false,
  1478. showColumn: true,
  1479. },
  1480. {
  1481. label: "退货数量",
  1482. prop: "returnsNumber",
  1483. overHidden: true,
  1484. width: 100,
  1485. disabled: true,
  1486. },
  1487. {
  1488. label: "退货金额",
  1489. prop: "returnsAmount",
  1490. overHidden: true,
  1491. width: 100,
  1492. disabled: true,
  1493. },
  1494. {
  1495. label: "备注",
  1496. prop: "remarks",
  1497. overHidden: true,
  1498. width: 100,
  1499. disabled: false,
  1500. },
  1501. ],
  1502. },
  1503. selectionMultilist: [], // 多选数据
  1504. optionPaymentDetails: {
  1505. align: "center",
  1506. index: true,
  1507. addBtnText: "录入明细",
  1508. menu: false,
  1509. refreshBtn: false,
  1510. dialogDrag: true,
  1511. addBtn: false,
  1512. span: 8,
  1513. height: 600,
  1514. addRowBtn: false,
  1515. editBtn: false,
  1516. delBtn: false,
  1517. menuWidth: 140,
  1518. dialogTop: 25,
  1519. dialogWidth: "80%",
  1520. column: [
  1521. {
  1522. label: "支付编号",
  1523. prop: "serialNumber",
  1524. },
  1525. {
  1526. label: "金额",
  1527. prop: "amount",
  1528. },
  1529. {
  1530. label: "类型",
  1531. prop: "type",
  1532. },
  1533. {
  1534. label: "支付时间",
  1535. prop: "createTime",
  1536. },
  1537. ],
  1538. },
  1539. optionOutboundRecords: {
  1540. align: "center",
  1541. index: true,
  1542. menu: false,
  1543. addBtnText: "录入明细",
  1544. refreshBtn: false,
  1545. dialogDrag: true,
  1546. addBtn: false,
  1547. span: 8,
  1548. height: 600,
  1549. addRowBtn: false,
  1550. editBtn: false,
  1551. delBtn: false,
  1552. // menuWidth: 140,
  1553. dialogTop: 25,
  1554. dialogWidth: "80%",
  1555. column: [
  1556. {
  1557. label: "出库单号",
  1558. prop: "billno",
  1559. },
  1560. // {
  1561. // label: '来源单号',
  1562. // prop: 'ordNo'
  1563. // },
  1564. {
  1565. label: "数量",
  1566. prop: "goodsTotalNum",
  1567. },
  1568. {
  1569. label: "实际数量",
  1570. prop: "sendTotalNum",
  1571. },
  1572. {
  1573. label: "业务类型",
  1574. prop: "bizTypeName",
  1575. },
  1576. {
  1577. label: "状态",
  1578. prop: "statusName",
  1579. },
  1580. {
  1581. label: "业务时间",
  1582. prop: "createTime",
  1583. },
  1584. ],
  1585. },
  1586. };
  1587. },
  1588. components: { SearchQuery, dicSelect },
  1589. props: {
  1590. onLoad: Object,
  1591. detailData: Object,
  1592. },
  1593. async created() {
  1594. console.log(this.detailData.id);
  1595. console.log(JSON.parse(localStorage.getItem("saber-tenantId")).content, 959);
  1596. if (JSON.parse(localStorage.getItem("saber-tenantId")).content == "069164") {
  1597. this.reportName = "轮胎商城-玉玲珑销售单";
  1598. } else {
  1599. this.reportName = "轮胎商城-销售订单";
  1600. }
  1601. getWorkDicts("tyre_express_company").then((res) => {
  1602. this.courierCompaniesList = res.data.data;
  1603. });
  1604. this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
  1605. if (this.formContacts.goodsId !== value) {
  1606. goodsDetail({
  1607. id: value,
  1608. customId: this.dicUrlWithCustomId,
  1609. stock: this.form.storageId ? this.form.storageId : "",
  1610. }).then((res) => {
  1611. this.goods = res.data.data;
  1612. this.formContacts.goodsNo = res.data.data.code;
  1613. this.formContacts.brandId = res.data.data.brandId;
  1614. this.formContacts.inventory = res.data.data.inventory;
  1615. this.formContacts.propertyName = res.data.data.specificationAndModel;
  1616. this.formContacts.pattern = res.data.data.brandItem;
  1617. this.formContacts.goodsDescription = res.data.data.goodsDescription;
  1618. this.formContacts.units = res.data.data.unit;
  1619. this.formContacts.price = res.data.data.price;
  1620. this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId;
  1621. console.log(res.data.data.sharedCompanyId);
  1622. console.log(res.data.data.sharedCompanyName);
  1623. this.form.sharedCompanyId = res.data.data.sharedCompanyId;
  1624. this.form.sharedCompanyName = res.data.data.sharedCompanyName;
  1625. this.sharedCompanyId = res.data.data.sharedCompanyId;
  1626. console.log(res.data.data.sharedCompanyId);
  1627. console.log(this.form.orderItemsList);
  1628. for (let i = 0; i < this.form.orderItemsList.length; i++) {
  1629. console.log(Number(this.form.orderItemsList[i].sharedCompanyId));
  1630. if (Number(this.form.orderItemsList[i].sharedCompanyId) != Number(res.data.data.sharedCompanyId)) {
  1631. this.isStatus = 0;
  1632. }
  1633. }
  1634. if (res.data.data.whether == 0) {
  1635. this.findObject(this.optionContacts.column, "dot").disabled = true;
  1636. } else {
  1637. this.findObject(this.optionContacts.column, "dot").disabled = false;
  1638. dotList({
  1639. storageId: this.form.storageId,
  1640. goodsId: this.formContacts.goodsId,
  1641. }).then((res) => {
  1642. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
  1643. });
  1644. }
  1645. // this.formContacts.goodsId = res.data.data.cname
  1646. // this.formContacts.goodsName = res.data.data.id
  1647. });
  1648. }
  1649. };
  1650. isProcurement({ param: "whether.model" }).then((res) => {
  1651. if (res.data.data == 1) {
  1652. this.findObject(this.optionContacts.column, "pattern").label = "规格型号1";
  1653. this.findObject(this.optionTwo.column, "brandItem").label = "规格型号1";
  1654. this.findObject(this.optionTwo.column, "originalFactory").search = false;
  1655. this.findObject(this.optionTwo.column, "explosionProof").search = false;
  1656. this.findObject(this.optionTwo.column, "selfRecovery").search = false;
  1657. this.findObject(this.optionTwo.column, "explosionProof").hide = true;
  1658. this.findObject(this.optionTwo.column, "originalFactory").hide = true;
  1659. this.findObject(this.optionTwo.column, "selfRecovery").hide = true;
  1660. this.findObject(this.optionContacts.column, "rebatePrice").hide = true;
  1661. this.findObject(this.optionContacts.column, "rebateCostprie").hide = true;
  1662. this.findObject(this.optionContacts.column, "rebateProfit").hide = true;
  1663. this.findObject(this.optionTwo.column, "explosionProof").showColumn = false;
  1664. this.findObject(this.optionTwo.column, "originalFactory").showColumn = false;
  1665. this.findObject(this.optionTwo.column, "selfRecovery").showColumn = false;
  1666. this.findObject(this.optionContacts.column, "rebatePrice").showColumn = true;
  1667. this.findObject(this.optionContacts.column, "rebateCostprie").showColumn = true;
  1668. this.findObject(this.optionContacts.column, "rebateProfit").showColumn = true;
  1669. }
  1670. });
  1671. this.findObject(this.optionContacts.column, "goodsId").change = ({ value, column }) => {
  1672. if (this.formContacts.goodsId !== value) {
  1673. goodsDetail({
  1674. id: value,
  1675. customId: this.dicUrlWithCustomId,
  1676. stock: this.form.storageId ? this.form.storageId : "",
  1677. }).then((res) => {
  1678. this.goods = res.data.data;
  1679. this.formContacts.goodsNo = res.data.data.code;
  1680. this.formContacts.brandId = res.data.data.brandId;
  1681. this.formContacts.inventory = res.data.data.inventory;
  1682. // this.formContacts.brandId = res.data.data.brandName
  1683. // this.formContacts.brandName = res.data.data.brandId
  1684. this.formContacts.propertyName = res.data.data.specificationAndModel;
  1685. this.formContacts.pattern = res.data.data.brandItem;
  1686. this.formContacts.goodsDescription = res.data.data.goodsDescription;
  1687. this.formContacts.dotListunits = res.data.data.unit;
  1688. this.sharedCompanyId = res.data.data.sharedCompanyId;
  1689. this.formContacts.sharedCompanyId = res.data.data.sharedCompanyId;
  1690. //
  1691. this.form.sharedCompanyId = res.data.data.sharedCompanyId;
  1692. this.form.sharedCompanyName = res.data.data.sharedCompanyName;
  1693. for (let i = 0; i < this.form.orderItemsList.length; i++) {
  1694. if (this.form.orderItemsList[i].sharedCompanyId != res.data.data.sharedCompanyId) {
  1695. this.isStatus = 0;
  1696. }
  1697. }
  1698. if (res.data.data.whether == 0) {
  1699. this.findObject(this.optionContacts.column, "dot").disabled = true;
  1700. } else {
  1701. this.findObject(this.optionContacts.column, "dot").disabled = false;
  1702. dotList({
  1703. storageId: this.form.storageId,
  1704. goodsId: this.formContacts.goodsId,
  1705. }).then((res) => {
  1706. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
  1707. });
  1708. }
  1709. // this.formContacts.goodsId = res.data.data.cname
  1710. // this.formContacts.goodsName = res.data.data.id
  1711. });
  1712. }
  1713. };
  1714. this.key++;
  1715. if (this.onLoad.id && this.detailData.id) {
  1716. this.isContacts = true;
  1717. this.isDisabled = true;
  1718. //添加删除按钮禁用
  1719. this.isAdd = true;
  1720. this.getDetail(this.onLoad.id, true);
  1721. } else if (this.onLoad.id) {
  1722. console.log(2);
  1723. this.getDetail(this.onLoad.id, true);
  1724. }
  1725. if (!this.form.id) {
  1726. console.log(3);
  1727. this.isSaveBtn = true;
  1728. this.isDisabledTask = true;
  1729. this.viewDisabled = true;
  1730. }
  1731. if (!this.detailData.id) {
  1732. this.editDis = false;
  1733. this.editButton = false;
  1734. this.isAddBtn = false;
  1735. this.isDisabledTask = false;
  1736. this.isSaveBtn = false;
  1737. this.viewDisabled = false;
  1738. this.form.businessSource = "内部销售";
  1739. isProcurement({ param: "freight" }).then((res) => {
  1740. // res.data.data === '1'
  1741. this.form.freight = res.data.data;
  1742. });
  1743. }
  1744. if (this.detailData.check) {
  1745. this.isExamineBtn = false;
  1746. // this.batchNo = this.detailData.check.batchNo
  1747. }
  1748. //成本、毛利对业务员隐藏
  1749. this.optionForm.column.forEach((its) => {
  1750. if (JSON.parse(localStorage.getItem("saber-userInfo")).content.role_name.split(",").includes("业务员")) {
  1751. if (its.prop == "cost" || its.prop == "grossProfit") {
  1752. this.$set(its, "display", false);
  1753. }
  1754. } else {
  1755. if (its.prop == "cost" || its.prop == "grossProfit") {
  1756. this.$set(its, "display", true);
  1757. }
  1758. }
  1759. });
  1760. // 明细信息成本、毛利对业务员隐藏
  1761. this.optionContacts.column.forEach((its) => {
  1762. if (JSON.parse(localStorage.getItem("saber-userInfo")).content.role_name.split(",").includes("业务员")) {
  1763. if (its.prop == "costprie" || its.prop == "grossProfit") {
  1764. this.$set(its, "hide", true);
  1765. }
  1766. } else {
  1767. if (its.prop == "costprie" || its.prop == "grossProfit") {
  1768. this.$set(its, "hide", false);
  1769. }
  1770. }
  1771. });
  1772. // if (this.detailData.id) {
  1773. // this.getDetailsfun()
  1774. // }
  1775. isProcurement({ param: "number.decimal" }).then((res) => {
  1776. this.numberDecimal = res.data.data ? Number(res.data.data) : 0;
  1777. });
  1778. },
  1779. watch: {
  1780. dicUrlWithCustomId() {
  1781. console.log(this.form);
  1782. // this.findObject(this.optionContacts.column, "goodsId").dicUrl = `/api/gubersail-admin/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=0`
  1783. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : "").then((res) => {
  1784. this.findObject(this.optionContacts.column, "goodsId").dicData = res.data.data;
  1785. });
  1786. },
  1787. "form.storageId"(newStorageId, oldStorageId) {
  1788. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : "").then((res) => {
  1789. console.log(res.data.data, "2");
  1790. this.findObject(this.optionContacts.column, "goodsId").dicData = res.data.data;
  1791. });
  1792. },
  1793. // 'form.orderItemsList.length'(newformContacts, oldformContacts) {
  1794. // console.log(this.formContacts);
  1795. // console.log(this.form.orderItemsList);
  1796. // // for (let i = 0; i < this.form.orderItemsList.length - 1; i++) {
  1797. // // const currentItem = this.form.orderItemsList[i];
  1798. // // const nextItem = this.form.orderItemsList[i + 1];
  1799. // // if (currentItem.sharedCompanyId !== nextItem.sharedCompanyId) {
  1800. // // console.log('不能添加');
  1801. // // }
  1802. // // }
  1803. // if (this.form.orderItemsList.length) {
  1804. // this.findObject(this.optionForm.column, 'storageId').disabled = true
  1805. // } else {
  1806. // this.findObject(this.optionForm.column, 'storageId').disabled = false
  1807. // }
  1808. // },
  1809. "form.sharedCompanyId"(newSharedCompanyId, oldSharedCompanyId) {
  1810. console.log(newSharedCompanyId, oldSharedCompanyId);
  1811. if (newSharedCompanyId != oldSharedCompanyId) {
  1812. console.log("不能添加");
  1813. }
  1814. console.log(this.sharedCompanyId);
  1815. },
  1816. $route(to, from) {
  1817. if (this.onLoad.id && this.detailData.id) {
  1818. this.$set(this.optionForm, "disabled", true);
  1819. this.$set(this.optionContacts, "disabled", true);
  1820. this.isContacts = true;
  1821. this.isDisabled = true;
  1822. this.isAdd = true;
  1823. this.getDetail(this.onLoad.id, true);
  1824. } else if (this.onLoad.id) {
  1825. this.getDetail(this.onLoad.id, true);
  1826. }
  1827. if (this.detailData.status == 1) {
  1828. this.isExamineBtn = false;
  1829. }
  1830. },
  1831. },
  1832. methods: {
  1833. rowDicChange(name, row, el) {
  1834. if (name == "reservoirArea") {
  1835. if (row) {
  1836. el.reservoirAreaId = row.id;
  1837. } else {
  1838. el.reservoirArea = null;
  1839. el.reservoirAreaId = null;
  1840. }
  1841. }
  1842. },
  1843. viewInventory() {
  1844. this.inventoryData = [];
  1845. inventoryList({ cname: this.selectionMultilist[0].goodsName }).then((res) => [
  1846. (this.inventoryData = res.data.data.records),
  1847. ]);
  1848. },
  1849. viewInventory2() {
  1850. inventoryList({ cname: this.selectionMultilist[0].goodsName }).then((res) => [
  1851. (this.inventoryData2 = res.data.data.records),
  1852. // res.data.data.records.forEach(item => {
  1853. // if (item.storageId == this.form.storageId && item.dot == this.selectionMultilist[0].dot) {
  1854. // if (Number(item.balanceQuantity) == Number(this.selectionMultilist[0].inventory)) {
  1855. // this.$message.success("库存一致,不需要同步");
  1856. // }
  1857. // if (Number(item.balanceQuantity) != Number(this.selectionMultilist[0].inventory)) {
  1858. // this.$confirm('是否更新库存', '提示', {
  1859. // confirmButtonText: '确定',
  1860. // cancelButtonText: '取消',
  1861. // type: 'warning'
  1862. // }).then(() => {
  1863. // this.form.orderItemsList.forEach(e => {
  1864. // if (e.goodsName == this.selectionMultilist[0].goodsName) {
  1865. // e.inventory = item.balanceQuantity
  1866. // }
  1867. // })
  1868. // // this.editCustomer()
  1869. // })
  1870. // }
  1871. // }
  1872. // })
  1873. ]);
  1874. },
  1875. synchronous(row) {
  1876. this.form.orderItemsList.forEach((e) => {
  1877. if (e.goodsName == this.selectionMultilist[0].goodsName) {
  1878. e.inventory = row.balanceQuantity;
  1879. e.dot = row.dot;
  1880. }
  1881. });
  1882. },
  1883. uploadAfter(res, done, loading, column) {
  1884. if (Array.isArray(res)) {
  1885. if (res instanceof Array) {
  1886. this.form.orderItemsList = this.form.orderItemsList.concat(res);
  1887. res.forEach((item) => {
  1888. dotList({
  1889. storageId: this.form.storageId,
  1890. goodsId: res.goodsId,
  1891. }).then((e) => {
  1892. this.findObject(this.optionContacts.column, "dot").dicData = e.data.data;
  1893. });
  1894. });
  1895. }
  1896. } else {
  1897. this.$message.error(res);
  1898. }
  1899. this.excelBox = false;
  1900. loading = false;
  1901. done(res);
  1902. },
  1903. derivation() {
  1904. window.open(`${this.templateUrl}?${this.website.tokenHeader}=${getToken()}&stockId=${this.form.storageId}`);
  1905. },
  1906. uploadBefore(file, done, loading) {
  1907. done();
  1908. loading = true;
  1909. },
  1910. // 销售明细 导入按钮
  1911. excelDialogfun(name) {
  1912. if (!this.form.customerId) {
  1913. this.$message.error("请选择店铺名称");
  1914. return;
  1915. }
  1916. if (name == "名称") {
  1917. this.findObject(this.excelOption.column, "excelFile").action = "/api/gubersail-admin/order/import-item-name";
  1918. this.templateUrl = "/api/gubersail-admin/order/export-item-name";
  1919. } else if (name == "code") {
  1920. this.findObject(this.excelOption.column, "excelFile").action = "/api/gubersail-admin/order/import-item-code";
  1921. this.templateUrl = "/api/gubersail-admin/order/export-item-code";
  1922. }
  1923. this.excelBox = true;
  1924. },
  1925. //生成退货单
  1926. getReturns() {
  1927. this.$confirm("您确定要退货吗?", {
  1928. confirmButtonText: "确定",
  1929. cancelButtonText: "取消",
  1930. type: "warning",
  1931. }).then(() => {
  1932. this.$router.push({
  1933. path: "/salesService/returns/index",
  1934. query: {
  1935. bsType: "TKXS",
  1936. id: this.form.id,
  1937. },
  1938. });
  1939. });
  1940. },
  1941. // 店铺名称监听
  1942. KHcorpChange(value) {
  1943. for (let item of this.customerData) {
  1944. if (item.cname == value) {
  1945. this.$set(this.form, "customerId", item.id);
  1946. this.$set(this.form, "customerName", item.cname);
  1947. getCustom({ id: item.id }).then((res) => {
  1948. if (res.data.data) {
  1949. this.dicUrlWithCustomId = res.data.data.id ? res.data.data.id : "";
  1950. this.form.storageId = res.data.data.deliveryWarehouseId;
  1951. this.form.storageName = res.data.data.deliveryWarehouseName;
  1952. this.form.contacts = res.data.data.corpsAttnList[0].cname;
  1953. this.form.phone = res.data.data.corpsAttnList[0].tel;
  1954. this.contactsOption = res.data.data.corpsAddrList;
  1955. this.form.recAddress =res.data.data.corpsAddrList[0].detailedAddress;
  1956. this.form.salerId = res.data.data.salesmanId ? res.data.data.salesmanId : "";
  1957. this.form.salerName = res.data.data.salesmanName ? res.data.data.salesmanName : "";
  1958. }
  1959. if (!res.data.data.deliveryWarehouseId) {
  1960. return this.$message.error("请维护店铺名称的发货仓库");
  1961. }
  1962. });
  1963. }
  1964. }
  1965. },
  1966. KHClear() {
  1967. this.form.customerId = "";
  1968. this.form.customerName = "";
  1969. this.dicUrlWithCustomId = "";
  1970. this.form.storageId = "";
  1971. this.form.contacts = "";
  1972. this.form.phone = "";
  1973. this.contactsOption = "";
  1974. this.form.recAddress = "";
  1975. this.form.salerId = "";
  1976. this.form.salerName = "";
  1977. this.KHgetListfun();
  1978. },
  1979. // 获取店铺名称数据
  1980. KHgetListfun(cname) {
  1981. KHgetList({
  1982. current: 1,
  1983. size: 10,
  1984. corpType: "KH",
  1985. enableOrNot: 1,
  1986. cname: cname ? cname : null,
  1987. }).then((res) => {
  1988. this.customerData = res.data.data.records;
  1989. });
  1990. },
  1991. // 获取详细明细信息
  1992. getDetailsfun() {
  1993. getDetails({
  1994. id: this.detailData.id,
  1995. }).then((res) => {
  1996. this.form = res.data.data;
  1997. this.form.orderItemsList = res.data.data.orderItemsList;
  1998. console.log(this.isEditButton, "bianj");
  1999. console.log(this.isDisabledTask, "chexiao");
  2000. console.log(this.buttonColor, "123");
  2001. // if (this.form.status == '待发货') {
  2002. //
  2003. // }
  2004. });
  2005. },
  2006. // 获取左侧筛选
  2007. getAllWorkDicts() {
  2008. getCorpTypes({ whetherIntegral: "0" }).then((res) => {
  2009. this.treeDataGoods = res.data.data;
  2010. });
  2011. },
  2012. //导入页左商品类型查询
  2013. nodeClick(data) {
  2014. this.treeDeptId = data.id;
  2015. this.page.currentPage = 1;
  2016. this.onLoadfun(this.page, { ...this.SelectSearch, goodsTypeId: this.treeDeptId });
  2017. },
  2018. closeGoods() {
  2019. this.treeDataGoods = [];
  2020. this.treeDeptId = "";
  2021. this.activeNameTabs = "searchList";
  2022. this.goodsType = 1;
  2023. },
  2024. //刷新触发
  2025. refreshChange() {
  2026. this.page.currentPage = 1;
  2027. this.onLoadfun(this.page);
  2028. },
  2029. //选中触发
  2030. selectionChange(list) {
  2031. this.tableData = list;
  2032. },
  2033. // 点击搜索触发
  2034. goodsSearch(params, done) {
  2035. this.page.currentPage = 1;
  2036. params = {
  2037. ...params,
  2038. artsVision: this.form.belongToCorpId,
  2039. };
  2040. // params.specificationAndModel = params.cname
  2041. // delete params.cname
  2042. this.onLoadfun(this.page, params);
  2043. done();
  2044. },
  2045. dicChange(name, row) {
  2046. if (name == "salerName") {
  2047. if (row) {
  2048. this.form.salerId = row.id;
  2049. this.form.salerName = row.name;
  2050. } else {
  2051. this.form.salerId = null;
  2052. this.form.salerName = null;
  2053. }
  2054. }
  2055. },
  2056. // 标签页切换
  2057. tabHandle(data) {
  2058. if (data.name == "searchList") {
  2059. this.goodsListShow = this.data;
  2060. this.page.total = this.pageList.total;
  2061. } else if (data.name == "importStaging") {
  2062. this.goodsListShow = this.goodsListSave;
  2063. this.page.total = 0;
  2064. }
  2065. },
  2066. // 商品信息价格计算
  2067. amountChange(value, row) {
  2068. if (value > 0) {
  2069. this.$refs.crud.toggleRowSelection(row, true);
  2070. } else {
  2071. this.$refs.crud.toggleRowSelection(row, false);
  2072. }
  2073. // 价格
  2074. // if (!row.price) {
  2075. // row.price = 0;
  2076. // }
  2077. },
  2078. importStagList(row, index, type) {
  2079. this.goodsListSave.push(row);
  2080. },
  2081. removeStagList(row, index, type) {
  2082. this.goodsListSave.splice(row.$index, 1);
  2083. },
  2084. //确认导入触发
  2085. async importGoods() {
  2086. this.surplusRouteQuantityOption.push({ storageQuantity: "0" });
  2087. if (this.goodsListSave.length > 0) {
  2088. this.goodsListSaveHandle();
  2089. } else {
  2090. if (this.tableData.length > 0) {
  2091. this.tableDataHandle();
  2092. }
  2093. }
  2094. },
  2095. // 导入按钮事件
  2096. tableDataHandle() {
  2097. // 循环获取库存数量
  2098. for (let item of this.tableData) {
  2099. let page = {};
  2100. if (this.form.storageId) {
  2101. page.storageId = this.form.storageId;
  2102. }
  2103. page.goodsId = item.goodsId;
  2104. let obj = {
  2105. goodsId: item.id,
  2106. price: item.price,
  2107. goodsName: item.cname,
  2108. goodsNum: item.goodsNum,
  2109. brandName: item.brandName,
  2110. storageId: this.form.storageId,
  2111. storageName: this.form.storageName,
  2112. brandId: item.brandId,
  2113. goodsNo: item.code,
  2114. propertyName: item.specificationAndModel,
  2115. inventory: item.inventory,
  2116. pattern: item.brandItem,
  2117. goodsDescription: item.goodsDescription,
  2118. dot: item.dot,
  2119. // poNo: item.poNo,
  2120. whether: item.whether,
  2121. units: item.unit,
  2122. // 小计
  2123. subTotalMoney: Number(item.goodsNum * item.price) ? Number(item.goodsNum * item.price).toFixed(2) : 0,
  2124. // 备注
  2125. remarks: item.remarks,
  2126. // 批次号的状态
  2127. dotedittype: false,
  2128. // 价格数量
  2129. goodsNumtype: false,
  2130. // 价格
  2131. pricetype: false,
  2132. // sendNum: 0,
  2133. $cellEdit: true,
  2134. };
  2135. if (item.goodsFilesList && item.goodsFilesList.length) {
  2136. for (let ite of item.goodsFilesList) {
  2137. if (ite.version == "0") {
  2138. obj.url = ite.url;
  2139. }
  2140. }
  2141. }
  2142. this.form.orderItemsList.push(obj);
  2143. }
  2144. this.dialogVisible = false;
  2145. },
  2146. // 导入
  2147. goodsListSaveHandle() {
  2148. this.tableData = this.goodsListSave;
  2149. this.tableDataHandle();
  2150. },
  2151. // 获取添加商品弹窗里的数据
  2152. goodsPageXsfun() {
  2153. goodsPageXs({
  2154. customId: this.form.customerId,
  2155. stock: this.form.storageId,
  2156. enableOrNot: 1,
  2157. whetherIntegral: "0",
  2158. }).then((res) => {
  2159. const data = res.data.data;
  2160. this.goodsListShow = data.records;
  2161. });
  2162. },
  2163. //导入商品弹窗列表查询
  2164. onLoadfun(page, params = { artsVision: this.form.belongToCorpId }) {
  2165. this.goodsListShow = [];
  2166. this.loading = true;
  2167. if (this.goodsType == 1) {
  2168. goodsPageXs({
  2169. current: page.currentPage,
  2170. size: page.pageSize,
  2171. customId: this.form.customerId,
  2172. stock: this.form.storageId,
  2173. enableOrNot: 1,
  2174. goodsTypeId: this.treeDeptId,
  2175. ...Object.assign(params, this.SelectSearch),
  2176. whetherIntegral: "0",
  2177. }).then((res) => {
  2178. const data = res.data.data;
  2179. this.page.total = data.total;
  2180. this.pageList.total = data.total;
  2181. this.data = data.records;
  2182. this.goodsListShow = data.records;
  2183. for (let item of this.goodsListShow) {
  2184. item.goodsNum = item.goodsNum ? item.goodsNum : 0;
  2185. }
  2186. this.loading = false;
  2187. });
  2188. }
  2189. if (this.goodsType == 2) {
  2190. getGoodAllList({
  2191. current: page.currentPage,
  2192. size: page.pageSize,
  2193. customId: this.form.customerId,
  2194. stock: this.form.storageId,
  2195. enableOrNot: 1,
  2196. goodsTypeId: this.treeDeptId,
  2197. ...Object.assign(params, this.SelectSearch),
  2198. whetherIntegral: "0",
  2199. }).then((res) => {
  2200. res.data.data.records.forEach((item) => {
  2201. item.goodsNum = item.goodsNum ? item.goodsNum : 0;
  2202. item.inventory = item.inventory ? item.inventory : 0;
  2203. });
  2204. const data = res.data.data;
  2205. this.page.total = data.total;
  2206. this.pageList.total = data.total;
  2207. this.data = data.records;
  2208. this.goodsListShow = data.records;
  2209. this.loading = false;
  2210. });
  2211. }
  2212. },
  2213. // 采购明细行编辑
  2214. rowEdit(row) {
  2215. // 获取是否管理批次号
  2216. if (row.$cellEdit == true) {
  2217. this.$set(row, "$cellEdit", false);
  2218. } else {
  2219. getDetailsGods({ id: row.goodsId }).then((res) => {
  2220. row.whether = res.data.data.whether;
  2221. this.picihaolistfun(row.id);
  2222. this.$set(row, "$cellEdit", true);
  2223. this.goodsPageXsfun();
  2224. });
  2225. }
  2226. },
  2227. // 批次号获取数据
  2228. picihaolistfun(goodsId) {
  2229. dotList({
  2230. storageId: this.form.storageId,
  2231. goodsId: goodsId,
  2232. }).then((res) => {
  2233. this.picihaolist = res.data.data;
  2234. });
  2235. },
  2236. // 批次号切换库存
  2237. dotchangefun(value, row) {
  2238. for (let item of this.picihaolist) {
  2239. if (item.dot == value) {
  2240. this.$set(row, "inventory", item.balanceQuantity);
  2241. this.$set(row, "rebatePrice", item.rebatePrice);
  2242. }
  2243. }
  2244. },
  2245. // 数量失焦触发
  2246. goodsNumblurfun(row) {
  2247. if (Number(row.goodsNum) > Number(row.inventory)) {
  2248. this.$message.warning("不能大于库存数量");
  2249. return;
  2250. }
  2251. },
  2252. editBtn(row, index) {
  2253. this.confirmEditing();
  2254. this.$refs.formContacts.rowEdit(row, index);
  2255. dotList({
  2256. storageId: this.form.storageId,
  2257. goodsId: this.formContacts.goodsId,
  2258. }).then((res) => {
  2259. this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
  2260. });
  2261. goodsListXs(this.dicUrlWithCustomId, this.form.storageId ? this.form.storageId : "").then((res) => {
  2262. this.findObject(this.optionContacts.column, "goodsId").dicData = res.data.data;
  2263. });
  2264. },
  2265. //表头编辑
  2266. confirmEditing() {
  2267. this.editButton = false;
  2268. if (this.form.status == "待确认") {
  2269. this.editDis = false;
  2270. }
  2271. },
  2272. revokeTask() {
  2273. this.$confirm("是否撤销出库任务审批?", "提示", {
  2274. confirmButtonText: "确定",
  2275. cancelButtonText: "取消",
  2276. type: "warning",
  2277. }).then(() => {
  2278. revokeCheckOrderRW(this.form).then((res) => {
  2279. this.buttonText = "生成任务";
  2280. // 将按钮颜色还原为success
  2281. this.buttonColor = "success";
  2282. this.$message.success("撤销出库成功");
  2283. this.getDetail(res.data.data.id);
  2284. this.isApplySettlement = false;
  2285. this.isContacts = true;
  2286. this.isDisabled = true;
  2287. this.isDisabledTask = false;
  2288. this.$set(this.optionForm, "disabled", false); // form 表单的禁用放开
  2289. this.$set(this.optionContacts, "disabled", false); // table 表格的禁用放开
  2290. // this.editButton = true // 把编辑按钮显示出来
  2291. //添加删除按钮禁用
  2292. this.isAdd = true;
  2293. });
  2294. });
  2295. },
  2296. //联系人change
  2297. contactsChange(e) {
  2298. // 假设this.contactsOption是你的数组对象
  2299. let matchedContact = this.contactsOption.find((item) => item.contacts == e);
  2300. // 判断是否找到匹配的对象
  2301. this.$set(this.form, "phone", matchedContact.tel);
  2302. this.$set(this.form, "recAddress", matchedContact.belongtoarea + matchedContact.detailedAddress);
  2303. },
  2304. //修改提交触发
  2305. editCustomer() {
  2306. this.$refs["form"].validate((valid, done) => {
  2307. done();
  2308. if (valid) {
  2309. if (this.form.orderItemsList.length == 0) {
  2310. this.$message.warning("请添加商品");
  2311. return;
  2312. }
  2313. for (let i in this.form.orderItemsList) {
  2314. this.form.orderItemsList[i].subTotalMoney = Number(
  2315. this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price
  2316. )
  2317. ? Number(this.form.orderItemsList[i].goodsNum * this.form.orderItemsList[i].price).toFixed(2)
  2318. : 0;
  2319. if (this.form.orderItemsList[i].goodsNum <= 0) {
  2320. return this.$message.warning(`销售明细序号${Number(i) + 1}的数量不能为零`);
  2321. }
  2322. if (!this.form.orderItemsList[i].sendNum) {
  2323. this.form.orderItemsList[i].sendNum = 0;
  2324. }
  2325. }
  2326. const loading = this.$loading({
  2327. lock: true,
  2328. text: "加载中",
  2329. spinner: "el-icon-loading",
  2330. background: "rgba(255,255,255,0.7)",
  2331. });
  2332. for (let courierCompanies of this.courierCompaniesList) {
  2333. if (courierCompanies.dictValue === this.form.logisticsCorpName) {
  2334. this.form.logisticsCorpId = courierCompanies.dictKey;
  2335. break;
  2336. }
  2337. }
  2338. // this.form.storageName = this.form.$storageId ? this.form.$storageId : "";
  2339. this.form.billType = this.form.billType ? this.form.billType : 0;
  2340. submit({
  2341. bsType: "XS",
  2342. ...this.form,
  2343. })
  2344. .then((res) => {
  2345. this.$message.success("保存成功");
  2346. this.getDetail(res.data.data.id);
  2347. })
  2348. .finally(() => {
  2349. loading.close();
  2350. });
  2351. } else {
  2352. return false;
  2353. }
  2354. });
  2355. },
  2356. orderConfirmation() {
  2357. let obj = {
  2358. bsType: "XS",
  2359. ...this.form,
  2360. };
  2361. const loading = this.$loading({
  2362. lock: true,
  2363. text: "加载中",
  2364. spinner: "el-icon-loading",
  2365. background: "rgba(255,255,255,0.7)",
  2366. });
  2367. orderConfirmation(obj)
  2368. .then((res) => {
  2369. this.$message.success("操作成功");
  2370. this.getDetail(this.form.id);
  2371. })
  2372. .finally(() => {
  2373. loading.close();
  2374. });
  2375. },
  2376. revokeOrderConfirmation() {
  2377. let obj = {
  2378. bsType: "XS",
  2379. ...this.form,
  2380. };
  2381. const loading = this.$loading({
  2382. lock: true,
  2383. text: "加载中",
  2384. spinner: "el-icon-loading",
  2385. background: "rgba(255,255,255,0.7)",
  2386. });
  2387. revokeOrderConfirmation(obj)
  2388. .then((res) => {
  2389. this.$message.success("操作成功");
  2390. this.editDis = false;
  2391. this.getDetail(this.form.id, "撤销确认订单");
  2392. })
  2393. .finally(() => {
  2394. loading.close();
  2395. });
  2396. },
  2397. //关闭弹窗表单
  2398. beforeClose(done, type) {
  2399. console.log(type);
  2400. // if(row == "add"){
  2401. // this.form.sharedCompanyId = this.form.sharedCompanyId?this.form.sharedCompanyId:''
  2402. // this.form.sharedCompanyName = this.form.sharedCompanyName?this.form.sharedCompanyName:''
  2403. // }
  2404. console.log("this.form.sharedCompanyId", this.form.sharedCompanyId);
  2405. console.log("this.form.sharedCompanyName", this.form.sharedCompanyName);
  2406. done();
  2407. },
  2408. getDetail(id, type) {
  2409. const loading = this.$loading({
  2410. lock: true,
  2411. text: "加载中",
  2412. spinner: "el-icon-loading",
  2413. background: "rgba(255,255,255,0.7)",
  2414. });
  2415. getDetails({ id: id })
  2416. .then((res) => {
  2417. this.form = res.data.data;
  2418. this.dataList = res.data.data.paymentRecordsList ? res.data.data.paymentRecordsList : [];
  2419. if (
  2420. this.form.status == "待发货" ||
  2421. this.form.status == "已发货" ||
  2422. this.form.status == "已收货" ||
  2423. this.form.status == "已退款" ||
  2424. this.form.status == "申请退货" ||
  2425. this.form.status == "已取消"
  2426. ) {
  2427. this.editDis = true;
  2428. }
  2429. //成本、毛利对业务员隐藏
  2430. this.optionForm.column.forEach((its) => {
  2431. if (JSON.parse(localStorage.getItem("saber-userInfo")).content.role_name.split(",").includes("业务员")) {
  2432. if (its.prop == "cost" || its.prop == "grossProfit") {
  2433. this.$set(its, "display", false);
  2434. }
  2435. } else {
  2436. if (its.prop == "cost" || its.prop == "grossProfit") {
  2437. this.$set(its, "display", true);
  2438. }
  2439. }
  2440. });
  2441. // 明细信息成本、毛利对业务员隐藏
  2442. this.optionContacts.column.forEach((its) => {
  2443. if (JSON.parse(localStorage.getItem("saber-userInfo")).content.role_name.split(",").includes("业务员")) {
  2444. if (its.prop == "costprie" || its.prop == "grossProfit") {
  2445. this.$set(its, "hide", true);
  2446. }
  2447. } else {
  2448. if (its.prop == "costprie" || its.prop == "grossProfit") {
  2449. this.$set(its, "hide", false);
  2450. }
  2451. }
  2452. });
  2453. this.form.orderItemsList.forEach((items) => {
  2454. if (!items.subTotalMoney) {
  2455. items.subTotalMoney = Number(items.goodsNum * items.price)
  2456. ? Number(items.goodsNum * items.price).toFixed(2)
  2457. : 0;
  2458. items.grossProfit = items.subTotalMoney - items.costprie;
  2459. }
  2460. });
  2461. loading.close();
  2462. })
  2463. .catch(() => {
  2464. loading.close();
  2465. });
  2466. },
  2467. //请核关闭
  2468. choceScheduleFun() {
  2469. this.checkScheduleDialog = false;
  2470. },
  2471. //关闭审核
  2472. choceCheckFun() {
  2473. this.isExamineBtn = !this.isExamineBtn;
  2474. this.checkDialog = false;
  2475. },
  2476. //申请退款
  2477. applySettlement(type) {
  2478. this.$confirm("您确定申请退款吗?", {
  2479. confirmButtonText: "确定",
  2480. cancelButtonText: "取消",
  2481. type: "warning",
  2482. }).then(() => {
  2483. this.$refs["form"].validate((valid, done) => {
  2484. done();
  2485. if (valid) {
  2486. const data = {
  2487. id: this.form.id,
  2488. url: "/salesManagement/saleOrder/index",
  2489. pageStatus: "this.$store.getters.ltxsStatus",
  2490. pageLabel: "销售订单",
  2491. };
  2492. const loading = this.$loading({
  2493. lock: true,
  2494. text: "加载中",
  2495. spinner: "el-icon-loading",
  2496. background: "rgba(255,255,255,0.7)",
  2497. });
  2498. checkOrder({ ...data })
  2499. .then((res) => {
  2500. this.getDetail(res.data.data.id);
  2501. this.$message.success("申请退款成功");
  2502. this.isApplySettlement = !this.isApplySettlement;
  2503. loading.close();
  2504. })
  2505. .catch(() => {
  2506. loading.close();
  2507. });
  2508. }
  2509. });
  2510. });
  2511. },
  2512. //确认退款
  2513. confirmRefundBtn() {
  2514. this.$confirm("您确定退款吗?", {
  2515. confirmButtonText: "确定",
  2516. cancelButtonText: "取消",
  2517. type: "warning",
  2518. }).then(() => {
  2519. const loading = this.$loading({
  2520. lock: true,
  2521. text: "加载中",
  2522. spinner: "el-icon-loading",
  2523. background: "rgba(255,255,255,0.7)",
  2524. });
  2525. // this.form.orderItemsList.forEach((items) => {
  2526. // let brandName = items.brandId
  2527. // items.brandId = items.brandName
  2528. // items.brandName = brandName
  2529. // let goodsName = items.goodsId
  2530. // items.goodsId = items.goodsName
  2531. // items.goodsName = goodsName
  2532. // })
  2533. confirmRefund({ ...this.form })
  2534. .then((res) => {
  2535. loading.close();
  2536. this.$message.success("确定退款成功");
  2537. })
  2538. .catch(() => {
  2539. loading.close();
  2540. });
  2541. });
  2542. },
  2543. //审批
  2544. examineBtn() {
  2545. this.checkData = this.$route.query.check;
  2546. this.checkDialog = true;
  2547. },
  2548. //撤销请核
  2549. revocationRequest() {
  2550. this.$confirm("您确定撤回此次申请吗?", {
  2551. confirmButtonText: "确定",
  2552. cancelButtonText: "取消",
  2553. type: "warning",
  2554. }).then(() => {
  2555. const loading = this.$loading({
  2556. lock: true,
  2557. text: "加载中",
  2558. spinner: "el-icon-loading",
  2559. background: "rgba(255,255,255,0.7)",
  2560. });
  2561. // this.form.orderItemsList.forEach((items) => {
  2562. // if (!items.subTotalMoney) {
  2563. // items.subTotalMoney = items.goodsNum * items.price
  2564. // items.grossProfit = items.subTotalMoney - items.costprie
  2565. // }
  2566. // let brandName = items.brandId
  2567. // items.brandId = items.brandName
  2568. // items.brandName = brandName
  2569. // let goodsName = items.goodsId
  2570. // items.goodsId = items.goodsName
  2571. // items.goodsName = goodsName
  2572. // })
  2573. revokeCheckOrder({ ...this.form }).then((res) => {
  2574. this.isRevocationRequest = !this.isRevocationRequest;
  2575. this.getDetail(res.data.data.id);
  2576. this.$message.success("撤回成功");
  2577. loading.close();
  2578. });
  2579. });
  2580. },
  2581. rowDelBox(row, index, type) {
  2582. this.$confirm("确定将选择数据删除?", {
  2583. confirmButtonText: "确定",
  2584. cancelButtonText: "取消",
  2585. type: "warning",
  2586. }).then(() => {
  2587. if (row.id) {
  2588. delOrderItem({ ids: row.id }).then((res) => {
  2589. this.form.orderItemsList.splice(index, 1);
  2590. this.$message.success("操作成功!");
  2591. });
  2592. } else {
  2593. this.form[type].splice(index, 1);
  2594. this.$message.success("操作成功!");
  2595. }
  2596. });
  2597. },
  2598. // 明细信息多选
  2599. selectionContacts(list) {
  2600. this.selectionMultilist = list;
  2601. },
  2602. // 快捷复制
  2603. quickCopy() {
  2604. let temp = document.createElement("textarea");
  2605. let txt = `${this.form.customerName} ${this.form.businesDate}`;
  2606. for (let item of this.form.orderItemsList) {
  2607. txt += `\n${item.goodsName} ${item.goodsNum}`;
  2608. }
  2609. document.body.appendChild(temp);
  2610. temp.value = txt;
  2611. temp.select();
  2612. document.execCommand("copy");
  2613. document.body.removeChild(temp);
  2614. },
  2615. // 一键删除
  2616. batchDelete() {
  2617. if (this.selectionMultilist.length == 0) {
  2618. return this.$message.warning("请选择要删除的数据");
  2619. }
  2620. this.$confirm("确定将选择数据删除?", {
  2621. confirmButtonText: "确定",
  2622. cancelButtonText: "取消",
  2623. type: "warning",
  2624. }).then(() => {
  2625. let multiList = this.selectionMultilist;
  2626. let arr = this.form.orderItemsList;
  2627. // 获取有id 的数据
  2628. const itemsWithId = multiList.filter((item) => item.hasOwnProperty("id"));
  2629. let arrIds = itemsWithId.map((item) => item.id); // 获取id 数据
  2630. // 把选中的删除掉
  2631. multiList.forEach((item) => {
  2632. for (let index in arr) {
  2633. if (JSON.stringify(item) == JSON.stringify(arr[index])) {
  2634. arr.splice(Number(index), 1);
  2635. }
  2636. }
  2637. });
  2638. // 有id 的处理
  2639. if (itemsWithId.length != 0) {
  2640. delOrderItem({ ids: arrIds.join(",") }).then((res) => {
  2641. this.$message.success("操作成功!");
  2642. });
  2643. }
  2644. });
  2645. },
  2646. rowSave(form, done, loading) {
  2647. if (this.isStatus) {
  2648. done(form);
  2649. } else {
  2650. this.$message.error("请选择相同公司的商品");
  2651. }
  2652. console.log(form);
  2653. // this.form.sharedCompanyId = res.data.data.sharedCompanyId
  2654. // this.form.sharedCompanyName = res.data.data.sharedCompanyName
  2655. },
  2656. rowUpdate(form, index, done, loading) {
  2657. done(form);
  2658. },
  2659. // 新增商品
  2660. rowAdd(row, type) {
  2661. if (!this.form.customerId) {
  2662. return this.$message.error("请选择店铺名称");
  2663. }
  2664. if (!this.form.storageId) {
  2665. return this.$message.error("请维护店铺名称的发货仓库");
  2666. }
  2667. this.findObject(
  2668. this.optionContacts.column,
  2669. "goodsId"
  2670. ).dicUrl = `/api/gubersail-admin/goodsDesc/goodsListXs?cname={{key}}&customId=${this.dicUrlWithCustomId}&enableOrNot=1&stock=${this.form.storageId}`;
  2671. this.goodsType = type;
  2672. this.getAllWorkDicts();
  2673. this.goodsListSave = [];
  2674. setTimeout((res) => {
  2675. this.refreshChange();
  2676. this.dialogVisible = true;
  2677. }, 300);
  2678. // this.$refs.formContacts.rowAdd()
  2679. },
  2680. //打印
  2681. handlePrint() {
  2682. this.switchDialog = !this.switchDialog;
  2683. },
  2684. onClose(val) {
  2685. this.switchDialog = val;
  2686. },
  2687. backToList(type) {
  2688. this.$emit("backToList", type);
  2689. },
  2690. // 弹框的重置
  2691. resetCrud() {
  2692. this.$message.success("重置成功");
  2693. },
  2694. // 弹窗的保存
  2695. saveCrud() {
  2696. this.$message.success("保存成功");
  2697. },
  2698. },
  2699. };
  2700. </script>
  2701. <style lang="scss" scoped>
  2702. ::v-deep .el-form-item {
  2703. margin-bottom: 8px !important;
  2704. }
  2705. </style>