price_list.vue 11 KB

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