details.vue 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746
  1. <template>
  2. <div class="">
  3. <div v-if="isEdit == 1">
  4. <div>
  5. <div class="diy-table-1">
  6. <el-row>
  7. <el-col :span="8" class="item">
  8. <div class="label">销售政策编号</div>
  9. <div class="value">{{ detail.code }}</div>
  10. </el-col>
  11. <el-col :span="8" class="item">
  12. <div class="label">销售政策类型</div>
  13. <div class="value">
  14. {{ detail.type == 'PROVISION' ? '配提' : '限量' }}
  15. </div>
  16. </el-col>
  17. <el-col :span="8" class="item">
  18. <div class="label">状态</div>
  19. <div class="value">
  20. {{ detail.status == 1 ? '已生效' : '未生效' }}
  21. </div>
  22. </el-col>
  23. <el-col :span="24" class="item">
  24. <div class="label">销售政策名称</div>
  25. <div class="value">
  26. <el-input v-model="detail.title" disabled placeholder="请输入销售政策名称" />
  27. </div>
  28. </el-col>
  29. <el-col :span="24" class="item">
  30. <div class="label">表头备注</div>
  31. <div class="value">
  32. {{ detail.remark }}
  33. </div>
  34. </el-col>
  35. <el-col v-if="(detail.examineStatus = 'SAVE' && detail.examineTime != null)" :span="24" class="item">
  36. <div class="label">驳回原因</div>
  37. <div class="value">
  38. {{ detail.examineRemark }}
  39. </div>
  40. </el-col>
  41. <el-col :span="8" class="item">
  42. <div class="label">制单人</div>
  43. <div class="value">{{ detail.createBy }}</div>
  44. </el-col>
  45. <el-col :span="8" class="item">
  46. <div class="label">制单日期</div>
  47. <div class="value">
  48. {{ detail.createTime }}
  49. </div>
  50. </el-col>
  51. <el-col :span="8" class="item">
  52. <div class="label">生效日期</div>
  53. <div class="value">
  54. {{ detail.startTime }}
  55. </div>
  56. </el-col>
  57. <el-col :span="24" class="item">
  58. <div class="label">失效日期</div>
  59. <div class="value">
  60. {{ detail.endTime }}
  61. </div>
  62. </el-col>
  63. <template v-if="detail.type === 'LIMIT'">
  64. <el-col :span="12" class="item">
  65. <div class="label">商家最少起提数量</div>
  66. <div class="value">
  67. {{ detail.minBuyNum }}
  68. </div>
  69. </el-col>
  70. <el-col :span="12" class="item">
  71. <div class="label">商家最大提货组数</div>
  72. <div class="value">
  73. {{ detail.maxBuyNum }}
  74. </div>
  75. </el-col>
  76. </template>
  77. </el-row>
  78. <el-row v-if="detail.imgSrc && isShow !== 5" class="img-box">
  79. <el-col :span="24" class="item">
  80. <div class="label" style="height: 150px">政策封面图</div>
  81. <div class="value" style="height: 150px">
  82. <template v-for="item in detail.imgSrc">
  83. <el-image
  84. v-if="checkFileType(item) == 'image'"
  85. ref="img"
  86. :src="$imageUrl + item"
  87. style="width: 120px; height: 120px; margin-right: 20px"
  88. fit="cover"
  89. :preview-src-list="[$imageUrl + item]"
  90. class="elImageClose"
  91. />
  92. <img v-if="checkFileType(item) == 'word'" class="file" src="@/assets/common/word.png">
  93. <img v-if="checkFileType(item) == 'excel'" class="file" src="@/assets/common/excel.png">
  94. <img v-if="checkFileType(item) == 'ppt'" class="file" src="@/assets/common/ppt.png">
  95. <img
  96. v-if="checkFileType(item) == 'pdf'"
  97. class="file"
  98. style="cursor: pointer"
  99. src="@/assets/common/pdf.png"
  100. @click="openPdf(item)"
  101. >
  102. <img v-if="checkFileType(item) == 'file'" class="file aaa" src="@/assets/common/zip.jpeg">
  103. </template>
  104. <!-- <el-image
  105. v-for="item in detail.imgSrc"
  106. style="height: 120px; widht: 120px;margin-left: 20px"
  107. :src="$imageUrl + item"
  108. fit="fill"
  109. :preview-src-list="srcList"
  110. /> -->
  111. </div>
  112. </el-col>
  113. </el-row>
  114. <el-row v-if="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. <image-upload :file-list="fileList" :multiple="false" />
  119. </div>
  120. </el-col>
  121. </el-row>
  122. <el-row v-if="this.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="12" class="item">
  132. <div class="label">返利使用金额需满额使用</div>
  133. <div class="value">
  134. <el-checkbox v-model="detail.isFullRebate" disabled>{{
  135. detail.isFullRebate ? '是' : '否'
  136. }}</el-checkbox>
  137. </div>
  138. </el-col>
  139. <el-col :span="12" class="item">
  140. <div class="label">商用空调政策</div>
  141. <div class="value">
  142. <el-checkbox v-model="detail.commercialType" disabled>{{
  143. detail.commercialType ? '是' : '否'
  144. }}</el-checkbox>
  145. </div>
  146. </el-col>
  147. <!-- <el-col :span="8" class="item">-->
  148. <!-- <div class="label">关闭人</div>-->
  149. <!-- <div class="value"></div>-->
  150. <!-- </el-col>-->
  151. <!-- <el-col :span="24" class="item">-->
  152. <!-- <div class="label">关闭日期</div>-->
  153. <!-- <div class="value"></div>-->
  154. <!-- </el-col>-->
  155. </el-row>
  156. </div>
  157. <div class="mymain-container">
  158. <el-row>
  159. <el-divider />
  160. <el-row type="flex">
  161. <el-col :span="12">
  162. <h4 style="display: inline-block; margin-right: 20px">货品信息</h4>
  163. <ExportButton
  164. v-if="isShow === 4"
  165. style="display: inline-block"
  166. :ex-url="'policy/material/export'"
  167. ex-text="导出货品"
  168. :ex-params="{ policyId: detail.code }"
  169. />
  170. <el-upload
  171. v-if="isShow == 5"
  172. class="import-btn"
  173. :action="baseURL + 'student/import'"
  174. :http-request="handleImport"
  175. :file-list="importFileList"
  176. :show-file-list="false"
  177. >
  178. <el-button size="mini">导入货品价格表</el-button>
  179. </el-upload>
  180. </el-col>
  181. <el-col :span="12" class="tr" />
  182. </el-row>
  183. <el-divider />
  184. </el-row>
  185. <div class="table">
  186. <el-table
  187. v-loading="listLoading"
  188. :data="dataList"
  189. element-loading-text="Loading"
  190. border
  191. max-height="700"
  192. fit
  193. highlight-current-row
  194. stripe
  195. >
  196. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  197. <el-table-column
  198. prop="materialNumber"
  199. label="物料编码"
  200. min-width="160"
  201. show-overflow-tooltip
  202. align="left"
  203. >
  204. <template slot-scope="scope">
  205. <CopyButton :copy-text="scope.row.materialNumber" />
  206. <span>{{ scope.row.materialNumber }}</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column prop="materialName" label="产品名称" min-width="160" show-overflow-tooltip align="left">
  210. <template slot-scope="scope">
  211. <CopyButton :copy-text="scope.row.materialName" />
  212. <span>{{ scope.row.materialName }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column prop="specification" label="规格型号" min-width="300" show-overflow-tooltip align="left">
  216. <template slot-scope="scope">
  217. <CopyButton :copy-text="scope.row.specification" />
  218. <span>{{ scope.row.specification }}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column
  222. prop="saleTypeCode"
  223. label="销售类型编码"
  224. min-width="160"
  225. show-overflow-tooltip
  226. align="left"
  227. />
  228. <el-table-column
  229. prop="saleTypeName"
  230. label="销售类型"
  231. min-width="160"
  232. show-overflow-tooltip
  233. align="left"
  234. />
  235. <el-table-column prop="discAmount" label="格力折扣" align="right" />
  236. <el-table-column prop="price" label="单价" align="right" />
  237. <el-table-column prop="orgPrice" label="原供价" align="right" min-width="150">
  238. <template slot-scope="scope">
  239. {{ scope.row.orgPrice }}
  240. </template>
  241. </el-table-column>
  242. <el-table-column prop="priceType" label="价格类型" align="left" min-width="150">
  243. <template slot-scope="scope">
  244. {{ scope.row.priceType }}
  245. </template>
  246. </el-table-column>
  247. <el-table-column label="返利钱包" align="left" min-width="200" show-overflow-tooltip>
  248. <template slot-scope="scope">
  249. <template v-for="item in scope.row.walletRelaList">
  250. <el-tag v-if="item.type === 'REBATE'" style="margin: 5px" type="success" size="mini">{{
  251. item.walletName
  252. }}</el-tag>
  253. </template>
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="现金钱包" align="left" min-width="200" show-overflow-tooltip>
  257. <template slot-scope="scope">
  258. <template v-for="item in scope.row.walletRelaList">
  259. <el-tag v-if="item.type === 'COMMONLY'" style="margin: 5px" type="success" size="mini">{{
  260. item.walletName
  261. }}</el-tag>
  262. </template>
  263. </template>
  264. </el-table-column>
  265. <el-table-column prop="status" label="状态" align="left" show-overflow-tooltip min-width="150">
  266. <template slot-scope="scope">
  267. {{ scope.row.status ? '启用' : '作废' }}
  268. </template>
  269. </el-table-column>
  270. </el-table>
  271. </div>
  272. <!-- 分页 -->
  273. <div style="margin: 20px 0">
  274. <el-pagination
  275. :current-page="dcurrentPage"
  276. :page-sizes="[10, 20, 30, 50]"
  277. :page-size="10"
  278. layout="total, sizes, prev, pager, next, jumper"
  279. :total="dlistTotal"
  280. @size-change="handleSizeChange2"
  281. @current-change="handleCurrentChange2"
  282. />
  283. </div>
  284. <el-row>
  285. <el-divider />
  286. <el-row type="flex">
  287. <el-col :span="12">
  288. <h4 style="display: inline-block; margin-right: 20px">条件信息</h4>
  289. </el-col>
  290. </el-row>
  291. <el-divider />
  292. </el-row>
  293. <div class="table">
  294. <el-table :data="conditionList" element-loading-text="Loading" border fit highlight-current-row stripe>
  295. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  296. <el-table-column prop="name" label="限定条件" align="left">
  297. <template slot-scope="scope">
  298. {{ scope.row.name }}
  299. </template>
  300. </el-table-column>
  301. <el-table-column label="操作" align="left" width="150">
  302. <template slot-scope="scope">
  303. <template v-if="isShow == 5">
  304. <el-button type="text" size="mini" @click="getCommonApi(scope.row)">编辑</el-button>
  305. <el-popconfirm
  306. confirm-button-text="好的"
  307. cancel-button-text="不用了"
  308. icon="el-icon-info"
  309. icon-color="red"
  310. title="内容确定删除吗?"
  311. @onConfirm="handleCondition(scope.row.id, scope.$index)"
  312. >
  313. <el-button slot="reference" type="text" class="textColor el-popover-left">删除</el-button>
  314. </el-popconfirm>
  315. </template>
  316. <el-button v-else type="text" size="mini" @click="getCommonApi(scope.row)">查看条件</el-button>
  317. </template>
  318. </el-table-column>
  319. </el-table>
  320. </div>
  321. <el-row>
  322. <el-divider />
  323. <el-row type="flex">
  324. <el-col :span="12">
  325. <h4 style="display: inline-block; margin-right: 20px">经销商使用范围</h4>
  326. <template v-if="detail.flag == 0">
  327. <ExportButton
  328. v-if="isShow === 4"
  329. style="display: inline-block"
  330. :ex-url="'policy/customer/export'"
  331. ex-text="导出经销商"
  332. :ex-params="{ policyId: detail.code }"
  333. />
  334. </template>
  335. </el-col>
  336. </el-row>
  337. <el-divider />
  338. <el-radio-group v-model="detail.flag">
  339. <el-radio label="0" :disabled="detail.flag != 0">指定经销商</el-radio>
  340. <el-radio label="1" :disabled="detail.flag != 1">广州经销商</el-radio>
  341. <el-radio label="2" :disabled="detail.flag != 2">佛山经销商</el-radio>
  342. </el-radio-group>
  343. </el-row>
  344. <div class="table">
  345. <template v-if="isShow != 5">
  346. <template v-if="detail.flag == 0">
  347. <el-table
  348. v-loading="listLoading"
  349. :data="custoList"
  350. element-loading-text="Loading"
  351. border
  352. fit
  353. highlight-current-row
  354. stripe
  355. >
  356. <el-table-column fixed type="index" label="序号" width="50" align="left" />
  357. <el-table-column prop="customerNumber" label="经销商编码" align="left">
  358. <template slot-scope="scope">
  359. <CopyButton :copy-text="scope.row.customerNumber" />
  360. <span>{{ scope.row.customerNumber }}</span>
  361. </template></el-table-column>
  362. <el-table-column prop="customerName" label="经销商名称" align="left">
  363. <template slot-scope="scope">
  364. <CopyButton :copy-text="scope.row.customerName" />
  365. <span>{{ scope.row.customerName }}</span>
  366. </template>
  367. </el-table-column>
  368. </el-table>
  369. <!-- 分页 -->
  370. <div style="margin: 20px 0">
  371. <el-pagination
  372. :current-page="currentPages"
  373. :page-sizes="[10, 20, 30, 50]"
  374. :page-size="10"
  375. layout="total, sizes, prev, pager, next, jumper"
  376. :total="clistTotals"
  377. @size-change="handleSizeChanges"
  378. @current-change="handleCurrentChanges"
  379. />
  380. </div>
  381. </template>
  382. </template>
  383. <template v-else>
  384. <el-row :gutter="20">
  385. <el-col :span="10" :offset="0">
  386. <h5>未选经销商</h5>
  387. <el-divider direction="horizontal" content-position="left" />
  388. <el-table
  389. ref="multipleTable"
  390. :data="dataL"
  391. element-loading-text="Loading"
  392. border
  393. height="480px"
  394. fit
  395. highlight-current-row
  396. @select-all="handleSelectionAllChange"
  397. @selection-change="handleSelectionChange"
  398. >
  399. <el-table-column type="selection" width="55" :selectable="selectable" align="left" />
  400. <el-table-column prop="number" label="经销商编码" align="left">
  401. <template slot-scope="scope">
  402. <CopyButton :copy-text="scope.row.number" />
  403. <span>{{ scope.row.number }}</span>
  404. </template>
  405. </el-table-column>
  406. <el-table-column prop="name" label="经销商名称" align="left">
  407. <template slot-scope="scope">
  408. <CopyButton :copy-text="scope.row.name" />
  409. <span>{{ scope.row.name }}</span>
  410. </template>
  411. </el-table-column>
  412. </el-table>
  413. <!-- 分页 -->
  414. <div style="margin: 20px 0">
  415. <el-pagination
  416. :current-page="currentPages"
  417. :page-sizes="[10, 20, 30, 50]"
  418. :page-size="10"
  419. layout="total, sizes, prev, pager, next, jumper"
  420. :total="clistTotal"
  421. @size-change="handleSizeChanges"
  422. @current-change="handleCurrentChanges"
  423. />
  424. </div>
  425. </el-col>
  426. <el-col :span="4" class="middle_box" :offset="0">
  427. <el-col>
  428. <el-button size="mini" :disabled="type == 2" @click="handleAllAdd">全部添加</el-button></el-col>
  429. <el-col> <el-button size="mini" :disabled="type == 2" @click="handleAdd">增加</el-button></el-col>
  430. <el-col> <el-button size="mini" :disabled="type == 1" @click="handleDelete">删除</el-button></el-col>
  431. <el-col>
  432. <el-button size="mini" :disabled="type == 1" @click="handleAllDelete">全部删除</el-button></el-col>
  433. </el-col>
  434. <el-col :span="10" :offset="0">
  435. <h5>已选经销商</h5>
  436. <el-divider direction="horizontal" content-position="left" />
  437. <el-table
  438. v-loading="listLoading"
  439. :data="custoList"
  440. element-loading-text="Loading"
  441. border
  442. height="480px"
  443. fit
  444. highlight-current-row
  445. stripe
  446. @select-all="handleSelectionAllChange2"
  447. @selection-change="handleSelectionChange2"
  448. >
  449. <el-table-column type="selection" width="55" align="left" />
  450. <el-table-column prop="customerNumber" label="经销商编码" align="left">
  451. <template slot-scope="scope">
  452. <CopyButton :copy-text="scope.row.customerNumber" />
  453. <span>{{ scope.row.customerNumber }}</span>
  454. </template>
  455. </el-table-column>
  456. <el-table-column prop="customerName" label="经销商名称" align="left">
  457. <template slot-scope="scope">
  458. <CopyButton :copy-text="scope.row.customerName" />
  459. <span>{{ scope.row.customerName }}</span>
  460. </template>
  461. </el-table-column>
  462. </el-table>
  463. <!-- 分页 -->
  464. <!-- <div style="margin: 20px 0">
  465. <el-pagination
  466. @size-change="handleSizeChanges"
  467. @current-change="handleCurrentChanges"
  468. :current-page="currentPages"
  469. :page-sizes="[10, 20, 30, 50]"
  470. :page-size="10"
  471. layout="total, sizes, prev, pager, next, jumper"
  472. :total="clistTotals"
  473. >
  474. </el-pagination>
  475. </div> -->
  476. </el-col>
  477. </el-row>
  478. </template>
  479. <template>
  480. <div style="dispaly: flex">
  481. <h4 style="display: inline-block; margin-right: 20px">经销商上限</h4>
  482. <ExportButton
  483. style="display: inline-block; margin-right: 20px"
  484. :ex-url="'policy/limit/export'"
  485. :ex-params="exParams"
  486. />
  487. <!-- <el-button
  488. v-if="detail.type !== 'PROVISION' && list.length"
  489. type="primary"
  490. size="mini"
  491. @click="()=>{
  492. visible = true
  493. handelBatchData()
  494. }"
  495. >批量修改</el-button> -->
  496. <template v-if="detail.type !== 'LIMIT'">
  497. <el-button
  498. v-if="list.length"
  499. type="primary"
  500. size="mini"
  501. @click="()=>{
  502. visible = true
  503. handelBatchData()
  504. }"
  505. >批量修改上限</el-button>
  506. </template>
  507. <el-divider />
  508. </div>
  509. <div>
  510. <div class="table">
  511. <el-table
  512. v-loading="clistLoading"
  513. :data="list"
  514. element-loading-text="Loading"
  515. border
  516. fit
  517. highlight-current-row
  518. stripe
  519. @select-all="handleSelectionAllChange2"
  520. @selection-change="handleSelectionChange2"
  521. >
  522. <el-table-column type="index" width="50" />
  523. <el-table-column
  524. prop="customerNumber"
  525. label="经销商编号
  526. "
  527. align="left"
  528. min-width="300"
  529. >
  530. <template slot-scope="scope">
  531. <CopyButton :copy-text="scope.row.customerNumber" />
  532. <span>{{ scope.row.customerNumber }}</span>
  533. </template>
  534. </el-table-column>
  535. <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
  536. <template slot-scope="scope">
  537. <CopyButton :copy-text="scope.row.customerName" />
  538. <span>{{ scope.row.customerName }}</span>
  539. </template>
  540. </el-table-column>
  541. <el-table-column prop="materialName" label="物料名称" align="left" min-width="200">
  542. <template slot-scope="scope">
  543. {{ scope.row.materialName }}
  544. </template>
  545. </el-table-column>
  546. <el-table-column prop="materialNumber" label="物料编号" align="left" min-width="200">
  547. <template slot-scope="scope">
  548. {{ scope.row.materialNumber }}
  549. </template>
  550. </el-table-column>
  551. <el-table-column prop="limitQty" label="购买量上限" align="left" min-width="200">
  552. <template slot-scope="scope">
  553. {{ scope.row.limitQty }}
  554. </template>
  555. </el-table-column>
  556. <el-table-column prop="orderNums" label="已下订单数" align="left" min-width="200">
  557. <template slot-scope="scope">
  558. {{ scope.row.orderNums }}
  559. </template>
  560. </el-table-column>
  561. <el-table-column prop="examineOrderNums" label="已审订单数" align="left" min-width="200">
  562. <template slot-scope="scope">
  563. {{ scope.row.examineOrderNums }}
  564. </template>
  565. </el-table-column>
  566. </el-table>
  567. </div>
  568. <!-- 分页 -->
  569. <div style="margin: 20px 0">
  570. <el-pagination
  571. :current-page="policyList.currentPages"
  572. :page-sizes="[10, 20, 30, 50]"
  573. :page-size="10"
  574. layout="total, sizes, prev, pager, next, jumper"
  575. :total="cTotal"
  576. @size-change="handleSizeChanges4"
  577. @current-change="handleCurrentChanges4"
  578. />
  579. </div>
  580. </div>
  581. </template>
  582. <div>
  583. <div>
  584. <h4 style="display: inline-block; margin-right: 20px"> 经销商提货上限</h4>
  585. <el-divider />
  586. </div>
  587. <div style="margin: 20px 0">
  588. <!-- <el-upload
  589. class="import-btn cus-btn"
  590. :action="baseURL + 'policy/limit/group/import'"
  591. :http-request="handleImportPolicyLimitGroupPolicy"
  592. :file-list="importFileList"
  593. :show-file-list="false"
  594. >
  595. <el-button type="primary" size="mini">导入经销商配提套数</el-button>
  596. </el-upload> -->
  597. <ExportButton
  598. style="display: inline-block; margin-right: 10px"
  599. :ex-url="'policy/limit/group/export'"
  600. ex-text="导出经销商配提套数"
  601. :ex-params="{ policyId: detail.code }"
  602. />
  603. <template v-if="detail.type !== 'LIMIT'">
  604. <el-button
  605. v-if="policyLimitGroupList.length"
  606. type="primary"
  607. size="mini"
  608. @click="()=>{
  609. limitGroupvisible = true
  610. handelLimitGroupData()
  611. }"
  612. >批量修改配提套数上限</el-button>
  613. </template>
  614. <template v-else>
  615. <el-button
  616. v-if="policyLimitGroupList.length"
  617. type="primary"
  618. size="mini"
  619. @click="()=>{
  620. buyNumvisible = true
  621. handelLimitGroupData()
  622. }"
  623. >批量修改上限</el-button>
  624. </template>
  625. <!-- <el-button type="primary" size="mini" @click="hanleDownloadFilesPolicyLimitGroupPolicy"
  626. >下载模板</el-button
  627. > -->
  628. </div>
  629. <!-- <el-row style="margin: 20px 0">
  630. <el-col :span="12">
  631. <el-input v-model="policyKeyWord" placeholder="查找经销商" size="mini" />
  632. </el-col>
  633. <el-col :span="10" style="margin-left: 20px">
  634. <el-button size="mini" @click="getPolicyLimitGroupList">确定</el-button>
  635. <el-button size="mini" @click="onPolicyReset">重置</el-button>
  636. </el-col>
  637. </el-row> -->
  638. <div>
  639. <div class="table">
  640. <el-table
  641. v-loading="policyLoading"
  642. :data="policyLimitGroupList"
  643. element-loading-text="Loading"
  644. border
  645. fit
  646. highlight-current-row
  647. stripe
  648. >
  649. <el-table-column type="index" width="50" />
  650. <el-table-column
  651. prop="customerNumber"
  652. label="经销商编号
  653. "
  654. align="left"
  655. width="300"
  656. >
  657. <template slot-scope="scope">
  658. <CopyButton :copy-text="scope.row.customerNumber" />
  659. <span>{{ scope.row.customerNumber }}</span>
  660. </template>
  661. </el-table-column>
  662. <el-table-column prop="customerName" label="经销商名称" align="left" min-width="300">
  663. <template slot-scope="scope">
  664. <CopyButton :copy-text="scope.row.customerName" />
  665. <span>{{ scope.row.customerName }}</span>
  666. </template>
  667. </el-table-column>
  668. <template v-if="detail.type == 'LIMIT'">
  669. <el-table-column prop="minBuyNum" label="最小提货数量" align="left" min-width="200">
  670. <template slot-scope="scope">
  671. {{ scope.row.minBuyNum }}
  672. </template>
  673. </el-table-column>
  674. <el-table-column prop="maxBuyNum" label="最大提货组数" align="left" min-width="200">
  675. <template slot-scope="scope">
  676. {{ scope.row.maxBuyNum }}
  677. </template>
  678. </el-table-column>
  679. </template>
  680. <template v-else>
  681. <el-table-column prop="groupLimitNum" label="配提上限组数" align="left" min-width="200">
  682. <template slot-scope="scope">
  683. {{ scope.row.groupLimitNum }}
  684. </template>
  685. </el-table-column>
  686. </template>
  687. <!-- <el-table-column prop="orderNums" label="配提上限已下订单数" align="left" width="200">
  688. <template slot-scope="scope">
  689. {{ scope.row.orderNums }}
  690. </template>
  691. </el-table-column>
  692. <el-table-column prop="examineOrderNums" label="配提上限已审订单数" align="left" width="200">
  693. <template slot-scope="scope">
  694. {{ scope.row.examineOrderNums }}
  695. </template>
  696. </el-table-column> -->
  697. </el-table>
  698. </div>
  699. <!-- 分页 -->
  700. <div style="margin: 20px 0">
  701. <el-pagination
  702. :current-page="policyCurrentPages"
  703. :page-sizes="[10, 20, 30, 50]"
  704. :page-size="10"
  705. layout="total, sizes, prev, pager, next, jumper"
  706. :total="policyListTotal"
  707. @size-change="handlePolicySizeChanges"
  708. @current-change="handlePolicyCurrentChanges"
  709. />
  710. </div>
  711. </div>
  712. </div>
  713. </div>
  714. <div v-if="isShow == 8 && detail.examineStatus == 'WAIT'" class="descriptions diy-table-1">
  715. <el-row>
  716. <el-col :span="6">审核人</el-col>
  717. <el-col :span="6">{{ $store.getters.name }}</el-col>
  718. <el-col :span="6">审核结果</el-col>
  719. <el-col :span="6">
  720. <template>
  721. <el-radio-group v-model="examineStatus">
  722. <el-radio :label="'OK'">通过</el-radio>
  723. <el-radio :label="'FAIL'">驳回</el-radio>
  724. </el-radio-group>
  725. </template>
  726. </el-col>
  727. </el-row>
  728. <el-row class="item">
  729. <el-col :span="4">审批说明</el-col>
  730. <el-col :span="20" class="col value" style="padding-left: 10px">
  731. <el-input v-model="remark" size="mini" placeholder="请输入内容" />
  732. </el-col>
  733. </el-row>
  734. <el-row>
  735. <el-button type="primary" size="mini" @click="handleSubmit">审核通过</el-button>
  736. </el-row>
  737. </div>
  738. </div>
  739. <div>
  740. <el-button v-if="isShow == 5" type="primary" size="default" @click="handleSave">保存</el-button>
  741. </div>
  742. </div>
  743. <operation-records v-if="detail && detail.code" ref="operation" :policy-id="detail.code" />
  744. <el-dialog
  745. title="批量修改"
  746. :visible.sync="visible"
  747. width="50%"
  748. :append-to-body="true"
  749. :close-on-click-modal="false"
  750. @close="handleDialogVisible"
  751. >
  752. <el-row :gutter="20">
  753. <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
  754. <el-col :span="4" :offset="0"> 购买量上限 </el-col>
  755. <el-col :span="8" :offset="0"> <el-input v-model.number="limitQty" type="number" size="mini" /></el-col>
  756. </el-col>
  757. <el-col :span="24" :offset="0" style="margin-bottom: 20px">
  758. <div style="display: flex">
  759. <el-input v-model="limitQtyKeyWord" placeholder="输入关键字搜索" size="mini" />
  760. <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelBatchData('search')">查询</el-button>
  761. <el-button size="mini" @click="onReset">重置</el-button>
  762. </div>
  763. </el-col>
  764. </el-row>
  765. <zj-table
  766. :table-attributes="tableAttributes"
  767. :table-events="tableEvents"
  768. :is-drop="true"
  769. :columns="columns"
  770. :table-data="tableData"
  771. />
  772. <div style="margin: 20px 0">
  773. <el-pagination
  774. :current-page="batchCurrentPages"
  775. :page-sizes="[10, 20, 30, 50]"
  776. :page-size="10"
  777. layout="total, sizes, prev, pager, next, jumper"
  778. :total="batchTotal"
  779. @size-change="handleBatchSizeChanges"
  780. @current-change="handleBatchCurrentChanges"
  781. />
  782. </div>
  783. <span slot="footer">
  784. <el-button @click="handleDialogVisible">取消</el-button>
  785. <el-button type="primary" @click="onSubmit($event,'limit')">确定</el-button>
  786. </span>
  787. </el-dialog>
  788. <el-dialog
  789. title="批量修改"
  790. :visible.sync="limitGroupvisible"
  791. width="50%"
  792. :append-to-body="true"
  793. :close-on-click-modal="false"
  794. @close="handleLimitDialogVisible"
  795. >
  796. <el-row :gutter="20">
  797. <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
  798. <el-col :span="4" :offset="0"> 配提套数上限 </el-col>
  799. <el-col :span="8" :offset="0"> <el-input v-model.number="limitGroupNum" type="number" size="mini" /></el-col>
  800. </el-col>
  801. <el-col :span="24" :offset="0" style="margin-bottom: 20px">
  802. <div style="display: flex">
  803. <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
  804. <el-button style="margin-left: 20px" type="primary" size="mini" @click="handelLimitGroupData('search')">查询</el-button>
  805. <el-button size="mini" @click="onLimitReset">重置</el-button>
  806. </div>
  807. </el-col>
  808. </el-row>
  809. <zj-table
  810. :table-attributes="tableAttributes"
  811. :table-events="tableEvents"
  812. :is-drop="true"
  813. :columns="limitColumns"
  814. :table-data="limitTableData"
  815. />
  816. <div style="margin: 20px 0">
  817. <el-pagination
  818. :current-page="limitCurrentPages"
  819. :page-sizes="[10, 20, 30, 50]"
  820. :page-size="10"
  821. layout="total, sizes, prev, pager, next, jumper"
  822. :total="limitTotal"
  823. @size-change="handleLimitSizeChanges"
  824. @current-change="handleLimitCurrentChanges"
  825. />
  826. </div>
  827. <span slot="footer">
  828. <el-button @click="handleLimitDialogVisible">取消</el-button>
  829. <el-button type="primary" @click="onLimitSubmit($event, 'limit')">确定</el-button>
  830. </span>
  831. </el-dialog>
  832. <el-dialog
  833. title="批量修改"
  834. :visible.sync="buyNumvisible"
  835. width="50%"
  836. :append-to-body="true"
  837. :close-on-click-modal="false"
  838. @close="handleLimitDialogVisible"
  839. >
  840. <el-row :gutter="20">
  841. <el-col :span="24" style="display: flex; align-items: center; margin-bottom: 20px">
  842. <el-col :span="4" :offset="0"> 最小提货数量 </el-col>
  843. <el-col :span="8" :offset="0"> <el-input v-model.number="minBuyNum" type="number" size="mini" /></el-col>
  844. <el-col :span="4" :offset="0"> 最大提货组数 </el-col>
  845. <el-col :span="8" :offset="0"> <el-input v-model.number="maxBuyNum" type="number" size="mini" /></el-col>
  846. </el-col>
  847. <el-col :span="24" :offset="0" style="margin-bottom: 20px">
  848. <div style="display: flex">
  849. <el-input v-model="limitGroupKeyWord" placeholder="输入关键字搜索" size="mini" />
  850. <el-button
  851. style="margin-left: 20px"
  852. type="primary"
  853. size="mini"
  854. @click="handelLimitGroupData('search')"
  855. >查询</el-button>
  856. <el-button size="mini" @click="onLimitReset">重置</el-button>
  857. </div>
  858. </el-col>
  859. </el-row>
  860. <zj-table
  861. :table-attributes="tableAttributes"
  862. :table-events="tableEvents"
  863. :is-drop="true"
  864. :columns="limitColumns"
  865. :table-data="limitTableData"
  866. />
  867. <div style="margin: 20px 0">
  868. <el-pagination
  869. :current-page="limitCurrentPages"
  870. :page-sizes="[10, 20, 30, 50]"
  871. :page-size="10"
  872. layout="total, sizes, prev, pager, next, jumper"
  873. :total="limitTotal"
  874. @size-change="handleLimitSizeChanges"
  875. @current-change="handleLimitCurrentChanges"
  876. />
  877. </div>
  878. <span slot="footer">
  879. <el-button @click="handleLimitDialogVisible">取消</el-button>
  880. <el-button type="primary" @click="onLimitSubmit">确定</el-button>
  881. </span>
  882. </el-dialog>
  883. </div>
  884. <add-condition
  885. v-else
  886. :id="cid"
  887. :is-edit="isEdit"
  888. :is-show="isShow"
  889. @close="handleConditionClose"
  890. @back="handleBack"
  891. />
  892. </div>
  893. </template>
  894. <script>
  895. import {
  896. deleteCondition,
  897. deleteMaterialPolicy,
  898. getConditionList,
  899. getCrList,
  900. getCustomerList,
  901. getMaterialList,
  902. getPolicyDetail,
  903. toExamine,
  904. updatePolicy,
  905. getPolicyList,
  906. updateLimitBatchupdate,
  907. getPolicyLimitGroupList,
  908. updateLimitGrouppdate
  909. } from '@/api/policy_list'
  910. import { downloadFiles, handleImport } from '@/utils/util'
  911. import AddCondition from './AddCondition'
  912. import ImageUpload from '@/components/Common/image-upload.vue'
  913. import OperationRecords from './OperationRecords.vue'
  914. import Minxin from '@/mixin'
  915. export default {
  916. name: 'Examine',
  917. components: {
  918. AddCondition,
  919. ImageUpload,
  920. OperationRecords
  921. },
  922. mixins: [Minxin],
  923. props: ['id', 'isShow'],
  924. data() {
  925. return {
  926. baseURL: '',
  927. dcurrentPage: 1,
  928. dpageSize: 10,
  929. dlistTotal: 0,
  930. currentPages: 1, // 当前页码
  931. pageSizes: 10, // 每页数量
  932. clistTotal: 0,
  933. input: '',
  934. remark: '',
  935. fileList: [],
  936. listLoading: false,
  937. imageUrl: '',
  938. dataList: [],
  939. examineStatus: 'OK',
  940. options: {},
  941. value: '',
  942. detail: {},
  943. srcList: [],
  944. screenForm: {
  945. code: '',
  946. createBy: '',
  947. endCreateTime: '',
  948. endTime1: '',
  949. endTime2: '',
  950. examineBy: '',
  951. remark: '',
  952. startCreateTime: '',
  953. startTime1: '',
  954. startTime2: '',
  955. status: '',
  956. title: '',
  957. type: ''
  958. },
  959. conditionList: [],
  960. custoList: [],
  961. isEdit: 1,
  962. cid: '',
  963. cpolicyId: '',
  964. dataL: [],
  965. clistTotal: 0,
  966. clistTotals: 0,
  967. type: 1,
  968. fileList: [],
  969. importFileList: [],
  970. leftData: [],
  971. rightData: [],
  972. typeOptions: [
  973. {
  974. value: 'PROVISION',
  975. label: '配提'
  976. },
  977. {
  978. value: 'LIMIT',
  979. label: '限量'
  980. }
  981. ],
  982. detailFang: false,
  983. policyList: {
  984. pageNum: 1,
  985. pageSize: 10,
  986. policyId: '',
  987. keyword: '',
  988. currentPages: 1
  989. },
  990. list: [],
  991. cTotal: 1,
  992. clistLoading: false,
  993. visible: false,
  994. maxBuyNumVisible: false,
  995. tableData: [],
  996. tableAttributes: {
  997. selectColumn: true
  998. },
  999. tableEvents: {
  1000. 'selection-change': this.selectionChange
  1001. },
  1002. limitQty: null,
  1003. maxBuyNum: null,
  1004. limitQtyKeyWord: '',
  1005. maxBuyNumKeyWord: '',
  1006. selectedData: [],
  1007. batchCurrentPages: 1,
  1008. batchPageSizes: 10,
  1009. batchTotal: 0,
  1010. policyLimitGroupList: [],
  1011. policyLoading: false,
  1012. policyCurrentPages: 1,
  1013. policyPageSize: 10,
  1014. policyListTotal: 0,
  1015. policyKeyWord: '',
  1016. limitGroupvisible: false,
  1017. limitGroupNum: null,
  1018. limitGroupKeyWord: '',
  1019. limitCurrentPages: 1,
  1020. limitTotal: 0,
  1021. limitPageSizes: 10,
  1022. limitTableData: [],
  1023. buyNumvisible: false,
  1024. minBuyNum: null
  1025. }
  1026. },
  1027. computed: {
  1028. exParams() {
  1029. return {
  1030. policyId: this.detail.code
  1031. }
  1032. },
  1033. columns() {
  1034. return [
  1035. {
  1036. columnAttributes: {
  1037. label: '经销商编码',
  1038. prop: 'customerNumber'
  1039. }
  1040. },
  1041. {
  1042. columnAttributes: {
  1043. label: '经销商名称',
  1044. prop: 'customerName'
  1045. }
  1046. },
  1047. {
  1048. columnAttributes: {
  1049. label: '物料名称',
  1050. prop: 'materialName'
  1051. }
  1052. },
  1053. {
  1054. columnAttributes: {
  1055. label: '物料编号',
  1056. prop: 'materialNumber'
  1057. }
  1058. }
  1059. ]
  1060. },
  1061. limitColumns() {
  1062. return [
  1063. {
  1064. columnAttributes: {
  1065. label: '经销商编码',
  1066. prop: 'customerNumber'
  1067. }
  1068. },
  1069. {
  1070. columnAttributes: {
  1071. label: '经销商名称',
  1072. prop: 'customerName'
  1073. }
  1074. }
  1075. ]
  1076. }
  1077. },
  1078. created() {},
  1079. methods: {
  1080. handleConditionClose() {
  1081. this.isEdit = 1
  1082. },
  1083. funTitle() {
  1084. const title = '详情页'
  1085. return title
  1086. },
  1087. handleBack() {
  1088. this.isEdit = 1
  1089. },
  1090. getList() {
  1091. this.listLoading = true
  1092. getPolicyDetail({ policyId: this.id }).then(res => {
  1093. this.detail = res.data
  1094. this.detail.flag = this.detail.flag + ''
  1095. this.detail.imgSrc = this.detail.imgSrc.split(',')
  1096. this.detail.imgSrc.forEach(k => {
  1097. this.srcList.push(this.$imageUrl + k)
  1098. })
  1099. // this.srcList = [this.$imageUrl + this.detail.imgSrc]
  1100. if (this.isShow == 5 && this.detail.imgSrc) {
  1101. this.fileList = [
  1102. {
  1103. hover: '',
  1104. url: this.detail.imgSrc
  1105. }
  1106. ]
  1107. }
  1108. this.handletwoList()
  1109. // 获取条件政策
  1110. this.getConditionList()
  1111. this.getCond()
  1112. this.getPolicyList()
  1113. this.getPolicyLimitGroupList()
  1114. })
  1115. },
  1116. getPolicyList() {
  1117. this.clistLoading = true
  1118. getPolicyList({
  1119. pageNum: this.policyList.currentPages,
  1120. pageSize: this.policyList.pageSize,
  1121. policyId: this.id,
  1122. keyword: this.policyList.keyword
  1123. }).then(res => {
  1124. this.list = res.data.records
  1125. console.log(this.list, '785787')
  1126. this.cTotal = res.data.total
  1127. this.clistLoading = false
  1128. })
  1129. },
  1130. // 检查文件类型
  1131. checkFileType(url) {
  1132. if (!url) return ''
  1133. const fileSuffix = url.substring(url.lastIndexOf('.') + 1)
  1134. if (['jpg', 'jpeg', 'png'].includes(fileSuffix)) {
  1135. return 'image'
  1136. } else if (['doc', 'docx', 'dot', 'wps', 'wpt'].includes(fileSuffix)) {
  1137. return 'word'
  1138. } else if (['xls', 'xlsx', 'xlt', 'et', 'ett'].includes(fileSuffix)) {
  1139. return 'excel'
  1140. } else if (['ppt', 'pptx', 'dps', 'dpt', 'pot', 'pps'].includes(fileSuffix)) {
  1141. return 'ppt'
  1142. } else if (['pdf'].includes(fileSuffix)) {
  1143. return 'pdf'
  1144. } else if (['zip', 'rar', 'gz', 'apk'].includes(fileSuffix)) {
  1145. return 'file'
  1146. } else {
  1147. return ''
  1148. }
  1149. },
  1150. openPdf(pdfUrl) {
  1151. window.open(this.$imageUrl + pdfUrl)
  1152. },
  1153. getCrList() {
  1154. const customerParams = {
  1155. pageNum: this.currentPage,
  1156. pageSize: this.pageSize,
  1157. keyword: this.region == 1 || this.region == '' ? '' : this.keyword,
  1158. region: this.region == 1 ? this.keyword : ''
  1159. }
  1160. // 获取经销商列表
  1161. getCrList(customerParams).then(res => {
  1162. for (let j = 0; j < this.custoList.length; j++) {
  1163. for (let i = 0; i < res.data.records.length; i++) {
  1164. if (res.data.records[i].id == this.custoList[j].customerId) {
  1165. res.data.records[i].disabled = true
  1166. }
  1167. }
  1168. }
  1169. this.dataL = res.data.records
  1170. for (let k = 0; k < this.dataL.length; k++) {
  1171. (this.dataL[k].customerId = this.dataL[k].id),
  1172. (this.dataL[k].customerName = this.dataL[k].name),
  1173. (this.dataL[k].customerNumber = this.dataL[k].number)
  1174. }
  1175. console.log(this.dataL, '获取经销商列表')
  1176. this.clistTotal = res.data.total
  1177. })
  1178. },
  1179. // 更改每页数量
  1180. handleSizeChanges(val) {
  1181. this.pageSizes = val
  1182. this.currentPages = 1
  1183. this.getCond()
  1184. },
  1185. // 更改当前页
  1186. handleCurrentChanges(val) {
  1187. this.currentPages = val
  1188. this.getCond()
  1189. },
  1190. // 更改每页数量
  1191. handleSizeChange2(val) {
  1192. this.dpageSize = val
  1193. this.dcurrentPage = 1
  1194. this.handletwoList()
  1195. },
  1196. // 更改当前页
  1197. handleCurrentChange2(val) {
  1198. this.dcurrentPage = val
  1199. this.handletwoList()
  1200. },
  1201. getCommonApi(row) {
  1202. this.isEdit = 2
  1203. this.cid = row.id
  1204. this.cpolicyId = row.policyId
  1205. },
  1206. getCond() {
  1207. this.listLoading = true
  1208. const custoParams = {
  1209. pageNum: this.currentPages,
  1210. pageSize: this.pageSizes,
  1211. policyId: this.detail.code
  1212. }
  1213. getCustomerList(custoParams).then(res => {
  1214. this.custoList = res.data.records
  1215. this.clistTotals = res.data.total
  1216. this.listLoading = false
  1217. this.getCrList()
  1218. })
  1219. },
  1220. handleSubmit() {
  1221. toExamine({
  1222. examineStatus: this.examineStatus,
  1223. policyId: this.id,
  1224. examineRemark: this.remark
  1225. }).then(res => {
  1226. this.$successMsg('已提交审核')
  1227. this.isShow = 1
  1228. this.$emit('close')
  1229. })
  1230. },
  1231. // 获取货品信息
  1232. handletwoList() {
  1233. // this.searchForm.type
  1234. const paramss = {
  1235. pageNum: this.dcurrentPage,
  1236. pageSize: this.dpageSize,
  1237. policyId: this.detail.code,
  1238. saleTypeCode: ''
  1239. }
  1240. getMaterialList(paramss)
  1241. .then(result => {
  1242. this.dataList = result.data.records
  1243. this.dlistTotal = result.data.total
  1244. this.listLoading = false
  1245. })
  1246. .catch(err => {
  1247. console.error(err)
  1248. })
  1249. },
  1250. // 更改每页数量
  1251. handleSizeChanges4(val) {
  1252. this.policyList.pageSizes = val
  1253. this.policyList.currentPages = 1
  1254. this.getPolicyList()
  1255. },
  1256. // 更改当前页
  1257. handleCurrentChanges4(val) {
  1258. this.policyList.currentPages = val
  1259. this.getPolicyList()
  1260. },
  1261. // 导入
  1262. async handleImport(param) {
  1263. this.importLoading = true
  1264. const file = param.file
  1265. console.log(file, 123)
  1266. const formData = new FormData()
  1267. formData.append('file', file)
  1268. formData.append('policyId', this.detail.code)
  1269. // formData.append("mainId", this.detail.mainId);
  1270. const result = await handleImport('/policy/material/import', formData)
  1271. this.importLoading = false
  1272. this.importFileList = []
  1273. if (result.code == 200) {
  1274. this.$alert(result.message, '导入成功', {
  1275. confirmButtonText: '确定'
  1276. })
  1277. this.handletwoList()
  1278. } else {
  1279. this.$alert(result.message, '导入失败', {
  1280. confirmButtonText: '确定'
  1281. })
  1282. }
  1283. },
  1284. handleCondition(id, index) {
  1285. deleteCondition({ id }).then(res => {
  1286. // this.conditionList.splice(index, 1);
  1287. // Object.assign(
  1288. // this.$children[9].$data,
  1289. // this.$children[9].$options.data()
  1290. // );
  1291. this.getConditionList()
  1292. this.$successMsg('删除成功')
  1293. })
  1294. },
  1295. getConditionList() {
  1296. const condParams = {
  1297. policyId: this.detail.code
  1298. }
  1299. getConditionList(condParams).then(res => {
  1300. this.conditionList = res.data
  1301. })
  1302. },
  1303. // 删除
  1304. hanleDelete(id) {
  1305. const params = { policyMaterialId: id }
  1306. deleteMaterialPolicy(params).then(res => {
  1307. this.$successMsg('删除成功')
  1308. this.handletwoList()
  1309. })
  1310. },
  1311. /**
  1312. * 根据条件禁用行复选框
  1313. * 函数返回值为false则禁用选择(反之亦然)
  1314. * @param {Object} row - 行数据
  1315. * @param {String} index - 索引值
  1316. * @return Boolean
  1317. */
  1318. selectable: function(row, index) {
  1319. // row.disabled == undefined 才能被选中
  1320. if (row.disabled == undefined || row.disabled == false) {
  1321. return true
  1322. } else {
  1323. return false
  1324. }
  1325. // 函数必须有返回值且是布尔值
  1326. // 页面刷新后该函数会执行 N 次进行判断(N 为表格行数)
  1327. // 如果没有返回值则默认返回false(全部无法选中)
  1328. },
  1329. handleSelectionAllChange(e) {
  1330. this.leftData = e
  1331. this.type = 1
  1332. },
  1333. handleSelectionChange(e) {
  1334. this.leftData = e
  1335. this.type = 1
  1336. },
  1337. handleSelectionAllChange2(e) {
  1338. this.rightData = e
  1339. this.type = 2
  1340. },
  1341. handleSelectionChange2(e) {
  1342. this.rightData = e
  1343. this.type = 2
  1344. },
  1345. handleLeft(e) {
  1346. this.type = 1
  1347. },
  1348. handleRight(e) {
  1349. this.type = 2
  1350. },
  1351. handleAllAdd() {
  1352. if (this.type == 1 && this.leftData.length) {
  1353. for (let i = 0; i < this.dataL.length; i++) {
  1354. for (let j = 0; j < this.leftData.length; j++) {
  1355. if (this.dataL[i].id == this.leftData[j].id) {
  1356. this.dataL[i].disabled = true
  1357. }
  1358. }
  1359. }
  1360. this.custoList = [...this.custoList, ...this.leftData]
  1361. this.$refs.multipleTable.clearSelection()
  1362. } else {
  1363. this.$errorMsg('请选择要添加的经销商')
  1364. }
  1365. },
  1366. handleAllDelete() {
  1367. if (this.type == 2 && this.rightData.length) {
  1368. for (let i = 0; i < this.dataL.length; i++) {
  1369. for (let j = 0; j < this.rightData.length; j++) {
  1370. if (this.dataL[i].id == this.rightData[j].customerId) {
  1371. this.$set(this.dataL[i], 'disabled', false)
  1372. }
  1373. }
  1374. }
  1375. const arr = this.resArr(this.custoList, this.rightData)
  1376. this.custoList = arr
  1377. } else {
  1378. this.$errorMsg('请选择要删除的经销商')
  1379. }
  1380. },
  1381. handleAdd() {
  1382. if (this.type == 1 && this.leftData.length) {
  1383. for (let i = 0; i < this.dataL.length; i++) {
  1384. for (let j = 0; j < this.leftData.length; j++) {
  1385. if (this.dataL[i].id == this.leftData[j].id) {
  1386. this.dataL[i].disabled = true
  1387. }
  1388. }
  1389. }
  1390. this.custoList = [...this.custoList, ...this.leftData]
  1391. this.leftData = []
  1392. this.$refs.multipleTable.clearSelection()
  1393. } else {
  1394. this.$errorMsg('请选择要添加的经销商')
  1395. }
  1396. },
  1397. handleDelete() {
  1398. if (this.type == 2 && this.rightData.length) {
  1399. for (let i = 0; i < this.dataL.length; i++) {
  1400. for (let j = 0; j < this.rightData.length; j++) {
  1401. if (this.dataL[i].id == this.rightData[j].customerId) {
  1402. this.$set(this.dataL[i], 'disabled', false)
  1403. }
  1404. }
  1405. }
  1406. const arr = this.resArr(this.custoList, this.rightData)
  1407. this.custoList = arr
  1408. } else {
  1409. this.$errorMsg('请选择要删除的经销商')
  1410. }
  1411. },
  1412. // 去掉相同数据
  1413. resArr(arr1, arr2) {
  1414. return arr1.filter(v => arr2.every(val => val.id != v.id))
  1415. },
  1416. async handleSave() {
  1417. if (this.custoList.length) {
  1418. var arr = []
  1419. this.custoList.forEach(el => {
  1420. arr.push({
  1421. customerId: el.customerId,
  1422. customerName: el.customerName,
  1423. customerNumber: el.customerNumber,
  1424. lastOrderTime: '',
  1425. limitTakeNum: 0,
  1426. policyId: this.detail.code,
  1427. policyTitle: '',
  1428. remark: ''
  1429. })
  1430. })
  1431. const params = {
  1432. ...this.detail,
  1433. policyCustomers: arr,
  1434. imgSrc: this.fileList.length ? this.fileList[0].url : ''
  1435. }
  1436. await updatePolicy(params)
  1437. await this.getCond()
  1438. this.$successMsg('编辑成功')
  1439. this.fileList = []
  1440. this.isShow = 1
  1441. }
  1442. },
  1443. selectionChange(data) {
  1444. this.selectedData = data
  1445. },
  1446. handelBatchData(search) {
  1447. if (search) {
  1448. this.batchCurrentPages = 1
  1449. }
  1450. getPolicyList({
  1451. pageNum: this.batchCurrentPages,
  1452. pageSize: this.batchPageSizes,
  1453. policyId: this.id,
  1454. keyword: this.limitQtyKeyWord
  1455. }).then(res => {
  1456. this.tableData = res.data.records
  1457. this.batchTotal = res.data.total
  1458. })
  1459. },
  1460. handleDialogVisible() {
  1461. this.visible = false
  1462. this.buyNumvisible = false
  1463. this.maxBuyNumVisible = false
  1464. this.batchCurrentPages = 1
  1465. this.batchPageSizes = 10
  1466. this.limitQty = null
  1467. this.maxBuyNum = null
  1468. this.minBuyNum = null
  1469. this.limitQtyKeyWord = ''
  1470. this.maxBuyNumKeyWord = ''
  1471. },
  1472. onSubmit(e, type) {
  1473. console.log(type)
  1474. if (!this.selectedData.length) {
  1475. this.$errorMsg('不能为空,请选择')
  1476. return
  1477. }
  1478. let params = {}
  1479. const customerIds = this.selectedData
  1480. .map(k => {
  1481. return k.customerId
  1482. })
  1483. .join(',')
  1484. const ids = this.selectedData
  1485. .map(k => {
  1486. return k.id
  1487. })
  1488. .join(',')
  1489. if (type) {
  1490. if (this.limitQty <= 0) {
  1491. this.$errorMsg('购买量上限不能小于0或不能为空')
  1492. return
  1493. }
  1494. params = {
  1495. customerIds,
  1496. ids,
  1497. limitQty: this.limitQty
  1498. }
  1499. }
  1500. updateLimitBatchupdate(params).then(res => {
  1501. this.handleDialogVisible()
  1502. this.getPolicyList()
  1503. this.getPolicyLimitGroupList()
  1504. this.$refs.operation.getCommonLogList()
  1505. this.$successMsg('批量修改成功')
  1506. })
  1507. },
  1508. handleBatchSizeChanges(val) {
  1509. this.batchCurrentPages = 1
  1510. this.batchPageSizes = val
  1511. this.handelBatchData()
  1512. },
  1513. onReset() {
  1514. this.limitQtyKeyWord = ''
  1515. this.maxBuyNumKeyWord = ''
  1516. this.handelBatchData()
  1517. },
  1518. handleBatchCurrentChanges(val) {
  1519. this.batchCurrentPages = val
  1520. this.handelBatchData()
  1521. },
  1522. getPolicyLimitGroupList() {
  1523. this.policyLoading = true
  1524. getPolicyLimitGroupList({
  1525. pageNum: this.policyCurrentPages,
  1526. pageSize: this.policyPageSize,
  1527. policyId: this.id,
  1528. keyword: this.policyKeyWord
  1529. }).then(res => {
  1530. this.policyLimitGroupList = res.data.records
  1531. this.policyListTotal = res.data.total
  1532. this.policyLoading = false
  1533. })
  1534. },
  1535. handlePolicySizeChanges(val) {
  1536. this.policyCurrentPages = 1
  1537. this.policyPageSize = val
  1538. this.getPolicyLimitGroupList()
  1539. },
  1540. onPolicyReset() {
  1541. this.policyCurrentPages = 1
  1542. this.policyPageSize = 10
  1543. this.policyKeyWord = ''
  1544. this.getPolicyLimitGroupList()
  1545. },
  1546. handlePolicyCurrentChanges(val) {
  1547. this.policyCurrentPages = val
  1548. this.getPolicyLimitGroupList()
  1549. },
  1550. hanleDownloadFilesPolicyLimitGroupPolicy() {
  1551. downloadFiles('policy/limit/group/download')
  1552. },
  1553. async handleImportPolicyLimitGroupPolicy(param) {
  1554. this.importLoading = true
  1555. const file = param.file
  1556. const formData = new FormData()
  1557. formData.append('file', file)
  1558. formData.append('policyId', this.id)
  1559. // formData.append('type', this.detail.type)
  1560. // formData.append("mainId", this.searchForm.mainId);
  1561. const result = await handleImport('policy/limit/group/import', formData)
  1562. this.importLoading = false
  1563. this.importFileList = []
  1564. if (result.code === 200) {
  1565. await this.$alert(result.message, '导入成功', {
  1566. confirmButtonText: '确定'
  1567. })
  1568. // this.policyLimitGroupList = result.data
  1569. this.getPolicyLimitGroupList()
  1570. } else {
  1571. await this.$alert(result.message, '导入失败', {
  1572. confirmButtonText: '确定'
  1573. })
  1574. }
  1575. },
  1576. handelLimitGroupData(search) {
  1577. if (search) {
  1578. this.limitCurrentPages = 1
  1579. }
  1580. this.limitGroupvisible = true
  1581. getPolicyLimitGroupList({
  1582. pageNum: this.limitCurrentPages,
  1583. pageSize: this.limitPageSizes,
  1584. policyId: this.id,
  1585. keyword: this.limitGroupKeyWord
  1586. }).then(res => {
  1587. this.limitTableData = res.data.records
  1588. this.limitTotal = res.data.total
  1589. })
  1590. },
  1591. onLimitSubmit(e, type) {
  1592. if (!this.selectedData.length) {
  1593. this.$errorMsg('不能为空,请选择')
  1594. return
  1595. }
  1596. const ids = this.selectedData
  1597. .map(k => {
  1598. return k.id
  1599. })
  1600. .join(',')
  1601. let params = {}
  1602. if (type) {
  1603. if (this.limitGroupNum <= 0) {
  1604. this.$errorMsg('配提套数上限不能小于0或不能为空')
  1605. return
  1606. }
  1607. params = {
  1608. ids,
  1609. limitGroupNum: this.limitGroupNum
  1610. }
  1611. } else {
  1612. params = {
  1613. ids,
  1614. minBuyNum: this.minBuyNum,
  1615. maxBuyNum: this.maxBuyNum
  1616. }
  1617. }
  1618. updateLimitGrouppdate(params).then(res => {
  1619. this.handleLimitDialogVisible()
  1620. this.$successMsg('批量修改成功')
  1621. this.getPolicyLimitGroupList()
  1622. this.getPolicyList()
  1623. this.$refs.operation.getCommonLogList()
  1624. })
  1625. },
  1626. handleLimitSizeChanges(val) {
  1627. this.limitCurrentPages = 1
  1628. this.limitPageSizes = val
  1629. this.handelLimitGroupData()
  1630. },
  1631. handleLimitCurrentChanges(val) {
  1632. this.limitCurrentPages = val
  1633. this.handelLimitGroupData()
  1634. },
  1635. onLimitReset() {
  1636. this.limitGroupKeyWord = ''
  1637. this.handelLimitGroupData()
  1638. },
  1639. handleLimitDialogVisible() {
  1640. this.buyNumvisible = false
  1641. this.limitGroupvisible = false
  1642. this.limitGroupNum = null
  1643. this.limitGroupKeyWord = ''
  1644. this.limitCurrentPages = 1
  1645. this.limitTotal = 0
  1646. this.limitPageSizes = 10
  1647. this.maxBuyNum = null
  1648. this.minBuyNum = null
  1649. this.limitQtyKeyWord = ''
  1650. this.maxBuyNumKeyWord = ''
  1651. }
  1652. }
  1653. }
  1654. </script>
  1655. <style lang="scss" scoped>
  1656. ::v-deep .elImageClose .el-image-viewer__wrapper span[class='el-image-viewer__btn el-image-viewer__close'] {
  1657. top: 100px;
  1658. }
  1659. .file {
  1660. margin-right: 20px;
  1661. }
  1662. .el-col {
  1663. overflow: hidden;
  1664. }
  1665. .value {
  1666. ::v-deep .el-input__prefix {
  1667. display: none;
  1668. }
  1669. }
  1670. .descriptions {
  1671. // border: #EBEEF5;
  1672. border: 1px solid #ebeef5;
  1673. border-bottom: none;
  1674. .el-row {
  1675. height: 40px;
  1676. line-height: 40px;
  1677. }
  1678. .el-col:nth-child(odd) {
  1679. background-color: #ebeef5;
  1680. }
  1681. .el-col {
  1682. padding: 0 15px;
  1683. height: 100%;
  1684. border-bottom: 1px solid #ebeef5;
  1685. }
  1686. }
  1687. .el-divider--horizontal {
  1688. margin: 20px 0;
  1689. }
  1690. .col {
  1691. height: 100px;
  1692. }
  1693. .import-btn {
  1694. margin-right: 10px;
  1695. display: inline-block;
  1696. }
  1697. ::v-deep .el-input__icon .el-icon-time {
  1698. display: none;
  1699. }
  1700. .middle_box {
  1701. margin-top: 80px;
  1702. text-align: center;
  1703. height: 430px;
  1704. display: flex;
  1705. flex-direction: column;
  1706. align-content: center;
  1707. justify-content: space-between;
  1708. align-items: center;
  1709. }
  1710. .img-box {
  1711. height: 150px;
  1712. display: flex;
  1713. align-items: center;
  1714. }
  1715. </style>