details.vue 41 KB

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