difference_price_list.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  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="mini"
  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="k3CategoryNumber">
  79. <el-select
  80. v-model="screenForm.k3CategoryNumber"
  81. placeholder="请选择产品类别"
  82. >
  83. <el-option label="全部" value="" />
  84. <el-option
  85. v-for="item in dictList"
  86. :label="item.name"
  87. :value="item.number"
  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="12" :lg="6">
  101. <el-form-item label="备注" prop="remark">
  102. <el-input v-model="screenForm.remark" placeholder="请输入备注" />
  103. </el-form-item>
  104. </el-col>
  105. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  106. <el-form-item label="">
  107. <el-button size="mini" @click="resetScreenForm">清空</el-button>
  108. <el-button size="mini" type="primary" @click="submitScreenForm"
  109. >搜索</el-button
  110. >
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. </el-form>
  115. </div>
  116. <!-- 按钮 -->
  117. <div class="btn-group clearfix">
  118. <div>
  119. <el-popconfirm
  120. v-if="$checkBtnRole('del', $route.meta.roles)"
  121. confirm-button-text="好的"
  122. cancel-button-text="不用了"
  123. icon="el-icon-info"
  124. icon-color="red"
  125. title="内容确定删除吗?"
  126. @onConfirm="handleDelete"
  127. >
  128. <el-button
  129. type="primary"
  130. size="mini"
  131. icon="el-icon-delete"
  132. slot="reference"
  133. class="el-popover-left"
  134. >删除</el-button
  135. >
  136. </el-popconfirm>
  137. <el-button
  138. type="primary"
  139. style="margin-left: 10px"
  140. size="mini"
  141. @click="handleRevokeAll"
  142. >批量作废</el-button
  143. >
  144. <!-- <ExportButton
  145. :exUrl="'product-upd-price/export'"
  146. :exParams="exParams"
  147. class="exp"
  148. /> -->
  149. <!-- <el-button type="primary" size="mini">打印</el-button> -->
  150. </div>
  151. <div class="fl">
  152. <!-- <el-popconfirm
  153. style="margin-right: 10px"
  154. title="批量作废吗?"
  155. @onConfirm="handleRevokeAll"
  156. >
  157. <el-button
  158. slot="reference"
  159. type="text"
  160. size="mini"
  161. >批量作废</el-button>
  162. </el-popconfirm> -->
  163. </div>
  164. </div>
  165. <div class="mymain-container">
  166. <!-- 列表 -->
  167. <div class="table">
  168. <el-table
  169. v-loading="listLoading"
  170. :data="dataList"
  171. element-loading-text="Loading"
  172. border
  173. fit
  174. :row-class-name="tableRowClassName"
  175. @select-all="hanleSelectAll"
  176. @select="hanleSelectAll"
  177. >
  178. <el-table-column
  179. type="selection"
  180. align="left"
  181. width="50"
  182. ></el-table-column>
  183. <!-- <el-table-column type="selection" align="left" />-->
  184. <!-- <el-table-column
  185. align="left"
  186. label="产品类别"
  187. prop="mainName"
  188. min-width="160"
  189. show-overflow-tooltip
  190. ></el-table-column> -->
  191. <el-table-column
  192. align="left"
  193. label="物料编码"
  194. prop="materialNumber"
  195. min-width="200"
  196. show-overflow-tooltip
  197. >
  198. <template slot-scope="scope">
  199. <CopyButton :copyText="scope.row.materialNumber" />
  200. <span>{{ scope.row.materialNumber }}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column
  204. align="left"
  205. label="产品编码"
  206. prop="materialOldNumber"
  207. min-width="200"
  208. show-overflow-tooltip
  209. >
  210. <template slot-scope="scope">
  211. <CopyButton :copyText="scope.row.materialOldNumber" />
  212. <span>{{ scope.row.materialOldNumber }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column
  216. align="left"
  217. label="产品名称"
  218. prop="materialName"
  219. min-width="200"
  220. show-overflow-tooltip
  221. >
  222. <template slot-scope="scope">
  223. <CopyButton :copyText="scope.row.materialName" />
  224. <span>{{ scope.row.materialName }}</span>
  225. </template>
  226. </el-table-column>
  227. <el-table-column
  228. align="left"
  229. label="规格型号"
  230. prop="specification"
  231. min-width="200"
  232. show-overflow-tooltip
  233. >
  234. <template slot-scope="scope">
  235. <CopyButton :copyText="scope.row.specification" />
  236. <span>{{ scope.row.specification }}</span>
  237. </template>
  238. </el-table-column>
  239. <el-table-column
  240. align="left"
  241. label="销售类型"
  242. prop="saleTypeName"
  243. min-width="160"
  244. show-overflow-tooltip
  245. />
  246. <el-table-column
  247. align="left"
  248. label="单位"
  249. prop="unit"
  250. min-width="160"
  251. show-overflow-tooltip
  252. />
  253. <!-- <el-table-column
  254. align="left"
  255. label="数量下限"
  256. prop="qty"
  257. min-width="160"
  258. show-overflow-tooltip
  259. />
  260. <el-table-column
  261. align="left"
  262. label="返利类型(钱包)"
  263. prop="wallets"
  264. min-width="200"
  265. show-overflow-tooltip
  266. >
  267. <template slot-scope="scope">
  268. <template v-for="(item, index) in scope.row.wallets">
  269. <template v-if="item.type === 'REBATE'">
  270. <el-tag
  271. :key="index"
  272. type="success"
  273. style="margin: 0 10px"
  274. size="mini"
  275. >
  276. {{ item.walletName }}
  277. </el-tag>
  278. </template>
  279. </template>
  280. </template>
  281. </el-table-column>
  282. <el-table-column
  283. align="left"
  284. label="现金钱包"
  285. prop="modifyPriceDepartment"
  286. min-width="200"
  287. show-overflow-tooltip
  288. >
  289. <template slot-scope="scope">
  290. <template v-for="(item, index) in scope.row.wallets">
  291. <template v-if="item.type === 'COMMONLY'">
  292. <el-tag
  293. :key="index"
  294. type="success"
  295. style="margin: 0 10px"
  296. size="mini"
  297. >
  298. {{ item.walletName }}
  299. </el-tag>
  300. </template>
  301. </template>
  302. </template>
  303. </el-table-column> -->
  304. <el-table-column
  305. align="left"
  306. label="生效日期"
  307. prop="startDate"
  308. min-width="160"
  309. show-overflow-tooltip
  310. />
  311. <el-table-column
  312. align="left"
  313. label="失效日期"
  314. prop="endDate"
  315. min-width="160"
  316. show-overflow-tooltip
  317. />
  318. <!-- <el-table-column
  319. align="left"
  320. label="是否销价"
  321. prop="isPromote"
  322. min-width="160"
  323. show-overflow-tooltip
  324. >
  325. <template slot-scope="scope">
  326. <el-tag size="mini" v-if="scope.row.isPromote" type="success"
  327. >是</el-tag
  328. >
  329. <el-tag size="mini" v-else type="danger">否</el-tag>
  330. </template>
  331. </el-table-column> -->
  332. <el-table-column
  333. align="left"
  334. label="是否作废"
  335. prop="isRevoke"
  336. min-width="160"
  337. show-overflow-tooltip
  338. >
  339. <template slot-scope="scope">
  340. <el-tag size="mini" v-if="scope.row.isRevoke" type="success"
  341. >是</el-tag
  342. >
  343. <el-tag size="mini" v-else type="danger">否</el-tag>
  344. </template>
  345. </el-table-column>
  346. <el-table-column
  347. align="right"
  348. label="单价"
  349. prop="batchPrice"
  350. min-width="160"
  351. show-overflow-tooltip
  352. />
  353. <!-- <el-table-column
  354. align="right"
  355. label="格力折扣"
  356. prop="discAmount"
  357. min-width="160"
  358. show-overflow-tooltip
  359. /> -->
  360. <el-table-column
  361. align="left"
  362. label="备注"
  363. prop="remark"
  364. min-width="160"
  365. show-overflow-tooltip
  366. />
  367. <el-table-column fixed="left" width="150" label="操作" align="center">
  368. <template slot-scope="scope">
  369. <el-popconfirm
  370. v-if="!scope.row.isRevoke"
  371. style="margin-right: 10px"
  372. title="作废吗?"
  373. @onConfirm="handleRevoke(scope.row.id)"
  374. >
  375. <el-button slot="reference" type="text" size="mini"
  376. >作废</el-button
  377. >
  378. </el-popconfirm>
  379. <el-button
  380. v-if="$checkBtnRole('del', $route.meta.roles)"
  381. type="text"
  382. size="mini"
  383. @click="handleDelete(scope.row.id)"
  384. >删除</el-button
  385. >
  386. </template>
  387. </el-table-column>
  388. </el-table>
  389. </div>
  390. <!-- 分页 -->
  391. <div class="fr">
  392. <el-pagination
  393. :current-page="currentPage"
  394. :page-sizes="[10, 20, 30, 50]"
  395. :page-size="10"
  396. layout="total, sizes, prev, pager, next, jumper"
  397. :total="listTotal"
  398. @size-change="handleSizeChange"
  399. @current-change="handleCurrentChange"
  400. />
  401. </div>
  402. </div>
  403. </div>
  404. </template>
  405. <script>
  406. import Mixin from "@/mixin/index";
  407. import {
  408. getProductDelete,
  409. getProductPriceList,
  410. getTypeList,
  411. handlePriceRevoke,
  412. } from "@/api/basic_data/material";
  413. import { getCategoryList } from "@/api/common";
  414. import ExportButton from "@/components/Common/export-button.vue";
  415. export default {
  416. mixins: [Mixin],
  417. data() {
  418. return {
  419. currentPage: 1,
  420. pageSize: 10,
  421. listTotal: 0,
  422. dataList: [],
  423. screenForm: {
  424. k3CategoryNumber: "",
  425. endDate: "",
  426. materialName: "",
  427. materialNumber: "",
  428. materialOldNumber: "",
  429. saleTypeId: "",
  430. specification: "",
  431. startDate: "",
  432. remark: "",
  433. },
  434. ztypeList: [],
  435. dictList: {},
  436. };
  437. },
  438. computed: {
  439. exParams() {
  440. return {
  441. k3CategoryNumber: this.screenForm.k3CategoryNumber,
  442. endDate: this.screenForm.endDate,
  443. materialName: this.screenForm.materialName,
  444. materialNumber: this.screenForm.materialNumber,
  445. materialOldNumber: this.screenForm.materialOldNumber,
  446. saleTypeId: this.screenForm.saleTypeId,
  447. specification: this.screenForm.specification,
  448. startDate: this.screenForm.startDate,
  449. remark: this.screenForm.remark,
  450. billType: "DIFF",
  451. };
  452. },
  453. },
  454. mounted() {
  455. getCategoryList({ pageNum: 1, pageSize: -1 }).then((res) => {
  456. this.dictList = res.data.records;
  457. console.log(this.dictList, 777777);
  458. });
  459. },
  460. methods: {
  461. addFn() {
  462. this.showDialogForm = true;
  463. },
  464. handleDelete(id) {
  465. this.hanleDeleteAllPromise(id).then((ids) => {
  466. getProductDelete(ids).then((res) => {
  467. this.$successMsg("删除成功");
  468. this.getList();
  469. });
  470. });
  471. },
  472. getList() {
  473. this.listLoading = true;
  474. const params = {
  475. pageNum: this.currentPage,
  476. pageSize: this.pageSize,
  477. k3CategoryNumber: this.screenForm.k3CategoryNumber,
  478. endDate: this.screenForm.endDate,
  479. materialName: this.screenForm.materialName,
  480. materialNumber: this.screenForm.materialNumber,
  481. materialOldNumber: this.screenForm.materialOldNumber,
  482. saleTypeId: this.screenForm.saleTypeId,
  483. specification: this.screenForm.specification,
  484. startDate: this.screenForm.startDate,
  485. remark: this.screenForm.remark,
  486. billType: "DIFF",
  487. };
  488. getProductPriceList(params).then((res) => {
  489. this.dataList = res.data.records;
  490. console.log(res.data.records);
  491. this.listTotal = res.data.total;
  492. this.listLoading = false;
  493. });
  494. getTypeList({ ...params, pageNum: 1, pageSize: -1 }).then((res) => {
  495. this.ztypeList = res.data.records;
  496. // console.log(this.ztypeList, "type1111");
  497. });
  498. },
  499. handleRevoke(id) {
  500. handlePriceRevoke({ ids: id }).then((res) => {
  501. this.$successMsg("操作成功");
  502. this.getList();
  503. });
  504. },
  505. handleRevokeAll() {
  506. handlePriceRevoke({ ids: this.ids.join("") }).then((res) => {
  507. this.$successMsg("操作成功");
  508. this.getList();
  509. });
  510. },
  511. tableRowClassName({ row, rowIndex }) {
  512. // || row.examineStatus=='FAIL'
  513. if (this.ids.includes(row.id)) {
  514. return "warning-row";
  515. }
  516. return "";
  517. },
  518. },
  519. components: { ExportButton },
  520. };
  521. </script>
  522. <style lang="scss" scoped>
  523. ::v-deep .el-table .warning-row {
  524. background: oldlace;
  525. }
  526. ::v-deep .el-select--small {
  527. width: 100%;
  528. }
  529. ::v-deep .el-date-editor {
  530. width: 100%;
  531. }
  532. .exp {
  533. display: inline-block;
  534. margin-left: 10px;
  535. }
  536. </style>