Examine.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303
  1. <template>
  2. <div class="">
  3. <div v-if="isEdit == 1">
  4. <div>
  5. <div class="diy-table-1">
  6. <el-row>
  7. <el-col :span="8" class="item">
  8. <div class="label">销售政策编号</div>
  9. <div class="value">{{ detail.code }}</div>
  10. </el-col>
  11. <el-col :span="8" class="item">
  12. <div class="label">销售政策类型</div>
  13. <div class="value">
  14. <el-select v-model="detail.type" size="small" disabled placeholder="销售政策类型" class="select_height">
  15. <el-option
  16. v-for="(item, index) in typeOptions"
  17. :key="index"
  18. :label="item.label"
  19. :value="item.value"
  20. />
  21. </el-select>
  22. </div>
  23. </el-col>
  24. <el-col :span="8" class="item">
  25. <div class="label">状态</div>
  26. <div class="value">
  27. {{ detail.status == 1 ? '已生效' : '未生效' }}
  28. </div>
  29. </el-col>
  30. <el-col :span="24" class="item">
  31. <div class="label">销售政策名称</div>
  32. <div class="value">
  33. <el-input v-model="detail.title" disabled placeholder="请输入政策名称" />
  34. </div>
  35. </el-col>
  36. <el-col :span="24" class="item">
  37. <div class="label">表头备注</div>
  38. <div class="value">
  39. <el-input v-model="detail.remark" disabled placeholder="请输入表头备注" />
  40. </div>
  41. </el-col>
  42. <el-col :span="8" class="item">
  43. <div class="label">制单人</div>
  44. <div class="value">{{ detail.createBy }}</div>
  45. </el-col>
  46. <el-col :span="8" class="item">
  47. <div class="label">制单日期</div>
  48. <div class="value">
  49. <el-date-picker
  50. v-model="detail.createTime"
  51. disabled
  52. type="datetime"
  53. placeholder="制单日期"
  54. default-time="00:00:00"
  55. value-format="yyyy-MM-dd HH:mm:ss"
  56. />
  57. </div>
  58. </el-col>
  59. <el-col :span="8" class="item">
  60. <div class="label">生效日期</div>
  61. <div class="value">
  62. <el-date-picker
  63. v-model="detail.startTime"
  64. disabled
  65. type="datetime"
  66. placeholder="生效日期"
  67. default-time="00:00:00"
  68. value-format="yyyy-MM-dd HH:mm:ss"
  69. />
  70. </div>
  71. </el-col>
  72. <el-col :span="24" class="item">
  73. <div class="label">失效日期</div>
  74. <div class="value">
  75. <el-date-picker
  76. v-model="detail.endTime"
  77. disabled
  78. type="datetime"
  79. placeholder="生效日期"
  80. default-time="00:00:00"
  81. value-format="yyyy-MM-dd HH:mm:ss"
  82. />
  83. </div>
  84. </el-col>
  85. <template v-if="detail.type === 'LIMIT'">
  86. <el-col :span="12" class="item">
  87. <div class="label">商家最少起提数量</div>
  88. <div class="value">
  89. {{ detail.minBuyNum }}
  90. </div>
  91. </el-col>
  92. <el-col :span="12" class="item">
  93. <div class="label">商家最大提货组数</div>
  94. <div class="value">
  95. {{ detail.maxBuyNum }}
  96. </div>
  97. </el-col>
  98. </template>
  99. </el-row>
  100. <el-row v-if="detail.imgSrc" class="img-box">
  101. <el-col :span="24" class="item">
  102. <div class="label" style="height: 150px">政策封面图</div>
  103. <div class="value" style="height: 150px">
  104. <template v-for="item in detail.imgSrc">
  105. <el-image
  106. v-if="checkFileType(item) == 'image'"
  107. ref="img"
  108. :src="$imageUrl + item"
  109. style="width: 120px; height: 120px; margin-right: 20px"
  110. fit="cover"
  111. :preview-src-list="[$imageUrl + item]"
  112. class="elImageClose"
  113. />
  114. <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png">
  115. <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png">
  116. <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png">
  117. <img
  118. v-if="checkFileType(item) == 'pdf'"
  119. class="file"
  120. style="cursor: pointer"
  121. src="@/assets/common/pdf.png"
  122. @click="openPdf(item)"
  123. >
  124. <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
  125. </template>
  126. </div>
  127. </el-col>
  128. </el-row>
  129. <el-row v-if="this.isShow == 4">
  130. <el-col :span="8" class="item">
  131. <div class="label">审核人</div>
  132. <div class="value">{{ detail.examineBy }}</div>
  133. </el-col>
  134. <el-col :span="16" class="item">
  135. <div class="label">审核日期</div>
  136. <div class="value">{{ detail.examineTime }}</div>
  137. </el-col>
  138. <!-- <el-col :span="8" class="item">-->
  139. <!-- <div class="label">关闭人</div>-->
  140. <!-- <div class="value"></div>-->
  141. <!-- </el-col>-->
  142. <!-- <el-col :span="24" class="item">-->
  143. <!-- <div class="label">关闭日期</div>-->
  144. <!-- <div class="value"></div>-->
  145. <!-- </el-col>-->
  146. </el-row>
  147. <el-row>
  148. <el-col :span="12" class="item">
  149. <div class="label">返利使用金额需满额使用</div>
  150. <div class="value">
  151. <el-checkbox v-model="detail.isFullRebate" disabled>{{
  152. detail.isFullRebate ? '是' : '否'
  153. }}</el-checkbox>
  154. </div>
  155. </el-col>
  156. <el-col :span="12" class="item">
  157. <div class="label">商用空调政策</div>
  158. <div class="value">
  159. <el-checkbox v-model="detail.commercialType" disabled>{{
  160. detail.commercialType ? '是' : '否'
  161. }}</el-checkbox>
  162. </div>
  163. </el-col>
  164. </el-row>
  165. </div>
  166. <div class="mymain-container">
  167. <el-row>
  168. <el-divider />
  169. <el-row type="flex">
  170. <el-col :span="12">
  171. <h4 style="display: inline-block; margin-right: 20px">货品信息</h4>
  172. <ExportButton
  173. v-if="isShow === 4"
  174. style="display: inline-block"
  175. :ex-url="'policy/material/export'"
  176. ex-text="导出货品"
  177. :ex-params="{ policyId: detail.code }"
  178. />
  179. </el-col>
  180. <el-col :span="12" class="tr">
  181. <!-- <el-button size="small" @click="$parent.isShow = 10"
  182. >查看条件</el-button
  183. > -->
  184. </el-col>
  185. </el-row>
  186. <el-divider />
  187. </el-row>
  188. <div class="table">
  189. <el-table
  190. v-loading="listLoading"
  191. :data="dataList"
  192. element-loading-text="Loading"
  193. border
  194. max-height="700"
  195. fit
  196. highlight-current-row
  197. stripe
  198. >
  199. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  200. <el-table-column prop="materialNumber" label="物料编码" min-width="160" show-overflow-tooltip align="left">
  201. <template slot-scope="scope">
  202. <CopyButton :copy-text="scope.row.materialNumber" />
  203. <span>{{ scope.row.materialNumber }}</span>
  204. </template>
  205. </el-table-column>
  206. <el-table-column prop="materialName" label="产品名称" min-width="160" show-overflow-tooltip align="left">
  207. <template slot-scope="scope">
  208. <CopyButton :copy-text="scope.row.materialName" />
  209. <span>{{ scope.row.materialName }}</span>
  210. </template>
  211. </el-table-column>
  212. <el-table-column prop="specification" label="规格型号" min-width="300" show-overflow-tooltip align="left">
  213. <template slot-scope="scope">
  214. <CopyButton :copy-text="scope.row.specification" />
  215. <span>{{ scope.row.specification }}</span>
  216. </template>
  217. </el-table-column>
  218. <el-table-column
  219. prop="saleTypeCode"
  220. label="销售类型编码"
  221. min-width="160"
  222. show-overflow-tooltip
  223. align="left"
  224. />
  225. <el-table-column prop="saleTypeName" label="销售类型" min-width="160" show-overflow-tooltip align="left" />
  226. <el-table-column prop="discAmount" label="格力折扣" align="right" />
  227. <el-table-column prop="price" label="单价" align="right" />
  228. <el-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
  229. <template slot-scope="scope">
  230. {{ scope.row.orgPrice }}
  231. </template>
  232. </el-table-column>
  233. <el-table-column prop="priceType" label="价格类型" align="left" min-width="150">
  234. <template slot-scope="scope">
  235. {{ scope.row.priceType }}
  236. </template>
  237. </el-table-column>
  238. <el-table-column label="返利钱包" align="left" min-width="200" show-overflow-tooltip>
  239. <template slot-scope="scope">
  240. <template v-for="item in scope.row.walletRelaList">
  241. <el-tag v-if="item.type === 'REBATE'" style="margin: 5px" type="success" size="small">{{
  242. item.walletName
  243. }}</el-tag>
  244. </template>
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="现金钱包" align="left" min-width="200" show-overflow-tooltip>
  248. <template slot-scope="scope">
  249. <template v-for="item in scope.row.walletRelaList">
  250. <el-tag v-if="item.type === 'COMMONLY'" style="margin: 5px" type="success" size="small">{{
  251. item.walletName
  252. }}</el-tag>
  253. </template>
  254. </template>
  255. </el-table-column>
  256. <el-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
  257. <template slot-scope="scope">
  258. {{ scope.row.status ? '启用' : '作废' }}
  259. </template>
  260. </el-table-column>
  261. </el-table>
  262. </div>
  263. <!-- 分页 -->
  264. <div style="margin: 20px 0">
  265. <el-pagination
  266. :current-page="dcurrentPage"
  267. :page-sizes="[10, 20, 30, 50]"
  268. :page-size="10"
  269. layout="total, sizes, prev, pager, next, jumper"
  270. :total="dlistTotal"
  271. @size-change="handleSizeChange2"
  272. @current-change="handleCurrentChange2"
  273. />
  274. </div>
  275. <el-row>
  276. <el-divider />
  277. <el-row type="flex">
  278. <el-col :span="12">
  279. <h4 style="display: inline-block; margin-right: 20px">条件信息</h4>
  280. </el-col>
  281. </el-row>
  282. <el-divider />
  283. </el-row>
  284. <el-table :data="conditionList" element-loading-text="Loading" border fit highlight-current-row stripe>
  285. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  286. <el-table-column prop="name" label="限定条件" align="left">
  287. <template slot-scope="scope">
  288. {{ scope.row.name }}
  289. </template>
  290. </el-table-column>
  291. <el-table-column label="操作" align="left" width="150">
  292. <template slot-scope="scope">
  293. <el-button type="text" size="small" @click="getCommonApi(scope.row)">查看条件</el-button>
  294. </template>
  295. </el-table-column>
  296. </el-table>
  297. <el-row>
  298. <el-divider />
  299. <el-row type="flex">
  300. <el-col :span="12">
  301. <h4 style="display: inline-block; margin-right: 20px">经销商使用范围</h4>
  302. <template v-if="detail.flag == 0">
  303. <ExportButton
  304. v-if="isShow === 4"
  305. style="display: inline-block"
  306. :ex-url="'policy/customer/export'"
  307. ex-text="导出经销商"
  308. :ex-params="{ policyId: detail.code }"
  309. />
  310. </template>
  311. </el-col>
  312. </el-row>
  313. <el-divider />
  314. </el-row>
  315. <div style="margin-bottom: 20px">
  316. <el-radio-group v-model="detail.flag">
  317. <el-radio :label="0" :disabled="detail.flag != 0">指定经销商</el-radio>
  318. <el-radio :label="1" :disabled="detail.flag != 1">广州经销商</el-radio>
  319. <el-radio :label="2" :disabled="detail.flag != 2">佛山经销商</el-radio>
  320. </el-radio-group>
  321. </div>
  322. <template v-if="isShow != 5">
  323. <template v-if="detail.flag == 0">
  324. <el-table
  325. v-loading="listLoading"
  326. :data="custoList"
  327. element-loading-text="Loading"
  328. border
  329. fit
  330. highlight-current-row
  331. stripe
  332. >
  333. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  334. <el-table-column prop="customerNumber" label="经销商编码" align="left">
  335. <template slot-scope="scope">
  336. <CopyButton :copy-text="scope.row.customerNumber" />
  337. <span>{{ scope.row.customerNumber }}</span>
  338. </template></el-table-column>
  339. <el-table-column prop="customerName" label="经销商名称" align="left">
  340. <template slot-scope="scope">
  341. <CopyButton :copy-text="scope.row.customerName" />
  342. <span>{{ scope.row.customerName }}</span>
  343. </template>
  344. </el-table-column>
  345. </el-table>
  346. <!-- 分页 -->
  347. <div style="margin: 20px 0">
  348. <el-pagination
  349. :current-page="currentPages"
  350. :page-sizes="[10, 20, 30, 50]"
  351. :page-size="10"
  352. layout="total, sizes, prev, pager, next, jumper"
  353. :total="clistTotals"
  354. @size-change="handleSizeChanges"
  355. @current-change="handleCurrentChanges"
  356. />
  357. </div>
  358. </template>
  359. </template>
  360. <template v-else>
  361. <el-row :gutter="20">
  362. <el-col :span="10" :offset="0">
  363. <h5>未选经销商</h5>
  364. <el-divider direction="horizontal" content-position="left" />
  365. <div class="table">
  366. <el-table
  367. ref="multipleTable"
  368. :data="dataL"
  369. element-loading-text="Loading"
  370. border
  371. height="480px"
  372. fit
  373. highlight-current-row
  374. @select-all="handleSelectionAllChange"
  375. @selection-change="handleSelectionChange"
  376. >
  377. <el-table-column type="selection" width="55" :selectable="selectable" align="left" />
  378. <el-table-column prop="number" label="经销商编码" align="left">
  379. <template slot-scope="scope">
  380. <CopyButton :copy-text="scope.row.number" />
  381. <span>{{ scope.row.number }}</span>
  382. </template>
  383. </el-table-column>
  384. <el-table-column prop="name" label="经销商名称" align="left">
  385. <template slot-scope="scope">
  386. <CopyButton :copy-text="scope.row.name" />
  387. <span>{{ scope.row.name }}</span>
  388. </template>
  389. </el-table-column>
  390. </el-table>
  391. </div>
  392. <!-- 分页 -->
  393. <div style="margin: 20px 0">
  394. <el-pagination
  395. :current-page="currentPages"
  396. :page-sizes="[10, 20, 30, 50]"
  397. :page-size="10"
  398. layout="total, sizes, prev, pager, next, jumper"
  399. :total="clistTotal"
  400. @size-change="handleSizeChanges"
  401. @current-change="handleCurrentChanges"
  402. />
  403. </div>
  404. </el-col>
  405. <el-col :span="4" class="middle_box" :offset="0">
  406. <el-col>
  407. <el-button size="small" :disabled="type == 2" @click="handleAllAdd">全部添加</el-button></el-col>
  408. <el-col> <el-button size="small" :disabled="type == 2" @click="handleAdd">增加</el-button></el-col>
  409. <el-col> <el-button size="small" :disabled="type == 1" @click="handleDelete">删除</el-button></el-col>
  410. <el-col>
  411. <el-button size="small" :disabled="type == 1" @click="handleAllDelete">全部删除</el-button></el-col>
  412. </el-col>
  413. <el-col :span="10" :offset="0">
  414. <h5>已选经销商</h5>
  415. <el-divider direction="horizontal" content-position="left" />
  416. <div class="table">
  417. <el-table
  418. v-loading="listLoading"
  419. :data="custoList"
  420. element-loading-text="Loading"
  421. border
  422. height="480px"
  423. fit
  424. highlight-current-row
  425. stripe
  426. @select-all="handleSelectionAllChange2"
  427. @selection-change="handleSelectionChange2"
  428. >
  429. <el-table-column type="selection" width="55" align="left" />
  430. <el-table-column prop="customerNumber" label="经销商编码" align="left">
  431. <template slot-scope="scope">
  432. <CopyButton :copy-text="scope.row.customerNumber" />
  433. <span>{{ scope.row.customerNumber }}</span>
  434. </template>
  435. </el-table-column>
  436. <el-table-column prop="customerName" label="经销商名称" align="left">
  437. <template slot-scope="scope">
  438. <CopyButton :copy-text="scope.row.customerName" />
  439. <span>{{ scope.row.customerName }}</span>
  440. </template>
  441. </el-table-column>
  442. </el-table>
  443. </div>
  444. </el-col>
  445. </el-row>
  446. </template>
  447. <div>
  448. <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
  449. <el-divider />
  450. </div>
  451. <div>
  452. <el-table
  453. v-if="detail.type == 'PROVISION'"
  454. v-loading="clistLoading"
  455. :data="list"
  456. element-loading-text="Loading"
  457. border
  458. fit
  459. highlight-current-row
  460. stripe
  461. @select-all="handleSelectionAllChange2"
  462. @selection-change="handleSelectionChange2"
  463. >
  464. <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
  465. <template slot-scope="scope">
  466. <CopyButton :copy-text="scope.row.customerName" />
  467. <span>{{ scope.row.customerName }}</span>
  468. </template>
  469. </el-table-column>
  470. <el-table-column prop="maxBuyNum" label="最大提货套数" align="left">
  471. <template slot-scope="scope">
  472. {{ scope.row.maxBuyNum }}
  473. </template>
  474. </el-table-column>
  475. <el-table-column prop="materialName" label="物料名称" align="left">
  476. <template slot-scope="scope">
  477. {{ scope.row.materialName }}
  478. </template>
  479. </el-table-column>
  480. <el-table-column prop="materialNumber" label="物料编号" align="left">
  481. <template slot-scope="scope">
  482. {{ scope.row.materialNumber }}
  483. </template>
  484. </el-table-column>
  485. <el-table-column prop="limitQty" label="订货上限" align="left">
  486. <template slot-scope="scope">
  487. {{ scope.row.limitQty }}
  488. </template>
  489. </el-table-column>
  490. <el-table-column prop="orderNums" label="已下订单数" align="left">
  491. <template slot-scope="scope">
  492. {{ scope.row.orderNums }}
  493. </template>
  494. </el-table-column>
  495. <el-table-column prop="examineOrderNums" label="已审订单数" align="left">
  496. <template slot-scope="scope">
  497. {{ scope.row.examineOrderNums }}
  498. </template>
  499. </el-table-column>
  500. </el-table>
  501. <el-table
  502. v-else
  503. v-loading="clistLoading"
  504. :data="list"
  505. element-loading-text="Loading"
  506. border
  507. fit
  508. highlight-current-row
  509. stripe
  510. @select-all="handleSelectionAllChange2"
  511. @selection-change="handleSelectionChange2"
  512. >
  513. <el-table-column type="index" label="序号" align="left" />
  514. <el-table-column prop="customerNumber" label="经销商编号" align="left" width="300">
  515. <template slot-scope="scope">
  516. <CopyButton :copy-text="scope.row.customerNumber" />
  517. <span>{{ scope.row.customerNumber }}</span>
  518. </template>
  519. </el-table-column>
  520. <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
  521. <template slot-scope="scope">
  522. <CopyButton :copy-text="scope.row.customerName" />
  523. <span>{{ scope.row.customerName }}</span>
  524. </template>
  525. </el-table-column>
  526. <el-table-column prop="minBuyNum" label="最少起提数" align="left">
  527. <template slot-scope="scope">
  528. <span>{{ scope.row.minBuyNum }}</span>
  529. </template>
  530. </el-table-column>
  531. <el-table-column prop="maxBuyNum" label="最大提货组数" align="left">
  532. <template slot-scope="scope">
  533. <span>{{ scope.row.maxBuyNum }}</span>
  534. </template>
  535. </el-table-column>
  536. <el-table-column prop="orderNums" label="已下订单数" align="left">
  537. <template slot-scope="scope">
  538. <span>{{ scope.row.orderNums }}</span>
  539. </template>
  540. </el-table-column>
  541. <el-table-column prop="examineOrderNums" label="已审订单数" align="left">
  542. <template slot-scope="scope">
  543. <span>{{ scope.row.examineOrderNums }}</span>
  544. </template>
  545. </el-table-column>
  546. </el-table>
  547. <!-- 分页 -->
  548. <div style="margin: 20px 0">
  549. <el-pagination
  550. :current-page="policyList.currentPages"
  551. :page-sizes="[10, 20, 30, 50]"
  552. :page-size="10"
  553. layout="total, sizes, prev, pager, next, jumper"
  554. :total="cTotal"
  555. @size-change="handleSizeChanges4"
  556. @current-change="handleCurrentChanges4"
  557. />
  558. </div>
  559. <div v-if="detail && detail.type == 'PROVISION'">
  560. <div>
  561. <h4 style="display: inline-block; margin-right: 20px">经销商配提套数上限</h4>
  562. <el-divider />
  563. </div>
  564. <div style="margin: 20px 0">
  565. <!-- <el-upload
  566. class="import-btn cus-btn"
  567. :action="baseURL + 'policy/limit/group/import'"
  568. :http-request="handleImportPolicyLimitGroupPolicy"
  569. :file-list="importFileList"
  570. :show-file-list="false"
  571. >
  572. <el-button type="primary" size="mini">导入经销商配提套数</el-button>
  573. </el-upload> -->
  574. <!-- <ExportButton
  575. style="display: inline-block;margin-right: 10px;"
  576. :ex-url="'policy/limit/group/export'"
  577. ex-text="导出经销商配提套数"
  578. :ex-params="{ policyId: detail.code }"
  579. />
  580. <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy">下载模板</el-button> -->
  581. </div>
  582. <!-- <el-row style="margin: 20px 0">
  583. <el-col :span="12">
  584. <el-input v-model="policyKeyWord" placeholder="查找经销商" size="mini" />
  585. </el-col>
  586. <el-col :span="10" style="margin-left: 20px">
  587. <el-button size="mini" @click="getPolicyLimitGroupList">确定</el-button>
  588. <el-button size="mini" @click="onPolicyReset">重置</el-button>
  589. </el-col>
  590. </el-row> -->
  591. <div>
  592. <div class="table">
  593. <el-table
  594. v-loading="policyLoading"
  595. :data="policyLimitGroupList"
  596. element-loading-text="Loading"
  597. border
  598. fit
  599. highlight-current-row
  600. stripe
  601. >
  602. <el-table-column type="index" width="50" />
  603. <el-table-column
  604. prop="customerNumber"
  605. label="经销商编号
  606. "
  607. align="left"
  608. width="300"
  609. >
  610. <template slot-scope="scope">
  611. <CopyButton :copy-text="scope.row.customerNumber" />
  612. <span>{{ scope.row.customerNumber }}</span>
  613. </template>
  614. </el-table-column>
  615. <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
  616. <template slot-scope="scope">
  617. <CopyButton :copy-text="scope.row.customerName" />
  618. <span>{{ scope.row.customerName }}</span>
  619. </template>
  620. </el-table-column>
  621. <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" width="200">
  622. <template slot-scope="scope">
  623. {{ scope.row.groupLimitNum }}
  624. </template>
  625. </el-table-column>
  626. <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
  627. <template slot-scope="scope">
  628. {{ scope.row.orderNums }}
  629. </template>
  630. </el-table-column>
  631. <el-table-column prop="examineOrderNums" label="配提上限已审订单数" align="left" width="200">
  632. <template slot-scope="scope">
  633. {{ scope.row.examineOrderNums }}
  634. </template>
  635. </el-table-column>
  636. </el-table>
  637. </div>
  638. <!-- 分页 -->
  639. <div style="margin: 20px 0">
  640. <el-pagination
  641. :current-page="policyCurrentPages"
  642. :page-sizes="[10, 20, 30, 50]"
  643. :page-size="10"
  644. layout="total, sizes, prev, pager, next, jumper"
  645. :total="policyListTotal"
  646. @size-change="handlePolicySizeChanges"
  647. @current-change="handlePolicyCurrentChanges"
  648. />
  649. </div>
  650. </div>
  651. </div>
  652. </div>
  653. <div v-if="isShow == 5 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
  654. <el-row>
  655. <el-col :span="6">审核人</el-col>
  656. <el-col :span="6">{{ $store.getters.name }}</el-col>
  657. <el-col :span="6">审核结果</el-col>
  658. <el-col :span="6">
  659. <template>
  660. <el-radio-group v-model="examineStatus">
  661. <el-radio :label="'OK'">通过</el-radio>
  662. <el-radio :label="'FAIL'">驳回</el-radio>
  663. </el-radio-group>
  664. </template>
  665. </el-col>
  666. </el-row>
  667. <el-row class="item">
  668. <el-col :span="4">审批说明</el-col>
  669. <el-col :span="20" class="col value" style="padding-left: 10px">
  670. <el-input v-model="remark" size="small" placeholder="请输入内容" />
  671. </el-col>
  672. </el-row>
  673. <el-row>
  674. <el-button type="primary" size="small" @click="handleSubmit">审核</el-button>
  675. </el-row>
  676. </div>
  677. </div>
  678. </div>
  679. </div>
  680. <AddCondition v-else :id="cid" :is-edit="isEdit" @close="handleConditionClose" @back="handleBack" />
  681. </div>
  682. </template>
  683. <script>
  684. import {
  685. deleteCondition,
  686. deleteMaterialPolicy,
  687. getConditionList,
  688. getCrList,
  689. getCustomerList,
  690. getMaterialList,
  691. getPolicyDetail,
  692. toExamine,
  693. updatePolicy,
  694. getPolicyList,
  695. getPolicyLimitGroupList
  696. } from '@/api/policy_list'
  697. import AddCondition from './AddCondition'
  698. import ImageUpload from '@/components/Common/image-upload.vue'
  699. import { downloadFiles, handleImport } from '@/utils/util'
  700. import Minxin from '@/mixin'
  701. export default {
  702. name: 'Examine',
  703. components: {
  704. AddCondition,
  705. ImageUpload
  706. },
  707. mixins: [Minxin],
  708. props: {
  709. id: {
  710. type: String,
  711. default: ''
  712. },
  713. isShow: {
  714. type: Number
  715. }
  716. },
  717. data() {
  718. return {
  719. baseURL: '',
  720. dcurrentPage: 1,
  721. dpageSize: 10,
  722. dlistTotal: 0,
  723. currentPages: 1, // 当前页码
  724. pageSizes: 10, // 每页数量
  725. clistTotal: 0,
  726. input: '',
  727. remark: '',
  728. fileList: [],
  729. listLoading: false,
  730. imageUrl: '',
  731. dataList: [],
  732. examineStatus: 'OK',
  733. options: {},
  734. value: '',
  735. detail: {},
  736. srcList: [],
  737. screenForm: {
  738. code: '',
  739. createBy: '',
  740. endCreateTime: '',
  741. endTime1: '',
  742. endTime2: '',
  743. examineBy: '',
  744. remark: '',
  745. startCreateTime: '',
  746. startTime1: '',
  747. startTime2: '',
  748. status: '',
  749. title: '',
  750. type: ''
  751. },
  752. conditionList: [],
  753. custoList: [],
  754. isEdit: 1,
  755. cid: '',
  756. cpolicyId: '',
  757. dataL: [],
  758. clistTotal: 0,
  759. clistTotals: 0,
  760. type: 1,
  761. fileList: [],
  762. importFileList: [],
  763. leftData: [],
  764. rightData: [],
  765. typeOptions: [
  766. {
  767. value: 'PROVISION',
  768. label: '配提'
  769. },
  770. {
  771. value: 'LIMIT',
  772. label: '限量'
  773. }
  774. ],
  775. detailFang: false,
  776. policyList: {
  777. pageNum: 1,
  778. pageSize: 10,
  779. policyId: '',
  780. keyword: '',
  781. currentPages: 1
  782. },
  783. list: [],
  784. cTotal: 1,
  785. clistLoading: false,
  786. policyLimitGroupList: [],
  787. policyLoading: false,
  788. policyCurrentPages: 1,
  789. policyPageSize: 10,
  790. policyListTotal: 0,
  791. policyKeyWord: ''
  792. }
  793. },
  794. computed: {
  795. comTitle() {
  796. let title = '详情页'
  797. if (this.isShow == 5) {
  798. title = '编辑页'
  799. } else if (this.isShow == 8 && !this.detailFang) {
  800. title = '审核页'
  801. } else {
  802. title = '详情页'
  803. }
  804. return title
  805. }
  806. },
  807. created() {},
  808. methods: {
  809. handleConditionClose() {
  810. this.isEdit = 1
  811. },
  812. getList() {
  813. this.listLoading = true
  814. getPolicyDetail({ policyId: this.id }).then(res => {
  815. this.detail = res.data
  816. this.detail.imgSrc = this.detail.imgSrc.split(',')
  817. this.detail.imgSrc.forEach(k => {
  818. this.srcList.push(this.$imageUrl + k)
  819. })
  820. if (this.isShow == 5 && this.detail.imgSrc) {
  821. this.fileList = [
  822. {
  823. hover: '',
  824. url: this.detail.imgSrc
  825. }
  826. ]
  827. }
  828. this.handletwoList()
  829. // 获取条件政策
  830. this.getConditionList()
  831. this.getCond()
  832. this.getPolicyList()
  833. this.getPolicyLimitGroupList()
  834. })
  835. },
  836. getPolicyList() {
  837. this.clistLoading = true
  838. getPolicyList({
  839. pageNum: this.policyList.currentPages,
  840. pageSize: this.policyList.pageSize,
  841. policyId: this.id,
  842. keyword: this.policyList.keyword
  843. }).then(res => {
  844. this.list = res.data.records
  845. this.cTotal = res.data.total
  846. this.clistLoading = false
  847. })
  848. },
  849. // 更改每页数量
  850. handleSizeChanges4(val) {
  851. this.policyList.pageSizes = val
  852. this.policyList.currentPages = 1
  853. this.getPolicyList()
  854. },
  855. // 更改当前页
  856. handleCurrentChanges4(val) {
  857. this.policyList.currentPages = val
  858. this.getPolicyList()
  859. },
  860. getCrList() {
  861. const customerParams = {
  862. pageNum: this.currentPage,
  863. pageSize: this.pageSize,
  864. keyword: this.region == 1 || this.region == '' ? '' : this.keyword,
  865. region: this.region == 1 ? this.keyword : ''
  866. }
  867. // 获取经销商列表
  868. getCrList(customerParams).then(res => {
  869. for (let j = 0; j < this.custoList.length; j++) {
  870. for (let i = 0; i < res.data.records.length; i++) {
  871. if (res.data.records[i].id == this.custoList[j].customerId) {
  872. res.data.records[i].disabled = true
  873. }
  874. }
  875. }
  876. this.dataL = res.data.records
  877. for (let k = 0; k < this.dataL.length; k++) {
  878. (this.dataL[k].customerId = this.dataL[k].id),
  879. (this.dataL[k].customerName = this.dataL[k].name),
  880. (this.dataL[k].customerNumber = this.dataL[k].number)
  881. }
  882. console.log(this.dataL, '获取经销商列表')
  883. this.clistTotal = res.data.total
  884. })
  885. },
  886. // 更改每页数量
  887. handleSizeChanges(val) {
  888. this.pageSizes = val
  889. this.currentPage = 1
  890. this.getCrList()
  891. },
  892. // 更改当前页
  893. handleCurrentChanges(val) {
  894. this.currentPage = val
  895. this.getCrList()
  896. },
  897. handleBack() {
  898. this.isEdit = 1
  899. },
  900. // 检查文件类型
  901. checkFileType(url) {
  902. if (!url) return ''
  903. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  904. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  905. return 'image'
  906. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  907. return 'word'
  908. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  909. return 'excel'
  910. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  911. return 'ppt'
  912. } else if (['pdf'].includes(fileSuffix)) {
  913. return 'pdf'
  914. } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
  915. return 'file'
  916. } else {
  917. return ''
  918. }
  919. },
  920. openPdf(pdfUrl) {
  921. window.open(this.$imageUrl + pdfUrl)
  922. },
  923. // 更改每页数量
  924. handleSizeChange2(val) {
  925. this.dpageSize = val
  926. this.dcurrentPage = 1
  927. this.handletwoList()
  928. },
  929. // 更改当前页
  930. handleCurrentChange2(val) {
  931. this.dcurrentPage = val
  932. this.handletwoList()
  933. },
  934. getCommonApi(row) {
  935. this.isEdit = 2
  936. this.cid = row.id
  937. this.cpolicyId = row.policyId
  938. },
  939. getCond() {
  940. this.listLoading = true
  941. const custoParams = {
  942. pageNum: 1,
  943. pageSize: -1,
  944. policyId: this.detail.code
  945. }
  946. getCustomerList(custoParams).then(res => {
  947. this.custoList = res.data.records
  948. this.clistTotals = res.data.total
  949. this.listLoading = false
  950. this.getCrList()
  951. })
  952. },
  953. handleSubmit() {
  954. toExamine({
  955. examineStatus: this.examineStatus,
  956. policyId: this.id,
  957. examineRemark: this.remark
  958. }).then(res => {
  959. this.$successMsg('已提交审核')
  960. this.$emit('close')
  961. })
  962. },
  963. // 获取货品信息
  964. handletwoList() {
  965. // this.searchForm.type
  966. const paramss = {
  967. pageNum: this.dcurrentPage,
  968. pageSize: this.dpageSize,
  969. policyId: this.detail.code,
  970. saleTypeCode: ''
  971. }
  972. getMaterialList(paramss)
  973. .then(result => {
  974. this.dataList = result.data.records
  975. this.dlistTotal = result.data.total
  976. this.listLoading = false
  977. })
  978. .catch(err => {
  979. console.error(err)
  980. })
  981. },
  982. // 导入
  983. async handleImport(param) {
  984. this.importLoading = true
  985. const file = param.file
  986. console.log(file, 123)
  987. const formData = new FormData()
  988. formData.append('file', file)
  989. formData.append('policyId', this.detail.code)
  990. // formData.append("mainId", this.detail.mainId);
  991. const result = await handleImport('/policy/material/import', formData)
  992. this.importLoading = false
  993. this.importFileList = []
  994. if (result.code == 200) {
  995. this.$alert(result.message, '导入成功', {
  996. confirmButtonText: '确定'
  997. })
  998. this.handletwoList()
  999. } else {
  1000. this.$alert(result.message, '导入失败', {
  1001. confirmButtonText: '确定'
  1002. })
  1003. }
  1004. },
  1005. handleCondition(id, index) {
  1006. deleteCondition({ id }).then(res => {
  1007. // this.conditionList.splice(index, 1);
  1008. // Object.assign(
  1009. // this.$children[9].$data,
  1010. // this.$children[9].$options.data()
  1011. // );
  1012. this.getConditionList()
  1013. this.$successMsg('删除成功')
  1014. })
  1015. },
  1016. getConditionList() {
  1017. const condParams = {
  1018. policyId: this.detail.code
  1019. }
  1020. getConditionList(condParams).then(res => {
  1021. this.conditionList = res.data
  1022. })
  1023. },
  1024. // 删除
  1025. hanleDelete(id) {
  1026. const params = { policyMaterialId: id }
  1027. deleteMaterialPolicy(params).then(res => {
  1028. this.$successMsg('删除成功')
  1029. this.handletwoList()
  1030. })
  1031. },
  1032. /**
  1033. * 根据条件禁用行复选框
  1034. * 函数返回值为false则禁用选择(反之亦然)
  1035. * @param {Object} row - 行数据
  1036. * @param {String} index - 索引值
  1037. * @return Boolean
  1038. */
  1039. selectable: function(row, index) {
  1040. // row.disabled == undefined 才能被选中
  1041. if (row.disabled == undefined || row.disabled == false) {
  1042. return true
  1043. } else {
  1044. return false
  1045. }
  1046. // 函数必须有返回值且是布尔值
  1047. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1048. // 如果没有返回值则默认返回false(全部无法选中)
  1049. },
  1050. handleSelectionAllChange(e) {
  1051. this.leftData = e
  1052. this.type = 1
  1053. },
  1054. handleSelectionChange(e) {
  1055. this.leftData = e
  1056. this.type = 1
  1057. },
  1058. handleSelectionAllChange2(e) {
  1059. this.rightData = e
  1060. this.type = 2
  1061. },
  1062. handleSelectionChange2(e) {
  1063. this.rightData = e
  1064. this.type = 2
  1065. },
  1066. handleLeft(e) {
  1067. this.type = 1
  1068. },
  1069. handleRight(e) {
  1070. this.type = 2
  1071. },
  1072. handleAllAdd() {
  1073. if (this.type == 1 && this.leftData.length) {
  1074. for (let i = 0; i < this.dataL.length; i++) {
  1075. for (let j = 0; j < this.leftData.length; j++) {
  1076. if (this.dataL[i].id == this.leftData[j].id) {
  1077. this.dataL[i].disabled = true
  1078. }
  1079. }
  1080. }
  1081. this.custoList = [...this.custoList, ...this.leftData]
  1082. this.$refs.multipleTable.clearSelection()
  1083. } else {
  1084. this.$errorMsg('请选择要添加的经销商')
  1085. }
  1086. },
  1087. handleAllDelete() {
  1088. if (this.type == 2 && this.rightData.length) {
  1089. for (let i = 0; i < this.dataL.length; i++) {
  1090. for (let j = 0; j < this.rightData.length; j++) {
  1091. if (this.dataL[i].id == this.rightData[j].customerId) {
  1092. this.$set(this.dataL[i], 'disabled', false)
  1093. }
  1094. }
  1095. }
  1096. const arr = this.resArr(this.custoList, this.rightData)
  1097. this.custoList = arr
  1098. } else {
  1099. this.$errorMsg('请选择要删除的经销商')
  1100. }
  1101. },
  1102. handleAdd() {
  1103. if (this.type == 1 && this.leftData.length) {
  1104. for (let i = 0; i < this.dataL.length; i++) {
  1105. for (let j = 0; j < this.leftData.length; j++) {
  1106. if (this.dataL[i].id == this.leftData[j].id) {
  1107. this.dataL[i].disabled = true
  1108. }
  1109. }
  1110. }
  1111. this.custoList = [...this.custoList, ...this.leftData]
  1112. this.leftData = []
  1113. this.$refs.multipleTable.clearSelection()
  1114. } else {
  1115. this.$errorMsg('请选择要添加的经销商')
  1116. }
  1117. },
  1118. handleDelete() {
  1119. if (this.type == 2 && this.rightData.length) {
  1120. for (let i = 0; i < this.dataL.length; i++) {
  1121. for (let j = 0; j < this.rightData.length; j++) {
  1122. if (this.dataL[i].id == this.rightData[j].customerId) {
  1123. this.$set(this.dataL[i], 'disabled', false)
  1124. }
  1125. }
  1126. }
  1127. const arr = this.resArr(this.custoList, this.rightData)
  1128. this.custoList = arr
  1129. } else {
  1130. this.$errorMsg('请选择要删除的经销商')
  1131. }
  1132. },
  1133. // 去掉相同数据
  1134. resArr(arr1, arr2) {
  1135. return arr1.filter(v => arr2.every(val => val.id != v.id))
  1136. },
  1137. async handleSave() {
  1138. if (this.custoList.length) {
  1139. var arr = []
  1140. this.custoList.forEach(el => {
  1141. arr.push({
  1142. customerId: el.customerId,
  1143. customerName: el.customerName,
  1144. customerNumber: el.customerNumber,
  1145. lastOrderTime: '',
  1146. limitTakeNum: 0,
  1147. policyId: this.detail.code,
  1148. policyTitle: '',
  1149. remark: ''
  1150. })
  1151. })
  1152. const params = {
  1153. ...this.detail,
  1154. policyCustomers: arr,
  1155. imgSrc: this.fileList.length ? this.fileList[0].url : ''
  1156. }
  1157. await updatePolicy(params)
  1158. await this.getCond()
  1159. this.$successMsg('编辑成功')
  1160. this.fileList = []
  1161. this.isShow = 1
  1162. }
  1163. },
  1164. getPolicyLimitGroupList() {
  1165. this.policyLoading = true
  1166. getPolicyLimitGroupList({
  1167. pageNum: this.policyCurrentPages,
  1168. pageSize: this.policyPageSize,
  1169. policyId: this.id,
  1170. keyword: this.policyKeyWord
  1171. }).then(res => {
  1172. this.policyLimitGroupList = res.data.records
  1173. this.policyListTotal = res.data.total
  1174. this.policyLoading = false
  1175. })
  1176. },
  1177. handlePolicySizeChanges(val) {
  1178. this.policyCurrentPages = 1
  1179. this.policyPageSize = val
  1180. this.getPolicyLimitGroupList()
  1181. },
  1182. onPolicyReset() {
  1183. this.policyCurrentPages = 1
  1184. this.policyPageSize = 10
  1185. this.policyKeyWord = ''
  1186. this.getPolicyLimitGroupList()
  1187. },
  1188. handlePolicyCurrentChanges(val) {
  1189. this.policyCurrentPages = val
  1190. this.getPolicyLimitGroupList()
  1191. },
  1192. hanleDownloadFilesPolicyLimitGroupPolicy() {
  1193. downloadFiles('policy/limit/group/download')
  1194. },
  1195. async handleImportPolicyLimitGroupPolicy(param) {
  1196. this.importLoading = true
  1197. const file = param.file
  1198. const formData = new FormData()
  1199. formData.append('file', file)
  1200. formData.append('policyId', this.id)
  1201. // formData.append('type', this.policyType)
  1202. // formData.append("mainId", this.searchForm.mainId);
  1203. const result = await handleImport('policy/limit/group/import', formData)
  1204. this.importLoading = false
  1205. this.importFileList = []
  1206. if (result.code === 200) {
  1207. await this.$alert(result.message, '导入成功', {
  1208. confirmButtonText: '确定'
  1209. })
  1210. // this.policyLimitGroupList = result.data
  1211. this.getPolicyLimitGroupList()
  1212. } else {
  1213. await this.$alert(result.message, '导入失败', {
  1214. confirmButtonText: '确定'
  1215. })
  1216. }
  1217. }
  1218. }
  1219. }
  1220. </script>
  1221. <style lang="scss" scoped>
  1222. ::v-deep .elImageClose .el-image-viewer__wrapper span[class='el-image-viewer__btn el-image-viewer__close'] {
  1223. top: 100px;
  1224. }
  1225. .el-col {
  1226. overflow: hidden;
  1227. }
  1228. .value {
  1229. ::v-deep .el-input__prefix {
  1230. display: none;
  1231. }
  1232. }
  1233. .descriptions {
  1234. // border: #EBEEF5;
  1235. border: 1px solid #ebeef5;
  1236. border-bottom: none;
  1237. .el-row {
  1238. height: 40px;
  1239. line-height: 40px;
  1240. }
  1241. .el-col:nth-child(odd) {
  1242. background-color: #ebeef5;
  1243. }
  1244. .el-col {
  1245. padding: 0 15px;
  1246. height: 100%;
  1247. border-bottom: 1px solid #ebeef5;
  1248. }
  1249. }
  1250. .el-divider--horizontal {
  1251. margin: 20px 0;
  1252. }
  1253. .col {
  1254. height: 100px;
  1255. }
  1256. .import-btn {
  1257. margin-right: 10px;
  1258. display: inline-block;
  1259. }
  1260. ::v-deep .el-input__icon .el-icon-time {
  1261. display: none;
  1262. }
  1263. .middle_box {
  1264. margin-top: 80px;
  1265. text-align: center;
  1266. height: 430px;
  1267. display: flex;
  1268. flex-direction: column;
  1269. align-content: center;
  1270. justify-content: space-between;
  1271. align-items: center;
  1272. }
  1273. .img-box {
  1274. height: 150px;
  1275. display: flex;
  1276. align-items: center;
  1277. }
  1278. </style>