Examine.vue 45 KB

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