Examine.vue 40 KB

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