details.vue 39 KB

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