retail_form.vue 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158
  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. this.factor = []
  1324. // // consloe(this.dataList, "kkkk");
  1325. });
  1326. },
  1327. // 下一步获取某个政策条件比例数据
  1328. handleCondition() {
  1329. if (this.multipleSelection.length) {
  1330. this.cusIndex += 1;
  1331. this.disabled = true;
  1332. this.multipleData.push(this.multipleSelection);
  1333. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1334. } else {
  1335. this.$errorMsg("请选择");
  1336. }
  1337. // // consloe(this.cusIndex,'下');
  1338. },
  1339. // 上一步
  1340. handleShang() {
  1341. this.cusIndex == 0 ? (this.disabled = false) : "";
  1342. this.multipleData.splice(this.cusIndex, 1);
  1343. this.popDataArr.splice(this.cusIndex, 1);
  1344. this.cusIndex -= 1;
  1345. // // consloe(this.cusIndex,'上');
  1346. },
  1347. /**
  1348. * 根据条件禁用行复选框
  1349. * 函数返回值为false则禁用选择(反之亦然)
  1350. * @param {Object} row - 行数据
  1351. * @param {String} index - 索引值
  1352. * @return Boolean
  1353. */
  1354. selectable: function (row, index) {
  1355. // row.disabled == undefined 才能被选中
  1356. if (row.disabled == undefined) {
  1357. return true;
  1358. }
  1359. // 函数必须有返回值且是布尔值
  1360. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1361. // 如果没有返回值则默认返回false(全部无法选中)
  1362. },
  1363. /**
  1364. * 根据条件禁用行复选框
  1365. * 函数返回值为false则禁用选择(反之亦然)
  1366. * @param {Object} row - 行数据
  1367. * @param {String} index - 索引值
  1368. * @return Boolean
  1369. */
  1370. selectable2: function (row, index) {
  1371. // row.disabled == undefined 才能被选中
  1372. if (row.disabled == undefined) {
  1373. return true;
  1374. }
  1375. // 函数必须有返回值且是布尔值
  1376. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1377. // 如果没有返回值则默认返回false(全部无法选中)
  1378. },
  1379. // 条件数据多选
  1380. handleSelectionChange(val, type, index) {
  1381. if (type === 1) {
  1382. this.type = 1;
  1383. if (!this.multipleSelections.length) {
  1384. this.multipleSelections = new Array(index).fill([]);
  1385. } else {
  1386. for (let i = 0; i < this.multipleSelections.length; i++) {
  1387. if (
  1388. !this.multipleSelections[i] ||
  1389. !this.multipleSelections[i].length
  1390. ) {
  1391. this.multipleSelections[i] = [];
  1392. }
  1393. }
  1394. }
  1395. this.$set(this.multipleSelections, index, val);
  1396. this.$set(this.totalArr, index, {
  1397. totalQty: 0,
  1398. totalPrice: 0,
  1399. totalAmount: 0,
  1400. });
  1401. for (let j = 0; j < this.multipleSelections[index].length; j++) {
  1402. this.multipleSelections[index][j].fang = true;
  1403. this.totalArr[index].totalQty +=
  1404. +this.multipleSelections[index][j].qty;
  1405. this.totalArr[index].totalPrice +=
  1406. +this.multipleSelections[index][j].price;
  1407. this.totalArr[index].totalAmount +=
  1408. +this.multipleSelections[index][j].price *
  1409. +this.multipleSelections[index][j].qty;
  1410. }
  1411. // consloe(this.multipleSelections);
  1412. } else {
  1413. this.type = 2;
  1414. this.multipleSelection = val;
  1415. console.log(this.multipleSelection);
  1416. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1417. for (let i = 0; i < this.multipleSelection.length; i++) {
  1418. this.multipleSelection[i].fang = true;
  1419. this.totalQty += +this.multipleSelection[i].qty;
  1420. this.totalPrice += +this.multipleSelection[i].price;
  1421. this.totalAmount +=
  1422. +this.multipleSelection[i].price * +this.multipleSelection[i].qty;
  1423. }
  1424. }
  1425. },
  1426. hanlePopData() {
  1427. console.log(this.multipleSelections);
  1428. this.multipleData.push(this.multipleSelection);
  1429. if (this.multipleData.length && this.multipleSelection.length) {
  1430. let arrData = [];
  1431. for (let i = 0; i < this.multipleData.length; i++) {
  1432. if (
  1433. this.multipleData[i].wallets &&
  1434. this.multipleData[i].wallets.length
  1435. ) {
  1436. this.multipleData[i].id = null;
  1437. this.$set(
  1438. this.multipleData[i],
  1439. "customerWalletId",
  1440. this.multipleData[i].wallets[0].customerWalletId
  1441. );
  1442. this.$set(
  1443. this.multipleData[i],
  1444. "serviceName",
  1445. this.multipleData[i].wallets[0].serviceName
  1446. );
  1447. this.$set(
  1448. this.multipleData[i],
  1449. "serviceId",
  1450. this.multipleData[i].wallets[0].serviceId
  1451. );
  1452. this.$set(this.multipleData[i], "amount", 0);
  1453. }
  1454. arrData = [...arrData, ...this.multipleData[i]];
  1455. }
  1456. if (this.goodsList.length) {
  1457. this.goodsList = [...this.goodsList, ...arrData];
  1458. } else {
  1459. this.goodsList = arrData;
  1460. }
  1461. if (this.dataList.length) {
  1462. for (let u = 0; u < this.goodsList.length; u++) {
  1463. this.goodsList[u].disabled = true;
  1464. }
  1465. this.newDataList = this.multipleSelection;
  1466. this.disabled = true;
  1467. }
  1468. this.goodsList.forEach((item) => {
  1469. item.sums1 = ["qty", "directTransferQty"];
  1470. item.sums2 = [
  1471. "price",
  1472. "rebateAmount",
  1473. "compute_amount",
  1474. "compute_flAmount",
  1475. "compute_zkAmount",
  1476. "compute_sfAmount",
  1477. ];
  1478. this.$set(item, "status1", "");
  1479. this.$set(item, "status2", "");
  1480. this.$set(item, "userList", this.userList);
  1481. });
  1482. if (this.goodsList.length && this.goodsList[0].wallets.length) {
  1483. console.log(555555);
  1484. this.mainForm.k3ServiceName =
  1485. this.goodsList[0].wallets[0].serviceName || "";
  1486. this.mainForm.k3ServiceId =
  1487. this.goodsList[0].wallets[0].serviceId || "";
  1488. }
  1489. // if (this.goodsList.length>4) {
  1490. // this.newGoodsList = this.goodsList
  1491. // this.newGoodsList.length = 4
  1492. // }
  1493. this.cusIndex = 0;
  1494. this.total = 0;
  1495. this.popDataArr = [];
  1496. this.multipleData = [];
  1497. this.multipleSelection = [];
  1498. this.policyId = this.screenForm.policyId;
  1499. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1500. this.isShowDialog = false;
  1501. this.$refs.singleTable.clearSelection();
  1502. // consloe(this.goodsList, "kkkk");
  1503. } else if (this.multipleSelections.length) {
  1504. let arrData = [];
  1505. this.newMultipleSelections = this.multipleSelections;
  1506. for (let i = 0; i < this.multipleSelections.length; i++) {
  1507. for (let j = 0; j < this.multipleSelections[i].length; j++) {
  1508. this.multipleSelections[i][j].disabled = true;
  1509. this.multipleSelections[i][j].id = null;
  1510. if (this.multipleSelections[i][j].wallets.length) {
  1511. this.$set(
  1512. this.multipleSelections[i][j],
  1513. "customerWalletId",
  1514. this.multipleSelections[i][j].wallets[0].customerWalletId
  1515. );
  1516. this.$set(
  1517. this.multipleSelections[i][j],
  1518. "serviceName",
  1519. this.multipleSelections[i][j].wallets[0].serviceName
  1520. );
  1521. this.$set(
  1522. this.multipleSelections[i][j],
  1523. "serviceId",
  1524. this.multipleSelections[i][j].wallets[0].serviceId
  1525. );
  1526. this.$set(this.multipleSelections[i][j], "amount", 0);
  1527. }
  1528. arrData = [...arrData, this.multipleSelections[i][j]];
  1529. }
  1530. }
  1531. if (this.goodsList.length) {
  1532. this.goodsList = [...this.goodsList, ...arrData];
  1533. } else {
  1534. this.goodsList = arrData;
  1535. }
  1536. if (this.goodsList.length && this.goodsList[0].wallets.length) {
  1537. this.mainForm.k3ServiceName =
  1538. this.goodsList[0].wallets[0].serviceName || "";
  1539. this.mainForm.k3ServiceId =
  1540. this.goodsList[0].wallets[0].serviceId || "";
  1541. }
  1542. this.goodsList.forEach((item) => {
  1543. this.$set(item, "status1", "");
  1544. this.$set(item, "status2", "");
  1545. this.$set(item, "userList", this.userList);
  1546. item.sums1 = ["qty", "directTransferQty"];
  1547. item.sums2 = [
  1548. "price",
  1549. "rebateAmount",
  1550. "compute_amount",
  1551. "compute_flAmount",
  1552. "compute_zkAmount",
  1553. "compute_sfAmount",
  1554. ];
  1555. });
  1556. this.disabled = true;
  1557. // this.popDataArr = [];
  1558. this.multipleData = [];
  1559. this.multipleSelection = [];
  1560. this.policyId = this.screenForm.policyId;
  1561. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1562. this.isShowDialog = false;
  1563. this.$refs.singleTable.forEach((k) => {
  1564. k.clearSelection();
  1565. });
  1566. // this.$refs.singleTable.clearSelection();
  1567. } else {
  1568. this.$errorMsg("请选择");
  1569. }
  1570. },
  1571. // 获取详情
  1572. getDetail() {
  1573. getUserList({
  1574. pageNum: 1,
  1575. pageSize: -1,
  1576. adminWebsitId: "",
  1577. isCustomer: 0,
  1578. roleId: "",
  1579. status: true,
  1580. userName: "",
  1581. }).then((res) => {
  1582. this.userList = res.data.records;
  1583. getDetail({ id: this.listItem.id }).then((res) => {
  1584. const data = res.data;
  1585. this.mainForm.date = data.theTime;
  1586. this.mainForm.type = data.mainId;
  1587. this.mainForm.remark = data.remark;
  1588. this.mainForm.policyId = data.policyId;
  1589. this.policyId = data.policyId;
  1590. this.mainForm.k3ServiceName = data.k3ServiceName;
  1591. (this.mainForm.k3ServiceId = data.k3ServiceId),
  1592. (this.mainForm.fileNum = data.fileNum);
  1593. // this.mainForm.k3ServiceName = data.retailOrderItemList[0].wallets[0].serviceName
  1594. // this.mainForm.k3ServiceId = data.retailOrderItemList[0].wallets[0].serviceId
  1595. data.retailOrderItemList.forEach((item) => {
  1596. item.status1 = "";
  1597. item.status2 = "";
  1598. item.sums1 = ["qty", "directTransferQty"];
  1599. item.sums2 = [
  1600. "price",
  1601. "rebateAmount",
  1602. "compute_amount",
  1603. "compute_flAmount",
  1604. "compute_zkAmount",
  1605. "compute_sfAmount",
  1606. ];
  1607. this.$set(item, "userList", this.userList);
  1608. item.rebateWallets.forEach((j) => {
  1609. if (j.customerWalletId2 === data.customerWalletId2) {
  1610. this.$set(item, "amount", j.amount || 0);
  1611. }
  1612. });
  1613. item.wallets.forEach((k) => {
  1614. if (k.customerWalletId === data.customerWalletId) {
  1615. this.$set(item, "serviceId", k.serviceId);
  1616. this.$set(item, "serviceName", k.serviceName);
  1617. }
  1618. });
  1619. });
  1620. this.goodsList = data.retailOrderItemList;
  1621. });
  1622. });
  1623. },
  1624. // 获取销售政策
  1625. getPolicyList() {
  1626. policyList({
  1627. pageNum: 1,
  1628. pageSize: -1,
  1629. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1630. status: true,
  1631. }).then((res) => {
  1632. if (this.policyId) {
  1633. this.screenForm.policyId = this.policyId;
  1634. this.disabled = true;
  1635. } else {
  1636. this.screenForm.policyId = res.data.records[0].code;
  1637. }
  1638. this.policyList = res.data.records;
  1639. console.log( res.data.records);
  1640. if (this.policyList.length) {
  1641. this.handlePolicy(this.screenForm.policyId)
  1642. // const type = this.policyList.find(e=>e.code==this.screenForm.policyId).type
  1643. // if (type === "PROVISION") {
  1644. // // this.handlePolicy( res.data.records[0].id);
  1645. // }else{
  1646. // }
  1647. }
  1648. });
  1649. },
  1650. // 引用销售政策搜索
  1651. async handlePolicyTypeList() {
  1652. if (!this.screenForm.policyId) {
  1653. this.$errorMsg("请选择销售政策");
  1654. return;
  1655. }
  1656. if (this.popArr.length) {
  1657. this.popDataArr = [];
  1658. this.dataList = [];
  1659. for (let i = 0; i < this.popArr.length; i++) {
  1660. await this.getConditionList(this.policyConditionId, i + 1, false);
  1661. }
  1662. } else {
  1663. // sProvision = true
  1664. this.getMaterialTypeList("sProvision");
  1665. }
  1666. },
  1667. // 获取销售类型
  1668. getTypeList() {
  1669. const params = {
  1670. pageNum: 1,
  1671. pageSize: -1,
  1672. saleCode: "",
  1673. saleName: "",
  1674. status: "",
  1675. };
  1676. typeList(params).then((res) => {
  1677. this.ztypeList = res.data.records;
  1678. // // consloe(this.ztypeList, "type1111");
  1679. });
  1680. },
  1681. // 获取仓库列表
  1682. getWarehouseList() {
  1683. getWarehouseList({
  1684. pageNum: 1,
  1685. pageSize: -1,
  1686. }).then((res) => {
  1687. this.warehouseList = res.data.records;
  1688. });
  1689. },
  1690. // 获取限定机型
  1691. getpolicyTypeList() {
  1692. getpolicyTypeList({
  1693. pageNum: 1,
  1694. pageSize: 10,
  1695. policyId: this.screenForm.policyId,
  1696. saleTypeCode: this.screenForm.saleTypeCode,
  1697. }).then((res) => {
  1698. for (let i = 0; i < res.data.records.length; i++) {
  1699. this.$set(res.data.records[i], "qty", 1);
  1700. res.data.records[i].sums2 = ["price", "qty", "zong"];
  1701. res.data.records[i].userList = this.userList;
  1702. }
  1703. this.dataList = res.data.records;
  1704. this.total = res.data.total;
  1705. });
  1706. },
  1707. // 打开引用
  1708. handleShow() {
  1709. this.isShowDialog = true;
  1710. this.getPolicyList();
  1711. },
  1712. // 获取钱包列表
  1713. getWalletList() {
  1714. getWalletList({
  1715. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1716. type: "COMMONLY",
  1717. }).then((res) => {
  1718. this.xjWalletList = res.data;
  1719. });
  1720. getWalletList({
  1721. customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
  1722. type: "REBATE",
  1723. }).then((res) => {
  1724. this.flWalletList = res.data;
  1725. });
  1726. },
  1727. // 获取销售类型列表
  1728. getSalesTypeList() {
  1729. getSalesTypeList({
  1730. pageNum: 1,
  1731. pageSize: -1,
  1732. }).then((res) => {
  1733. this.salesTypeList = res.data.records;
  1734. });
  1735. },
  1736. getDictList() {
  1737. getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
  1738. this.typeList = res.data;
  1739. });
  1740. },
  1741. // 获取商品列表
  1742. getGoodsList() {
  1743. getGoodsList({
  1744. pageNum: this.currentPage,
  1745. pageSize: 10,
  1746. mainId: this.screenForm.type,
  1747. saleId: this.screenForm.salesType,
  1748. materialCode: this.screenForm.proNum,
  1749. materialName: this.screenForm.proName,
  1750. specification: this.screenForm.proModel,
  1751. price1: this.screenForm.price1,
  1752. price2: this.screenForm.price2,
  1753. }).then((res) => {
  1754. const oldGoodsList = this.goodsList;
  1755. const newGoodsList = res.data.records;
  1756. for (let i = 0; i < oldGoodsList.length; i++) {
  1757. const oldItem = oldGoodsList[i];
  1758. for (let j = 0; j < newGoodsList.length; j++) {
  1759. const newItem = newGoodsList[j];
  1760. if (newItem.materialId === oldItem.materialId) {
  1761. newGoodsList[j].selected = true;
  1762. break;
  1763. }
  1764. }
  1765. }
  1766. res.data.records.forEach((item) => {
  1767. item.materialName = item.name;
  1768. item.materialCode = item.number;
  1769. item.saleTypeName = item.saleName;
  1770. item.unit = item.baseUnit;
  1771. item.price = item.batchPrice;
  1772. item.tax = item.taxRate;
  1773. item.isDirectTransfer = false;
  1774. item.directTransferQty = "";
  1775. item.status1 = "";
  1776. item.status2 = "";
  1777. item.rebateAmount = "";
  1778. item.rebateRate = "";
  1779. item.productPriceId = item.id;
  1780. });
  1781. this.leftGoodsList = res.data.records;
  1782. this.listTotal = res.data.total;
  1783. });
  1784. },
  1785. // 查询重复值并禁选
  1786. checkboxSelect(row, rowIndex) {
  1787. if (row.selected) {
  1788. return false; // 禁用
  1789. } else {
  1790. return true; // 不禁用
  1791. }
  1792. },
  1793. // 点击 选择商品
  1794. openDialog() {
  1795. this.getSalesTypeList();
  1796. this.getGoodsList();
  1797. this.isShowDialog = true;
  1798. },
  1799. // 提交筛选表单
  1800. submitScreenForm() {
  1801. this.currentPage = 1;
  1802. this.getGoodsList();
  1803. },
  1804. // 重置筛选表单
  1805. resetScreenForm() {
  1806. this.$refs.screenForm.resetFields();
  1807. this.currentPage = 1;
  1808. this.getGoodsList();
  1809. },
  1810. // 关闭 弹窗
  1811. closeDialog() {
  1812. this.isShowDialog = false;
  1813. this.popDataArr = [];
  1814. },
  1815. // 删除
  1816. deleteGoods() {
  1817. const rightGoodsList = this.rightGoodsList;
  1818. const rightSelection = this.rightSelection;
  1819. for (let i = 0; i < rightGoodsList.length; i++) {
  1820. for (let j = 0; j < rightSelection.length; j++) {
  1821. if (rightSelection[j].materialId == rightGoodsList[i].materialId) {
  1822. this.rightGoodsList.splice(i, 1);
  1823. }
  1824. }
  1825. }
  1826. },
  1827. // 确定 添加产品
  1828. submitAddGoods() {
  1829. if (this.radio) {
  1830. const params = this.radio.split("&");
  1831. this.screenForm.policyId = params[1];
  1832. this.mainForm.policyId = params[1];
  1833. this.cusIndex += 1;
  1834. getpolicyList({
  1835. materialId: params[2],
  1836. policyId: params[1],
  1837. }).then((res) => {
  1838. this.pop = res.data.pop;
  1839. this.popArr = res.data.pop.split(":");
  1840. this.popArr.splice(0, 1);
  1841. for (let i = 0; i < this.popArr.length; i++) {
  1842. this.$set(this.radioObj, "radio" + (i + 1), "");
  1843. }
  1844. this.step = this.cusIndex + 1;
  1845. this.getConditionList(params[3], this.step);
  1846. });
  1847. } else {
  1848. this.$errorMsg("请选择");
  1849. }
  1850. },
  1851. // 更改每页数量
  1852. handleSizeChange(val) {
  1853. this.pageSize = val;
  1854. this.currentPage = 1;
  1855. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1856. },
  1857. // 更改当前页
  1858. handleCurrentChange(val) {
  1859. this.currentPage = val;
  1860. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1861. },
  1862. // 更改列表当前页
  1863. handleTableCurrentChange(val) {
  1864. this.currentPage = val;
  1865. this.getConditionList(this.policyConditionId, this.cusIndex + 1);
  1866. },
  1867. handleClose() {
  1868. this.totalQty = this.totalPrice = this.totalAmount = 0;
  1869. // this.dataList = [];
  1870. // this.popDataArr = [];
  1871. // this.screenForm.policyId = "";
  1872. // this.screenForm.saleTypeCode = "";
  1873. },
  1874. // 删除产品
  1875. deleteItem(index, id) {
  1876. this.goodsList.splice(index, 1);
  1877. // this.dataList
  1878. this.newDataList.splice(index, 1);
  1879. if (!this.goodsList.length) {
  1880. this.disabled = false;
  1881. this.policyId = "";
  1882. this.mainForm.policyId = "";
  1883. }
  1884. // this.popDataArr.splice(index,1)
  1885. },
  1886. // 修改返利钱包
  1887. changeWallet(e, row) {
  1888. if (e) {
  1889. const obj = row.rebateWallets.filter((k) => {
  1890. return e === k.customerWalletId;
  1891. })[0];
  1892. this.$set(row, "rebateRate", obj.rebateRate || 0);
  1893. this.$set(row, "amount", obj.amount || 0);
  1894. } else {
  1895. this.$set(row, "rebateRate", 0);
  1896. this.$set(row, "amount", 0);
  1897. }
  1898. },
  1899. clearWallet(e) {
  1900. console.log(e);
  1901. // const obj = row.rebateWallets.filter(k => {
  1902. // return e === k.customerWalletId
  1903. // })[0]
  1904. this.$set(row, "rebateRate", 0);
  1905. },
  1906. // 检查库存
  1907. checkStock() {
  1908. if (!this.warehouseValue) {
  1909. return this.$errorMsg("请选择仓库");
  1910. }
  1911. if (!this.goodsList) {
  1912. return this.$errorMsg("请添加货品");
  1913. }
  1914. const ids = [];
  1915. this.goodsList.forEach((item) => {
  1916. ids.push(item.materialId);
  1917. });
  1918. checkStock({
  1919. correspondId: this.warehouseValue,
  1920. materialId: ids.join(","),
  1921. }).then((res) => {
  1922. if (res.data) {
  1923. this.goodsList.forEach((item, index) => {
  1924. item.status1 = res.data[index].allStockNum;
  1925. item.status2 = res.data[index].stockNum;
  1926. // // consloe(item.status1, item.status2);
  1927. });
  1928. }
  1929. });
  1930. },
  1931. status2Filter(item) {
  1932. if (
  1933. item.status2 === "" ||
  1934. item.status2 === null ||
  1935. item.status2 === undefined
  1936. )
  1937. return "未检查";
  1938. if (item.status2 <= 0) {
  1939. return "无货";
  1940. } else if (item.status2 >= 1 && item.status2 <= 30) {
  1941. return item.status2;
  1942. } else if (item.status2 >= 31 && item.status2 <= 1000) {
  1943. return "有货";
  1944. } else {
  1945. return "充足";
  1946. }
  1947. // else if (item.status2 >= item.qty) return '可用'
  1948. // else return '短缺'
  1949. },
  1950. // 保存
  1951. clickSubmitForm() {
  1952. this.$refs.mainForm.validate((valid) => {
  1953. if (valid) {
  1954. // let mainName =
  1955. // this.typeList[
  1956. // findElem(this.typeList, "dictCode", this.mainForm.type)
  1957. // ].dictValue;
  1958. this.goodsList.userList = [];
  1959. this.goodsList.forEach((k) => {
  1960. delete k.userList;
  1961. });
  1962. const params = {
  1963. theTime: this.mainForm.date,
  1964. k3ServiceId: this.mainForm.k3ServiceId,
  1965. k3ServiceName: this.mainForm.k3ServiceName,
  1966. remark: this.mainForm.remark,
  1967. type: 2, // 1:普通零售单,2:政策零售单
  1968. retailOrderItemList: this.goodsList,
  1969. policyId: this.policyId,
  1970. fileNo: this.mainForm.fileNum,
  1971. };
  1972. console.log(params);
  1973. if (this.listItem) {
  1974. console.log(params.listItem);
  1975. params.id = this.listItem.id;
  1976. editData(params).then((res) => {
  1977. this.$successMsg("编辑成功");
  1978. this.goBack();
  1979. this.$parent.getList();
  1980. });
  1981. } else {
  1982. params.retailOrderItemList.forEach((k) => {
  1983. k.id = null;
  1984. });
  1985. addData(params).then((res) => {
  1986. this.$successMsg("添加成功");
  1987. this.goBack();
  1988. this.$parent.getList();
  1989. });
  1990. }
  1991. }
  1992. });
  1993. },
  1994. },
  1995. };
  1996. </script>
  1997. <style scoped lang="scss">
  1998. .yinput {
  1999. ::v-deep .el-input__inner {
  2000. text-align: right;
  2001. }
  2002. }
  2003. .fr {
  2004. margin: 10px;
  2005. overflow: hidden;
  2006. }
  2007. .detail-container {
  2008. width: 100%;
  2009. height: 100%;
  2010. margin-bottom: 80px;
  2011. ::v-deep .el-table__append-wrapper {
  2012. overflow: initial;
  2013. }
  2014. }
  2015. .table {
  2016. margin-top: 20px 0 0 0;
  2017. background-color: rgb(237 237 237);
  2018. }
  2019. .page-footer .footer.hideSidebar {
  2020. margin-left: 0;
  2021. width: 100%;
  2022. }
  2023. .mybox {
  2024. padding: 20px 0;
  2025. text-align: right;
  2026. div:first-child {
  2027. flex: 0 0 55px;
  2028. }
  2029. div {
  2030. flex: 1 0 200px;
  2031. padding-right: 10px;
  2032. text-align: right;
  2033. }
  2034. }
  2035. .myselect {
  2036. ::v-deep .el-select-dropdown__item {
  2037. max-width: 500px;
  2038. }
  2039. }
  2040. .main-title {
  2041. display: flex;
  2042. justify-content: space-between;
  2043. align-items: center;
  2044. margin-top: 20px;
  2045. height: 60px;
  2046. border-bottom: 1px solid #dcdfe6;
  2047. margin-bottom: 20px;
  2048. .title {
  2049. font-size: 16px;
  2050. font-weight: 600;
  2051. padding-left: 10px;
  2052. }
  2053. }
  2054. .tables {
  2055. display: flex;
  2056. margin-top: 10px;
  2057. .table {
  2058. width: 45%;
  2059. }
  2060. .buttons {
  2061. display: flex;
  2062. flex-direction: column;
  2063. justify-content: center;
  2064. align-items: center;
  2065. padding: 0 10px;
  2066. button {
  2067. margin: 0;
  2068. margin-top: 10px;
  2069. }
  2070. }
  2071. }
  2072. .ellipsis {
  2073. overflow: hidden;
  2074. text-overflow: ellipsis;
  2075. white-space: nowrap;
  2076. }
  2077. </style>