retail_form.vue 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159
  1. <template>
  2. <div class="detail-container">
  3. <el-page-header :content="listItem ? '编辑' : '新增'" @back="goBack" />
  4. <div class="main-title">
  5. <div class="title">订单信息</div>
  6. </div>
  7. <el-form
  8. ref="mainForm"
  9. :model="mainForm"
  10. label-width="120px"
  11. size="small"
  12. label-position="right"
  13. >
  14. <el-row :gutter="20">
  15. <el-col :xs="24" :sm="12" :lg="12">
  16. <el-form-item label="销售政策编号" prop="policyCode">
  17. <div style="display: flex">
  18. <el-input
  19. v-model="policyId"
  20. placeholder="销售政策编号"
  21. disabled
  22. />
  23. <el-button
  24. style="margin-left: 10px"
  25. size="small"
  26. @click="handleShow"
  27. >引用</el-button
  28. >
  29. </div>
  30. </el-form-item>
  31. </el-col>
  32. <!-- <el-col :xs="24" :sm="12" :lg="8" v-else>
  33. <el-form-item label="销售政策编号" prop="policyCode">
  34. <el-input
  35. disabled
  36. v-model="mainForm.policyId"
  37. placeholder="销售政策编号"
  38. ></el-input>
  39. </el-form-item>
  40. </el-col> -->
  41. <el-col :xs="24" :sm="12" :lg="12" style="height: 51px">
  42. <el-form-item label="单据日期" prop="date">
  43. <el-date-picker
  44. v-model="mainForm.date"
  45. type="datetime"
  46. disabled
  47. style="width: 100%"
  48. placeholder="选择日期"
  49. />
  50. </el-form-item>
  51. </el-col>
  52. <el-col :xs="24" :sm="12" :lg="12">
  53. <el-form-item label="表头备注" prop="remark">
  54. <el-input v-model="mainForm.remark" placeholder="请输入表头备注" />
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :lg="12">
  58. <el-form-item label="文件编号" prop="fileNum">
  59. <el-input
  60. v-model="mainForm.fileNum"
  61. placeholder="请输入文件编号"
  62. ></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :xs="24" :sm="12" :lg="12">
  66. <el-form-item label="业务员" prop="k3ServiceName">
  67. <el-select
  68. v-model="mainForm.k3ServiceName"
  69. placeholder="选择业务员"
  70. style="width: 100%"
  71. filterable
  72. @change="handleUser"
  73. >
  74. <el-option
  75. v-for="item in userList"
  76. :key="item.adminUserId"
  77. :label="item.nickName"
  78. :value="item.adminUserId"
  79. />
  80. </el-select>
  81. </el-form-item>
  82. </el-col>
  83. </el-row>
  84. </el-form>
  85. <div class="main-title">
  86. <div class="title">货品信息</div>
  87. <div>
  88. <el-select
  89. v-model="warehouseValue"
  90. placeholder="请选择发货仓库"
  91. size="small"
  92. style="margin-right: 10px"
  93. >
  94. <el-option
  95. v-for="(item, index) in warehouseList"
  96. :key="index"
  97. :label="item.name"
  98. :value="item.id"
  99. />
  100. </el-select>
  101. <el-button
  102. type="primary"
  103. size="small"
  104. icon="el-icon-search"
  105. @click="checkStock"
  106. >检查库存</el-button
  107. >
  108. <el-divider direction="vertical" />
  109. </div>
  110. </div>
  111. <div class="table">
  112. <el-table
  113. :data="goodsList"
  114. element-loading-text="Loading"
  115. border
  116. fit
  117. show-summary
  118. :summary-method="$getSummaries"
  119. highlight-current-row
  120. stripe
  121. max-height="400"
  122. >
  123. <el-table-column align="left" label="序号" type="index" width="50" />
  124. <el-table-column
  125. align="left"
  126. label="销售类型"
  127. prop="saleTypeName"
  128. min-width="100"
  129. show-overflow-tooltip
  130. />
  131. <el-table-column
  132. align="left"
  133. label="物料编码"
  134. prop="materialNumber"
  135. min-width="200"
  136. show-overflow-tooltip
  137. >
  138. <template slot-scope="scope">
  139. <CopyButton
  140. :copyText="
  141. scope.row.materialNumber
  142. ? scope.row.materialNumber
  143. : scope.row.materialCode
  144. "
  145. />
  146. <span>
  147. {{
  148. scope.row.materialNumber
  149. ? scope.row.materialNumber
  150. : scope.row.materialCode
  151. }}</span
  152. >
  153. </template>
  154. </el-table-column>
  155. <el-table-column
  156. align="left"
  157. label="产品名称"
  158. prop="materialName"
  159. min-width="200"
  160. show-overflow-tooltip
  161. >
  162. <template slot-scope="scope">
  163. <CopyButton :copyText="scope.row.materialName" />
  164. <span> {{ scope.row.materialName }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column
  168. align="left"
  169. label="规格型号"
  170. prop="specification"
  171. min-width="200"
  172. show-overflow-tooltip
  173. >
  174. <template slot-scope="scope">
  175. <CopyButton :copyText="scope.row.specification" />
  176. <span> {{ scope.row.specification }}</span>
  177. </template>
  178. </el-table-column>
  179. <el-table-column
  180. align="left"
  181. label="单位"
  182. prop="unit"
  183. min-width="100"
  184. show-overflow-tooltip
  185. />
  186. <el-table-column
  187. align="right"
  188. label="单价"
  189. prop="price"
  190. min-width="100"
  191. show-overflow-tooltip
  192. />
  193. <el-table-column
  194. align="right"
  195. label="总数量"
  196. prop="qty"
  197. min-width="100"
  198. show-overflow-tooltip
  199. >
  200. <template slot-scope="scope">
  201. <el-input class="yinput" v-model="scope.row.qty" size="small" />
  202. </template>
  203. </el-table-column>
  204. <el-table-column
  205. align="right"
  206. label="订单金额"
  207. min-width="100"
  208. prop="compute_amount"
  209. show-overflow-tooltip
  210. >
  211. <template slot-scope="scope">
  212. {{ (scope.row.price * scope.row.qty) | numToFixed }}
  213. </template>
  214. </el-table-column>
  215. <el-table-column
  216. align="left"
  217. label="返利钱包"
  218. prop="customerWalletId2"
  219. min-width="160"
  220. show-overflow-tooltip
  221. >
  222. <template slot-scope="scope">
  223. <el-select
  224. v-model="scope.row.customerWalletId2"
  225. placeholder="选择返利钱包"
  226. clearable
  227. size="small"
  228. @remove-tag="clearWallet($event, scope.row)"
  229. @change="changeWallet($event, scope.row)"
  230. >
  231. <el-option
  232. v-for="item in scope.row.rebateWallets"
  233. :key="item.customerWalletId"
  234. :label="item.name"
  235. :value="item.customerWalletId"
  236. />
  237. </el-select>
  238. </template>
  239. </el-table-column>
  240. <el-table-column
  241. align="right"
  242. label="返利金额"
  243. min-width="100"
  244. prop="compute_flAmount"
  245. show-overflow-tooltip
  246. >
  247. <template slot-scope="scope">
  248. {{
  249. ((scope.row.price - scope.row.discAmount) *
  250. scope.row.qty *
  251. ((scope.row.rebateRate || 0) * 100)) /
  252. 100
  253. }}
  254. </template>
  255. </el-table-column>
  256. <el-table-column
  257. align="right"
  258. label="格力折扣"
  259. min-width="100"
  260. prop="compute_zkAmount"
  261. show-overflow-tooltip
  262. >
  263. <template slot-scope="scope">
  264. {{ (scope.row.qty * scope.row.discAmount) | numToFixed }}
  265. </template>
  266. </el-table-column>
  267. <el-table-column
  268. align="left"
  269. label="现金钱包"
  270. prop="customerWalletId"
  271. min-width="160"
  272. show-overflow-tooltip
  273. >
  274. <template slot-scope="scope">
  275. <el-select
  276. v-model="scope.row.customerWalletId"
  277. placeholder="选择现金钱包"
  278. clearable
  279. size="small"
  280. @change="handleWallets($event, scope.row, scope.$index)"
  281. >
  282. <el-option
  283. v-for="item in scope.row.wallets"
  284. :key="item.customerWalletId"
  285. :label="item.name"
  286. :value="item.customerWalletId"
  287. />
  288. </el-select>
  289. </template>
  290. </el-table-column>
  291. <!-- <el-table-column-->
  292. <!-- align="left"-->
  293. <!-- label="业务员"-->
  294. <!-- prop="retiredQty"-->
  295. <!-- min-width="160"-->
  296. <!-- show-overflow-tooltip-->
  297. <!-- >-->
  298. <!-- <template slot-scope="scope">-->
  299. <!-- <el-select-->
  300. <!-- v-model="scope.row.serviceName"-->
  301. <!-- size="small"-->
  302. <!-- disabled-->
  303. <!-- placeholder="选择业务员"-->
  304. <!-- style="width: 100%"-->
  305. <!-- @change="handleUser2($event,scope.row)"-->
  306. <!-- >-->
  307. <!-- <el-option-->
  308. <!-- v-for="item in scope.row.userList"-->
  309. <!-- :key="item.adminUserId"-->
  310. <!-- :label="item.nickName"-->
  311. <!-- :value="item.adminUserId"-->
  312. <!-- />-->
  313. <!-- </el-select>-->
  314. <!-- </template>-->
  315. <!-- </el-table-column>-->
  316. <el-table-column
  317. align="right"
  318. label="可用返利"
  319. prop="rebateAmount"
  320. min-width="100"
  321. show-overflow-tooltip
  322. >
  323. <template slot-scope="scope">
  324. <div>{{ scope.row.rebateAmount | numToFixed }}</div>
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. align="right"
  329. label="使用返利金额"
  330. prop="compute_flAmount"
  331. min-width="120"
  332. show-overflow-tooltip
  333. >
  334. <template slot-scope="scope">
  335. {{
  336. (((scope.row.price - scope.row.discAmount) *
  337. scope.row.qty *
  338. (scope.row.rebateRate * 100)) /
  339. 100)
  340. | numToFixed
  341. }}
  342. </template>
  343. </el-table-column>
  344. <el-table-column
  345. align="right"
  346. label="实付金额"
  347. min-width="100"
  348. prop="compute_sfAmount"
  349. show-overflow-tooltip
  350. >
  351. <template slot-scope="scope">
  352. {{ comTatol(scope.row) | numToFixed }}
  353. <!-- {{(scope.row.price - (scope.row.qty * scope.row.discAmount) -(((scope.row.price - scope.row.discAmount) * scope.row.qty * ((scope.row.rebateRate || 0) * 100)) / 100))*scope.row.qty | numToFixed }} -->
  354. <!-- {{ (((scope.row.price * scope.row.qty) * 100 - ((scope.row.price * scope.row.qty * (scope.row.rebateRate * 100)) / 100) * 100 - ((scope.row.qty * (scope.row.discAmount * 100)) / 100) * 100) / 100) | numToFixed }} -->
  355. </template>
  356. </el-table-column>
  357. <el-table-column
  358. align="left"
  359. label="是否直调"
  360. prop="isDirectTransfer"
  361. min-width="100"
  362. >
  363. <template slot-scope="scope">
  364. <el-checkbox v-model="scope.row.isDirectTransfer" />
  365. </template>
  366. </el-table-column>
  367. <!-- <el-table-column
  368. align="left"
  369. label="直调数量"
  370. prop="directTransferQty"
  371. min-width="100"
  372. >
  373. <template slot-scope="scope">
  374. <el-input
  375. v-model="scope.row.directTransferQty"
  376. size="small"
  377. ></el-input>
  378. </template>
  379. </el-table-column> -->
  380. <el-table-column
  381. align="left"
  382. label="表体备注"
  383. prop="remark"
  384. min-width="160"
  385. >
  386. <template slot-scope="scope">
  387. <el-input v-model="scope.row.remark" size="small" />
  388. </template>
  389. </el-table-column>
  390. <el-table-column
  391. align="right"
  392. label="税率"
  393. prop="tax"
  394. min-width="100"
  395. show-overflow-tooltip
  396. />
  397. <!-- <el-table-column-->
  398. <!-- v-if="!listItem"-->
  399. <!-- align="left"-->
  400. <!-- label="总仓库"-->
  401. <!-- prop="status1"-->
  402. <!-- min-width="100"-->
  403. <!-- show-overflow-tooltip-->
  404. <!-- >-->
  405. <!-- <template slot-scope="scope">-->
  406. <!-- <div>{{ scope.row.status1 | status1Filter }}</div>-->
  407. <!-- </template>-->
  408. <!-- </el-table-column>-->
  409. <el-table-column
  410. v-if="!listItem"
  411. align="left"
  412. label="仓库状态"
  413. prop="status2"
  414. min-width="100"
  415. show-overflow-tooltip
  416. >
  417. <template slot-scope="scope">
  418. <div>{{ status2Filter(scope.row) }}</div>
  419. </template>
  420. </el-table-column>
  421. <el-table-column align="left" label="操作" width="100" fixed="right">
  422. <template slot-scope="scope">
  423. <!-- <el-button
  424. type="text"
  425. @click="(dialogVisible = true), (cid = scope.row.id)"
  426. >修改</el-button
  427. > -->
  428. <el-button
  429. type="text"
  430. @click="deleteItem(scope.$index, scope.row.id)"
  431. >删除</el-button
  432. >
  433. </template>
  434. </el-table-column>
  435. </el-table>
  436. </div>
  437. <div class="page-footer">
  438. <div class="footer" :class="classObj">
  439. <el-button type="primary" @click="clickSubmitForm">保 存</el-button>
  440. <el-popconfirm
  441. title="确定关闭吗?"
  442. style="margin-left: 10px"
  443. @onConfirm="goBack"
  444. >
  445. <el-button slot="reference">返回列表</el-button>
  446. </el-popconfirm>
  447. </div>
  448. </div>
  449. <el-dialog
  450. :visible.sync="isShowDialog"
  451. width="80%"
  452. :close-on-click-modal="false"
  453. title="引用销售政策"
  454. @close="handleClose"
  455. >
  456. <template>
  457. <el-form
  458. ref="screenForm"
  459. :model="screenForm"
  460. label-width="120px"
  461. label-position="left"
  462. size="small"
  463. >
  464. <el-row
  465. v-if="factor.length && !dataList.length"
  466. style="margin: 0 0 20px 0; font-size: 20px"
  467. >
  468. 引用销售政策表头备注:{{
  469. !remark ? factor[0].name : remark
  470. }}
  471. 配提比例:{{ pop }}
  472. </el-row>
  473. <el-row
  474. v-if="factor.length && !dataList.length && factor[0].remark"
  475. style="margin: 0 0 20px 0; font-size: 20px"
  476. >
  477. 备注:{{ factor[0].remark }}
  478. </el-row>
  479. <el-row :gutter="20">
  480. <el-col :xs="24" :sm="8" :lg="11">
  481. <el-form-item label="规格型号">
  482. <div style="display:flex">
  483. <el-input
  484. v-model="screenForm.specification"
  485. placeholder="请输入型号规格型号"
  486. />
  487. <el-button style="margin-left:10px" type="primary" size="mini" @click="handleGetPolicyList">查询</el-button>
  488. </div>
  489. </el-form-item>
  490. </el-col>
  491. <el-col :xs="24" :sm="12" :lg="11">
  492. <el-form-item label="销售政策" class="myselect">
  493. <el-select
  494. v-model="screenForm.policyId"
  495. placeholder="选择销售政策"
  496. filterable
  497. :disabled="disabled"
  498. style="width: 100%"
  499. @change="handlePolicy"
  500. >
  501. <el-option
  502. v-for="item in policyList"
  503. :key="item.code"
  504. :label="item.title"
  505. :value="item.code"
  506. >
  507. <span>{{ item.title }}</span>
  508. <span
  509. v-if="item.policyRemark"
  510. style="margin-left: 15px; color: #f00; font-size: 12px"
  511. >( {{ item.policyRemark }} )</span
  512. >
  513. </el-option>
  514. </el-select>
  515. </el-form-item>
  516. </el-col>
  517. <el-col :xs="24" :sm="8" :lg="11">
  518. <el-form-item label="规格型号">
  519. <div style="display:flex">
  520. <el-input
  521. v-model="screenForm.specifications"
  522. placeholder="请输入型号规格型号"
  523. />
  524. </div>
  525. </el-form-item>
  526. </el-col>
  527. <el-col :xs="24" :sm="12" :lg="11">
  528. <el-form-item label="销售类型">
  529. <el-select
  530. v-model="screenForm.saleTypeCode"
  531. filterable
  532. placeholder="选择销售类型"
  533. style="width: 100%"
  534. clearable
  535. >
  536. <el-option
  537. v-for="item in ztypeList"
  538. :key="item.id"
  539. :label="item.saleName"
  540. :value="item.saleCode"
  541. />
  542. </el-select>
  543. </el-form-item>
  544. </el-col>
  545. <el-col :xs="22" :sm="22" :lg="22" class="tr">
  546. <!-- <el-button
  547. type="primary"
  548. size="small"
  549. @click="handlePolicyTypeList"
  550. >查询</el-button> -->
  551. <el-button
  552. type="primary"
  553. size="small"
  554. @click="handlePolicyTypeList"
  555. >查询</el-button
  556. >
  557. </el-col>
  558. </el-row>
  559. </el-form>
  560. <template v-if="!dataList.length">
  561. <div v-for="(item, index) in popDataArr" :key="index">
  562. <div style="padding: 20px 0">
  563. <div v-if="index == 0">限定机型</div>
  564. <div v-else>配提机型{{ index }}</div>
  565. </div>
  566. <el-table
  567. ref="singleTable"
  568. v-loading="listLoading"
  569. class="table"
  570. :data="item"
  571. element-loading-text="Loading"
  572. max-height="500"
  573. border
  574. fit
  575. highlight-current-row
  576. stripe
  577. @select-all="handleSelectionChange($event, 1, index)"
  578. @selection-change="handleSelectionChange($event, 1, index)"
  579. >
  580. <el-table-column
  581. align="left"
  582. type="selection"
  583. :selectable="selectable"
  584. width="55"
  585. />
  586. <template v-for="col in columns">
  587. <el-table-column
  588. v-if="col.num"
  589. :align="col.align"
  590. :label="col.lable"
  591. :prop="col.prop"
  592. :min-width="col.widht"
  593. show-overflow-tooltip
  594. >
  595. <template slot-scope="scope">
  596. <el-input
  597. v-model.lazy="scope.row.qty"
  598. type="number" @mousewheel.native.prevent
  599. size="small"
  600. class="yinput"
  601. @blur="blurQty(scope.row.qty, scope.row)"
  602. @input="funQty(scope.row.qty, scope.row, index)"
  603. />
  604. </template>
  605. </el-table-column>
  606. <el-table-column
  607. v-else-if="col.jie"
  608. :align="col.align"
  609. :label="col.lable"
  610. :prop="col.prop"
  611. :min-width="col.widht"
  612. show-overflow-tooltip
  613. >
  614. <template slot-scope="scope">
  615. {{ scope.row.qty * scope.row.price || 0 | numToFixed }}
  616. </template>
  617. </el-table-column>
  618. <el-table-column
  619. v-else
  620. :align="col.align"
  621. :label="col.lable"
  622. :prop="col.prop"
  623. :min-width="col.widht"
  624. show-overflow-tooltip
  625. >
  626. <template slot-scope="scope">
  627. <template
  628. v-if="col.lable == '产品名称' || col.lable == '规格型号'"
  629. >
  630. <CopyButton :copyText="scope.row[col.prop]" />
  631. <span> {{ scope.row[col.prop] }}</span>
  632. </template>
  633. <template v-else>
  634. {{ scope.row[col.prop] || 0 | numToFixed }}
  635. </template>
  636. </template>
  637. </el-table-column>
  638. </template>
  639. <template #append>
  640. <div class="mybox">
  641. <el-row class="mybox-row" type="flex">
  642. <el-col style="width: 55px">合计</el-col>
  643. <el-col />
  644. <el-col />
  645. <el-col />
  646. <el-col>{{ totalArr[index].totalQty }}</el-col>
  647. <el-col>{{
  648. totalArr[index].totalPrice | numToFixed
  649. }}</el-col>
  650. <el-col>{{
  651. totalArr[index].totalAmount | numToFixed
  652. }}</el-col>
  653. </el-row>
  654. </div>
  655. </template>
  656. </el-table>
  657. <!-- <div style="margin: 10px 0">
  658. 分页
  659. <el-pagination
  660. @size-change="
  661. popfun['handleSizeChange' + (index + 1)]($event, index + 1)
  662. "
  663. @current-change="
  664. popfun['handleCurrentChange' + (index + 1)]($event, index + 1)
  665. "
  666. :current-page="popcun['cun' + (index + 1)]"
  667. :page-sizes="[10]"
  668. :page-size="10"
  669. layout="total, sizes, prev, pager, next, jumper"
  670. :total="poptotal['total' + (index + 1)]"
  671. >
  672. </el-pagination>
  673. </div> -->
  674. </div>
  675. <!-- <div v-if="factor.length">-->
  676. <!-- 引用销售政策说明:{{ factor.length ? factor[0].name : "" }} 配提比列:{{pop}}-->
  677. <!-- </div>-->
  678. <span slot="footer" class="dialog-footer">
  679. <el-button type="primary" @click="hanlePopData">完成</el-button>
  680. </span>
  681. </template>
  682. <template v-else>
  683. <el-table
  684. ref="singleTable"
  685. v-loading="listLoading2"
  686. class="table"
  687. :data="dataList"
  688. element-loading-text="Loading"
  689. border
  690. fit
  691. max-height="500"
  692. highlight-current-row
  693. stripe
  694. @select-all="handleSelectionChange"
  695. @selection-change="handleSelectionChange"
  696. >
  697. <el-table-column
  698. align="left"
  699. type="selection"
  700. :selectable="selectable2"
  701. width="55"
  702. />
  703. <template v-for="col in columns">
  704. <el-table-column
  705. v-if="col.num"
  706. :align="col.align"
  707. :label="col.lable"
  708. :prop="col.prop"
  709. :min-width="col.widht"
  710. show-overflow-tooltip
  711. >
  712. <template slot-scope="scope">
  713. <el-input
  714. v-model.lazy="scope.row.qty"
  715. type="number" @mousewheel.native.prevent
  716. class="yinput"
  717. size="small"
  718. @blur="blurQty(scope.row.qty, scope.row)"
  719. @input="funQty(scope.row.qty, scope.row)"
  720. />
  721. </template>
  722. </el-table-column>
  723. <el-table-column
  724. v-else-if="col.jie"
  725. :align="col.align"
  726. :label="col.lable"
  727. :prop="col.prop"
  728. :min-width="col.widht"
  729. show-overflow-tooltip
  730. >
  731. <template slot-scope="scope">
  732. {{ scope.row.qty * scope.row.price || 0 | numToFixed }}
  733. </template>
  734. </el-table-column>
  735. <el-table-column
  736. v-else
  737. :align="col.align"
  738. :label="col.lable"
  739. :prop="col.prop"
  740. :min-width="col.widht"
  741. show-overflow-tooltip
  742. >
  743. <template slot-scope="scope">
  744. <template
  745. v-if="col.lable == '产品名称' || col.lable == '规格型号'"
  746. >
  747. <CopyButton :copyText="scope.row[col.prop]" />
  748. <span> {{ scope.row[col.prop] }}</span>
  749. </template>
  750. <template v-else>
  751. {{ scope.row[col.prop] || 0 | numToFixed }}
  752. </template>
  753. </template>
  754. </el-table-column>
  755. </template>
  756. <template #append>
  757. <div class="mybox">
  758. <el-row class="mybox-row" type="flex">
  759. <el-col style="width: 55px">合计</el-col>
  760. <el-col />
  761. <el-col />
  762. <el-col />
  763. <el-col>{{ totalQty }}</el-col>
  764. <el-col>{{ totalPrice | numToFixed }}</el-col>
  765. <el-col>{{ totalAmount | numToFixed }}</el-col>
  766. </el-row>
  767. </div>
  768. </template>
  769. </el-table>
  770. <!-- <div style="margin: 10px 0">
  771. <el-pagination
  772. @size-change="handleSizeChange"
  773. @current-change="handleCurrentChange"
  774. :current-page="currentPage"
  775. :page-sizes="[10]"
  776. :page-size="10"
  777. layout="total, sizes, prev, pager, next, jumper"
  778. :total="total"
  779. >
  780. </el-pagination>
  781. </div> -->
  782. <span slot="footer" class="dialog-footer">
  783. <el-button type="primary" @click="hanlePopData">完成</el-button>
  784. </span>
  785. </template>
  786. </template>
  787. </el-dialog>
  788. </div>
  789. </template>
  790. <script>
  791. import {
  792. addData,
  793. checkStock,
  794. editData,
  795. getConditionList,
  796. getDetail,
  797. getGoodsList,
  798. getMaterialTypeList,
  799. getPolicyConditionList,
  800. getpolicyList,
  801. getpolicyTypeList,
  802. getSalesTypeList,
  803. getUserList,
  804. getWalletList,
  805. getWarehouseList,
  806. policyList,
  807. typeList,
  808. } from "@/api/supply/policy";
  809. import { getDictList } from "@/api/common";
  810. export default {
  811. name: "RetailForm",
  812. componentName: "RetailForm",
  813. filters: {
  814. status1Filter(val) {
  815. if (val === "" || val === null || val === undefined) return "未检查";
  816. else if (val === 0) return "无货";
  817. else if (val > 0 && val <= 30) return val;
  818. else if (val > 30 && val <= 1000) return "有货";
  819. else if (val > 1000) return "充足";
  820. },
  821. },
  822. props: ["listItem"],
  823. data() {
  824. return {
  825. tableData: [],
  826. currentPage: 1, // 当前页码
  827. pageSize: 10, // 每页数量
  828. listTotal: 0, // 列表总数
  829. cusIndex: 0,
  830. total: 0,
  831. radio: "",
  832. pop: "",
  833. dialogVisible: false,
  834. factor: [],
  835. popArr: [],
  836. mainForm: {
  837. id: "",
  838. date: "",
  839. type: "",
  840. ztype: "",
  841. remark: "",
  842. fileNum: "",
  843. policyCode: "",
  844. policyRemark: "",
  845. policyId: "",
  846. k3ServiceId: "",
  847. k3ServiceName: "",
  848. },
  849. // mainFormRules: {
  850. // type: [{ required: true, message: "请选择品类", trigger: "change" }],
  851. // },
  852. goodsList: [],
  853. warehouseList: [],
  854. warehouseValue: "",
  855. isShowDialog: false,
  856. screenForm: {
  857. policyId: "",
  858. saleTypeCode: "",
  859. factorId: "",
  860. specification: "",
  861. specifications:""
  862. },
  863. currentPage: 1,
  864. listTotal: 0,
  865. salesTypeList: [],
  866. typeList: [],
  867. ztypeList: [],
  868. leftGoodsList: [],
  869. rightGoodsList: [],
  870. leftSelection: [],
  871. rightSelection: [],
  872. policyList: [],
  873. xjWalletList: [],
  874. flWalletList: [],
  875. dataList: [],
  876. columns: [
  877. {
  878. prop: "saleTypeName",
  879. lable: "销售类型",
  880. widht: 200,
  881. align: "left",
  882. },
  883. {
  884. prop: "materialName",
  885. lable: "产品名称",
  886. widht: 200,
  887. align: "left",
  888. },
  889. {
  890. prop: "specification",
  891. lable: "规格型号",
  892. widht: 350,
  893. align: "left",
  894. },
  895. {
  896. prop: "qty",
  897. lable: "数量",
  898. widht: 200,
  899. num: true,
  900. align: "right",
  901. },
  902. {
  903. prop: "price",
  904. lable: "单价",
  905. widht: 200,
  906. align: "right",
  907. },
  908. {
  909. prop: "zong",
  910. widht: 200,
  911. lable: "金额",
  912. jie: true,
  913. align: "right",
  914. },
  915. ],
  916. listLoading: false,
  917. listLoading2: false,
  918. popDataArr: [],
  919. radioObj: {},
  920. step: 0,
  921. policyId: "",
  922. policyConditionId: "",
  923. multipleSelection: [],
  924. multipleSelections: [],
  925. multipleData: [],
  926. disabled: false,
  927. cid: "",
  928. newDataList: [],
  929. userList: [],
  930. fang: false,
  931. popfun: {},
  932. poptotal: {},
  933. popcun: {},
  934. totalQty: 0,
  935. totalPrice: 0,
  936. totalAmount: 0,
  937. totalArr: [],
  938. type: 1,
  939. newMultipleSelections: [],
  940. remark: "",
  941. };
  942. },
  943. computed: {
  944. sidebar() {
  945. // console.log(11145454);
  946. return this.$store.state.app.sidebar;
  947. },
  948. classObj() {
  949. return {
  950. hideSidebar: !this.sidebar.opened,
  951. openSidebar: this.sidebar.opened,
  952. };
  953. },
  954. comxjWalletList() {
  955. return (c) => {
  956. // // consloe(c, "现金钱包");
  957. const walle = [];
  958. const ovalVall = c == undefined || !c.length ? [] : c;
  959. for (let i = 0; i < this.xjWalletList.length; i++) {
  960. for (let j = 0; j < ovalVall.length; j++) {
  961. if (this.xjWalletList[i].walletRebateId == ovalVall[j].walletId) {
  962. walle.push(this.xjWalletList[i]);
  963. }
  964. }
  965. }
  966. return walle;
  967. };
  968. },
  969. comText() {
  970. return (val) => {
  971. if (this.cusIndex - 1 == 0) {
  972. const params = this.radio.split("&");
  973. return this.dataList.filter((k) => {
  974. return k.id == params[0];
  975. })[0][val];
  976. } else {
  977. const params =
  978. this.radioObj["radio" + (this.cusIndex - 1)].split("&");
  979. return this.popDataArr[this.cusIndex - 2].filter((k) => {
  980. return k.id == params[0];
  981. })[0][val];
  982. }
  983. };
  984. },
  985. // pickerOptions({ $props }) {
  986. // return {
  987. // disabledDate: (time) => {
  988. // return time.getTime() < Date.now() - 1 * 24 * 60 * 60 * 1000;
  989. // },
  990. // };
  991. // },
  992. comTatol() {
  993. return (row) => {
  994. return (
  995. row.price * row.qty -
  996. row.qty * row.discAmount -
  997. ((row.price - row.discAmount) *
  998. row.qty *
  999. ((row.rebateRate || 0) * 100)) /
  1000. 100
  1001. );
  1002. };
  1003. },
  1004. },
  1005. watch: {
  1006. goodsList: {
  1007. handler(newValue, oldValue) {
  1008. if (newValue && newValue.length) {
  1009. newValue.forEach((item, index) => {
  1010. this.goodsList[index].compute_amount = item.price * item.qty;
  1011. this.goodsList[index].compute_flAmount =
  1012. ((item.price - item.discAmount) *
  1013. item.qty *
  1014. (item.rebateRate * 100)) /
  1015. 100;
  1016. this.goodsList[index].compute_zkAmount = item.qty * item.discAmount;
  1017. this.goodsList[index].compute_sfAmount =
  1018. item.price * item.qty -
  1019. item.qty * item.discAmount -
  1020. ((item.price - item.discAmount) *
  1021. item.qty *
  1022. ((item.rebateRate || 0) * 100)) /
  1023. 100;
  1024. });
  1025. }
  1026. this.goodsList = newValue;
  1027. },
  1028. immediate: true,
  1029. deep: true,
  1030. },
  1031. },
  1032. created() {
  1033. this.getDictList();
  1034. this.getWalletList();
  1035. this.getWarehouseList();
  1036. this.getTypeList();
  1037. this.getUserList();
  1038. if (this.listItem) {
  1039. this.getDetail();
  1040. }
  1041. },
  1042. methods: {
  1043. blurQty(e, row) {
  1044. if (!e) {
  1045. this.$set(row, "qty", 1);
  1046. }
  1047. },
  1048. funQty(qty, row, index) {
  1049. if (row.fang) {
  1050. if (this.type == 1) {
  1051. this.$set(this.totalArr, index, {
  1052. totalQty: 0,
  1053. totalPrice: 0,
  1054. totalAmount: 0,
  1055. });
  1056. let sum = 0;
  1057. for (let j = 0; j < this.multipleSelections[index].length; j++) {
  1058. this.multipleSelections[index][j].fang = true;
  1059. sum += +this.multipleSelections[index][j].qty;
  1060. this.totalArr[index].totalPrice +=
  1061. +this.multipleSelections[index][j].price;
  1062. this.totalArr[index].totalAmount +=
  1063. +this.multipleSelections[index][j].price * +qty;
  1064. }
  1065. this.totalArr[index].totalQty = sum;
  1066. } else {
  1067. let sum = 0;
  1068. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1069. for (let i = 0; i < this.multipleSelection.length; i++) {
  1070. sum += +this.multipleSelection[i].qty;
  1071. this.totalPrice += +this.multipleSelection[i].price;
  1072. this.totalAmount += +this.multipleSelection[i].price * +qty;
  1073. }
  1074. this.totalQty += sum;
  1075. }
  1076. }
  1077. },
  1078. getUserList() {
  1079. getUserList({
  1080. pageNum: 1,
  1081. pageSize: -1,
  1082. adminWebsitId: "",
  1083. isCustomer: 0,
  1084. roleId: "",
  1085. status: true,
  1086. userName: "",
  1087. }).then((res) => {
  1088. this.userList = res.data.records;
  1089. // // consloe(this.userList,'122');
  1090. });
  1091. },
  1092. handleUser(e) {
  1093. const user = this.userList.filter((k) => {
  1094. return k.adminUserId == e;
  1095. })[0];
  1096. this.mainForm.k3ServiceId = user.adminUserId;
  1097. this.mainForm.k3ServiceName = user.nickName;
  1098. },
  1099. handleUser2(e, row) {
  1100. const user = this.userList.filter((k) => {
  1101. return k.adminUserId == e;
  1102. })[0];
  1103. this.$set(row, "serviceId", user.adminUserId);
  1104. this.$set(row, "serviceName", user.nickName);
  1105. this.$set(this.mainForm, "k3ServiceId", user.adminUserId);
  1106. this.$set(this.mainForm, "k3ServiceName", user.nickName);
  1107. },
  1108. // 返回列表
  1109. goBack() {
  1110. this.$emit("backListFormDetail");
  1111. },
  1112. handleWallets(e, row, index) {
  1113. if (e) {
  1114. const service = row.wallets.filter((k) => {
  1115. return e == k.customerWalletId;
  1116. })[0];
  1117. if (index == 0 && !this.mainForm.k3ServiceId) {
  1118. this.$set(this.mainForm, "k3ServiceId", service.serviceId);
  1119. this.$set(this.mainForm, "k3ServiceName", service.serviceName);
  1120. }
  1121. this.$set(row, "serviceId", service.serviceId);
  1122. this.$set(row, "serviceName", service.serviceName);
  1123. // this.$set(row,'amount',service.amount || 0)
  1124. } else {
  1125. console.log(index);
  1126. if (index === 0) {
  1127. this.$set(this.mainForm, "k3ServiceId", "");
  1128. this.$set(this.mainForm, "k3ServiceName", "");
  1129. }
  1130. this.$set(row, "serviceId", "");
  1131. this.$set(row, "serviceName", "");
  1132. // this.$set(row,'amount',0 )
  1133. }
  1134. },
  1135. // 选择销售政策获取政策条件列表
  1136. async handlePolicy(e) {
  1137. console.log(e);
  1138. this.totalArr = [];
  1139. this.multipleSelections = [];
  1140. this.dataList = [];
  1141. this.popDataArr = [];
  1142. this.screenForm.saleTypeCode = "";
  1143. const type = this.policyList.filter((k) => {
  1144. return k.code === e;
  1145. })[0].type;
  1146. console.log(type=="PROVISION");
  1147. if (type == "PROVISION") {
  1148. // PROVISION 配提
  1149. // 选择销售政策PolidcyId改变获取条件列表
  1150. const { data } = await getPolicyConditionList({ policyId: e });
  1151. this.factor = data;
  1152. this.pop = data[0].pop;
  1153. this.remark = data[0].remark || "";
  1154. this.popArr = data[0].pop.split(":");
  1155. if (this.policyId) {
  1156. this.screenForm.policyId = this.policyId;
  1157. if (this.listItem) {
  1158. this.policyConditionId = data[0].id;
  1159. }
  1160. } else {
  1161. this.screenForm.policyId = data[0].policyId;
  1162. this.policyConditionId = data[0].id;
  1163. }
  1164. for (let i = 0; i < this.popArr.length; i++) {
  1165. await this.getConditionList(this.policyConditionId, i + 1);
  1166. }
  1167. } else {
  1168. // LIMIT 限量
  1169. this.getMaterialTypeList("sProvision");
  1170. }
  1171. },
  1172. hendleEdit(val, index) {
  1173. this.dialogVisible = false;
  1174. // let params = {
  1175. // id: this.cid,
  1176. // theTime: this.mainForm.date,
  1177. // mainId: this.mainForm.type,
  1178. // mainName: this.mainForm.mainName,
  1179. // remark: this.mainForm.remark,
  1180. // type: 2,
  1181. // retailOrderItemList: this.goodsList,
  1182. // policyId: this.policyId,
  1183. // };
  1184. // editData(params).then((res) => {
  1185. // this.$successMsg("编辑成功");
  1186. // this.getDetail();
  1187. // });
  1188. },
  1189. // 获取条件相对应的比列
  1190. handleFactor(e) {
  1191. const data = this.factor.filter((k) => {
  1192. return k.id == e;
  1193. })[0];
  1194. // // consloe(data, "kkkk");
  1195. this.pop = data.pop;
  1196. this.popArr = data.pop.split(":");
  1197. this.screenForm.policyId = data.policyId;
  1198. this.policyConditionId = data.id;
  1199. },
  1200. async handleGetPolicyList(){
  1201. const {data} = await policyList({
  1202. pageNum: 1,
  1203. pageSize: -1,
  1204. status:1,
  1205. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1206. specification: this.screenForm.specification,
  1207. })
  1208. this.policyList = data.records
  1209. if (data.records.length) {
  1210. this.handlePolicy(data.records[0].code);
  1211. }
  1212. },
  1213. // 获取某一个比例下的数据 ,查询popType 当前 this.cusIndex+1
  1214. async getConditionList(policyConditionId, popType, fang) {
  1215. this.listLoading = true;
  1216. const { data } = await getConditionList({
  1217. pageNum: this.currentPage,
  1218. pageSize: -1,
  1219. policyConditionId,
  1220. popType,
  1221. specification: this.screenForm.specifications,
  1222. saleTypeCode: this.screenForm.saleTypeCode,
  1223. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1224. });
  1225. if (!fang) {
  1226. this.poptotal["total" + popType] = data.total;
  1227. this.popcun["cun" + popType] = 1;
  1228. this.popfun["handleSizeChange" + popType] = (val, index) => {
  1229. this.popcun["cun" + index] = val;
  1230. this.currentPage = 1;
  1231. this.getConditionList(this.policyConditionId, index, true);
  1232. };
  1233. this.popfun["handleCurrentChange" + popType] = (val, index) => {
  1234. this.popcun["cun" + index] = val;
  1235. this.getConditionList(this.policyConditionId, index, true);
  1236. };
  1237. }
  1238. const datas = data.records;
  1239. if (this.listItem) {
  1240. for (let i = 0; i < this.goodsList.length; i++) {
  1241. for (let j = 0; j < datas.length; j++) {
  1242. if (datas[j].id == this.goodsList[i].policyMaterialId) {
  1243. this.$set(datas[j], "disabled", true);
  1244. }
  1245. }
  1246. }
  1247. }
  1248. // this.total = data.total;
  1249. // console.log(this.goodsList,'4555');
  1250. if (this.goodsList.length) {
  1251. for (let p = 0; p < this.goodsList.length; p++) {
  1252. for (let q = 0; q < datas.length; q++) {
  1253. if ((this.goodsList[p].id || this.goodsList[p].policyMaterialId) == datas[q].id ) {
  1254. this.$set(datas[q], "disabled", true);
  1255. }
  1256. }
  1257. }
  1258. }
  1259. for (let i = 0; i < data.records.length; i++) {
  1260. data.records[i].qty = 1;
  1261. data.records[i].policyMaterialId = data.records[i].id;
  1262. this.$set(
  1263. data.records[i],
  1264. "zong",
  1265. data.records[i].qty * data.records[i].price
  1266. );
  1267. data.records[i].sums1 = ["price", "qty", "zong"];
  1268. // this.$set(data.records[i],'userList',this.userList)
  1269. }
  1270. if (fang) {
  1271. this.popDataArr[popType] = datas;
  1272. } else {
  1273. console.log(datas,'89');
  1274. this.popDataArr.push(datas);
  1275. }
  1276. this.totalArr.push({
  1277. totalQty: 0,
  1278. totalPrice: 0,
  1279. totalAmount: 0,
  1280. });
  1281. // this.$set(this.totalArr,[...this.totalArr])
  1282. this.listLoading = false;
  1283. // consloe(this.popDataArr);
  1284. },
  1285. // 获取政策列表
  1286. getMaterialTypeList(val) {
  1287. this.listLoading2 = true;
  1288. getMaterialTypeList({
  1289. pageNum: 1,
  1290. pageSize: -1,
  1291. policyId: this.screenForm.policyId,
  1292. saleTypeCode: this.screenForm.saleTypeCode,
  1293. specification: this.screenForm.specifications,
  1294. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1295. [val]: true,
  1296. }).then((res) => {
  1297. this.dataList = res.data.records;
  1298. if (this.listItem) {
  1299. for (let i = 0; i < this.goodsList.length; i++) {
  1300. for (let j = 0; j < this.dataList.length; j++) {
  1301. if (this.dataList[j].id == this.goodsList[i].policyMaterialId) {
  1302. this.$set(this.dataList[i], "disabled", true);
  1303. }
  1304. }
  1305. }
  1306. }
  1307. for (let i = 0; i < res.data.records.length; i++) {
  1308. this.$set(res.data.records[i], "qty", 1);
  1309. res.data.records[i].sums1 = ["price", "qty", "zong"];
  1310. res.data.records[i].userList = this.userList;
  1311. res.data.records[i].policyMaterialId = res.data.records[i].id;
  1312. for (let j = 0; j < this.goodsList.length; j++) {
  1313. if ((this.goodsList[j].id || this.goodsList[j].policyMaterialId) == res.data.records[i].id) {
  1314. res.data.records[i].disabled = false;
  1315. }
  1316. }
  1317. }
  1318. this.dataList = res.data.records;
  1319. this.total = res.data.total;
  1320. this.listLoading2 = false;
  1321. this.popDataArr = [];
  1322. this.popArr = [];
  1323. // // consloe(this.dataList, "kkkk");
  1324. });
  1325. },
  1326. // 下一步获取某个政策条件比例数据
  1327. handleCondition() {
  1328. if (this.multipleSelection.length) {
  1329. this.cusIndex += 1;
  1330. this.disabled = true;
  1331. this.multipleData.push(this.multipleSelection);
  1332. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1333. } else {
  1334. this.$errorMsg("请选择");
  1335. }
  1336. // // consloe(this.cusIndex,'下');
  1337. },
  1338. // 上一步
  1339. handleShang() {
  1340. this.cusIndex == 0 ? (this.disabled = false) : "";
  1341. this.multipleData.splice(this.cusIndex, 1);
  1342. this.popDataArr.splice(this.cusIndex, 1);
  1343. this.cusIndex -= 1;
  1344. // // consloe(this.cusIndex,'上');
  1345. },
  1346. /**
  1347. * 根据条件禁用行复选框
  1348. * 函数返回值为false则禁用选择(反之亦然)
  1349. * @param {Object} row - 行数据
  1350. * @param {String} index - 索引值
  1351. * @return Boolean
  1352. */
  1353. selectable: function (row, index) {
  1354. // row.disabled == undefined 才能被选中
  1355. if (row.disabled == undefined) {
  1356. return true;
  1357. }
  1358. // 函数必须有返回值且是布尔值
  1359. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1360. // 如果没有返回值则默认返回false(全部无法选中)
  1361. },
  1362. /**
  1363. * 根据条件禁用行复选框
  1364. * 函数返回值为false则禁用选择(反之亦然)
  1365. * @param {Object} row - 行数据
  1366. * @param {String} index - 索引值
  1367. * @return Boolean
  1368. */
  1369. selectable2: function (row, index) {
  1370. // row.disabled == undefined 才能被选中
  1371. if (row.disabled == undefined) {
  1372. return true;
  1373. }
  1374. // 函数必须有返回值且是布尔值
  1375. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1376. // 如果没有返回值则默认返回false(全部无法选中)
  1377. },
  1378. // 条件数据多选
  1379. handleSelectionChange(val, type, index) {
  1380. if (type === 1) {
  1381. this.type = 1;
  1382. if (!this.multipleSelections.length) {
  1383. this.multipleSelections = new Array(index).fill([]);
  1384. } else {
  1385. for (let i = 0; i < this.multipleSelections.length; i++) {
  1386. if (
  1387. !this.multipleSelections[i] ||
  1388. !this.multipleSelections[i].length
  1389. ) {
  1390. this.multipleSelections[i] = [];
  1391. }
  1392. }
  1393. }
  1394. this.$set(this.multipleSelections, index, val);
  1395. this.$set(this.totalArr, index, {
  1396. totalQty: 0,
  1397. totalPrice: 0,
  1398. totalAmount: 0,
  1399. });
  1400. for (let j = 0; j < this.multipleSelections[index].length; j++) {
  1401. this.multipleSelections[index][j].fang = true;
  1402. this.totalArr[index].totalQty +=
  1403. +this.multipleSelections[index][j].qty;
  1404. this.totalArr[index].totalPrice +=
  1405. +this.multipleSelections[index][j].price;
  1406. this.totalArr[index].totalAmount +=
  1407. +this.multipleSelections[index][j].price *
  1408. +this.multipleSelections[index][j].qty;
  1409. }
  1410. // consloe(this.multipleSelections);
  1411. } else {
  1412. this.type = 2;
  1413. this.multipleSelection = val;
  1414. console.log(this.multipleSelection);
  1415. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1416. for (let i = 0; i < this.multipleSelection.length; i++) {
  1417. this.multipleSelection[i].fang = true;
  1418. this.totalQty += +this.multipleSelection[i].qty;
  1419. this.totalPrice += +this.multipleSelection[i].price;
  1420. this.totalAmount +=
  1421. +this.multipleSelection[i].price * +this.multipleSelection[i].qty;
  1422. }
  1423. }
  1424. },
  1425. hanlePopData() {
  1426. console.log(this.multipleSelections);
  1427. this.multipleData.push(this.multipleSelection);
  1428. if (this.multipleData.length && this.multipleSelection.length) {
  1429. let arrData = [];
  1430. for (let i = 0; i < this.multipleData.length; i++) {
  1431. if (
  1432. this.multipleData[i].wallets &&
  1433. this.multipleData[i].wallets.length
  1434. ) {
  1435. this.multipleData[i].id = null;
  1436. this.$set(
  1437. this.multipleData[i],
  1438. "customerWalletId",
  1439. this.multipleData[i].wallets[0].customerWalletId
  1440. );
  1441. this.$set(
  1442. this.multipleData[i],
  1443. "serviceName",
  1444. this.multipleData[i].wallets[0].serviceName
  1445. );
  1446. this.$set(
  1447. this.multipleData[i],
  1448. "serviceId",
  1449. this.multipleData[i].wallets[0].serviceId
  1450. );
  1451. this.$set(this.multipleData[i], "amount", 0);
  1452. }
  1453. arrData = [...arrData, ...this.multipleData[i]];
  1454. }
  1455. if (this.goodsList.length) {
  1456. this.goodsList = [...this.goodsList, ...arrData];
  1457. } else {
  1458. this.goodsList = arrData;
  1459. }
  1460. if (this.dataList.length) {
  1461. for (let u = 0; u < this.goodsList.length; u++) {
  1462. this.goodsList[u].disabled = true;
  1463. }
  1464. this.newDataList = this.multipleSelection;
  1465. this.disabled = true;
  1466. }
  1467. this.goodsList.forEach((item) => {
  1468. item.sums1 = ["qty", "directTransferQty"];
  1469. item.sums2 = [
  1470. "price",
  1471. "rebateAmount",
  1472. "compute_amount",
  1473. "compute_flAmount",
  1474. "compute_zkAmount",
  1475. "compute_sfAmount",
  1476. ];
  1477. this.$set(item, "status1", "");
  1478. this.$set(item, "status2", "");
  1479. this.$set(item, "userList", this.userList);
  1480. });
  1481. if (this.goodsList.length && this.goodsList[0].wallets.length) {
  1482. console.log(555555);
  1483. this.mainForm.k3ServiceName =
  1484. this.goodsList[0].wallets[0].serviceName || "";
  1485. this.mainForm.k3ServiceId =
  1486. this.goodsList[0].wallets[0].serviceId || "";
  1487. }
  1488. // if (this.goodsList.length>4) {
  1489. // this.newGoodsList = this.goodsList
  1490. // this.newGoodsList.length = 4
  1491. // }
  1492. this.cusIndex = 0;
  1493. this.total = 0;
  1494. this.popDataArr = [];
  1495. this.multipleData = [];
  1496. this.multipleSelection = [];
  1497. this.policyId = this.screenForm.policyId;
  1498. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1499. this.isShowDialog = false;
  1500. this.$refs.singleTable.clearSelection();
  1501. // consloe(this.goodsList, "kkkk");
  1502. } else if (this.multipleSelections.length) {
  1503. let arrData = [];
  1504. this.newMultipleSelections = this.multipleSelections;
  1505. for (let i = 0; i < this.multipleSelections.length; i++) {
  1506. for (let j = 0; j < this.multipleSelections[i].length; j++) {
  1507. this.multipleSelections[i][j].disabled = true;
  1508. this.multipleSelections[i][j].id = null;
  1509. if (this.multipleSelections[i][j].wallets.length) {
  1510. this.$set(
  1511. this.multipleSelections[i][j],
  1512. "customerWalletId",
  1513. this.multipleSelections[i][j].wallets[0].customerWalletId
  1514. );
  1515. this.$set(
  1516. this.multipleSelections[i][j],
  1517. "serviceName",
  1518. this.multipleSelections[i][j].wallets[0].serviceName
  1519. );
  1520. this.$set(
  1521. this.multipleSelections[i][j],
  1522. "serviceId",
  1523. this.multipleSelections[i][j].wallets[0].serviceId
  1524. );
  1525. this.$set(this.multipleSelections[i][j], "amount", 0);
  1526. }
  1527. arrData = [...arrData, this.multipleSelections[i][j]];
  1528. }
  1529. }
  1530. if (this.goodsList.length) {
  1531. this.goodsList = [...this.goodsList, ...arrData];
  1532. } else {
  1533. this.goodsList = arrData;
  1534. }
  1535. if (this.goodsList.length && this.goodsList[0].wallets.length) {
  1536. this.mainForm.k3ServiceName =
  1537. this.goodsList[0].wallets[0].serviceName || "";
  1538. this.mainForm.k3ServiceId =
  1539. this.goodsList[0].wallets[0].serviceId || "";
  1540. }
  1541. this.goodsList.forEach((item) => {
  1542. this.$set(item, "status1", "");
  1543. this.$set(item, "status2", "");
  1544. this.$set(item, "userList", this.userList);
  1545. item.sums1 = ["qty", "directTransferQty"];
  1546. item.sums2 = [
  1547. "price",
  1548. "rebateAmount",
  1549. "compute_amount",
  1550. "compute_flAmount",
  1551. "compute_zkAmount",
  1552. "compute_sfAmount",
  1553. ];
  1554. });
  1555. this.disabled = true;
  1556. // this.popDataArr = [];
  1557. this.multipleData = [];
  1558. this.multipleSelection = [];
  1559. this.policyId = this.screenForm.policyId;
  1560. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1561. this.isShowDialog = false;
  1562. this.$refs.singleTable.forEach((k) => {
  1563. k.clearSelection();
  1564. });
  1565. // this.$refs.singleTable.clearSelection();
  1566. } else {
  1567. this.$errorMsg("请选择");
  1568. }
  1569. },
  1570. // 获取详情
  1571. getDetail() {
  1572. getUserList({
  1573. pageNum: 1,
  1574. pageSize: -1,
  1575. adminWebsitId: "",
  1576. isCustomer: 0,
  1577. roleId: "",
  1578. status: true,
  1579. userName: "",
  1580. }).then((res) => {
  1581. this.userList = res.data.records;
  1582. getDetail({ id: this.listItem.id }).then((res) => {
  1583. const data = res.data;
  1584. this.mainForm.date = data.theTime;
  1585. this.mainForm.type = data.mainId;
  1586. this.mainForm.remark = data.remark;
  1587. this.mainForm.policyId = data.policyId;
  1588. this.policyId = data.policyId;
  1589. this.mainForm.k3ServiceName = data.k3ServiceName;
  1590. (this.mainForm.k3ServiceId = data.k3ServiceId),
  1591. (this.mainForm.fileNum = data.fileNum);
  1592. // this.mainForm.k3ServiceName = data.retailOrderItemList[0].wallets[0].serviceName
  1593. // this.mainForm.k3ServiceId = data.retailOrderItemList[0].wallets[0].serviceId
  1594. data.retailOrderItemList.forEach((item) => {
  1595. item.status1 = "";
  1596. item.status2 = "";
  1597. item.sums1 = ["qty", "directTransferQty"];
  1598. item.sums2 = [
  1599. "price",
  1600. "rebateAmount",
  1601. "compute_amount",
  1602. "compute_flAmount",
  1603. "compute_zkAmount",
  1604. "compute_sfAmount",
  1605. ];
  1606. this.$set(item, "userList", this.userList);
  1607. item.rebateWallets.forEach((j) => {
  1608. if (j.customerWalletId2 === data.customerWalletId2) {
  1609. this.$set(item, "amount", j.amount || 0);
  1610. }
  1611. });
  1612. item.wallets.forEach((k) => {
  1613. if (k.customerWalletId === data.customerWalletId) {
  1614. this.$set(item, "serviceId", k.serviceId);
  1615. this.$set(item, "serviceName", k.serviceName);
  1616. }
  1617. });
  1618. });
  1619. this.goodsList = data.retailOrderItemList;
  1620. });
  1621. });
  1622. },
  1623. // 获取销售政策
  1624. getPolicyList() {
  1625. policyList({
  1626. pageNum: 1,
  1627. pageSize: -1,
  1628. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1629. status: true,
  1630. }).then((res) => {
  1631. if (this.policyId) {
  1632. this.screenForm.policyId = this.policyId;
  1633. this.disabled = true;
  1634. } else {
  1635. this.screenForm.policyId = res.data.records[0].code;
  1636. }
  1637. this.policyList = res.data.records;
  1638. console.log( res.data.records);
  1639. if (this.policyList.length) {
  1640. this.screenForm.saleTypeCode = ''
  1641. this.screenForm.specifications = ''
  1642. this.handlePolicy(this.screenForm.policyId)
  1643. // const type = this.policyList.find(e=>e.code==this.screenForm.policyId).type
  1644. // if (type === "PROVISION") {
  1645. // // this.handlePolicy( res.data.records[0].id);
  1646. // }else{
  1647. // }
  1648. }
  1649. });
  1650. },
  1651. // 引用销售政策搜索
  1652. async handlePolicyTypeList() {
  1653. if (!this.screenForm.policyId) {
  1654. this.$errorMsg("请选择销售政策");
  1655. return;
  1656. }
  1657. if (this.popArr.length) {
  1658. this.popDataArr = [];
  1659. this.dataList = [];
  1660. for (let i = 0; i < this.popArr.length; i++) {
  1661. await this.getConditionList(this.policyConditionId, i + 1, false);
  1662. }
  1663. } else {
  1664. // sProvision = true
  1665. this.getMaterialTypeList("sProvision");
  1666. }
  1667. },
  1668. // 获取销售类型
  1669. getTypeList() {
  1670. const params = {
  1671. pageNum: 1,
  1672. pageSize: -1,
  1673. saleCode: "",
  1674. saleName: "",
  1675. status: "",
  1676. };
  1677. typeList(params).then((res) => {
  1678. this.ztypeList = res.data.records;
  1679. // // consloe(this.ztypeList, "type1111");
  1680. });
  1681. },
  1682. // 获取仓库列表
  1683. getWarehouseList() {
  1684. getWarehouseList({
  1685. pageNum: 1,
  1686. pageSize: -1,
  1687. }).then((res) => {
  1688. this.warehouseList = res.data.records;
  1689. });
  1690. },
  1691. // 获取限定机型
  1692. getpolicyTypeList() {
  1693. getpolicyTypeList({
  1694. pageNum: 1,
  1695. pageSize: 10,
  1696. policyId: this.screenForm.policyId,
  1697. saleTypeCode: this.screenForm.saleTypeCode,
  1698. }).then((res) => {
  1699. for (let i = 0; i < res.data.records.length; i++) {
  1700. this.$set(res.data.records[i], "qty", 1);
  1701. res.data.records[i].sums2 = ["price", "qty", "zong"];
  1702. res.data.records[i].userList = this.userList;
  1703. }
  1704. this.dataList = res.data.records;
  1705. this.total = res.data.total;
  1706. });
  1707. },
  1708. // 打开引用
  1709. handleShow() {
  1710. this.isShowDialog = true;
  1711. this.getPolicyList();
  1712. },
  1713. // 获取钱包列表
  1714. getWalletList() {
  1715. getWalletList({
  1716. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1717. type: "COMMONLY",
  1718. }).then((res) => {
  1719. this.xjWalletList = res.data;
  1720. });
  1721. getWalletList({
  1722. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1723. type: "REBATE",
  1724. }).then((res) => {
  1725. this.flWalletList = res.data;
  1726. });
  1727. },
  1728. // 获取销售类型列表
  1729. getSalesTypeList() {
  1730. getSalesTypeList({
  1731. pageNum: 1,
  1732. pageSize: -1,
  1733. }).then((res) => {
  1734. this.salesTypeList = res.data.records;
  1735. });
  1736. },
  1737. getDictList() {
  1738. getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
  1739. this.typeList = res.data;
  1740. });
  1741. },
  1742. // 获取商品列表
  1743. getGoodsList() {
  1744. getGoodsList({
  1745. pageNum: this.currentPage,
  1746. pageSize: 10,
  1747. mainId: this.screenForm.type,
  1748. saleId: this.screenForm.salesType,
  1749. materialCode: this.screenForm.proNum,
  1750. materialName: this.screenForm.proName,
  1751. specification: this.screenForm.proModel,
  1752. price1: this.screenForm.price1,
  1753. price2: this.screenForm.price2,
  1754. }).then((res) => {
  1755. const oldGoodsList = this.goodsList;
  1756. const newGoodsList = res.data.records;
  1757. for (let i = 0; i < oldGoodsList.length; i++) {
  1758. const oldItem = oldGoodsList[i];
  1759. for (let j = 0; j < newGoodsList.length; j++) {
  1760. const newItem = newGoodsList[j];
  1761. if (newItem.materialId === oldItem.materialId) {
  1762. newGoodsList[j].selected = true;
  1763. break;
  1764. }
  1765. }
  1766. }
  1767. res.data.records.forEach((item) => {
  1768. item.materialName = item.name;
  1769. item.materialCode = item.number;
  1770. item.saleTypeName = item.saleName;
  1771. item.unit = item.baseUnit;
  1772. item.price = item.batchPrice;
  1773. item.tax = item.taxRate;
  1774. item.isDirectTransfer = false;
  1775. item.directTransferQty = "";
  1776. item.status1 = "";
  1777. item.status2 = "";
  1778. item.rebateAmount = "";
  1779. item.rebateRate = "";
  1780. item.productPriceId = item.id;
  1781. });
  1782. this.leftGoodsList = res.data.records;
  1783. this.listTotal = res.data.total;
  1784. });
  1785. },
  1786. // 查询重复值并禁选
  1787. checkboxSelect(row, rowIndex) {
  1788. if (row.selected) {
  1789. return false; // 禁用
  1790. } else {
  1791. return true; // 不禁用
  1792. }
  1793. },
  1794. // 点击 选择商品
  1795. openDialog() {
  1796. this.getSalesTypeList();
  1797. this.getGoodsList();
  1798. this.isShowDialog = true;
  1799. },
  1800. // 提交筛选表单
  1801. submitScreenForm() {
  1802. this.currentPage = 1;
  1803. this.getGoodsList();
  1804. },
  1805. // 重置筛选表单
  1806. resetScreenForm() {
  1807. this.$refs.screenForm.resetFields();
  1808. this.currentPage = 1;
  1809. this.getGoodsList();
  1810. },
  1811. // 关闭 弹窗
  1812. closeDialog() {
  1813. this.isShowDialog = false;
  1814. this.popDataArr = [];
  1815. },
  1816. // 删除
  1817. deleteGoods() {
  1818. const rightGoodsList = this.rightGoodsList;
  1819. const rightSelection = this.rightSelection;
  1820. for (let i = 0; i < rightGoodsList.length; i++) {
  1821. for (let j = 0; j < rightSelection.length; j++) {
  1822. if (rightSelection[j].materialId == rightGoodsList[i].materialId) {
  1823. this.rightGoodsList.splice(i, 1);
  1824. }
  1825. }
  1826. }
  1827. },
  1828. // 确定 添加产品
  1829. submitAddGoods() {
  1830. if (this.radio) {
  1831. const params = this.radio.split("&");
  1832. this.screenForm.policyId = params[1];
  1833. this.mainForm.policyId = params[1];
  1834. this.cusIndex += 1;
  1835. getpolicyList({
  1836. materialId: params[2],
  1837. policyId: params[1],
  1838. }).then((res) => {
  1839. this.pop = res.data.pop;
  1840. this.popArr = res.data.pop.split(":");
  1841. this.popArr.splice(0, 1);
  1842. for (let i = 0; i < this.popArr.length; i++) {
  1843. this.$set(this.radioObj, "radio" + (i + 1), "");
  1844. }
  1845. this.step = this.cusIndex + 1;
  1846. this.getConditionList(params[3], this.step);
  1847. });
  1848. } else {
  1849. this.$errorMsg("请选择");
  1850. }
  1851. },
  1852. // 更改每页数量
  1853. handleSizeChange(val) {
  1854. this.pageSize = val;
  1855. this.currentPage = 1;
  1856. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1857. },
  1858. // 更改当前页
  1859. handleCurrentChange(val) {
  1860. this.currentPage = val;
  1861. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1862. },
  1863. // 更改列表当前页
  1864. handleTableCurrentChange(val) {
  1865. this.currentPage = val;
  1866. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1867. },
  1868. handleClose() {
  1869. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1870. // this.dataList = [];
  1871. // this.popDataArr = [];
  1872. // this.screenForm.policyId = "";
  1873. // this.screenForm.saleTypeCode = "";
  1874. },
  1875. // 删除产品
  1876. deleteItem(index, id) {
  1877. this.goodsList.splice(index, 1);
  1878. // this.dataList
  1879. this.newDataList.splice(index, 1);
  1880. if (!this.goodsList.length) {
  1881. this.disabled = false;
  1882. this.policyId = "";
  1883. this.mainForm.policyId = "";
  1884. }
  1885. // this.popDataArr.splice(index,1)
  1886. },
  1887. // 修改返利钱包
  1888. changeWallet(e, row) {
  1889. if (e) {
  1890. const obj = row.rebateWallets.filter((k) => {
  1891. return e === k.customerWalletId;
  1892. })[0];
  1893. this.$set(row, "rebateRate", obj.rebateRate || 0);
  1894. this.$set(row, "amount", obj.amount || 0);
  1895. } else {
  1896. this.$set(row, "rebateRate", 0);
  1897. this.$set(row, "amount", 0);
  1898. }
  1899. },
  1900. clearWallet(e) {
  1901. console.log(e);
  1902. // const obj = row.rebateWallets.filter(k => {
  1903. // return e === k.customerWalletId
  1904. // })[0]
  1905. this.$set(row, "rebateRate", 0);
  1906. },
  1907. // 检查库存
  1908. checkStock() {
  1909. if (!this.warehouseValue) {
  1910. return this.$errorMsg("请选择仓库");
  1911. }
  1912. if (!this.goodsList) {
  1913. return this.$errorMsg("请添加货品");
  1914. }
  1915. const ids = [];
  1916. this.goodsList.forEach((item) => {
  1917. ids.push(item.materialId);
  1918. });
  1919. checkStock({
  1920. correspondId: this.warehouseValue,
  1921. materialId: ids.join(","),
  1922. }).then((res) => {
  1923. if (res.data) {
  1924. this.goodsList.forEach((item, index) => {
  1925. item.status1 = res.data[index].allStockNum;
  1926. item.status2 = res.data[index].stockNum;
  1927. // // consloe(item.status1, item.status2);
  1928. });
  1929. }
  1930. });
  1931. },
  1932. status2Filter(item) {
  1933. if (
  1934. item.status2 === "" ||
  1935. item.status2 === null ||
  1936. item.status2 === undefined
  1937. )
  1938. return "未检查";
  1939. if (item.status2 <= 0) {
  1940. return "无货";
  1941. } else if (item.status2 >= 1 && item.status2 <= 30) {
  1942. return item.status2;
  1943. } else if (item.status2 >= 31 && item.status2 <= 1000) {
  1944. return "有货";
  1945. } else {
  1946. return "充足";
  1947. }
  1948. // else if (item.status2 >= item.qty) return '可用'
  1949. // else return '短缺'
  1950. },
  1951. // 保存
  1952. clickSubmitForm() {
  1953. this.$refs.mainForm.validate((valid) => {
  1954. if (valid) {
  1955. // let mainName =
  1956. // this.typeList[
  1957. // findElem(this.typeList, "dictCode", this.mainForm.type)
  1958. // ].dictValue;
  1959. this.goodsList.userList = [];
  1960. this.goodsList.forEach((k) => {
  1961. delete k.userList;
  1962. });
  1963. const params = {
  1964. theTime: this.mainForm.date,
  1965. k3ServiceId: this.mainForm.k3ServiceId,
  1966. k3ServiceName: this.mainForm.k3ServiceName,
  1967. remark: this.mainForm.remark,
  1968. type: 2, // 1:普通零售单,2:政策零售单
  1969. retailOrderItemList: this.goodsList,
  1970. policyId: this.policyId,
  1971. fileNo: this.mainForm.fileNum,
  1972. };
  1973. console.log(params);
  1974. if (this.listItem) {
  1975. console.log(params.listItem);
  1976. params.id = this.listItem.id;
  1977. editData(params).then((res) => {
  1978. this.$successMsg("编辑成功");
  1979. this.goBack();
  1980. this.$parent.getList();
  1981. });
  1982. } else {
  1983. params.retailOrderItemList.forEach((k) => {
  1984. k.id = null;
  1985. });
  1986. addData(params).then((res) => {
  1987. this.$successMsg("添加成功");
  1988. this.goBack();
  1989. this.$parent.getList();
  1990. });
  1991. }
  1992. }
  1993. });
  1994. },
  1995. },
  1996. };
  1997. </script>
  1998. <style scoped lang="scss">
  1999. .yinput {
  2000. ::v-deep .el-input__inner {
  2001. text-align: right;
  2002. }
  2003. }
  2004. .fr {
  2005. margin: 10px;
  2006. overflow: hidden;
  2007. }
  2008. .detail-container {
  2009. width: 100%;
  2010. height: 100%;
  2011. margin-bottom: 80px;
  2012. ::v-deep .el-table__append-wrapper {
  2013. overflow: initial;
  2014. }
  2015. }
  2016. .table {
  2017. margin-top: 20px 0 0 0;
  2018. background-color: rgb(237 237 237);
  2019. }
  2020. .page-footer .footer.hideSidebar {
  2021. margin-left: 0;
  2022. width: 100%;
  2023. }
  2024. .mybox {
  2025. padding: 20px 0;
  2026. text-align: right;
  2027. div:first-child {
  2028. flex: 0 0 55px;
  2029. }
  2030. div {
  2031. flex: 1 0 200px;
  2032. padding-right: 10px;
  2033. text-align: right;
  2034. }
  2035. }
  2036. .myselect {
  2037. ::v-deep .el-select-dropdown__item {
  2038. max-width: 500px;
  2039. }
  2040. }
  2041. .main-title {
  2042. display: flex;
  2043. justify-content: space-between;
  2044. align-items: center;
  2045. margin-top: 20px;
  2046. height: 60px;
  2047. border-bottom: 1px solid #dcdfe6;
  2048. margin-bottom: 20px;
  2049. .title {
  2050. font-size: 16px;
  2051. font-weight: 600;
  2052. padding-left: 10px;
  2053. }
  2054. }
  2055. .tables {
  2056. display: flex;
  2057. margin-top: 10px;
  2058. .table {
  2059. width: 45%;
  2060. }
  2061. .buttons {
  2062. display: flex;
  2063. flex-direction: column;
  2064. justify-content: center;
  2065. align-items: center;
  2066. padding: 0 10px;
  2067. button {
  2068. margin: 0;
  2069. margin-top: 10px;
  2070. }
  2071. }
  2072. }
  2073. .ellipsis {
  2074. overflow: hidden;
  2075. text-overflow: ellipsis;
  2076. white-space: nowrap;
  2077. }
  2078. </style>