price_list.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template>
  2. <div class="app-container">
  3. <!-- 筛选条件 -->
  4. <div>
  5. <el-form
  6. ref="screenForm"
  7. :model="screenForm"
  8. label-width="70px"
  9. size="small"
  10. label-position="left"
  11. >
  12. <el-row :gutter="20">
  13. <el-col :xs="24" :sm="12" :lg="6">
  14. <el-form-item label="物料编码" prop="materialNumber">
  15. <el-input
  16. v-model="screenForm.materialNumber"
  17. placeholder="请输入物料编码"
  18. />
  19. </el-form-item>
  20. </el-col>
  21. <el-col :xs="24" :sm="12" :lg="6">
  22. <el-form-item label="产品名称" prop="materialName">
  23. <el-input
  24. v-model="screenForm.materialName"
  25. placeholder="请输入产品名称"
  26. />
  27. </el-form-item>
  28. </el-col>
  29. <el-col :xs="24" :sm="12" :lg="6">
  30. <el-form-item label="产品编码" prop="materialOldNumber">
  31. <el-input
  32. v-model="screenForm.materialOldNumber"
  33. placeholder="请输入产品编码"
  34. />
  35. </el-form-item>
  36. </el-col>
  37. <!-- <el-col :xs="24" :sm="12" :lg="6">-->
  38. <!-- <el-form-item label="生效日期" prop="startDate">-->
  39. <!-- <el-date-picker-->
  40. <!-- v-model="screenForm.startDate"-->
  41. <!-- type="datetime"-->
  42. <!-- placeholder="请输入生效日期"-->
  43. <!-- value-format="yyyy-MM-dd HH:mm:ss"-->
  44. <!-- >-->
  45. <!-- </el-date-picker>-->
  46. <!-- </el-form-item>-->
  47. <!-- </el-col>-->
  48. <!-- <el-col :xs="24" :sm="12" :lg="6">-->
  49. <!-- <el-form-item label="失效日期" prop="endDate">-->
  50. <!-- <el-date-picker-->
  51. <!-- v-model="screenForm.endDate"-->
  52. <!-- type="datetime"-->
  53. <!-- placeholder="请输入生效日期"-->
  54. <!-- value-format="yyyy-MM-dd HH:mm:ss "-->
  55. <!-- >-->
  56. <!-- </el-date-picker>-->
  57. <!-- </el-form-item>-->
  58. <!-- </el-col>-->
  59. <el-col :xs="24" :sm="12" :lg="6">
  60. <el-form-item label="销售类型" prop="saleTypeId">
  61. <el-select
  62. v-model="screenForm.saleTypeId"
  63. filterable
  64. placeholder="选择销售类型"
  65. style="width: 100%"
  66. >
  67. <el-option label="全部" value="" />
  68. <el-option
  69. v-for="item in ztypeList"
  70. :key="item.id"
  71. :label="item.saleName"
  72. :value="item.id"
  73. />
  74. </el-select>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :xs="24" :sm="12" :lg="6">
  78. <el-form-item label="产品品类" prop="categoryId">
  79. <el-select
  80. v-model="screenForm.mainId"
  81. placeholder="请选择产品品类"
  82. >
  83. <el-option label="全部" value="" />
  84. <el-option
  85. v-for="item in dictList"
  86. :label="item.dictValue"
  87. :value="item.dictCode"
  88. />
  89. </el-select>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :xs="24" :sm="12" :lg="6">
  93. <el-form-item label="规格型号" prop="specification">
  94. <el-input
  95. v-model="screenForm.specification"
  96. placeholder="请输入规格型号"
  97. />
  98. </el-form-item>
  99. </el-col>
  100. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  101. <el-form-item label="">
  102. <el-button size="small" @click="resetScreenForm">清空</el-button>
  103. <el-button
  104. size="small"
  105. type="primary"
  106. @click="submitScreenForm"
  107. >搜索</el-button>
  108. </el-form-item>
  109. </el-col>
  110. </el-row>
  111. </el-form>
  112. </div>
  113. <!-- 按钮 -->
  114. <div class="btn-group clearfix">
  115. <div class="fr">
  116. <!-- <el-button type="primary" size="small">导出</el-button>-->
  117. <!-- <el-button type="primary" size="small">打印</el-button> -->
  118. </div>
  119. </div>
  120. <div class="mymain-container">
  121. <!-- 列表 -->
  122. <div class="table">
  123. <el-table
  124. v-loading="listLoading"
  125. :data="dataList"
  126. element-loading-text="Loading"
  127. border
  128. fit
  129. stripe
  130. >
  131. <!-- <el-table-column type="selection" align="left" />-->
  132. <!-- <el-table-column
  133. align="left"
  134. label="产品品类"
  135. prop="mainName"
  136. min-width="160"
  137. show-overflow-tooltip
  138. ></el-table-column> -->
  139. <el-table-column
  140. align="left"
  141. label="物料编码"
  142. prop="materialNumber"
  143. min-width="200"
  144. show-overflow-tooltip
  145. >
  146. <template slot-scope="scope">
  147. <CopyButton :copyText="scope.row.materialNumber" />
  148. <span>{{scope.row.materialNumber}}</span>
  149. </template>
  150. </el-table-column>
  151. <el-table-column
  152. align="left"
  153. label="产品编码"
  154. prop="materialOldNumber"
  155. min-width="200"
  156. show-overflow-tooltip
  157. >
  158. <template slot-scope="scope">
  159. <CopyButton :copyText="scope.row.materialOldNumber" />
  160. <span>{{scope.row.materialOldNumber}}</span>
  161. </template>
  162. </el-table-column>
  163. <el-table-column
  164. align="left"
  165. label="产品名称"
  166. prop="materialName"
  167. min-width="200"
  168. show-overflow-tooltip
  169. >
  170. <template slot-scope="scope">
  171. <CopyButton :copyText="scope.row.materialName" />
  172. <span>{{scope.row.materialName}}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column
  176. align="left"
  177. label="规格型号"
  178. prop="specification"
  179. min-width="200"
  180. show-overflow-tooltip
  181. >
  182. <template slot-scope="scope">
  183. <CopyButton :copyText="scope.row.specification" />
  184. <span>{{scope.row.specification}}</span>
  185. </template>
  186. </el-table-column>
  187. <el-table-column
  188. align="left"
  189. label="销售类型"
  190. prop="saleTypeName"
  191. min-width="160"
  192. show-overflow-tooltip
  193. />
  194. <el-table-column
  195. align="left"
  196. label="单位"
  197. prop="unit"
  198. min-width="160"
  199. show-overflow-tooltip
  200. />
  201. <el-table-column
  202. align="left"
  203. label="数量下限"
  204. prop="qty"
  205. min-width="160"
  206. show-overflow-tooltip
  207. />
  208. <el-table-column
  209. align="left"
  210. label="返利类型(钱包)"
  211. prop="wallets"
  212. min-width="200"
  213. show-overflow-tooltip
  214. >
  215. <template slot-scope="scope">
  216. <template v-for="(item, index) in scope.row.wallets">
  217. <template v-if="item.type === 'REBATE'">
  218. <el-tag
  219. :key="index"
  220. type="success"
  221. style="margin: 0 10px"
  222. size="small"
  223. >
  224. {{ item.walletName }}
  225. </el-tag>
  226. </template>
  227. </template>
  228. </template>
  229. </el-table-column>
  230. <el-table-column
  231. align="left"
  232. label="现金钱包"
  233. prop="modifyPriceDepartment"
  234. min-width="200"
  235. show-overflow-tooltip
  236. >
  237. <template slot-scope="scope">
  238. <template v-for="(item, index) in scope.row.wallets">
  239. <template v-if="item.type === 'COMMONLY'">
  240. <el-tag
  241. :key="index"
  242. type="success"
  243. style="margin: 0 10px"
  244. size="small"
  245. >
  246. {{ item.walletName }}
  247. </el-tag>
  248. </template>
  249. </template>
  250. </template>
  251. </el-table-column>
  252. <el-table-column
  253. align="left"
  254. label="生效日期"
  255. prop="startDate"
  256. min-width="160"
  257. show-overflow-tooltip
  258. />
  259. <el-table-column
  260. align="left"
  261. label="失效日期"
  262. prop="endDate"
  263. min-width="160"
  264. show-overflow-tooltip
  265. />
  266. <el-table-column
  267. align="left"
  268. label="是否促销价"
  269. prop="isPromote"
  270. min-width="160"
  271. show-overflow-tooltip
  272. >
  273. <template slot-scope="scope">
  274. <el-tag v-if="scope.row.isPromote" type="success">是</el-tag>
  275. <el-tag v-else type="danger">否</el-tag>
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. align="left"
  280. label="是否促作废"
  281. prop="isRevoke"
  282. min-width="160"
  283. show-overflow-tooltip
  284. >
  285. <template slot-scope="scope">
  286. <el-tag v-if="scope.row.isRevoke" type="success">是</el-tag>
  287. <el-tag v-else type="danger">否</el-tag>
  288. </template>
  289. </el-table-column>
  290. <el-table-column
  291. align="right"
  292. label="批发价1"
  293. prop="batchPrice"
  294. min-width="160"
  295. show-overflow-tooltip
  296. />
  297. <el-table-column
  298. align="right"
  299. label="格力折扣"
  300. prop="discAmount"
  301. min-width="160"
  302. show-overflow-tooltip
  303. />
  304. <el-table-column
  305. align="left"
  306. label="备注"
  307. prop="remark"
  308. min-width="160"
  309. show-overflow-tooltip
  310. />
  311. <el-table-column
  312. fixed="left"
  313. width="150"
  314. label="操作"
  315. align="center"
  316. >
  317. <template slot-scope="scope">
  318. <el-button
  319. type="text"
  320. size="small"
  321. @click="handleRevoke(scope.row.id)"
  322. >作废</el-button>
  323. <el-button
  324. v-if="$checkBtnRole('del', $route.meta.roles)"
  325. type="text"
  326. size="small"
  327. @click="handleDelete(scope.row.id)"
  328. >删除</el-button>
  329. </template>
  330. </el-table-column>
  331. </el-table>
  332. </div>
  333. <!-- 分页 -->
  334. <div class="fr">
  335. <el-pagination
  336. :current-page="currentPage"
  337. :page-sizes="[10, 20, 30, 50]"
  338. :page-size="10"
  339. layout="total, sizes, prev, pager, next, jumper"
  340. :total="listTotal"
  341. @size-change="handleSizeChange"
  342. @current-change="handleCurrentChange"
  343. />
  344. </div>
  345. </div>
  346. </div>
  347. </template>
  348. <script>
  349. import Mixin from '@/mixin/index'
  350. import { getProductDelete, getProductPriceList, getTypeList, handlePriceRevoke } from '@/api/basic_data/material'
  351. import { getDictList } from '@/api/common'
  352. export default {
  353. mixins: [Mixin],
  354. data() {
  355. return {
  356. currentPage: 1, // 当前页码
  357. pageSize: 10, // 每页数量
  358. listTotal: 0, // 列表总数
  359. dataList: [],
  360. screenForm: {
  361. mainId: '',
  362. endDate: '',
  363. materialName: '',
  364. materialNumber: '',
  365. materialOldNumber: '',
  366. saleTypeId: '',
  367. specification: '',
  368. startDate: ''
  369. },
  370. ztypeList: [],
  371. dictList: {}
  372. }
  373. },
  374. mounted() {
  375. getDictList({ sysDictEnum: 'PRODUCT_TYPE' }).then((res) => {
  376. this.dictList = res.data
  377. console.log(this.dictList)
  378. })
  379. },
  380. methods: {
  381. addFn() {
  382. this.showDialogForm = true
  383. },
  384. handleDelete(id) {
  385. this.hanleDeleteAllPromise(id).then((ids) => {
  386. getProductDelete(ids).then((res) => {
  387. this.$successMsg('删除成功')
  388. this.getList()
  389. })
  390. })
  391. },
  392. getList() {
  393. this.listLoading = true
  394. const params = {
  395. pageNum: this.currentPage,
  396. pageSize: this.pageSize,
  397. mainId: this.screenForm.mainId,
  398. endDate: this.screenForm.endDate,
  399. materialName: this.screenForm.materialName,
  400. materialNumber: this.screenForm.materialNumber,
  401. materialOldNumber: this.screenForm.materialOldNumber,
  402. saleTypeId: this.screenForm.saleTypeId,
  403. specification: this.screenForm.specification,
  404. startDate: this.screenForm.startDate
  405. }
  406. getProductPriceList(params).then((res) => {
  407. this.dataList = res.data.records
  408. console.log(res.data.records)
  409. this.listTotal = res.data.total
  410. this.listLoading = false
  411. })
  412. getTypeList(params).then((res) => {
  413. this.ztypeList = res.data.records
  414. // console.log(this.ztypeList, "type1111");
  415. })
  416. },
  417. handleRevoke(id) {
  418. handlePriceRevoke({ id }).then((res) => {
  419. this.$successMsg('操作成功')
  420. this.getList()
  421. })
  422. }
  423. }
  424. }
  425. </script>
  426. <style lang="scss" scoped>
  427. ::v-deep .el-select--small {
  428. width: 100%;
  429. }
  430. ::v-deep .el-date-editor {
  431. width: 100%;
  432. }
  433. </style>