modify_list.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <div class="app-container">
  3. <div v-if="show === 1">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <el-form ref="screenForm"
  7. :model="screenForm"
  8. label-width="70px"
  9. size="small"
  10. label-position="left">
  11. <el-row :gutter="20">
  12. <el-col :xs="24" :sm="12" :lg="6">
  13. <el-form-item label="存货编码" prop="materialNumber">
  14. <el-input placeholder="请输入存货编码" v-model="screenForm.materialNumber"></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :xs="24" :sm="12" :lg="6">
  18. <el-form-item label="存货名称" prop="materialName">
  19. <el-input placeholder="请输入存货名称" v-model="screenForm.materialName"></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="存货代码" prop="account">
  24. <el-input placeholder="请输入存货代码" v-model="screenForm.account"></el-input>
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="生效日期" prop="startDate">
  29. <el-input placeholder="请输入生效日期" v-model="screenForm.startDate"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  33. <el-form-item label="">
  34. <el-button size="small" @click="resetScreenForm"
  35. >清空</el-button
  36. >
  37. <el-button size="small" type="primary" @click="submitScreenForm"
  38. >搜索</el-button
  39. >
  40. </el-form-item>
  41. </el-col>
  42. </el-row>
  43. </el-form>
  44. </div>
  45. <!-- 按钮 -->
  46. <div class="btn-group clearfix">
  47. <div class="fl">
  48. <el-button type="primary" size="small" @click="addFn">新增</el-button>
  49. <el-button type="primary" size="small">编辑</el-button>
  50. <el-button type="primary" size="small">删除</el-button>
  51. </div>
  52. <div class="fr">
  53. <el-button type="primary" size="small">导入</el-button>
  54. <el-button type="primary" size="small">导出</el-button>
  55. <el-button type="primary" size="small">打印</el-button>
  56. </div>
  57. </div>
  58. <div class="mymain-container">
  59. <!-- 列表 -->
  60. <div class="table">
  61. <el-table
  62. v-loading="listLoading"
  63. :data="dataList"
  64. element-loading-text="Loading"
  65. border
  66. fit
  67. highlight-current-row
  68. stripe
  69. >
  70. <el-table-column type="selection" align="center"></el-table-column>
  71. <el-table-column
  72. align="center"
  73. label="单据号"
  74. prop="billId"
  75. min-width="160"
  76. show-overflow-tooltip
  77. ></el-table-column>
  78. <el-table-column
  79. align="center"
  80. label="调价日期"
  81. prop="modifyPriceDate"
  82. min-width="160"
  83. show-overflow-tooltip
  84. ></el-table-column>
  85. <el-table-column
  86. align="center"
  87. label="销售类型"
  88. prop="saleTypeId"
  89. min-width="160"
  90. show-overflow-tooltip
  91. ></el-table-column>
  92. <el-table-column
  93. align="center"
  94. label="产品品类"
  95. prop="productCategory"
  96. min-width="160"
  97. show-overflow-tooltip
  98. ></el-table-column>
  99. <el-table-column
  100. align="center"
  101. label="存货编码"
  102. prop="billId"
  103. min-width="160"
  104. show-overflow-tooltip
  105. ></el-table-column>
  106. <el-table-column
  107. align="center"
  108. label="存货名称"
  109. prop="materialName"
  110. min-width="160"
  111. show-overflow-tooltip
  112. ></el-table-column>
  113. <el-table-column
  114. align="center"
  115. label="规格型号"
  116. prop="specs"
  117. min-width="160"
  118. show-overflow-tooltip
  119. ></el-table-column>
  120. <el-table-column
  121. align="center"
  122. label="计量单位"
  123. prop="company"
  124. min-width="160"
  125. show-overflow-tooltip
  126. ></el-table-column>
  127. <el-table-column
  128. align="center"
  129. label="数量"
  130. prop="qty"
  131. min-width="160"
  132. show-overflow-tooltip
  133. ></el-table-column>
  134. <el-table-column
  135. align="center"
  136. label="批发价"
  137. prop="batchPrice"
  138. min-width="160"
  139. show-overflow-tooltip
  140. ></el-table-column>
  141. <el-table-column
  142. align="center"
  143. label="零售价"
  144. prop="retailPrice"
  145. min-width="160"
  146. show-overflow-tooltip
  147. ></el-table-column>
  148. <el-table-column
  149. align="center"
  150. label="生效日期"
  151. prop="startDate"
  152. min-width="160"
  153. show-overflow-tooltip
  154. ></el-table-column>
  155. <el-table-column
  156. align="center"
  157. label="失效日期"
  158. prop="endDate"
  159. min-width="160"
  160. show-overflow-tooltip
  161. ></el-table-column>
  162. <el-table-column
  163. align="center"
  164. label="是否促销价"
  165. prop="isPromote"
  166. min-width="160"
  167. show-overflow-tooltip
  168. >
  169. <template slot-scope="scope">
  170. <el-tag type="success" v-if="scope.row.isPromote">是</el-tag>
  171. <el-tag type="danger" v-else>否</el-tag>
  172. </template>
  173. </el-table-column>
  174. <el-table-column
  175. align="center"
  176. label="调价部门"
  177. prop="modifyPriceDepartment"
  178. min-width="160"
  179. show-overflow-tooltip
  180. ></el-table-column>
  181. <el-table-column
  182. align="center"
  183. label="调价业务员"
  184. prop="operatorName"
  185. min-width="160"
  186. show-overflow-tooltip
  187. ></el-table-column>
  188. <el-table-column
  189. align="center"
  190. label="制单日期"
  191. prop="preparationDate"
  192. min-width="160"
  193. show-overflow-tooltip
  194. ></el-table-column>
  195. <el-table-column
  196. align="center"
  197. label="审核人"
  198. prop="confirmBy"
  199. min-width="160"
  200. show-overflow-tooltip
  201. ></el-table-column>
  202. <el-table-column
  203. align="center"
  204. label="审核日期"
  205. prop="confirmTime"
  206. min-width="160"
  207. show-overflow-tooltip
  208. ></el-table-column>
  209. <el-table-column
  210. align="center"
  211. label="状态"
  212. prop="billFlag"
  213. min-width="160"
  214. show-overflow-tooltip
  215. >
  216. <template slot-scope="scope">
  217. <el-tag type="success" v-if="scope.row.billFlag =='A'">保存</el-tag>
  218. <el-tag type="danger" v-else-if="scope.row.billFlag =='B'">提交</el-tag>
  219. <el-tag type="danger" v-else>审核</el-tag>
  220. </template>
  221. </el-table-column>
  222. <el-table-column
  223. align="center"
  224. label="操作"
  225. min-width="160"
  226. show-overflow-tooltip
  227. >
  228. <template slot-scope="scope">
  229. <el-button type="text" class="textColor" @click="approvalFn(scope.row.id)"
  230. >审批</el-button
  231. >
  232. <el-button type="text" class="textColor" @click="detailFn(scope.row.id)"
  233. >详情</el-button
  234. >
  235. </template>
  236. </el-table-column>
  237. </el-table>
  238. </div>
  239. <!-- 分页 -->
  240. <div class="fr">
  241. <el-pagination
  242. @size-change="handleSizeChange"
  243. @current-change="handleCurrentChange"
  244. :current-page="currentPage"
  245. :page-sizes="[10, 20, 30, 50]"
  246. :page-size="10"
  247. layout="total, sizes, prev, pager, next, jumper"
  248. :total="listTotal"
  249. >
  250. </el-pagination>
  251. </div>
  252. </div>
  253. </div>
  254. <ModifyListApply v-else-if="show === 2" />
  255. <ModifyListApproval v-else-if="show === 3" :detail="detail"/>
  256. <ModifyListDetail v-else :detail="detail" />
  257. </div>
  258. </template>
  259. <script>
  260. import ModifyListApply from "./components/modify_list-apply.vue";
  261. import ModifyListApproval from "./components/modify_list-approval.vue";
  262. import ModifyListDetail from "./components/modify_list-detail.vue";
  263. import Mixin from "@/mixin/index";
  264. import {
  265. getProductRriceAdd,getProductRriceConfirm,getProductRriceDetail,
  266. getProductRriceEdit,getProductRriceList,getProductRriceRevoke,
  267. getProductRriceSubmit
  268. } from "@/api/basic_data/material";
  269. import { downloadFiles } from "@/utils/util";
  270. export default {
  271. mixins: [Mixin],
  272. data() {
  273. return {
  274. show: 3,
  275. currentPage: 1, // 当前页码
  276. pageSize: 10, // 每页数量
  277. listTotal: 0, // 列表总数
  278. dataList: [
  279. {
  280. billNnmber: "00000000121213",
  281. modifyPriceDate: "2022-03-10",
  282. saleType: "*一票机*",
  283. productCategory: "家用空调",
  284. code: "2022051775",
  285. name: "夏之凉变频1",
  286. specs: "KFR-26GW/",
  287. company: "套",
  288. number: "500",
  289. wholesale: "2899",
  290. retailPrice: "2999",
  291. effectiveDate: "2022-05-30",
  292. expiryDate: "2022-06-30",
  293. promotion: "是",
  294. modifyPriceDepartment: "销售部",
  295. modifyPriceSalesman: "张三",
  296. preparationDate: "2022-05-18",
  297. examineUser: "admin",
  298. examineDate: "2022-05-18",
  299. state: "已通过",
  300. },
  301. {
  302. billNnmber: "00000000121213",
  303. modifyPriceDate: "2022-03-10",
  304. saleType: "*一票机*",
  305. productCategory: "家用空调",
  306. code: "2022051775",
  307. name: "夏之凉变频1",
  308. specs: "KFR-26GW/",
  309. company: "套",
  310. number: "500",
  311. wholesale: "2899",
  312. retailPrice: "2999",
  313. effectiveDate: "2022-05-30",
  314. expiryDate: "2022-06-30",
  315. promotion: "是",
  316. modifyPriceDepartment: "销售部",
  317. modifyPriceSalesman: "张三",
  318. preparationDate: "2022-05-18",
  319. examineUser: "admin",
  320. examineDate: "2022-05-18",
  321. state: "已通过",
  322. },
  323. {
  324. billNnmber: "00000000121213",
  325. modifyPriceDate: "2022-03-10",
  326. saleType: "*一票机*",
  327. productCategory: "家用空调",
  328. code: "2022051775",
  329. name: "夏之凉变频1",
  330. specs: "KFR-26GW/",
  331. company: "套",
  332. number: "500",
  333. wholesale: "2899",
  334. retailPrice: "2999",
  335. effectiveDate: "2022-05-30",
  336. expiryDate: "2022-06-30",
  337. promotion: "是",
  338. modifyPriceDepartment: "销售部",
  339. modifyPriceSalesman: "张三",
  340. preparationDate: "2022-05-18",
  341. examineUser: "admin",
  342. examineDate: "2022-05-18",
  343. state: "已通过",
  344. },
  345. {
  346. billNnmber: "00000000121213",
  347. modifyPriceDate: "2022-03-10",
  348. saleType: "*一票机*",
  349. productCategory: "家用空调",
  350. code: "2022051775",
  351. name: "夏之凉变频1",
  352. specs: "KFR-26GW/",
  353. company: "套",
  354. number: "500",
  355. wholesale: "2899",
  356. retailPrice: "2999",
  357. effectiveDate: "2022-05-30",
  358. expiryDate: "2022-06-30",
  359. promotion: "是",
  360. modifyPriceDepartment: "销售部",
  361. modifyPriceSalesman: "张三",
  362. preparationDate: "2022-05-18",
  363. examineUser: "admin",
  364. examineDate: "2022-05-18",
  365. state: "已通过",
  366. },
  367. ],
  368. searchForm: {
  369. materialName: "",
  370. materialNumber: "",
  371. startDate: "",
  372. },
  373. detail:{}
  374. };
  375. },
  376. components: {
  377. ModifyListApply,
  378. ModifyListApproval,
  379. ModifyListDetail,
  380. },
  381. methods: {
  382. addFn() {
  383. this.show = 2;
  384. },
  385. approvalFn() {
  386. getProductRriceDetail({id}).then(res=>{
  387. this.detail = res.data
  388. this.show = 3;
  389. })
  390. },
  391. detailFn(id) {
  392. getProductRriceDetail({id}).then(res=>{
  393. this.detail = res.data
  394. this.show = 4;
  395. })
  396. },
  397. getList() {
  398. this.listLoading = true;
  399. let params = {
  400. pageNum: this.currentPage,
  401. pageSize: this.pageSize,
  402. materialName: this.searchForm.materialName,
  403. materialNumber: this.searchForm.materialNumber,
  404. startDate: this.searchForm.startDate,
  405. };
  406. getProductRriceList(params).then((res) => {
  407. this.dataList = res.data.records;
  408. this.listTotal = res.data.total;
  409. this.listLoading = false;
  410. });
  411. },
  412. editFn(id, row) {
  413. this.diaLogForm = {
  414. id,
  415. composeNumber: row.composeNumber,
  416. items: row.items === undefined ? [] : row.items,
  417. materialId: row.materialId,
  418. orgNumber: row.orgNumber,
  419. productModel: row.productModel,
  420. productVolume: row.productVolume,
  421. };
  422. this.showDialogForm = true;
  423. },
  424. hanleInfo() {
  425. if (this.type === 1) {
  426. getProductAdd(this.diaLogForm).then((res) => {
  427. this.$successMsg("保存成功");
  428. console.log(params, 123);
  429. this.getList();
  430. });
  431. } else if (this.type === 2) {
  432. const params = {
  433. ...this.diaLogForm,
  434. };
  435. console.log(params, 123);
  436. getProductEdit(params).then((res) => {
  437. this.$successMsg("编辑成功");
  438. this.getList();
  439. });
  440. this.diaLogForm.id = null;
  441. }
  442. this.showDialogForm = false;
  443. },
  444. hanleDelete(id) {
  445. this.hanleDeleteAllPromise(id).then((ids) => {
  446. getProductDel(ids).then((res) => {
  447. this.$successMsg("删除成功");
  448. });
  449. });
  450. },
  451. handleExport() {
  452. let screenData = {
  453. customerName: this.screenForm.customerName,
  454. freeDay: this.screenForm.freeDay,
  455. toll: this.screenForm.toll,
  456. };
  457. downloadFiles("/product-compose/export", screenData);
  458. },
  459. resetInfo() {
  460. this.diaLogForm = {
  461. id: null,
  462. composeNumber: "",
  463. id: "",
  464. items: [],
  465. materialId: "",
  466. orgNumber: 0,
  467. productModel: "",
  468. productVolume: "",
  469. };
  470. },
  471. },
  472. };
  473. </script>
  474. <style lang="scss" scoped>
  475. ::v-deep .el-select--small {
  476. width: 100%;
  477. }
  478. </style>