details.vue 39 KB

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