details.vue 39 KB

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