details.vue 43 KB

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