Examine.vue 39 KB

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