modify_list-apply.vue 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596
  1. <template>
  2. <div>
  3. <div>
  4. <el-page-header :content="!cid ? '存货调价单' : '编辑'" @back="goBack" />
  5. </div>
  6. <br><br>
  7. <div>
  8. <el-form
  9. ref="screenForm"
  10. label-width="100px"
  11. size="small"
  12. label-position="left"
  13. >
  14. <el-row :gutter="20">
  15. <el-col :xs="24" :sm="12" :lg="6">
  16. <el-form-item label="单据编号">
  17. <el-input
  18. v-model="base.updPriceBillId"
  19. placeholder="系统自动生成"
  20. disabled
  21. />
  22. </el-form-item>
  23. </el-col>
  24. <!-- <el-col :xs="24" :sm="12" :lg="6">
  25. <el-form-item label="调价业务员">
  26. <el-select
  27. placeholder="请选择调价业务员"
  28. filterable
  29. @change="handleUser"
  30. v-model="serviceId"
  31. >
  32. <el-option
  33. v-for="(item, index) in userList"
  34. :label="item.nickName"
  35. :value="item.roleId"
  36. :key="index"
  37. ></el-option>
  38. </el-select>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="调价部门">
  43. <el-input
  44. placeholder="调价部门"
  45. disabled
  46. v-model="adminCompanyName"
  47. ></el-input>
  48. </el-form-item>
  49. </el-col> -->
  50. <!-- <el-col :xs="24" :sm="12" :lg="6">
  51. <el-form-item label="销售类型">
  52. <el-select
  53. placeholder="请选择销售类型"
  54. filterable
  55. v-model="saleTypeId"
  56. >
  57. <el-option
  58. v-for="item in typeList"
  59. :label="item.saleName"
  60. :value="item.id"
  61. ></el-option>
  62. </el-select>
  63. </el-form-item>
  64. </el-col> -->
  65. <el-col :xs="24" :sm="12" :lg="6">
  66. <el-form-item label="文件编码">
  67. <el-input v-model="base.remark" placeholder="请输入" />
  68. </el-form-item>
  69. </el-col>
  70. <el-col :xs="24" :sm="12" :lg="6">
  71. <el-form-item label="" class="fr" />
  72. </el-col>
  73. </el-row>
  74. </el-form>
  75. </div>
  76. <div class="btn-group clearfixs" v-if="!cid">
  77. <el-upload
  78. class="import-btn"
  79. :action="baseURL + 'student/import'"
  80. :http-request="handleImport"
  81. :file-list="importFileList"
  82. :show-file-list="false"
  83. >
  84. <el-button
  85. type="primary"
  86. size="small"
  87. >导入调价单</el-button>
  88. </el-upload>
  89. <el-button
  90. type="primary"
  91. size="small"
  92. @click="hanleDownloadFiles"
  93. >下载模板</el-button>
  94. </div>
  95. <div class="mymain-container">
  96. <!-- 列表 -->
  97. <div class="table">
  98. <el-form v-if="!detail.length" size="small" label-position="left">
  99. <el-table
  100. v-loading="listLoading"
  101. :data="items"
  102. element-loading-text="Loading"
  103. border
  104. fit
  105. highlight-current-row
  106. stripe
  107. >
  108. <el-table-column
  109. align="center"
  110. label="操作类型"
  111. prop="nname"
  112. fixed="right"
  113. min-width="160"
  114. show-overflow-tooltip
  115. >
  116. <!-- <el-button type="text" class="textColor">修改</el-button> -->
  117. <template slot-scope="scope">
  118. <el-button
  119. type="text"
  120. class="textColor"
  121. @click="hanleDeleInd(scope.$index, scope.row.cid,scope.row.materialId)"
  122. >删除</el-button>
  123. </template>
  124. </el-table-column>
  125. <el-table-column
  126. align="center"
  127. label="销售类型"
  128. prop="mainId"
  129. min-width="160"
  130. show-overflow-tooltip
  131. >
  132. <template slot-scope="scope">
  133. <el-form-item>
  134. <template v-if="!cid">
  135. <el-select
  136. v-model="scope.row.mainId"
  137. placeholder="请选择销售类型"
  138. @change="
  139. handleSale($event, scope.$index, scope.row.saleTypes)
  140. "
  141. >
  142. <el-option
  143. v-for="item in scope.row.saleTypes"
  144. :label="item.saleName"
  145. :value="item.id"
  146. />
  147. </el-select>
  148. </template>
  149. <template v-else>
  150. <el-select
  151. v-model="scope.row.saleTypeId"
  152. placeholder="请选择销售类型"
  153. @change="handleSale($event, scope.$index, scope.row.id)"
  154. >
  155. <el-option
  156. v-for="item in typeList"
  157. :label="item.saleName"
  158. :value="item.id"
  159. />
  160. </el-select>
  161. </template>
  162. </el-form-item>
  163. </template>
  164. </el-table-column>
  165. <el-table-column
  166. align="center"
  167. label="物料编码"
  168. prop="materialNumber"
  169. min-width="160"
  170. show-overflow-tooltip
  171. >
  172. <template slot-scope="scope">
  173. <el-form-item>
  174. <el-input
  175. v-model="scope.row.materialNumber"
  176. disabled
  177. />
  178. </el-form-item>
  179. </template>
  180. </el-table-column>
  181. <el-table-column
  182. align="center"
  183. label="产品名称"
  184. prop="materialName"
  185. min-width="160"
  186. show-overflow-tooltip
  187. >
  188. <template slot-scope="scope">
  189. <el-form-item>
  190. <el-input
  191. v-model="scope.row.materialName"
  192. disabled
  193. />
  194. </el-form-item>
  195. </template>
  196. </el-table-column>
  197. <el-table-column
  198. align="center"
  199. label="规格型号"
  200. prop="specification"
  201. min-width="160"
  202. show-overflow-tooltip
  203. >
  204. <template slot-scope="scope">
  205. <el-form-item>
  206. <el-input
  207. v-model="scope.row.specification"
  208. disabled
  209. />
  210. </el-form-item>
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="center"
  215. label="计量单位"
  216. prop="unit"
  217. min-width="160"
  218. show-overflow-tooltip
  219. >
  220. <template slot-scope="scope">
  221. <el-form-item>
  222. <el-input v-model="scope.row.unit" disabled />
  223. </el-form-item>
  224. </template>
  225. </el-table-column>
  226. <el-table-column
  227. align="center"
  228. label="批发价"
  229. prop="batchPrice"
  230. min-width="160"
  231. show-overflow-tooltip
  232. >
  233. <template slot-scope="scope">
  234. <el-form-item>
  235. <el-input v-model="scope.row.batchPrice" placeholder="请输入批发价" />
  236. </el-form-item>
  237. </template>
  238. </el-table-column>
  239. <el-table-column
  240. align="center"
  241. label="格力折扣"
  242. prop="discAmount"
  243. min-width="160"
  244. show-overflow-tooltip
  245. ><template slot-scope="scope">
  246. <el-form-item>
  247. <el-input v-model="scope.row.discAmount" placeholder="请输入格力折扣" />
  248. </el-form-item>
  249. </template>
  250. </el-table-column>
  251. <el-table-column
  252. align="center"
  253. label="返利类型"
  254. prop="rebateUseRate"
  255. min-width="160"
  256. show-overflow-tooltip
  257. ><template slot-scope="scope">
  258. <el-form-item>
  259. <el-select
  260. v-model="scope.row.walletRebateId"
  261. multiple
  262. :disabled="scope.row.fang"
  263. placeholder="请选择返利类型"
  264. @change="handelRebateList($event, scope.$index, scope.row)"
  265. @remove-tag="handleRemove2($event, scope.$index, scope.row)"
  266. >
  267. <el-option
  268. v-for="(item, index) in scope.row.rebateList"
  269. :key="item.index"
  270. :value="item.walletRebateId"
  271. :label="item.name"
  272. />
  273. </el-select>
  274. </el-form-item>
  275. </template>
  276. </el-table-column>
  277. <el-table-column
  278. align="center"
  279. label="生效日期"
  280. prop="startDate"
  281. min-width="160"
  282. show-overflow-tooltip
  283. ><template slot-scope="scope">
  284. <el-form-item>
  285. <el-date-picker
  286. v-model="scope.row.startDate"
  287. type="date"
  288. placeholder="请输入调价日期"
  289. value-format="yyyy-MM-dd"
  290. />
  291. </el-form-item>
  292. </template>
  293. </el-table-column>
  294. <el-table-column
  295. align="center"
  296. label="失效日期"
  297. prop="endDate"
  298. min-width="160"
  299. show-overflow-tooltip
  300. ><template slot-scope="scope">
  301. <el-form-item>
  302. <el-date-picker
  303. v-model="scope.row.endDate"
  304. type="date"
  305. placeholder="请输入调价日期"
  306. value-format="yyyy-MM-dd"
  307. />
  308. </el-form-item>
  309. </template>
  310. </el-table-column>
  311. <el-table-column
  312. align="center"
  313. label="是否促销价"
  314. prop="isPromote"
  315. min-width="160"
  316. show-overflow-tooltip
  317. ><template slot-scope="scope">
  318. <el-form-item>
  319. <el-select
  320. v-model="scope.row.isPromote"
  321. placeholder="请选择是否促销价"
  322. >
  323. <el-option
  324. v-for="item in scope.row.isPromoteArr"
  325. :key="item.bool"
  326. :value="item.bool"
  327. :label="item.value"
  328. />
  329. </el-select>
  330. </el-form-item>
  331. </template>
  332. </el-table-column>
  333. <el-table-column
  334. align="center"
  335. label="数量"
  336. prop="qty"
  337. min-width="160"
  338. show-overflow-tooltip
  339. ><template slot-scope="scope">
  340. <el-form-item>
  341. <el-input v-model="scope.row.qty" placeholder="请输入数量" />
  342. </el-form-item>
  343. </template>
  344. </el-table-column>
  345. <el-table-column
  346. align="center"
  347. label="现金钱包"
  348. prop="wallets"
  349. min-width="160"
  350. show-overflow-tooltip
  351. ><template slot-scope="scope">
  352. <el-form-item>
  353. <template v-if="!cid">
  354. <el-select
  355. v-model="scope.row.walletsId"
  356. multiple
  357. clearable
  358. placeholder="请选择现金钱包"
  359. @change="handelWallets($event, scope.$index, scope.row)"
  360. @remove-tag="
  361. handleRemove($event, scope.$index, scope.row)
  362. "
  363. >
  364. <el-option
  365. v-for="item in scope.row.walleList"
  366. :key="item.id"
  367. :value="item.id"
  368. :label="item.name"
  369. /> </el-select></template>
  370. <template v-else>
  371. <el-select
  372. v-model="scope.row.walletsId"
  373. multiple
  374. clearable
  375. placeholder="请选择现金钱包"
  376. @change="handelWallets($event, scope.$index, scope.row)"
  377. @remove-tag="
  378. handleRemove($event, scope.$index, scope.row)
  379. "
  380. >
  381. <el-option
  382. v-for="item in scope.row.walleList"
  383. :key="item.walletId || item.id"
  384. :value="item.walletId || item.id"
  385. :label="item.walletName || item.name"
  386. /> </el-select></template>
  387. </el-form-item>
  388. </template>
  389. </el-table-column>
  390. <el-table-column
  391. align="center"
  392. label="发布"
  393. prop="isPublish"
  394. min-width="160"
  395. show-overflow-tooltip
  396. ><template slot-scope="scope">
  397. <el-form-item>
  398. <el-select
  399. v-model="scope.row.isPublish"
  400. placeholder="请选择是否发布"
  401. >
  402. <el-option
  403. v-for="item in scope.row.isPublishArr"
  404. :key="item.bool"
  405. :value="item.bool"
  406. :label="item.value"
  407. />
  408. </el-select>
  409. </el-form-item>
  410. </template>
  411. </el-table-column>
  412. </el-table>
  413. </el-form>
  414. <el-form v-else :model="detail" size="small" label-position="left">
  415. <el-table
  416. v-loading="listLoading"
  417. :data="detail"
  418. element-loading-text="Loading"
  419. border
  420. fit
  421. highlight-current-row
  422. stripe
  423. >
  424. <el-table-column
  425. align="center"
  426. label="操作类型"
  427. prop="nname"
  428. min-width="160"
  429. show-overflow-tooltip
  430. >
  431. <!-- <el-button type="text" class="textColor">修改</el-button> -->
  432. <template slot-scope="scope">
  433. <el-button
  434. type="text"
  435. class="textColor"
  436. @click="hanleDeleInd(scope.$index)"
  437. >删除</el-button>
  438. </template>
  439. </el-table-column>
  440. <el-table-column
  441. align="center"
  442. label="销售类型"
  443. prop="mainId"
  444. min-width="160"
  445. show-overflow-tooltip
  446. >
  447. <template slot-scope="scope">
  448. <el-form-item>
  449. <el-select
  450. v-model="scope.row.saleTypeId"
  451. placeholder="请选择销售类型"
  452. @change="handleSale($event, scope.$index, scope.row.id)"
  453. >
  454. <el-option
  455. v-for="item in typeList"
  456. :label="item.saleName"
  457. :value="item.id"
  458. />
  459. </el-select>
  460. </el-form-item>
  461. </template>
  462. </el-table-column>
  463. <el-table-column
  464. align="center"
  465. label="物料编码"
  466. prop="materialNumber"
  467. min-width="160"
  468. show-overflow-tooltip
  469. >
  470. <template slot-scope="scope">
  471. <el-form-item>
  472. <el-input v-model="scope.row.materialNumber" />
  473. </el-form-item>
  474. </template>
  475. </el-table-column>
  476. <el-table-column
  477. align="center"
  478. label="产品名称"
  479. prop="materialName"
  480. min-width="160"
  481. show-overflow-tooltip
  482. >
  483. <template slot-scope="scope">
  484. <el-form-item>
  485. <el-input v-model="scope.row.materialName" />
  486. </el-form-item>
  487. </template>
  488. </el-table-column>
  489. <el-table-column
  490. align="center"
  491. label="规格型号"
  492. prop="specification"
  493. min-width="160"
  494. show-overflow-tooltip
  495. >
  496. <template slot-scope="scope">
  497. <el-form-item>
  498. <el-input v-model="scope.row.specification" />
  499. </el-form-item>
  500. </template>
  501. </el-table-column>
  502. <el-table-column
  503. align="center"
  504. label="计量单位"
  505. prop="unit"
  506. min-width="160"
  507. show-overflow-tooltip
  508. >
  509. <template slot-scope="scope">
  510. <el-form-item>
  511. <el-input v-model="scope.row.SalesType" />
  512. </el-form-item>
  513. </template>
  514. </el-table-column>
  515. <el-table-column
  516. align="center"
  517. label="批发价"
  518. prop="batchPrice"
  519. min-width="160"
  520. show-overflow-tooltip
  521. >
  522. <template slot-scope="scope">
  523. <el-form-item>
  524. <el-input v-model="scope.row.batchPrice" />
  525. </el-form-item>
  526. </template>
  527. </el-table-column>
  528. <el-table-column
  529. align="center"
  530. label="零售价"
  531. prop="retailPrice"
  532. min-width="160"
  533. show-overflow-tooltip
  534. ><template slot-scope="scope">
  535. <el-form-item>
  536. <el-input v-model="scope.row.retailPrice" />
  537. </el-form-item>
  538. </template>
  539. </el-table-column>
  540. <el-table-column
  541. align="center"
  542. label="返利使用比例"
  543. prop="rebateUseRate"
  544. min-width="160"
  545. show-overflow-tooltip
  546. ><template slot-scope="scope">
  547. <el-form-item>
  548. <el-input v-model="scope.row.rebateUseRate" />
  549. </el-form-item>
  550. </template>
  551. </el-table-column>
  552. <el-table-column
  553. align="center"
  554. label="返利类型"
  555. prop="rebateUseRate"
  556. min-width="160"
  557. show-overflow-tooltip
  558. ><template slot-scope="scope">
  559. <el-form-item>
  560. <el-select
  561. v-model="scope.row.walletRebateId"
  562. multiple
  563. :disabled="scope.row.fang"
  564. placeholder="请选择返利类型"
  565. @change="handelRebateList($event, scope.$index, scope.row)"
  566. @remove-tag="handleRemove2($event, scope.$index, scope.row)"
  567. >
  568. <el-option
  569. v-for="(item, index) in scope.row.rebateList"
  570. :key="item.index"
  571. :value="item.walletRebateId"
  572. :label="item.name"
  573. />
  574. </el-select>
  575. </el-form-item>
  576. </template>
  577. </el-table-column>
  578. <el-table-column
  579. align="center"
  580. label="生效日期"
  581. prop="startDate"
  582. min-width="160"
  583. show-overflow-tooltip
  584. ><template slot-scope="scope">
  585. <el-form-item>
  586. <el-date-picker
  587. v-model="scope.row.startDate"
  588. type="date"
  589. placeholder="请输入调价日期"
  590. value-format="yyyy-MM-dd"
  591. />
  592. </el-form-item>
  593. </template>
  594. </el-table-column>
  595. <el-table-column
  596. align="center"
  597. label="失效日期"
  598. prop="endDate"
  599. min-width="160"
  600. show-overflow-tooltip
  601. ><template slot-scope="scope">
  602. <el-form-item>
  603. <el-date-picker
  604. v-model="scope.row.endDate"
  605. type="date"
  606. placeholder="请输入调价日期"
  607. value-format="yyyy-MM-dd"
  608. />
  609. </el-form-item>
  610. </template>
  611. </el-table-column>
  612. <el-table-column
  613. align="center"
  614. label="是否促销价"
  615. prop="isPromote"
  616. min-width="160"
  617. show-overflow-tooltip
  618. ><template slot-scope="scope">
  619. <el-form-item>
  620. <el-select
  621. v-model="scope.row.isPromote"
  622. placeholder="请选择是否促销价"
  623. >
  624. <el-option
  625. v-for="item in scope.row.isPromoteArr"
  626. :key="item.bool"
  627. :value="item.bool"
  628. :label="item.value"
  629. />
  630. </el-select>
  631. </el-form-item>
  632. </template>
  633. </el-table-column>
  634. <el-table-column
  635. align="center"
  636. label="数量"
  637. prop="qty"
  638. min-width="160"
  639. show-overflow-tooltip
  640. ><template slot-scope="scope">
  641. <el-form-item>
  642. <el-input v-model="scope.row.qty" />
  643. </el-form-item>
  644. </template>
  645. </el-table-column>
  646. <el-table-column
  647. align="center"
  648. label="支付钱包类型"
  649. prop="wallets"
  650. min-width="160"
  651. show-overflow-tooltip
  652. ><template slot-scope="scope">
  653. <el-form-item>
  654. <el-select
  655. v-model="scope.row.isPublish"
  656. placeholder="请选择支付钱包类型"
  657. >
  658. <el-option
  659. v-for="item in scope.row.rebateList"
  660. :key="item.walletRebateId"
  661. :value="item.walletRebateId"
  662. :label="item.name"
  663. />
  664. </el-select>
  665. </el-form-item>
  666. </template>
  667. </el-table-column>
  668. <el-table-column
  669. align="center"
  670. label="发布"
  671. prop="isPublish"
  672. min-width="160"
  673. show-overflow-tooltip
  674. ><template slot-scope="scope">
  675. <el-form-item>
  676. <el-select
  677. v-model="scope.row.isPublish"
  678. placeholder="请选择是否发布"
  679. >
  680. <el-option
  681. v-for="item in scope.row.isPublishArr"
  682. :key="item.bool"
  683. :value="item.bool"
  684. :label="item.value"
  685. />
  686. </el-select>
  687. </el-form-item>
  688. </template>
  689. </el-table-column>
  690. </el-table>
  691. </el-form>
  692. <el-dialog
  693. title="提示"
  694. :visible.sync="centerDialogVisible"
  695. width="50%"
  696. center
  697. class="dia"
  698. >
  699. <el-form
  700. ref="form"
  701. :model="form"
  702. label-width="80px"
  703. :inline="false"
  704. size="normal"
  705. >
  706. <el-form-item label="产品类型">
  707. <el-select v-model="materialId" placeholder="请选择" width="100%">
  708. <el-option
  709. v-for="item in materialLis"
  710. :key="item.id"
  711. :label="item.name"
  712. :value="item.id"
  713. />
  714. </el-select>
  715. </el-form-item>
  716. </el-form>
  717. <span slot="footer" class="dialog-footer">
  718. <el-button @click="centerDialogVisible = false">取 消</el-button>
  719. <el-button type="primary" @click="hanleAdd">确 定</el-button>
  720. </span>
  721. </el-dialog>
  722. </div>
  723. </div>
  724. <div class="btn-group clearfix">
  725. <template v-if="!cid">
  726. <el-button size="small" @click="handleReseat">重置</el-button>
  727. <el-button
  728. size="small"
  729. type="primary"
  730. @click="hanleSbumit"
  731. >提交</el-button>
  732. </template>
  733. <template v-else>
  734. <el-button
  735. size="small"
  736. type="primary"
  737. @click="hanleSave"
  738. >保存</el-button>
  739. </template>
  740. <el-button
  741. style="float: right"
  742. type="primary"
  743. size="small"
  744. @click="centerDialogVisible = true"
  745. >添加</el-button>
  746. </div>
  747. <el-dialog title="" :visible.sync="centerDialogVisible" width="80%" center>
  748. <div>
  749. <el-form
  750. ref="screenForm"
  751. :model="screenForm"
  752. label-width="70px"
  753. size="small"
  754. label-position="left"
  755. >
  756. <el-row :gutter="20">
  757. <el-col :xs="24" :sm="12" :lg="6">
  758. <el-form-item label="名称" prop="keyword">
  759. <el-input
  760. v-model="screenForm.keyword"
  761. placeholder="请输入名称"
  762. />
  763. </el-form-item>
  764. </el-col>
  765. <el-col :xs="24" :sm="12" :lg="6">
  766. <el-form-item label="规格" prop="specification">
  767. <el-input
  768. v-model="screenForm.specification"
  769. placeholder="请输入规格"
  770. />
  771. </el-form-item>
  772. </el-col>
  773. <el-col :xs="24" :sm="12" :lg="12" class="tr">
  774. <el-form-item label="">
  775. <el-button
  776. size="small"
  777. @click="resetScreenForm"
  778. >清空</el-button>
  779. <el-button
  780. size="small"
  781. type="primary"
  782. @click="submitScreenForm"
  783. >搜索</el-button>
  784. </el-form-item>
  785. </el-col>
  786. </el-row>
  787. </el-form>
  788. </div>
  789. <div class="mymain-container">
  790. <div class="table">
  791. <el-table
  792. ref="multipleTable"
  793. v-loading="listLoading"
  794. :data="dataList"
  795. element-loading-text="Loading"
  796. border
  797. fit
  798. highlight-current-row
  799. stripe
  800. @select-all="handleSelectionAllChange"
  801. @selection-change="handleSelectionChange"
  802. >
  803. <!-- :selectable="selectable"-->
  804. <el-table-column
  805. align="center"
  806. type="selection"
  807. width="55"
  808. />
  809. <el-table-column
  810. align="center"
  811. label="使用组织"
  812. prop="useOrgName"
  813. min-width="100"
  814. />
  815. <el-table-column
  816. align="center"
  817. label="编码"
  818. prop="number"
  819. min-width="100"
  820. label-class-name="bianma"
  821. class-name="fontstyle"
  822. />
  823. <el-table-column
  824. align="center"
  825. label="名称"
  826. prop="name"
  827. min-width="100"
  828. />
  829. <el-table-column
  830. align="center"
  831. label="规格型号"
  832. prop="specification"
  833. min-width="100"
  834. />
  835. <el-table-column
  836. align="center"
  837. label="数据状态"
  838. prop="forbidStatus"
  839. min-width="100"
  840. >
  841. <template slot-scope="scope">
  842. <el-tag
  843. v-if="scope.row.forbidStatus == 'A'"
  844. type="success"
  845. >正常</el-tag>
  846. <el-tag v-else type="danger">禁用</el-tag>
  847. </template>
  848. </el-table-column>
  849. <el-table-column
  850. align="center"
  851. label="是否维护商城资料"
  852. prop="maintainData"
  853. min-width="100"
  854. />
  855. <el-table-column
  856. align="center"
  857. label="是否维护内外机档案"
  858. prop="maintainFiles"
  859. min-width="100"
  860. />
  861. <el-table-column
  862. align="center"
  863. label="基本单位"
  864. prop="baseUnitId"
  865. min-width="100"
  866. />
  867. <el-table-column
  868. align="center"
  869. label="已使用"
  870. prop="used"
  871. min-width="100"
  872. />
  873. </el-table>
  874. </div>
  875. <!-- 分页 -->
  876. <div class="fr">
  877. <el-pagination
  878. :current-page="currentPage"
  879. :page-sizes="[10]"
  880. :page-size="10"
  881. layout="total, sizes, prev, pager, next, jumper"
  882. :total="listTotal"
  883. @size-change="handleSizeChange"
  884. @current-change="handleCurrentChange"
  885. />
  886. </div>
  887. </div>
  888. <span slot="footer" class="dialog-footer">
  889. <el-button @click="centerDialogVisible = false">取 消</el-button>
  890. <el-button type="primary" @click="handleDetermine">确 定</el-button>
  891. </span>
  892. </el-dialog>
  893. </div>
  894. </template>
  895. <script>
  896. import {
  897. getMaterialList,
  898. getProductRriceAdd,
  899. getProductRriceDetail,
  900. getRebate,
  901. getTypeList,
  902. getUserList,
  903. getWalletList,
  904. handleEdit
  905. } from '@/api/basic_data/material'
  906. import { downloadFiles, handleImport } from '@/utils/util'
  907. import Mixin from '@/mixin/index'
  908. export default {
  909. mixins: [Mixin],
  910. props: ['cid'],
  911. data() {
  912. return {
  913. baseURL: '',
  914. importFileList: [],
  915. listLoading: false,
  916. screenForm: {
  917. keyword: '',
  918. specification: ''
  919. },
  920. base: {
  921. adminCompanyId: '',
  922. adminWebsitId: '',
  923. billId: '',
  924. examineNote: '',
  925. examineResult: true,
  926. examineStatus: '',
  927. id: null,
  928. serviceId: '',
  929. serviceName: '',
  930. remark: '',
  931. saleTypeId: ''
  932. },
  933. items: [],
  934. materialLis: [],
  935. materialId: '',
  936. rebateList: [],
  937. typeList: [],
  938. saleTypeId: '',
  939. serviceId: '',
  940. adminCompanyId: '',
  941. serviceName: '',
  942. adminCompanyName: '',
  943. adminWebsitId: '',
  944. remark: '',
  945. detail: [],
  946. form: {},
  947. startDate: '',
  948. userList: [],
  949. centerDialogVisible: false,
  950. selectData: [],
  951. walleList: [],
  952. fang: true,
  953. wall1: [],
  954. wall2: []
  955. }
  956. },
  957. mounted() {
  958. },
  959. methods: {
  960. handleSale(e, index, saleTypes) {
  961. // console.log(this.rebateList);
  962. const linshi = []
  963. let saleArr = []
  964. const rebateList = []
  965. this.rebateList.forEach((k) => {
  966. k.saleTypes.forEach((j) => {
  967. if (!linshi.includes(j.saleTypeId) && j.saleTypeId == e) {
  968. rebateList.push(k)
  969. }
  970. })
  971. })
  972. saleArr = this.typeList.filter((i) => {
  973. return e == i.id
  974. })
  975. console.log(rebateList, '4444', this.rebateList, e)
  976. // this.items[index].mainName = saleArr[0].mainName;
  977. this.items[index].saleTypeId = e
  978. this.items[index].fang = false
  979. this.items[index].saleTypeName = saleArr[0].saleName
  980. this.$set(this.items[index], 'rebateList', rebateList)
  981. // this.fang = false;
  982. },
  983. resArr(arr1, arr2) {
  984. return arr1.filter((v) => arr2.every((val) => val.id != v.id))
  985. },
  986. // xua
  987. handelWallets(e, index, row) {
  988. // const id = row.cid || row.updPriceBillId
  989. // // if (e && e.length) {
  990. // for (let i = 0; i < e.length; i++) {
  991. // // if (!this.wall1.includes(e[e.length - 1])) {
  992. // this.$set(row, 'wallets', [
  993. // ...row.wallets,
  994. // {
  995. // type: 'COMMONLY',REBATE
  996. // id: '',
  997. // updPriceBillId: id,
  998. // updPriceBillItemId: id,
  999. // walletId: e[e.length - 1]
  1000. // }
  1001. // ])
  1002. // // this.wall1.push(e[e.length - 1])
  1003. // }
  1004. // // }
  1005. // // }
  1006. },
  1007. handelRebateList(e, index, row) {
  1008. // const id = row.cid || row.updPriceBillId
  1009. // if (e && e.length) {
  1010. // for (let i = 0; i < e.length; i++) {
  1011. // if (!this.wall2.includes(e[e.length - 1])) {
  1012. // console.log(44544)
  1013. // this.$set(row, 'wallets', [
  1014. // ...row.wallets,
  1015. // {
  1016. // type: 'REBATE',
  1017. // id: '',
  1018. // updPriceBillId: id,
  1019. // updPriceBillItemId: id,
  1020. // walletId: e[e.length - 1]
  1021. // }
  1022. // ])
  1023. // this.wall2.push(e[e.length - 1])
  1024. // }
  1025. // }
  1026. // }
  1027. },
  1028. handleRemove(e, index, row) {
  1029. // const copxyWall = JSON.parse(JSON.stringify(row.wallets))
  1030. // if (row.wallets[0].walletId === e) {
  1031. // copxyWall.splice(0, 1)
  1032. // }
  1033. // for (let i = 0; i < row.wallets.length; i++) {
  1034. // if (this.wall1.includes(e) && row.wallets[i].walletId === e) {
  1035. // this.wall1.splice(i, 1)
  1036. // copxyWall.splice(i, 1)
  1037. // }
  1038. // }
  1039. // this.$set(row, 'wallets', copxyWall)
  1040. },
  1041. handleRemove2(e, index, row) {
  1042. // const copxyWall = JSON.parse(JSON.stringify(row.wallets))
  1043. // for (let i = 0; i < row.wallets.length; i++) {
  1044. // if (this.wall2.includes(e) && row.wallets[i].walletId == e) {
  1045. // copxyWall.splice(i, 1)
  1046. // this.wall2.splice(i, 1)
  1047. // }
  1048. // }
  1049. // this.$set(row, 'wallets', copxyWall)
  1050. },
  1051. handleUser(e) {
  1052. const adminCompany = this.userList.filter((k) => {
  1053. return e == k.roleId
  1054. })[0]
  1055. this.adminWebsitId = adminCompany.adminUserId
  1056. this.adminCompanyName = adminCompany.adminCompanyName
  1057. this.serviceName = adminCompany.nickName || 'd'
  1058. this.serviceId = adminCompany.roleId
  1059. },
  1060. goBack() {
  1061. this.$parent.cid = ''
  1062. this.$parent.show = 1
  1063. // 更新父组件数据
  1064. this.$parent.getList()
  1065. },
  1066. indexMethod(index) {
  1067. console.log(index)
  1068. },
  1069. hanleDeleInd(index, id,materialId) {
  1070. if (id || materialId) {
  1071. const dataArr = JSON.parse(JSON.stringify(this.dataList))
  1072. for (let j = 0; j < dataArr.length; j++) {
  1073. if ((id || materialId) === dataArr[j].id) {
  1074. // dataArr[j].disabled = false
  1075. console.log(747)
  1076. this.$set(dataArr[j], 'disabled', false)
  1077. }
  1078. }
  1079. this.dataList = dataArr
  1080. }
  1081. this.items.splice(index, 1)
  1082. },
  1083. handleDetermine() {
  1084. if (this.selectData.length) {
  1085. for (let i = 0; i < this.selectData.length; i++) {
  1086. for (let j = 0; j < this.dataList.length; j++) {
  1087. if (this.selectData[i].id == this.dataList[j].id) {
  1088. this.dataList[j].disabled = true
  1089. }
  1090. }
  1091. this.items.push({
  1092. baseUnitId: '',
  1093. batchPrice: '',
  1094. unit: this.selectData[i].baseUnitId,
  1095. billId: '',
  1096. endDate: '',
  1097. isPromote: '',
  1098. isPublish: '',
  1099. materialId: this.selectData[i].id,
  1100. materialName: this.selectData[i].name,
  1101. materialNumber: this.selectData[i].number,
  1102. discAmount: '',
  1103. saleTypes: this.selectData[i].saleTypes,
  1104. materialOldNumber: this.selectData[i].oldNumber,
  1105. parentId: '',
  1106. walletRebateName: '',
  1107. walletRebateId: [],
  1108. rebateRate: '',
  1109. qty: '',
  1110. rebateUseRate: '',
  1111. retailPrice: '' || 0,
  1112. saleTypeId: '',
  1113. specification: this.selectData[i].specification,
  1114. startDate: this.selectData[i].startDate,
  1115. wallets: [],
  1116. rebateWallets: [],
  1117. rebateList: [],
  1118. walletsId: [this.selectData[i].wallets[0].id],
  1119. walleList: this.selectData[i].wallets,
  1120. isPublishArr: [
  1121. {
  1122. value: '是',
  1123. bool: true
  1124. },
  1125. {
  1126. value: '否',
  1127. bool: false
  1128. }
  1129. ],
  1130. isPromoteArr: [
  1131. {
  1132. value: '是',
  1133. bool: true
  1134. },
  1135. {
  1136. value: '否',
  1137. bool: false
  1138. }
  1139. ],
  1140. cid: this.selectData[i].id,
  1141. fang: true
  1142. })
  1143. }
  1144. this.selectData = []
  1145. this.$refs.multipleTable.clearSelection()
  1146. this.centerDialogVisible = false
  1147. } else {
  1148. this.$errorMsg('请选择内容')
  1149. }
  1150. },
  1151. getMaterialList() {
  1152. const params = {
  1153. pageNum: 1,
  1154. pageSize: 10,
  1155. keyword: '',
  1156. bindMain: true
  1157. }
  1158. getMaterialList(params).then((res) => {
  1159. this.materialLis = res.data.records
  1160. })
  1161. },
  1162. handleSelectionAllChange(e) {
  1163. this.selectData = e
  1164. },
  1165. handleSelectionChange(e) {
  1166. this.selectData = e
  1167. },
  1168. hanleAdd() {
  1169. if (this.materialId) {
  1170. this.centerDialogVisible = false
  1171. } else {
  1172. this.$errorMsg('请选择产品')
  1173. }
  1174. },
  1175. async getList() {
  1176. const params1 = {
  1177. pageNum: 1,
  1178. pageSize: -1,
  1179. saleCode: '',
  1180. saleName: '',
  1181. status: ''
  1182. }
  1183. getTypeList(params1).then((res) => {
  1184. this.typeList = res.data.records
  1185. })
  1186. getUserList({
  1187. pageNum: 1,
  1188. pageSize: -1,
  1189. adminWebsitId: '',
  1190. isCustomer: 0,
  1191. roleId: '',
  1192. status: '',
  1193. userName: ''
  1194. }).then((res) => {
  1195. this.userList = res.data.records
  1196. })
  1197. this.listLoading = true
  1198. const params = {
  1199. pageNum: this.currentPage,
  1200. pageSize: 10 || this.pageSize,
  1201. keyword: this.screenForm.keyword,
  1202. specification: this.screenForm.specification,
  1203. bindMain: true
  1204. }
  1205. getMaterialList(params).then((res) => {
  1206. this.dataList = res.data.records
  1207. this.listTotal = res.data.total
  1208. this.listLoading = false
  1209. })
  1210. const rebateParams = {
  1211. pageNum: 1,
  1212. pageSize: -1,
  1213. mainName: '',
  1214. saleTypeCode: '',
  1215. saleTypeName: '',
  1216. status: ''
  1217. }
  1218. const ress = await getRebate(rebateParams)
  1219. this.rebateList = ress.data.records
  1220. const wall = await getWalletList({ mainId: '', walletName: '' })
  1221. for (let u = 0; u < wall.data.length; u++) {
  1222. wall.data[u].walletId = wall.data[u].id
  1223. wall.data[u].walletName = wall.data[u].name
  1224. }
  1225. this.walleList = wall.data
  1226. if (this.$parent.show === 5) {
  1227. getProductRriceDetail({ id: this.cid }).then((res) => {
  1228. for (let i = 0; i < res.data.items.length; i++) {
  1229. const linshi = []
  1230. const rebateList = []
  1231. const walletIds = []
  1232. const walletRebateIds = []
  1233. res.data.items[i].isPublishArr = [
  1234. {
  1235. value: '是',
  1236. bool: true
  1237. },
  1238. {
  1239. value: '否',
  1240. bool: false
  1241. }
  1242. ]
  1243. res.data.items[i].isPromoteArr = [
  1244. {
  1245. value: '是',
  1246. bool: true
  1247. },
  1248. {
  1249. value: '否',
  1250. bool: false
  1251. }
  1252. ]
  1253. res.data.items[i].wallets = []
  1254. res.data.items[i].walletsId = []
  1255. res.data.items[i].walletRebateId = []
  1256. res.data.items[i].rebateWallets = []
  1257. for (let p = 0; p < res.data.items[i].wallets2.length; p++) {
  1258. if (res.data.items[i].wallets2[p].type === 'COMMONLY') {
  1259. walletIds.push(res.data.items[i].wallets2[p].walletId)
  1260. this.$set(res.data.items[i], 'wallets', [
  1261. ...res.data.items[i].wallets,
  1262. {
  1263. type: 'COMMONLY',
  1264. id: '',
  1265. updPriceBillId: res.data.items[i].updPriceBillId,
  1266. updPriceBillItemId: res.data.items[i].updPriceBillId,
  1267. walletId: res.data.items[i].wallets2[p].walletId
  1268. }
  1269. ])
  1270. } else if (res.data.items[i].wallets2[p].type === 'REBATE') {
  1271. walletRebateIds.push(res.data.items[i].wallets2[p].walletId)
  1272. this.$set(res.data.items[i], 'wallets', [
  1273. ...res.data.items[i].wallets,
  1274. {
  1275. type: 'REBATE',
  1276. id: '',
  1277. updPriceBillId: res.data.items[i].updPriceBillId,
  1278. updPriceBillItemId: res.data.items[i].updPriceBillId,
  1279. walletId: res.data.items[i].wallets2[p].walletId
  1280. }
  1281. ])
  1282. }
  1283. }
  1284. console.log(res.data.items[i].wallets)
  1285. this.rebateList.forEach((k) => {
  1286. k.saleTypes.forEach((j) => {
  1287. if (
  1288. !linshi.includes(j.saleTypeId) &&
  1289. j.saleTypeId === res.data.items[i].saleTypeId
  1290. ) {
  1291. for (let w = 0; w < walletRebateIds.length; w++) {
  1292. if (walletRebateIds[w] !== k.walletRebateId) {
  1293. // walletRebateIds.splice(w, 1)
  1294. }
  1295. }
  1296. rebateList.push(k)
  1297. }
  1298. })
  1299. })
  1300. if (this.dataList.length) {
  1301. for (let j = 0; j < res.data.items.length; j++) {
  1302. for (let k = 0; k < this.dataList.length; k++) {
  1303. if (res.data.items[j].materialId === this.dataList[k].id) {
  1304. this.dataList[k].disabled = true
  1305. }
  1306. }
  1307. }
  1308. // console.log(this.dataList)
  1309. }
  1310. this.$set(res.data.items[i], 'walletsId', walletIds)
  1311. this.$set(res.data.items[i], 'walletRebateId', walletRebateIds)
  1312. res.data.items[i].walleList = this.walleList
  1313. res.data.items[i].rebateList = rebateList
  1314. res.data.items[i].fang = false
  1315. }
  1316. this.items = res.data.items
  1317. this.base = res.data
  1318. this.listLoading = false
  1319. })
  1320. } else {
  1321. }
  1322. },
  1323. /**
  1324. * 根据条件禁用行复选框
  1325. * 函数返回值为false则禁用选择(反之亦然)
  1326. * @param {Object} row - 行数据
  1327. * @param {String} index - 索引值
  1328. * @return Boolean
  1329. */
  1330. // selectable: function(row, index) {
  1331. // // row.disabled == undefined 才能被选中
  1332. // if (row.disabled == undefined || row.disabled == false) {
  1333. // return true
  1334. // } else {
  1335. // return false
  1336. // }
  1337. // // 函数必须有返回值且是布尔值
  1338. // // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1339. // // 如果没有返回值则默认返回false(全部无法选中)
  1340. // },
  1341. hanleSbumit() {
  1342. this.filterWallets(this.items)
  1343. const params = {
  1344. ...this.base,
  1345. items: this.items,
  1346. saleTypeId: this.saleTypeId,
  1347. adminWebsitId: this.adminWebsitId,
  1348. serviceId: this.serviceId,
  1349. adminCompanyName: this.adminCompanyName,
  1350. serviceName: this.nickName
  1351. }
  1352. getProductRriceAdd(params).then((res) => {
  1353. this.$successMsg('成功')
  1354. this.$parent.show = 1
  1355. this.$parent.getList()
  1356. })
  1357. },
  1358. hanleSave() {
  1359. this.filterWallets(this.items)
  1360. handleEdit({
  1361. ...this.base,
  1362. items: this.items,
  1363. saleTypeId: this.saleTypeId,
  1364. adminWebsitId: this.adminWebsitId,
  1365. serviceId: this.serviceId,
  1366. adminCompanyName: this.adminCompanyName,
  1367. serviceName: this.nickName
  1368. }).then((res) => {
  1369. this.$successMsg('成功')
  1370. this.$parent.cid = ''
  1371. this.$parent.show = 1
  1372. this.$parent.getList()
  1373. })
  1374. },
  1375. handleReseat() {
  1376. this.base = {
  1377. adminCompanyId: '',
  1378. adminWebsitId: '',
  1379. billId: '',
  1380. examineNote: '',
  1381. examineResult: true,
  1382. examineStatus: '',
  1383. id: null,
  1384. serviceId: '',
  1385. serviceName: '',
  1386. remark: '',
  1387. saleTypeId: ''
  1388. }
  1389. this.saleTypeId = ''
  1390. this.items = []
  1391. },
  1392. // 导入
  1393. async handleImport(param) {
  1394. this.importLoading = true
  1395. const file = param.file
  1396. const formData = new FormData()
  1397. formData.append('file', file)
  1398. const result = await handleImport('/product-upd-price/material/import', formData)
  1399. this.importLoading = false
  1400. this.importFileList = []
  1401. if (result.code === 200) {
  1402. this.$alert(result.message, '导入成功', {
  1403. confirmButtonText: '确定'
  1404. })
  1405. for (let i = 0; i < result.data.length; i++) {
  1406. const linshi = []
  1407. const rebateList = []
  1408. const walletIds = []
  1409. const walletRebateIds = []
  1410. // result.data[i].id = result.data[i].materialId
  1411. result.data[i].isPublishArr = [
  1412. {
  1413. value: '是',
  1414. bool: true
  1415. },
  1416. {
  1417. value: '否',
  1418. bool: false
  1419. }
  1420. ]
  1421. result.data[i].isPromoteArr = [
  1422. {
  1423. value: '是',
  1424. bool: true
  1425. },
  1426. {
  1427. value: '否',
  1428. bool: false
  1429. }
  1430. ]
  1431. result.data[i].wallets = []
  1432. result.data[i].walletsId = []
  1433. result.data[i].walletRebateId = []
  1434. result.data[i].rebateWallets = []
  1435. result.data[i].saleTypes = this.typeList
  1436. result.data[i].mainId = result.data[i].saleTypeId
  1437. for (let p = 0; p < result.data[i].wallets2.length; p++) {
  1438. if (result.data[i].wallets2[p].type === 'COMMONLY') {
  1439. walletIds.push(result.data[i].wallets2[p].walletId)
  1440. this.$set(result.data[i], 'wallets', [
  1441. ...result.data[i].wallets,
  1442. {
  1443. type: 'COMMONLY',
  1444. id: '',
  1445. updPriceBillId: result.data[i].updPriceBillId,
  1446. updPriceBillItemId: result.data[i].updPriceBillId,
  1447. walletId: result.data[i].wallets2[p].walletId
  1448. }
  1449. ])
  1450. } else if (result.data[i].wallets2[p].type === 'REBATE') {
  1451. walletRebateIds.push(result.data[i].wallets2[p].walletId)
  1452. this.$set(result.data[i], 'wallets', [
  1453. ...result.data[i].wallets,
  1454. {
  1455. type: 'REBATE',
  1456. id: '',
  1457. updPriceBillId: result.data[i].updPriceBillId,
  1458. updPriceBillItemId: result.data[i].updPriceBillId,
  1459. walletId: result.data[i].wallets2[p].walletId
  1460. }
  1461. ])
  1462. }
  1463. }
  1464. this.rebateList.forEach((k) => {
  1465. k.saleTypes.forEach((j) => {
  1466. if (
  1467. !linshi.includes(j.saleTypeId) &&
  1468. j.saleTypeId === result.data[i].saleTypeId
  1469. ) {
  1470. for (let w = 0; w < walletRebateIds.length; w++) {
  1471. if (walletRebateIds[w] !== k.walletRebateId) {
  1472. // walletRebateIds.splice(w, 1)
  1473. }
  1474. }
  1475. rebateList.push(k)
  1476. }
  1477. })
  1478. })
  1479. this.$set(result.data[i], 'walletsId', walletIds)
  1480. this.$set(result.data[i], 'walletRebateId', walletRebateIds)
  1481. result.data[i].walleList = this.walleList
  1482. result.data[i].rebateList = rebateList
  1483. result.data[i].fang = false
  1484. }
  1485. // if (this.dataList.length) {
  1486. // for (let j = 0; j < result.data.length; j++) {
  1487. // for (let k = 0; k < this.dataList.length; k++) {
  1488. // if (result.data[j].materialId === this.dataList[k].id) {
  1489. // this.dataList[k].disabled = true
  1490. // }
  1491. // }
  1492. // }
  1493. // }
  1494. // this.items = [...this.items,...result.data]
  1495. // let newArr = [];
  1496. // let obj = {};
  1497. // for (var i = 0; i < this.items.length; i++) {
  1498. // if (!obj[this.items[i].materialId]) {
  1499. // newArr.push(this.items[i])
  1500. // obj[this.items[i].materialId] = true
  1501. // }
  1502. // }
  1503. // console.log(newArr,454 ,obj)
  1504. this.items = [...this.items,...result.data]
  1505. // console.log(resArrs(result.data,this.dataList),'55555')
  1506. } else {
  1507. this.$alert(result.message, '导入失败', {
  1508. confirmButtonText: '确定'
  1509. })
  1510. }
  1511. },
  1512. // 下载经销商模板
  1513. hanleDownloadFiles() {
  1514. downloadFiles('/product-upd-price/download')
  1515. },
  1516. filterWallets(array){
  1517. const wallets = []
  1518. for (let i = 0; i < array.length; i++) {
  1519. if (!array[i].walletsId.length) return
  1520. for (let j = 0; j < array[i].walleList.length; j++) {
  1521. for (let k = 0; k < array[i].walletsId.length; k++) {
  1522. if (array[i].walleList[j].id === array[i].walletsId[k]) {
  1523. wallets.push({
  1524. type: 'COMMONLY',
  1525. id: '',
  1526. updPriceBillId: array[i].cid || array[i].updPriceBillId,
  1527. updPriceBillItemId: array[i].cid || array[i].updPriceBillId,
  1528. walletId: array[i].walletsId[k]
  1529. })
  1530. }
  1531. }
  1532. }
  1533. for (let k = 0; k < array[i].rebateList.length; k++) {
  1534. if (!array[i].walletRebateId.length) return
  1535. for (let j = 0; j < array[i].walletRebateId.length; j++) {
  1536. if (array[i].rebateList[k].walletRebateId === array[i].walletRebateId[j]) {
  1537. wallets.push({
  1538. type: 'REBATE',
  1539. id: '',
  1540. updPriceBillId: array[i].cid || array[i].updPriceBillId,
  1541. updPriceBillItemId: array[i].cid || array[i].updPriceBillId,
  1542. walletId: array[i].walletRebateId[j]
  1543. })
  1544. }
  1545. }
  1546. }
  1547. array[i].wallets = wallets
  1548. }
  1549. }
  1550. }
  1551. }
  1552. </script>
  1553. <style lang="scss" scoped>
  1554. ::v-deep .el-date-editor--date {
  1555. width: 100%;
  1556. }
  1557. .dia .el-select--normal {
  1558. width: 100%;
  1559. }
  1560. .clearfixs{
  1561. display: flex;
  1562. }
  1563. .import-btn{
  1564. margin-right: 10px;
  1565. }
  1566. </style>