details.vue 43 KB

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