Examine.vue 39 KB

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