Examine.vue 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158
  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. <!-- 分页 -->
  445. <!-- <div style="margin: 20px 0">
  446. <el-pagination
  447. @size-change="handleSizeChanges"
  448. @current-change="handleCurrentChanges"
  449. :current-page="currentPages"
  450. :page-sizes="[10, 20, 30, 50]"
  451. :page-size="10"
  452. layout="total, sizes, prev, pager, next, jumper"
  453. :total="clistTotals"
  454. >
  455. </el-pagination>
  456. </div> -->
  457. </el-col>
  458. </el-row>
  459. </template>
  460. <div>
  461. <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
  462. <el-divider />
  463. </div>
  464. <div>
  465. <el-table
  466. v-if="detail.type == 'PROVISION'"
  467. v-loading="clistLoading"
  468. :data="list"
  469. element-loading-text="Loading"
  470. border
  471. fit
  472. highlight-current-row
  473. stripe
  474. @select-all="handleSelectionAllChange2"
  475. @selection-change="handleSelectionChange2"
  476. >
  477. <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
  478. <template slot-scope="scope">
  479. <CopyButton :copy-text="scope.row.customerName" />
  480. <span>{{ scope.row.customerName }}</span>
  481. </template>
  482. </el-table-column>
  483. <el-table-column prop="maxBuyNum" label="最大提货套数" align="left">
  484. <template slot-scope="scope">
  485. {{ scope.row.maxBuyNum }}
  486. </template>
  487. </el-table-column>
  488. <el-table-column prop="materialName" label="物料名称" align="left">
  489. <template slot-scope="scope">
  490. {{ scope.row.materialName }}
  491. </template>
  492. </el-table-column>
  493. <el-table-column prop="materialNumber" label="物料编号" align="left">
  494. <template slot-scope="scope">
  495. {{ scope.row.materialNumber }}
  496. </template>
  497. </el-table-column>
  498. <el-table-column prop="limitQty" label="订货上限" align="left">
  499. <template slot-scope="scope">
  500. {{ scope.row.limitQty }}
  501. </template>
  502. </el-table-column>
  503. <el-table-column prop="orderNums" label="已下订单数" align="left">
  504. <template slot-scope="scope">
  505. {{ scope.row.orderNums }}
  506. </template>
  507. </el-table-column>
  508. <el-table-column prop="examineOrderNums" label="已审订单数" align="left">
  509. <template slot-scope="scope">
  510. {{ scope.row.examineOrderNums }}
  511. </template>
  512. </el-table-column>
  513. </el-table>
  514. <el-table
  515. v-else
  516. v-loading="clistLoading"
  517. :data="list"
  518. element-loading-text="Loading"
  519. border
  520. fit
  521. highlight-current-row
  522. stripe
  523. @select-all="handleSelectionAllChange2"
  524. @selection-change="handleSelectionChange2"
  525. >
  526. <el-table-column type="index" label="序号" align="left" />
  527. <el-table-column prop="customerNumber" label="经销商编号" align="left" width="300">
  528. <template slot-scope="scope">
  529. <CopyButton :copy-text="scope.row.customerNumber" />
  530. <span>{{ scope.row.customerNumber }}</span>
  531. </template>
  532. </el-table-column>
  533. <el-table-column prop="customerName" label="经销商名称" align="left" width="300">
  534. <template slot-scope="scope">
  535. <CopyButton :copy-text="scope.row.customerName" />
  536. <span>{{ scope.row.customerName }}</span>
  537. </template>
  538. </el-table-column>
  539. <el-table-column prop="minBuyNum" label="最少起提数" align="left">
  540. <template slot-scope="scope">
  541. <span>{{ scope.row.minBuyNum }}</span>
  542. </template>
  543. </el-table-column>
  544. <el-table-column prop="maxBuyNum" label="最大提货组数" align="left">
  545. <template slot-scope="scope">
  546. <span>{{ scope.row.maxBuyNum }}</span>
  547. </template>
  548. </el-table-column>
  549. <el-table-column prop="orderNums" label="已下订单数" align="left">
  550. <template slot-scope="scope">
  551. <span>{{ scope.row.orderNums }}</span>
  552. </template>
  553. </el-table-column>
  554. <el-table-column prop="examineOrderNums" label="已审订单数" align="left">
  555. <template slot-scope="scope">
  556. <span>{{ scope.row.examineOrderNums }}</span>
  557. </template>
  558. </el-table-column>
  559. </el-table>
  560. <!-- 分页 -->
  561. <div style="margin: 20px 0">
  562. <el-pagination
  563. :current-page="policyList.currentPages"
  564. :page-sizes="[10, 20, 30, 50]"
  565. :page-size="10"
  566. layout="total, sizes, prev, pager, next, jumper"
  567. :total="cTotal"
  568. @size-change="handleSizeChanges4"
  569. @current-change="handleCurrentChanges4"
  570. />
  571. </div>
  572. </div>
  573. <div v-if="isShow == 5 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
  574. <el-row>
  575. <el-col :span="6">审核人</el-col>
  576. <el-col :span="6">{{ $store.getters.name }}</el-col>
  577. <el-col :span="6">审核结果</el-col>
  578. <el-col :span="6">
  579. <template>
  580. <el-radio-group v-model="examineStatus">
  581. <el-radio :label="'OK'">通过</el-radio>
  582. <el-radio :label="'FAIL'">驳回</el-radio>
  583. </el-radio-group>
  584. </template>
  585. </el-col>
  586. </el-row>
  587. <el-row class="item">
  588. <el-col :span="4">审批说明</el-col>
  589. <el-col :span="20" class="col value" style="padding-left: 10px">
  590. <el-input v-model="remark" size="small" placeholder="请输入内容" />
  591. </el-col>
  592. </el-row>
  593. <el-row>
  594. <el-button type="primary" size="small" @click="handleSubmit">审核</el-button>
  595. </el-row>
  596. </div>
  597. </div>
  598. </div>
  599. </div>
  600. <AddCondition v-else :id="cid" :is-edit="isEdit" @close="handleConditionClose" @back="handleBack" />
  601. </div>
  602. </template>
  603. <script>
  604. import {
  605. deleteCondition,
  606. deleteMaterialPolicy,
  607. getConditionList,
  608. getCrList,
  609. getCustomerList,
  610. getMaterialList,
  611. getPolicyDetail,
  612. toExamine,
  613. updatePolicy,
  614. getPolicyList
  615. } from '@/api/policy_list'
  616. import AddCondition from './AddCondition'
  617. import ImageUpload from '@/components/Common/image-upload.vue'
  618. import { handleImport } from '@/utils/util'
  619. import Minxin from '@/mixin'
  620. export default {
  621. name: 'Examine',
  622. components: {
  623. AddCondition,
  624. ImageUpload
  625. },
  626. mixins: [Minxin],
  627. props: {
  628. id: {
  629. type: String,
  630. default: ''
  631. },
  632. isShow: {
  633. type: Number
  634. }
  635. },
  636. data() {
  637. return {
  638. baseURL: '',
  639. dcurrentPage: 1,
  640. dpageSize: 10,
  641. dlistTotal: 0,
  642. currentPages: 1, // 当前页码
  643. pageSizes: 10, // 每页数量
  644. clistTotal: 0,
  645. input: '',
  646. remark: '',
  647. fileList: [],
  648. listLoading: false,
  649. imageUrl: '',
  650. dataList: [],
  651. examineStatus: 'OK',
  652. options: {},
  653. value: '',
  654. detail: {},
  655. srcList: [],
  656. screenForm: {
  657. code: '',
  658. createBy: '',
  659. endCreateTime: '',
  660. endTime1: '',
  661. endTime2: '',
  662. examineBy: '',
  663. remark: '',
  664. startCreateTime: '',
  665. startTime1: '',
  666. startTime2: '',
  667. status: '',
  668. title: '',
  669. type: ''
  670. },
  671. conditionList: [],
  672. custoList: [],
  673. isEdit: 1,
  674. cid: '',
  675. cpolicyId: '',
  676. dataL: [],
  677. clistTotal: 0,
  678. clistTotals: 0,
  679. type: 1,
  680. fileList: [],
  681. importFileList: [],
  682. leftData: [],
  683. rightData: [],
  684. typeOptions: [
  685. {
  686. value: 'PROVISION',
  687. label: '配提'
  688. },
  689. {
  690. value: 'LIMIT',
  691. label: '限量'
  692. }
  693. ],
  694. detailFang: false,
  695. policyList: {
  696. pageNum: 1,
  697. pageSize: 10,
  698. policyId: '',
  699. keyword: '',
  700. currentPages: 1
  701. },
  702. list: [],
  703. cTotal: 1,
  704. clistLoading: false
  705. }
  706. },
  707. computed: {
  708. comTitle() {
  709. let title = '详情页'
  710. if (this.isShow == 5) {
  711. title = '编辑页'
  712. } else if (this.isShow == 8 && !this.detailFang) {
  713. title = '审核页'
  714. } else {
  715. title = '详情页'
  716. }
  717. return title
  718. }
  719. },
  720. created() {},
  721. methods: {
  722. handleConditionClose() {
  723. this.isEdit = 1
  724. },
  725. getList() {
  726. this.listLoading = true
  727. getPolicyDetail({ policyId: this.id }).then(res => {
  728. this.detail = res.data
  729. this.detail.imgSrc = this.detail.imgSrc.split(',')
  730. this.detail.imgSrc.forEach(k => {
  731. this.srcList.push(this.$imageUrl + k)
  732. })
  733. if (this.isShow == 5 && this.detail.imgSrc) {
  734. this.fileList = [
  735. {
  736. hover: '',
  737. url: this.detail.imgSrc
  738. }
  739. ]
  740. }
  741. this.handletwoList()
  742. // 获取条件政策
  743. this.getConditionList()
  744. this.getCond()
  745. this.getPolicyList()
  746. })
  747. },
  748. getPolicyList() {
  749. this.clistLoading = true
  750. getPolicyList({
  751. pageNum: this.policyList.currentPages,
  752. pageSize: this.policyList.pageSize,
  753. policyId: this.id,
  754. keyword: this.policyList.keyword
  755. }).then(res => {
  756. this.list = res.data.records
  757. this.cTotal = res.data.total
  758. this.clistLoading = false
  759. })
  760. },
  761. // 更改每页数量
  762. handleSizeChanges4(val) {
  763. this.policyList.pageSizes = val
  764. this.policyList.currentPages = 1
  765. this.getPolicyList()
  766. },
  767. // 更改当前页
  768. handleCurrentChanges4(val) {
  769. this.policyList.currentPages = val
  770. this.getPolicyList()
  771. },
  772. getCrList() {
  773. const customerParams = {
  774. pageNum: this.currentPage,
  775. pageSize: this.pageSize,
  776. keyword: this.region == 1 || this.region == '' ? '' : this.keyword,
  777. region: this.region == 1 ? this.keyword : ''
  778. }
  779. // 获取经销商列表
  780. getCrList(customerParams).then(res => {
  781. for (let j = 0; j < this.custoList.length; j++) {
  782. for (let i = 0; i < res.data.records.length; i++) {
  783. if (res.data.records[i].id == this.custoList[j].customerId) {
  784. res.data.records[i].disabled = true
  785. }
  786. }
  787. }
  788. this.dataL = res.data.records
  789. for (let k = 0; k < this.dataL.length; k++) {
  790. (this.dataL[k].customerId = this.dataL[k].id),
  791. (this.dataL[k].customerName = this.dataL[k].name),
  792. (this.dataL[k].customerNumber = this.dataL[k].number)
  793. }
  794. console.log(this.dataL, '获取经销商列表')
  795. this.clistTotal = res.data.total
  796. })
  797. },
  798. // 更改每页数量
  799. handleSizeChanges(val) {
  800. this.pageSizes = val
  801. this.currentPages = 1
  802. this.getCond()
  803. },
  804. handleBack() {
  805. this.isEdit = 1
  806. },
  807. // 检查文件类型
  808. checkFileType(url) {
  809. if (!url) return ''
  810. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  811. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  812. return 'image'
  813. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  814. return 'word'
  815. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  816. return 'excel'
  817. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  818. return 'ppt'
  819. } else if (['pdf'].includes(fileSuffix)) {
  820. return 'pdf'
  821. } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
  822. return 'file'
  823. } else {
  824. return ''
  825. }
  826. },
  827. openPdf(pdfUrl) {
  828. window.open(this.$imageUrl + pdfUrl)
  829. },
  830. // 更改当前页
  831. handleCurrentChanges(val) {
  832. this.currentPages = val
  833. this.getCond()
  834. },
  835. // 更改每页数量
  836. handleSizeChange2(val) {
  837. this.dpageSize = val
  838. this.dcurrentPage = 1
  839. this.handletwoList()
  840. },
  841. // 更改当前页
  842. handleCurrentChange2(val) {
  843. this.dcurrentPage = val
  844. this.handletwoList()
  845. },
  846. getCommonApi(row) {
  847. this.isEdit = 2
  848. this.cid = row.id
  849. this.cpolicyId = row.policyId
  850. },
  851. getCond() {
  852. this.listLoading = true
  853. const custoParams = {
  854. pageNum: this.currentPages,
  855. pageSize: this.pageSizes,
  856. policyId: this.detail.code
  857. }
  858. getCustomerList(custoParams).then(res => {
  859. this.custoList = res.data.records
  860. this.clistTotals = res.data.total
  861. this.listLoading = false
  862. this.getCrList()
  863. })
  864. },
  865. handleSubmit() {
  866. toExamine({
  867. examineStatus: this.examineStatus,
  868. policyId: this.id,
  869. examineRemark: this.remark
  870. }).then(res => {
  871. this.$successMsg('已提交审核')
  872. this.$emit('close')
  873. })
  874. },
  875. // 获取货品信息
  876. handletwoList() {
  877. // this.searchForm.type
  878. const paramss = {
  879. pageNum: this.dcurrentPage,
  880. pageSize: this.dpageSize,
  881. policyId: this.detail.code,
  882. saleTypeCode: ''
  883. }
  884. getMaterialList(paramss)
  885. .then(result => {
  886. this.dataList = result.data.records
  887. this.dlistTotal = result.data.total
  888. this.listLoading = false
  889. })
  890. .catch(err => {
  891. console.error(err)
  892. })
  893. },
  894. // 导入
  895. async handleImport(param) {
  896. this.importLoading = true
  897. const file = param.file
  898. console.log(file, 123)
  899. const formData = new FormData()
  900. formData.append('file', file)
  901. formData.append('policyId', this.detail.code)
  902. // formData.append("mainId", this.detail.mainId);
  903. const result = await handleImport('/policy/material/import', formData)
  904. this.importLoading = false
  905. this.importFileList = []
  906. if (result.code == 200) {
  907. this.$alert(result.message, '导入成功', {
  908. confirmButtonText: '确定'
  909. })
  910. this.handletwoList()
  911. } else {
  912. this.$alert(result.message, '导入失败', {
  913. confirmButtonText: '确定'
  914. })
  915. }
  916. },
  917. handleCondition(id, index) {
  918. deleteCondition({ id }).then(res => {
  919. // this.conditionList.splice(index, 1);
  920. // Object.assign(
  921. // this.$children[9].$data,
  922. // this.$children[9].$options.data()
  923. // );
  924. this.getConditionList()
  925. this.$successMsg('删除成功')
  926. })
  927. },
  928. getConditionList() {
  929. const condParams = {
  930. policyId: this.detail.code
  931. }
  932. getConditionList(condParams).then(res => {
  933. this.conditionList = res.data
  934. })
  935. },
  936. // 删除
  937. hanleDelete(id) {
  938. const params = { policyMaterialId: id }
  939. deleteMaterialPolicy(params).then(res => {
  940. this.$successMsg('删除成功')
  941. this.handletwoList()
  942. })
  943. },
  944. /**
  945. * 根据条件禁用行复选框
  946. * 函数返回值为false则禁用选择(反之亦然)
  947. * @param {Object} row - 行数据
  948. * @param {String} index - 索引值
  949. * @return Boolean
  950. */
  951. selectable: function(row, index) {
  952. // row.disabled == undefined 才能被选中
  953. if (row.disabled == undefined || row.disabled == false) {
  954. return true
  955. } else {
  956. return false
  957. }
  958. // 函数必须有返回值且是布尔值
  959. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  960. // 如果没有返回值则默认返回false(全部无法选中)
  961. },
  962. handleSelectionAllChange(e) {
  963. this.leftData = e
  964. this.type = 1
  965. },
  966. handleSelectionChange(e) {
  967. this.leftData = e
  968. this.type = 1
  969. },
  970. handleSelectionAllChange2(e) {
  971. this.rightData = e
  972. this.type = 2
  973. },
  974. handleSelectionChange2(e) {
  975. this.rightData = e
  976. this.type = 2
  977. },
  978. handleLeft(e) {
  979. this.type = 1
  980. },
  981. handleRight(e) {
  982. this.type = 2
  983. },
  984. handleAllAdd() {
  985. if (this.type == 1 && this.leftData.length) {
  986. for (let i = 0; i < this.dataL.length; i++) {
  987. for (let j = 0; j < this.leftData.length; j++) {
  988. if (this.dataL[i].id == this.leftData[j].id) {
  989. this.dataL[i].disabled = true
  990. }
  991. }
  992. }
  993. this.custoList = [...this.custoList, ...this.leftData]
  994. this.$refs.multipleTable.clearSelection()
  995. } else {
  996. this.$errorMsg('请选择要添加的经销商')
  997. }
  998. },
  999. handleAllDelete() {
  1000. if (this.type == 2 && this.rightData.length) {
  1001. for (let i = 0; i < this.dataL.length; i++) {
  1002. for (let j = 0; j < this.rightData.length; j++) {
  1003. if (this.dataL[i].id == this.rightData[j].customerId) {
  1004. this.$set(this.dataL[i], 'disabled', false)
  1005. }
  1006. }
  1007. }
  1008. const arr = this.resArr(this.custoList, this.rightData)
  1009. this.custoList = arr
  1010. } else {
  1011. this.$errorMsg('请选择要删除的经销商')
  1012. }
  1013. },
  1014. handleAdd() {
  1015. if (this.type == 1 && this.leftData.length) {
  1016. for (let i = 0; i < this.dataL.length; i++) {
  1017. for (let j = 0; j < this.leftData.length; j++) {
  1018. if (this.dataL[i].id == this.leftData[j].id) {
  1019. this.dataL[i].disabled = true
  1020. }
  1021. }
  1022. }
  1023. this.custoList = [...this.custoList, ...this.leftData]
  1024. this.leftData = []
  1025. this.$refs.multipleTable.clearSelection()
  1026. } else {
  1027. this.$errorMsg('请选择要添加的经销商')
  1028. }
  1029. },
  1030. handleDelete() {
  1031. if (this.type == 2 && this.rightData.length) {
  1032. for (let i = 0; i < this.dataL.length; i++) {
  1033. for (let j = 0; j < this.rightData.length; j++) {
  1034. if (this.dataL[i].id == this.rightData[j].customerId) {
  1035. this.$set(this.dataL[i], 'disabled', false)
  1036. }
  1037. }
  1038. }
  1039. const arr = this.resArr(this.custoList, this.rightData)
  1040. this.custoList = arr
  1041. } else {
  1042. this.$errorMsg('请选择要删除的经销商')
  1043. }
  1044. },
  1045. // 去掉相同数据
  1046. resArr(arr1, arr2) {
  1047. return arr1.filter(v => arr2.every(val => val.id != v.id))
  1048. },
  1049. async handleSave() {
  1050. if (this.custoList.length) {
  1051. var arr = []
  1052. this.custoList.forEach(el => {
  1053. arr.push({
  1054. customerId: el.customerId,
  1055. customerName: el.customerName,
  1056. customerNumber: el.customerNumber,
  1057. lastOrderTime: '',
  1058. limitTakeNum: 0,
  1059. policyId: this.detail.code,
  1060. policyTitle: '',
  1061. remark: ''
  1062. })
  1063. })
  1064. const params = {
  1065. ...this.detail,
  1066. policyCustomers: arr,
  1067. imgSrc: this.fileList.length ? this.fileList[0].url : ''
  1068. }
  1069. await updatePolicy(params)
  1070. await this.getCond()
  1071. this.$successMsg('编辑成功')
  1072. this.fileList = []
  1073. this.isShow = 1
  1074. }
  1075. }
  1076. }
  1077. }
  1078. </script>
  1079. <style lang="scss" scoped>
  1080. ::v-deep .elImageClose .el-image-viewer__wrapper span[class='el-image-viewer__btn el-image-viewer__close'] {
  1081. top: 100px;
  1082. }
  1083. .el-col {
  1084. overflow: hidden;
  1085. }
  1086. .value {
  1087. ::v-deep .el-input__prefix {
  1088. display: none;
  1089. }
  1090. }
  1091. .descriptions {
  1092. // border: #EBEEF5;
  1093. border: 1px solid #ebeef5;
  1094. border-bottom: none;
  1095. .el-row {
  1096. height: 40px;
  1097. line-height: 40px;
  1098. }
  1099. .el-col:nth-child(odd) {
  1100. background-color: #ebeef5;
  1101. }
  1102. .el-col {
  1103. padding: 0 15px;
  1104. height: 100%;
  1105. border-bottom: 1px solid #ebeef5;
  1106. }
  1107. }
  1108. .el-divider--horizontal {
  1109. margin: 20px 0;
  1110. }
  1111. .col {
  1112. height: 100px;
  1113. }
  1114. .import-btn {
  1115. margin-right: 10px;
  1116. display: inline-block;
  1117. }
  1118. ::v-deep .el-input__icon .el-icon-time {
  1119. display: none;
  1120. }
  1121. .middle_box {
  1122. margin-top: 80px;
  1123. text-align: center;
  1124. height: 430px;
  1125. display: flex;
  1126. flex-direction: column;
  1127. align-content: center;
  1128. justify-content: space-between;
  1129. align-items: center;
  1130. }
  1131. .img-box {
  1132. height: 150px;
  1133. display: flex;
  1134. align-items: center;
  1135. }
  1136. </style>