editPolicy.vue 48 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415
  1. <template>
  2. <div>
  3. <div v-show="isCondition == 0" class="">
  4. <div>
  5. <div class="screen-container">
  6. <h4>销售政策信息</h4>
  7. <el-divider />
  8. <el-form ref="form" :model="searchForm" label-width="160px" size="mini" class="demo-searchForm">
  9. <el-row>
  10. <el-col :xs="24" :ms="12" :lg="12">
  11. <el-form-item label="销售政策编号">
  12. <el-input v-model="searchForm.code" disabled placeholder="如未填写,则系统自动生成" />
  13. </el-form-item>
  14. </el-col>
  15. <el-col :xs="24" :ms="12" :lg="12">
  16. <el-form-item label="销售政策名称" prop="title">
  17. <el-input v-model="searchForm.title" placeholder="销售政策名称" />
  18. </el-form-item>
  19. </el-col>
  20. <el-col :xs="24" :ms="12" :lg="12">
  21. <el-form-item label="销售政策类型" prop="type">
  22. <el-select v-model="searchForm.type" size="mini" placeholder="销售政策类型" class="select_height">
  23. <el-option
  24. v-for="(item, index) in typeOptions"
  25. :key="index"
  26. :label="item.label"
  27. :value="item.value"
  28. />
  29. </el-select>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :ms="12" :lg="12">
  33. <el-form-item label="" prop="type">
  34. <div style="height: 30px">
  35. <el-checkbox v-model="searchForm.isFullRebate">返利使用金额需满额使用</el-checkbox>
  36. <el-checkbox v-model="searchForm.commercialType">商用空调政策</el-checkbox>
  37. </div>
  38. </el-form-item>
  39. </el-col>
  40. <!-- <el-col :xs="24" :ms="12" :lg="12">
  41. <el-form-item label="产品类别" prop="mainId">
  42. <el-select
  43. v-model="searchForm.mainId"
  44. :disabled="dataList.length ? true : false"
  45. placeholder="请选择"
  46. @change="handelStop"
  47. >
  48. <el-option
  49. v-for="item in dictList"
  50. :label="item.dictValue"
  51. :value="item.dictCode"
  52. ></el-option>
  53. </el-select>
  54. </el-form-item>
  55. </el-col> -->
  56. <el-col :xs="24" :ms="12" :lg="12">
  57. <el-form-item label="生效日期" prop="startTime">
  58. <el-date-picker
  59. v-model="searchForm.startTime"
  60. type="datetime"
  61. placeholder="生效日期"
  62. default-time="00:00:00"
  63. value-format="yyyy-MM-dd HH:mm:ss"
  64. />
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :ms="12" :lg="12">
  68. <el-form-item label="失效日期" prop="endTime">
  69. <el-date-picker
  70. v-model="searchForm.endTime"
  71. type="datetime"
  72. placeholder="失效日期"
  73. default-time="00:00:00"
  74. value-format="yyyy-MM-dd HH:mm:ss"
  75. />
  76. </el-form-item>
  77. </el-col>
  78. <el-col :xs="24" :ms="24" :lg="24">
  79. <el-form-item label="表头备注" prop="remark">
  80. <el-input v-model="searchForm.remark" placeholder="新风机变频挂机。按提货数量1:3开单" />
  81. </el-form-item>
  82. </el-col>
  83. <template v-if="searchForm.type === 'LIMIT'">
  84. <el-col :xs="24" :ms="12" :lg="12">
  85. <el-form-item label="商家最少起提数量" prop="minBuyNum">
  86. <el-input v-model.number="searchForm.minBuyNum" type="number" placeholder="商家最少起提数量" />
  87. </el-form-item>
  88. </el-col>
  89. <el-col :xs="24" :ms="12" :lg="12">
  90. <el-form-item label="商家最大提货组数" prop="maxBuyNum">
  91. <el-input v-model.number="searchForm.maxBuyNum" type="number" placeholder="商家最大提货组数" />
  92. </el-form-item>
  93. </el-col>
  94. </template>
  95. <el-col :xs="24" :ms="24" :lg="24">
  96. <el-form-item label="政策封面图">
  97. <ImageUpload class="elImageClose" :file-list="fileList" multiple :limit="3" />
  98. </el-form-item>
  99. </el-col>
  100. </el-row>
  101. </el-form>
  102. </div>
  103. <div class="mymian-container">
  104. <el-row>
  105. <el-divider />
  106. <el-row type="flex">
  107. <el-col :span="12">
  108. <h4 style="display: inline-block; margin-right: 20px">货品信息</h4>
  109. <template>
  110. <el-upload
  111. class="import-btn"
  112. :action="baseURL + 'student/import'"
  113. :http-request="handleImport"
  114. :file-list="importFileList"
  115. :show-file-list="false"
  116. >
  117. <el-button type="primary" size="mini">导入货品价格表</el-button>
  118. </el-upload>
  119. </template>
  120. <el-button type="primary" size="mini" @click="handleDownloadFiles">下载模板</el-button>
  121. </el-col>
  122. </el-row>
  123. <el-divider />
  124. </el-row>
  125. <div class="table">
  126. <!-- v-el-select-loadmore="loadmore2" -->
  127. <pl-table
  128. ref="plTable"
  129. v-loading="listLoading"
  130. class="plTable"
  131. :data="dataList"
  132. row-key="index"
  133. use-virtual
  134. :data-changes-scroll-top="false"
  135. big-data-checkbox
  136. element-loading-text="Loading"
  137. height="450"
  138. border
  139. fit
  140. stripe
  141. >
  142. <pl-table-column type="index" label="序号" width="50" align="left" />
  143. <pl-table-column prop="materialNumber" label="物料编码" align="left" min-width="200">
  144. <template slot-scope="scope">
  145. <CopyButton :copy-text="scope.row.materialNumber" />
  146. <template v-if="scope.row.fang">
  147. {{ scope.row.materialNumber }}
  148. </template>
  149. <el-select
  150. v-else
  151. v-model="scope.row.materialNumber"
  152. size="mini"
  153. :remote-method="query => remoteMethod(query, 'number')"
  154. filterable
  155. remote
  156. style="width: 85%"
  157. @change="handleK3List($event, scope.row, scope.$index, 'materialNumber')"
  158. >
  159. <el-option v-for="(item, index) in k3List" :key="index" :label="item.number" :value="item.id" />
  160. </el-select>
  161. </template>
  162. </pl-table-column>
  163. <pl-table-column show-overflow-tooltip min-width="150" prop="materialName" label="产品名称" align="left">
  164. <template slot-scope="scope">
  165. <CopyButton :copy-text="scope.row.materialName" />
  166. <span>{{ scope.row.materialName }}</span>
  167. </template>
  168. </pl-table-column>
  169. <pl-table-column min-width="300" prop="specification" label="规格型号" align="left">
  170. <template slot-scope="scope">
  171. <CopyButton :copy-text="scope.row.specification" />
  172. <template v-if="scope.row.fang">
  173. {{ scope.row.specification }}
  174. </template>
  175. <el-tooltip v-else :disabled="scope.row.specification? false: true" class="item" effect="dark" :content="scope.row.specification" placement="top-start">
  176. <el-select
  177. v-model="scope.row.specification"
  178. size="mini"
  179. :remote-method="query => remoteMethod(query, 'specification')"
  180. filterable
  181. style="width: 85%"
  182. remote
  183. @change="handleK3List($event, scope.row, scope.$index, 'specification')"
  184. >
  185. <el-option
  186. v-for="(item, index) in k3List"
  187. :key="index"
  188. :label="item.specification"
  189. :value="item.id"
  190. />
  191. </el-select>
  192. </el-tooltip>
  193. </template>
  194. </pl-table-column>
  195. <pl-table-column show-overflow-tooltip min-width="150" prop="saleTypeName" label="销售类型" align="left">
  196. <template slot-scope="scope">
  197. <template v-if="scope.row.fang">
  198. {{ scope.row.saleTypeName }}
  199. </template>
  200. <el-select
  201. v-else
  202. v-model="scope.row.saleTypeId"
  203. remote
  204. reserve-keyword
  205. :remote-method="query => remoteMethodType(query, 'saleTypeId')"
  206. size="mini"
  207. filterable
  208. @change="handleSalesType($event, scope.row, scope.$index, 'saleTypeId')"
  209. >
  210. <el-option v-for="(item, index) in typeList" :key="index" :label="item.saleName" :value="item.id" />
  211. </el-select>
  212. </template>
  213. </pl-table-column>
  214. <pl-table-column
  215. show-overflow-tooltip
  216. min-width="150"
  217. prop="saleTypeCode"
  218. label="销售类型编码"
  219. align="left"
  220. />
  221. <pl-table-column prop="discAmount" label="格力折扣" align="right">
  222. <template slot-scope="scope">
  223. <template v-if="scope.row.fang">
  224. {{ scope.row.discAmount }}
  225. </template>
  226. <el-input
  227. v-else
  228. v-model.number="scope.row.discAmount"
  229. class="yinput"
  230. type="number"
  231. placeholder="请输入格力折扣"
  232. size="mini"
  233. @mousewheel.native.prevent
  234. @change="setText($event, scope.$index, scope.row, 'discAmount')"
  235. />
  236. </template>
  237. </pl-table-column>
  238. <pl-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
  239. <template slot-scope="scope">
  240. <template v-if="scope.row.fang">
  241. {{ scope.row.orgPrice }}
  242. </template>
  243. <el-input
  244. v-else
  245. v-model.number="scope.row.orgPrice"
  246. class="yinput"
  247. type="number"
  248. placeholder="请输入原供价"
  249. size="mini"
  250. @mousewheel.native.prevent
  251. @change="setText($event, scope.$index, scope.row, 'orgPrice')"
  252. />
  253. </template>
  254. </pl-table-column>
  255. <pl-table-column prop="priceType" label="价格类型" align="left" min-width="150">
  256. <template slot-scope="scope">
  257. <template v-if="scope.row.fang">
  258. {{ scope.row.priceType }}
  259. </template>
  260. <el-select
  261. v-else
  262. v-model="scope.row.priceType"
  263. size="mini"
  264. filterable
  265. clearable
  266. @change="setText($event, scope.$index, scope.row, 'priceType')"
  267. @focus="handlePriceType(scope.row)"
  268. >
  269. <el-option
  270. v-for="item in priceList2"
  271. :key="item.priceTypeId"
  272. :label="item.priceTypeName"
  273. :value="item.priceTypeId"
  274. />
  275. </el-select>
  276. </template>
  277. </pl-table-column>
  278. <pl-table-column prop="price" label="单价" align="right" show-overflow-tooltip min-width="150">
  279. <template slot-scope="scope">
  280. <template v-if="scope.row.fang">
  281. {{ scope.row.price }}
  282. </template>
  283. <el-input
  284. v-else
  285. v-model.number="scope.row.price"
  286. class="yinput"
  287. type="number"
  288. placeholder="请输入单价"
  289. size="mini"
  290. @change="setText($event, scope.$index, scope.row, 'price')"
  291. @mousewheel.native.prevent
  292. />
  293. </template>
  294. </pl-table-column>
  295. <pl-table-column label="返利钱包" align="left" show-overflow-tooltip min-width="200">
  296. <template slot-scope="scope">
  297. <template v-if="scope.row.fang">
  298. <template v-for="(item, index) in scope.row.walletRelaList">
  299. <el-tag v-if="item.type === 'REBATE'" :key="index" style="margin: 5px" type="success" size="mini">
  300. {{ item.walletName }}
  301. </el-tag>
  302. </template>
  303. </template>
  304. <template v-else>
  305. <el-select
  306. v-if="!rebateList2.length"
  307. v-model="scope.row.rebateWalletIds"
  308. size="mini"
  309. multiple
  310. collapse-tags
  311. filterable
  312. @change="setText($event, scope.$index, scope.row, 'rebateWalletIds')"
  313. >
  314. <el-option
  315. v-for="item in rebateList"
  316. :key="item.walletRebateId"
  317. :label="item.name"
  318. :value="item.walletRebateId"
  319. />
  320. </el-select>
  321. <el-select
  322. v-else
  323. v-model="scope.row.rebateWalletIds"
  324. size="mini"
  325. multiple
  326. collapse-tags
  327. filterable
  328. @change="setText($event, scope.$index, scope.row, 'rebateWalletIds')"
  329. >
  330. <el-option
  331. v-for="item in rebateList2"
  332. :key="item.walletRebateId"
  333. :label="item.name"
  334. :value="item.walletRebateId"
  335. />
  336. </el-select>
  337. </template>
  338. </template>
  339. </pl-table-column>
  340. <pl-table-column label="现金钱包" align="left" show-overflow-tooltip min-width="200">
  341. <template slot-scope="scope">
  342. <template v-if="scope.row.fang">
  343. <template v-for="(item, index) in scope.row.walletRelaList">
  344. <el-tag v-if="item.type === 'COMMONLY'" :key="index" style="margin: 5px" type="success" size="mini">
  345. {{ item.walletName }}
  346. </el-tag>
  347. </template>
  348. </template>
  349. <template v-else>
  350. <el-select
  351. v-if="!NoRebateWalletList2.length"
  352. v-model="scope.row.walletIds"
  353. size="mini"
  354. multiple
  355. collapse-tags
  356. filterable
  357. placeholder="请选择价格类型带出钱包"
  358. @change="setText($event, scope.$index, scope.row, 'walletIds')"
  359. >
  360. <el-option v-for="item in NoRebateWalletList" :key="item.id" :label="item.name" :value="item.id" />
  361. </el-select>
  362. <el-select
  363. v-else
  364. v-model="scope.row.walletIds"
  365. size="mini"
  366. multiple
  367. collapse-tags
  368. filterable
  369. placeholder="请选择价格类型带出钱包"
  370. @change="setText($event, scope.$index, scope.row, 'walletIds')"
  371. >
  372. <el-option v-for="item in NoRebateWalletList2" :key="item.id" :label="item.name" :value="item.id" />
  373. </el-select>
  374. </template>
  375. </template>
  376. </pl-table-column>
  377. <pl-table-column prop="remark" label="备注" align="left" show-overflow-tooltip min-width="150">
  378. <template slot-scope="scope">
  379. <template v-if="scope.row.fang">
  380. {{ scope.row.remark }}
  381. </template>
  382. <el-input
  383. v-else
  384. v-model="scope.row.remark"
  385. placeholder="备注"
  386. size="mini"
  387. @change="setText($event, scope.$index, scope.row, 'remark')"
  388. />
  389. </template>
  390. </pl-table-column>
  391. <pl-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
  392. <template slot-scope="scope">
  393. {{ scope.row.status ? '启用' : '作废' }}
  394. </template>
  395. </pl-table-column>
  396. <pl-table-column label="操作" align="center" min-width="150">
  397. <template slot-scope="scope">
  398. <el-button
  399. type="text"
  400. class="textColor el-popover-left"
  401. @click="handleEdit(scope.row, scope.$index)"
  402. >编辑
  403. </el-button>
  404. <el-popconfirm
  405. confirm-button-text="好的"
  406. cancel-button-text="不用了"
  407. icon="el-icon-info"
  408. icon-color="red"
  409. title="内容确定删除吗?"
  410. @onConfirm="handleDelete(scope.row.id, scope.$index)"
  411. >
  412. <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
  413. </el-popconfirm>
  414. <el-popconfirm
  415. v-if="!scope.row.status"
  416. confirm-button-text="好的"
  417. cancel-button-text="不用了"
  418. icon="el-icon-info"
  419. icon-color="red"
  420. title="启用吗?"
  421. @onConfirm="handleStatus(scope.row.id, true)"
  422. >
  423. <el-button slot="reference" type="text" class="textColor el-popover-left">启用</el-button>
  424. </el-popconfirm>
  425. <el-popconfirm
  426. v-else
  427. confirm-button-text="好的"
  428. cancel-button-text="不用了"
  429. icon="el-icon-info"
  430. icon-color="red"
  431. title="作废吗?"
  432. @onConfirm="handleStatus(scope.row.id, false)"
  433. >
  434. <el-button slot="reference" type="text" class="textColor el-popover-left">作废</el-button>
  435. </el-popconfirm>
  436. </template>
  437. </pl-table-column>
  438. </pl-table>
  439. </div>
  440. <!-- 分页 -->
  441. <div style="margin: 20px 20px 20px 0; display: flex; justify-content: space-between">
  442. <div>
  443. <el-button type="primary" size="mini" @click="handleNewInfo">添加</el-button>
  444. <el-button v-loading="fullscreenLoading" type="primary" size="mini" @click="handleSave">保存</el-button>
  445. </div>
  446. <!-- <el-pagination-->
  447. <!-- :current-page="dcurrentPage"-->
  448. <!-- :page-sizes="pageSizeArr"-->
  449. <!-- :page-size="size"-->
  450. <!-- layout="total, sizes, prev, pager, next, jumper"-->
  451. <!-- :total="listTotal"-->
  452. <!-- @size-change="handleSizeChange2"-->
  453. <!-- @current-change="handleCurrentChange2"-->
  454. <!-- />-->
  455. </div>
  456. <el-row>
  457. <el-divider />
  458. <el-row type="flex">
  459. <el-col :span="12">
  460. <h4 style="display: inline-block; margin-right: 20px">条件信息</h4>
  461. <el-button type="primary" size="mini" @click="handleAddCondition">添加</el-button>
  462. </el-col>
  463. </el-row>
  464. <el-divider />
  465. </el-row>
  466. <el-table :data="conditionList" element-loading-text="Loading" border fit highlight-current-row stripe>
  467. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  468. <el-table-column prop="name" label="限定条件" align="left">
  469. <template slot-scope="scope">
  470. <el-input
  471. v-model="scope.row.name"
  472. size="mini"
  473. style="text-align: center"
  474. placeholder="请输入名称"
  475. :disabled="scope.row.fang"
  476. @blur="handleConditionName(scope.row)"
  477. />
  478. </template>
  479. </el-table-column>
  480. <el-table-column fixed="right" width="150" label="操作" align="center">
  481. <template slot-scope="scope">
  482. <el-button
  483. type="text"
  484. size="mini"
  485. @click="
  486. scope.row.fang = false
  487. conditName = scope.row.name
  488. "
  489. >编辑
  490. </el-button>
  491. <el-button type="text" size="mini" @click="handleCondition(scope.row.id, scope.$index)">删除</el-button>
  492. <el-button type="text" size="mini" @click="catCond(scope.row)">查看条件</el-button>
  493. </template>
  494. </el-table-column>
  495. </el-table>
  496. </div>
  497. <div>
  498. <el-row>
  499. <el-divider />
  500. <el-row type="flex" align="middle">
  501. <el-col :span="2">
  502. <h4>经销商信息</h4>
  503. </el-col>
  504. </el-row>
  505. <el-divider />
  506. </el-row>
  507. <TabelTransfer
  508. v-if="detail && detail.code"
  509. :code="detail.code"
  510. :batch="true"
  511. :yregion="region"
  512. :policy-type="searchForm.type"
  513. @handlEditPolicy="handlEditPolicy"
  514. @handleReset="handleReset"
  515. />
  516. </div>
  517. </div>
  518. </div>
  519. <AddCondition
  520. v-show="isCondition === 1"
  521. ref="comDom"
  522. :code="searchForm.code"
  523. :is-show="isShow"
  524. :is-flag="isFlag"
  525. :is-condition="isCondition"
  526. @handleSubmitCon="handleSubmitCon"
  527. @back="handleBack"
  528. />
  529. <AddCondition
  530. v-show="isCondition === 2"
  531. :id="cid"
  532. ref="cond"
  533. :code="searchForm.code"
  534. :is-show="isShow"
  535. :is-flag="isFlag"
  536. :is-condition="isCondition"
  537. @back="handleBack"
  538. />
  539. </div>
  540. </template>
  541. <script>
  542. import { mapGetters, mapMutations } from 'vuex'
  543. import Minxin from '@/mixin'
  544. import {
  545. deleteCondition,
  546. deleteMaterialPolicy,
  547. getConditionList,
  548. getK3List,
  549. getMaterialList,
  550. getNoRebateWalletList,
  551. getPolicyDetail,
  552. getTypeList,
  553. getWalletRebateList,
  554. savePolicy,
  555. updateCondition,
  556. updatePolicy,
  557. setStauts
  558. } from '@/api/policy_list'
  559. import { getPriceSalesRelaListV2 } from '@/api/priceType'
  560. import { downloadFiles, handleImport } from '@/utils/util'
  561. // import Transfer from './Transfer'
  562. import TabelTransfer from './TabelTransfer'
  563. import AddCondition from './AddCondition'
  564. import ImageUpload from '@/components/Common/image-upload.vue'
  565. import { PlTable, PlTableColumn } from 'pl-table'
  566. export default {
  567. directives: {
  568. 'el-select-loadmore': {
  569. bind(el, binding) {
  570. console.log(el)
  571. // 获取element-ui定义好的scroll盒⼦
  572. const SELECTWRAP_DOM = el.querySelector(
  573. '.el-table__body-wrapper'
  574. // '.el-select-dropdown .el-select-dropdown__wrap'
  575. )
  576. SELECTWRAP_DOM.addEventListener('scroll', function() {
  577. /**
  578. * scrollHeight 获取元素内容⾼度(只读)
  579. * scrollTop 获取或者设置元素的偏移值,常⽤于, 计算滚动条的位置, 当⼀个元素的容器没有产⽣垂直⽅向的滚动条, 那它的scrollTop的值默认为0.
  580. * clientHeight 读取元素的可见⾼度(只读)
  581. * 如果元素滚动到底, 下⾯等式返回true, 没有则返回false:
  582. * ele.scrollHeight - ele.scrollTop === ele.clientHeight;
  583. */
  584. const condition = this.scrollHeight - this.scrollTop <= this.clientHeight
  585. if (condition) {
  586. binding.value()
  587. }
  588. })
  589. }
  590. }
  591. },
  592. mixins: [Minxin],
  593. props: {
  594. id: {
  595. type: String,
  596. default: ''
  597. },
  598. isShow: {
  599. type: Number
  600. },
  601. isFlag: {
  602. type: [Number, String]
  603. }
  604. },
  605. data() {
  606. return {
  607. fang: false,
  608. input: '',
  609. baseURL: '',
  610. isCondition: 0,
  611. searchForm: {
  612. code: '',
  613. endTime: '',
  614. imgSrc: '',
  615. remark: '',
  616. startTime: '',
  617. title: '',
  618. mainId: '',
  619. mainName: '',
  620. type: '',
  621. isFullRebate: false,
  622. commercialType: false,
  623. maxBuyNum: 0,
  624. minBuyNum: 0
  625. },
  626. conditName: '',
  627. dataList: [],
  628. addList: [],
  629. pageSizeArr: [10, 20, 30, 50],
  630. size: 10,
  631. listLoading: false,
  632. dialogVisible: false,
  633. importFileList: [],
  634. fileList: [],
  635. options: {},
  636. value: '',
  637. typeList: [],
  638. walletList: [],
  639. typeOptions: [
  640. {
  641. value: 'PROVISION',
  642. label: '配提'
  643. },
  644. {
  645. value: 'LIMIT',
  646. label: '限量'
  647. }
  648. ],
  649. conditionList: [],
  650. dictList: [],
  651. k3List: [],
  652. rebateList: [],
  653. rebateList2: [],
  654. NoRebateWalletList: [],
  655. NoRebateWalletList2: [],
  656. sleectBox: { currentPage: 1 },
  657. dpageSize: 10,
  658. dcurrentPage: 1,
  659. detail: {},
  660. cid: '',
  661. cpolicyId: '',
  662. region: 0,
  663. fullscreenLoading: false,
  664. srcList: [],
  665. priceList: [],
  666. priceList2: [],
  667. importRebate: {},
  668. importWallet: {}
  669. }
  670. },
  671. computed: {
  672. ...mapGetters({
  673. comCode: 'code'
  674. })
  675. },
  676. created() {},
  677. methods: {
  678. ...mapMutations('sales', ['initData']),
  679. handleStatus(id, status) {
  680. setStauts({ policyMaterialId: id, status }).then(res => {
  681. this.handletwoList()
  682. this.$successMsg(status ? '启用' : '作废')
  683. })
  684. },
  685. handleEdit(row, index) {
  686. row.fang = !row.fang
  687. !row.fang && this.handleWallet(row, index)
  688. },
  689. setText(e, index, row, name) {
  690. if (e) {
  691. if (name === 'priceType') {
  692. this.NoRebateWalletList2 = []
  693. this.rebateList2 = []
  694. const rebateListId = []
  695. const NoRebateWalletListId = []
  696. this.priceList.forEach(k => {
  697. if (k.priceTypeId === e) {
  698. if (k.walletId) {
  699. this.NoRebateWalletList2.push(
  700. {
  701. id: k.walletId,
  702. name: k.walletName
  703. }
  704. )
  705. NoRebateWalletListId.push(k.walletId)
  706. }
  707. if (k.walletId2) {
  708. this.rebateList2.push({
  709. walletRebateId: k.walletId2,
  710. name: k.walletName2
  711. })
  712. rebateListId.push(k.walletId2)
  713. }
  714. }
  715. })
  716. if (NoRebateWalletListId.length && this.importWallet.id && !~NoRebateWalletListId.indexOf(this.importWallet.id)) {
  717. this.NoRebateWalletList2.push(this.importWallet)
  718. NoRebateWalletListId.push(this.importWallet.id)
  719. }
  720. if (rebateListId.length && this.importRebate.walletRebateId && !~rebateListId.indexOf(this.importRebate.walletRebateId)) {
  721. this.rebateList2.push(this.importRebate)
  722. rebateListId.push(this.importRebate.walletRebateId)
  723. }
  724. const item = this.priceList.find(k => k.priceTypeId === e)
  725. this.dataList[index][name] = item.priceTypeName
  726. this.$set(row, 'walletIds', [])
  727. this.$set(row, 'rebateWalletIds', [])
  728. this.dataList[index].walletIds = []
  729. this.dataList[index].rebateWalletIds = []
  730. if (item.walletId) {
  731. this.$set(row, 'walletIds', [...new Set([...row.walletIds, ...NoRebateWalletListId])])
  732. this.dataList[index].walletIds = [...new Set([...row.walletIds, ...NoRebateWalletListId])]
  733. }
  734. if (item.walletId2) {
  735. this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, ...rebateListId])])
  736. this.dataList[index].rebateWalletIds = [...new Set([...row.rebateWalletIds, ...rebateListId])]
  737. }
  738. return
  739. }
  740. this.dataList[index][name] = row[name]
  741. } else {
  742. this.NoRebateWalletList2 = []
  743. this.rebateList2 = []
  744. this.dataList[index][name] = ''
  745. this.$set(row, 'walletIds', [])
  746. this.$set(row, 'rebateWalletIds', [])
  747. this.dataList[index].walletIds = []
  748. this.dataList[index].rebateWalletIds = []
  749. }
  750. },
  751. // 下载excel模板
  752. handleDownloadFiles() {
  753. downloadFiles('policy/download')
  754. },
  755. handleCondition(id, index) {
  756. deleteCondition({ id }).then(res => {
  757. this.conditionList.splice(index, 1)
  758. Object.assign(this.$children[9].$data, this.$children[9].$options.data())
  759. this.$successMsg('删除成功')
  760. })
  761. },
  762. catCond(row) {
  763. this.cid = row.id
  764. this.$refs.cond.getCommonApi('', row.id)
  765. this.isCondition = 2
  766. // $refs.cond.getCommonApi(),
  767. // (), (cid = scope.row.id)
  768. },
  769. handleAddCondition() {
  770. this.isCondition = 1
  771. console.log(this.conditionList[0].id, this.searchForm.code)
  772. this.$refs.comDom.getCommonApi(this.conditionList[0].id)
  773. this.$store.commit('sales/setId', this.searchForm.code)
  774. },
  775. // loadmore() {
  776. // this.sleectBox.currentPage++
  777. // this.getK3List()
  778. // },
  779. loadmore2() {
  780. if (this.dataList.length < this.listTotal) {
  781. const total = Math.floor(this.listTotal / 10)
  782. if (this.dcurrentPage <= total) {
  783. this.dcurrentPage++
  784. this.handletwoList()
  785. }
  786. }
  787. },
  788. getK3List() {
  789. getK3List({
  790. pageNum: this.sleectBox.currentPage,
  791. pageSize: 10,
  792. keyword: ''
  793. }).then(res => {
  794. this.k3List = [...this.k3List, ...res.data.records]
  795. })
  796. },
  797. async remoteMethodType(query, type) {
  798. console.log(111)
  799. // 获取销售类型列表
  800. const params = {
  801. pageNum: 1,
  802. pageSize: -1,
  803. saleCode: query,
  804. saleName: '',
  805. status: ''
  806. }
  807. const typeData = await getTypeList(params)
  808. this.typeList = typeData.data.records
  809. },
  810. remoteMethod(query, type) {
  811. console.log(query, type)
  812. if (query !== '') {
  813. getK3List({
  814. pageNum: 1,
  815. pageSize: 100,
  816. keyword: '',
  817. number: type === 'number' ? query : '',
  818. oldNumber: '',
  819. specification: type === 'specification' ? query : ''
  820. }).then(res => {
  821. this.k3List = res.data.records
  822. })
  823. } else {
  824. this.sleectBox.currentPage = 1
  825. this.getK3List()
  826. }
  827. },
  828. async getCommonApi() {
  829. // this.getK3List();
  830. // 非返利钱包
  831. const noRebateWalletData = await getNoRebateWalletList({
  832. walletName: ''
  833. })
  834. this.NoRebateWalletList = noRebateWalletData.data
  835. const walletRebateData = await getWalletRebateList({
  836. pageNum: 1,
  837. pageSize: -2,
  838. name: '',
  839. status: true
  840. })
  841. this.rebateList = walletRebateData.data.records
  842. const params = {
  843. pageNum: 1,
  844. pageSize: -1,
  845. saleCode: '',
  846. saleName: '',
  847. status: ''
  848. }
  849. // 获取销售类型列表
  850. const typeData = await getTypeList(params)
  851. this.typeList = typeData.data.records
  852. },
  853. handleSalesType(e, row, index, name) {
  854. let item
  855. try {
  856. item = this.typeList.filter(k => {
  857. return k.id === e
  858. })[0]
  859. const linshi = []
  860. const rebateList = []
  861. this.rebateList.forEach(k => {
  862. k.saleTypes.forEach(j => {
  863. if (!linshi.includes(j.saleTypeId) && j.saleTypeId === e) {
  864. rebateList.push(k)
  865. linshi.push(j.saleTypeId)
  866. }
  867. })
  868. })
  869. if (rebateList.length) {
  870. this.dataList[index].rebateWalletIds = [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])]
  871. this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, rebateList[0].walletRebateId])])
  872. }
  873. } catch (error) {
  874. console.log(error)
  875. }
  876. this.dataList[index][name] = row[name]
  877. this.dataList[index].saleTypeCode = item.saleCode
  878. this.dataList[index].saleTypeName = item.saleName
  879. this.$set(row, 'saleTypeCode', item.saleCode)
  880. this.$set(row, 'saleTypeName', item.saleName)
  881. this.$set(row, 'priceType', '')
  882. this.priceList = []
  883. this.rebateList2 = []
  884. this.NoRebateWalletList2 = []
  885. this.$set(row, 'walletIds', [])
  886. this.$set(row, 'rebateWalletIds', [])
  887. this.dataList[index].walletIds = []
  888. this.dataList[index].rebateWalletIds = []
  889. // this.$set(row,'saleTypeId',item.id)
  890. },
  891. // 修改条件名称
  892. handleConditionName(row) {
  893. console.log(row.name)
  894. if (this.conditName !== row.name) {
  895. updateCondition({ id: row.id, name: row.name }).then(res => {
  896. this.$successMsg('修改成功')
  897. })
  898. }
  899. row.fang = true
  900. },
  901. // 提交信息
  902. handleSubmitCon() {
  903. const params = {
  904. policyId: this.searchForm.code
  905. }
  906. // 获取条件政策
  907. getConditionList(params).then(res => {
  908. for (let i = 0; i < res.data.length; i++) {
  909. res.data[i].fang = true
  910. }
  911. this.conditionList = res.data
  912. Object.assign(this.$refs.comDom.$data, this.$refs.comDom.$options.data())
  913. })
  914. },
  915. // 视图部分已注释,废弃的功能 fucn
  916. handelStop() {
  917. if (this.searchForm.mainId) {
  918. this.fang = true
  919. } else {
  920. this.$errorMsg('请选择产品类别')
  921. }
  922. },
  923. // 导入
  924. async handleImport(param) {
  925. this.importLoading = true
  926. const file = param.file
  927. console.log(file, 123)
  928. const formData = new FormData()
  929. formData.append('file', file)
  930. formData.append('policyId', this.searchForm.code)
  931. // formData.append("mainId", this.searchForm.mainId);
  932. const result = await handleImport('/policy/material/import', formData)
  933. this.importLoading = false
  934. this.importFileList = []
  935. if (result.code === 200) {
  936. this.$successMsg('导入成功')
  937. this.dataList = []
  938. this.listTotal = 0
  939. this.sleectBox.currentPage = 1
  940. this.dcurrentPage = 1
  941. this.handletwoList()
  942. } else {
  943. this.$errorMsg(result.message)
  944. }
  945. },
  946. async getList() {
  947. await this.getCommonApi()
  948. await getPolicyDetail({ policyId: this.id }).then(async res => {
  949. this.detail = res.data
  950. this.searchForm = {
  951. code: this.detail.code,
  952. endTime: this.detail.endTime,
  953. imgSrc: this.detail.imgSrc,
  954. remark: this.detail.remark,
  955. startTime: this.detail.startTime,
  956. title: this.detail.title,
  957. type: this.detail.type,
  958. isFullRebate: this.detail.isFullRebate,
  959. commercialType: this.detail.commercialType,
  960. maxBuyNum: this.detail.maxBuyNum,
  961. minBuyNum: this.detail.minBuyNum
  962. }
  963. this.region = res.data.flag
  964. // this.srcList = [this.$imageUrl + this.detail.imgSrc]
  965. if (this.isShow === 3 && this.detail.imgSrc) {
  966. this.detail.imgSrc.split(',').forEach(k => {
  967. this.fileList.push({
  968. hover: '',
  969. url: k
  970. })
  971. this.srcList.push(this.$imageUrl + k)
  972. })
  973. }
  974. await this.handletwoList()
  975. // 获取条件政策
  976. await this.handleSubmitCon()
  977. })
  978. if (this.isFlag) {
  979. await this.handletwoList()
  980. }
  981. },
  982. // 更改每页数量
  983. handleSizeChange1(val) {
  984. this.pageSize = val
  985. this.currentPage = 1
  986. this.handletwoList()
  987. },
  988. // 更改当前页
  989. handleCurrentChange1(val) {
  990. this.currentPage = val
  991. this.handletwoList()
  992. },
  993. // 更改每页数量
  994. handleSizeChange2(val) {
  995. this.dpageSize = val
  996. this.dcurrentPage = 1
  997. this.handletwoList()
  998. },
  999. // 更改当前页
  1000. handleCurrentChange2(val) {
  1001. this.dcurrentPage = val
  1002. this.handletwoList()
  1003. },
  1004. // 获取货品信息
  1005. handletwoList() {
  1006. // this.searchForm.type
  1007. this.listLoading = true
  1008. const paramss = {
  1009. pageNum: 1,
  1010. pageSize: -1,
  1011. policyId: this.searchForm.code,
  1012. saleTypeCode: ''
  1013. }
  1014. getMaterialList(paramss)
  1015. .then(result => {
  1016. result.data.records.forEach(k => {
  1017. k.fang = true
  1018. k.walletIds = []
  1019. k.rebateWalletIds = []
  1020. if (!k.specification) {
  1021. k.materialNumber = k.materialId
  1022. k.specification = k.materialId
  1023. }
  1024. for (let i = 0; i < k.walletRelaList.length; i++) {
  1025. const d = k.walletRelaList[i]
  1026. d.id = d.walletId
  1027. d.name = d.walletName
  1028. if (d.type === 'REBATE') {
  1029. k.rebateWalletIds = [...k.rebateWalletIds, d.walletId]
  1030. k.ovalRebateWalletIds = [...k.rebateWalletIds, d.walletId]
  1031. } else {
  1032. k.walletIds = [...k.walletIds, d.walletId]
  1033. k.ovalWalletIds = [...k.rebateWalletIds, d.walletId]
  1034. }
  1035. }
  1036. // this.priceList.forEach(l => {
  1037. // if (l.priceTypeName == k.priceType) {
  1038. // k.priceType = l.priceTypeId
  1039. // }
  1040. // })
  1041. })
  1042. this.dataList = result.data.records
  1043. this.listTotal = result.data.total
  1044. this.listLoading = false
  1045. })
  1046. .catch(err => {
  1047. console.error(err)
  1048. })
  1049. },
  1050. // 提交审核
  1051. handlEditPolicy(policyCustomers, region) {
  1052. if (!this.searchForm.title) {
  1053. this.$errorMsg('请输入说明')
  1054. return
  1055. }
  1056. if (!this.searchForm.type) {
  1057. this.$errorMsg('请选择类型')
  1058. return
  1059. }
  1060. if (!this.searchForm.startTime) {
  1061. this.$errorMsg('请选择生效日期')
  1062. return
  1063. }
  1064. const formtData = () => {
  1065. var arr = []
  1066. policyCustomers.forEach(el => {
  1067. arr.push({
  1068. customerId: el.customerId || el.customerId,
  1069. customerName: el.name || el.customerName,
  1070. customerNumber: el.number || el.customerNumber,
  1071. lastOrderTime: '',
  1072. limitTakeNum: 0,
  1073. policyId: this.searchForm.code || this.detail.code,
  1074. policyTitle: '',
  1075. remark: ''
  1076. })
  1077. })
  1078. // this.dictList.forEach((k) => {
  1079. // if (k.dictCode == this.searchForm.mainId) {
  1080. // this.searchForm.mainName = k.dictValue;
  1081. // }
  1082. // });
  1083. const imgUrl = []
  1084. this.fileList.forEach(k => {
  1085. imgUrl.push(k.url)
  1086. })
  1087. const params = {
  1088. ...this.detail,
  1089. ...this.searchForm,
  1090. flag: region,
  1091. endTime: this.searchForm.endTime || '2100-01-01 00:00:00',
  1092. policyCustomers: arr,
  1093. imgSrc: imgUrl.join(',')
  1094. }
  1095. updatePolicy(params).then(res => {
  1096. this.$successMsg('编辑成功')
  1097. this.$emit('close')
  1098. })
  1099. }
  1100. if (region == 0) {
  1101. if (policyCustomers.length) {
  1102. formtData()
  1103. } else {
  1104. this.$errorMsg('选择经销商 ')
  1105. }
  1106. } else {
  1107. formtData()
  1108. }
  1109. },
  1110. // 删除
  1111. handleDelete(id, index) {
  1112. if (id) {
  1113. const params = { policyMaterialId: id }
  1114. deleteMaterialPolicy(params).then(res => {
  1115. this.dataList.splice(index, 1)
  1116. })
  1117. return
  1118. }
  1119. this.dataList.splice(index, 1)
  1120. if (!this.dataList.length) {
  1121. this.dcurrentPage !== 1 ? (this.dcurrentPage -= 1) : (this.dcurrentPage = 1)
  1122. }
  1123. // this.listTotal -= 1;
  1124. this.$successMsg('删除成功')
  1125. },
  1126. handleNewInfo() {
  1127. // 物料列表
  1128. this.$nextTick(() => {
  1129. this.dataList.push({
  1130. id: '',
  1131. discAmount: '',
  1132. materialId: '',
  1133. materialName: '',
  1134. materialNumber: '',
  1135. policyId: this.searchForm.code,
  1136. price: '',
  1137. fang: false,
  1138. remark: '',
  1139. saleTypeCode: '',
  1140. saleTypeId: '',
  1141. saleTypeName: '',
  1142. specification: '',
  1143. walletIds: [],
  1144. walletRelaList: [],
  1145. rebateWalletIds: []
  1146. })
  1147. this.sleectBox.currentPage = 1
  1148. })
  1149. // this.listTotal += 1;
  1150. // this.dataList.push(this.addList[this.addList.length-1])
  1151. },
  1152. handleSave() {
  1153. this.fullscreenLoading = true
  1154. if (!this.dataList.length) {
  1155. this.fullscreenLoading = false
  1156. return
  1157. }
  1158. for (let i = 0; i < this.dataList.length; i++) {
  1159. if (!this.dataList[i].materialId) {
  1160. this.$errorMsg('请选择货品')
  1161. return
  1162. }
  1163. if (!this.dataList[i].saleTypeId) {
  1164. this.$errorMsg('请选择销售类型')
  1165. return
  1166. }
  1167. if (!this.dataList[i].price) {
  1168. this.$errorMsg('请输入单价')
  1169. return
  1170. }
  1171. if (!this.dataList[i].walletIds.length) {
  1172. this.$errorMsg('请选择现金钱包')
  1173. return
  1174. }
  1175. }
  1176. savePolicy(this.dataList)
  1177. .then(res => {
  1178. this.dataList = []
  1179. this.sleectBox.currentPage = 1
  1180. this.dcurrentPage = 1
  1181. this.fullscreenLoading = false
  1182. this.$successMsg('保存成功')
  1183. this.handletwoList()
  1184. })
  1185. .finally(() => {
  1186. this.fullscreenLoading = false
  1187. })
  1188. },
  1189. handleK3List(e, row, index, name) {
  1190. const item = this.k3List.filter(k => {
  1191. return k.id == e
  1192. })[0]
  1193. this.$set(row, 'materialNumber', item.number)
  1194. this.$set(row, 'materialName', item.name)
  1195. this.$set(row, 'specification', item.specification)
  1196. this.$set(row, 'materialId', item.id)
  1197. this.dataList[index].materialNumber = item.number
  1198. this.dataList[index].materialName = item.name
  1199. this.dataList[index].specification = item.specification
  1200. this.dataList[index].materialId = item.id
  1201. this.getK3List()
  1202. },
  1203. handleReset() {
  1204. Object.assign(this.$data, this.$options.data())
  1205. this.getCommonApi()
  1206. },
  1207. handleBack() {
  1208. this.isCondition = 0
  1209. this.$emit('upDataIsFlag')
  1210. },
  1211. getPriceSalesRelaListV2(val) {
  1212. return getPriceSalesRelaListV2({
  1213. pageNum: 1,
  1214. pageSize: -1,
  1215. params: [
  1216. {
  1217. 'param': 'b.sale_code',
  1218. 'compare': 'like',
  1219. 'value': val
  1220. },
  1221. {
  1222. 'param': 'a.status',
  1223. 'compare': '=',
  1224. 'value': true
  1225. }
  1226. ]
  1227. }).then(res => {
  1228. this.priceList = res.data.records
  1229. this.priceList2 = this.quChong(res.data.records)
  1230. return Promise.resolve()
  1231. })
  1232. },
  1233. handlePriceType(e) {
  1234. this.priceList = []
  1235. if (e.saleTypeCode) {
  1236. this.getPriceSalesRelaListV2(e.saleTypeCode)
  1237. }
  1238. },
  1239. quChong(arr) {
  1240. var result = []
  1241. const obj = {}
  1242. for (let i = 0; i < arr.length; i++) {
  1243. if (!obj[arr[i].priceTypeId]) {
  1244. result.push(arr[i])
  1245. obj[arr[i].priceTypeId] = true
  1246. }
  1247. }
  1248. return result
  1249. },
  1250. handleWallet(row, index) {
  1251. if (row.saleTypeCode) {
  1252. this.getPriceSalesRelaListV2(row.saleTypeCode).then(res => {
  1253. this.NoRebateWalletList2 = []
  1254. this.rebateList2 = []
  1255. const rebateListId = []
  1256. const NoRebateWalletListId = []
  1257. this.priceList.forEach(k => {
  1258. if (k.priceTypeName === row.priceType) {
  1259. if (k.walletId) {
  1260. this.NoRebateWalletList2.push(
  1261. {
  1262. id: k.walletId,
  1263. name: k.walletName
  1264. }
  1265. )
  1266. NoRebateWalletListId.push(k.walletId)
  1267. }
  1268. if (k.walletId2) {
  1269. rebateListId.push(k.walletId2)
  1270. this.rebateList2.push({
  1271. walletRebateId: k.walletId2,
  1272. name: k.walletName2
  1273. })
  1274. }
  1275. }
  1276. })
  1277. if (row.ovalWalletIds && row.ovalWalletIds.length) {
  1278. row.ovalWalletIds.forEach(k => {
  1279. if (!~NoRebateWalletListId.indexOf(k)) {
  1280. const item = this.NoRebateWalletList.find(e => e.id === k)
  1281. this.importWallet = item
  1282. this.NoRebateWalletList2.push(item)
  1283. NoRebateWalletListId.push(item.id)
  1284. }
  1285. if (~NoRebateWalletListId.indexOf(k)) {
  1286. const item = this.NoRebateWalletList.find(e => e.id === k)
  1287. this.importWallet = item
  1288. }
  1289. })
  1290. }
  1291. console.log(row.ovalRebateWalletIds, this.rebateList)
  1292. if (row.ovalRebateWalletIds && row.ovalRebateWalletIds.length) {
  1293. row.ovalRebateWalletIds.forEach(k => {
  1294. if (!~rebateListId.indexOf(k)) {
  1295. const item = this.rebateList.find(e => e.walletRebateId === k)
  1296. this.importRebate = item
  1297. this.rebateList2.push(item)
  1298. rebateListId.push(item.walletRebateId)
  1299. }
  1300. if (~rebateListId.indexOf(k)) {
  1301. const item = this.rebateList.find(e => e.walletRebateId === k)
  1302. this.importRebate = item
  1303. }
  1304. })
  1305. }
  1306. this.$set(row, 'walletIds', [...new Set([...row.walletIds, ...NoRebateWalletListId])])
  1307. this.$set(row, 'rebateWalletIds', [...new Set([...row.rebateWalletIds, ...rebateListId])])
  1308. this.dataList[index].walletIds = [...new Set([...row.walletIds, ...NoRebateWalletListId])]
  1309. this.dataList[index].rebateWalletIds = [...new Set([...row.rebateWalletIds, ...rebateListId])]
  1310. })
  1311. }
  1312. }
  1313. },
  1314. components: {
  1315. // Transfer,
  1316. AddCondition,
  1317. ImageUpload,
  1318. TabelTransfer,
  1319. PlTable,
  1320. PlTableColumn
  1321. }
  1322. }
  1323. </script>
  1324. <style lang="scss" scoped>
  1325. ::v-deep .elImageClose .el-image-viewer__wrapper span[class='el-image-viewer__btn el-image-viewer__close'] {
  1326. top: 100px;
  1327. }
  1328. h4 {
  1329. margin: 0;
  1330. }
  1331. .yinput {
  1332. ::v-deep input {
  1333. text-align: right;
  1334. }
  1335. }
  1336. .pdt {
  1337. padding-top: 20px;
  1338. }
  1339. .import-btn {
  1340. margin-right: 10px;
  1341. display: inline-block;
  1342. }
  1343. .radio {
  1344. padding: 20px 0;
  1345. }
  1346. .el-divider--horizontal {
  1347. margin: 20px 0;
  1348. }
  1349. .el-container .el-divider--horizontal {
  1350. margin: 10px;
  1351. }
  1352. .el-select {
  1353. width: 100%;
  1354. }
  1355. .footer {
  1356. margin-bottom: 20px;
  1357. }
  1358. ::v-deep .el-table__virtual-wrapper {
  1359. width: auto !important;
  1360. }
  1361. ::v-deep .el-table__virtual-wrapper {
  1362. width: auto !important;
  1363. }
  1364. ::v-deep .plTable td {
  1365. height: 40px !important;
  1366. padding: 0 !important;
  1367. }
  1368. </style>