index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. <template>
  2. <div class="app-container">
  3. <el-card class="filter-container" shadow="never">
  4. <div>
  5. <i class="el-icon-search"></i>
  6. <span>筛选搜索</span>
  7. <el-button
  8. style="float: right"
  9. @click="handleSearchList()"
  10. type="primary"
  11. size="small"
  12. >
  13. 查询结果
  14. </el-button>
  15. <el-button
  16. style="float: right; margin-right: 15px"
  17. @click="handleResetSearch()"
  18. size="small"
  19. >
  20. 重置
  21. </el-button>
  22. </div>
  23. <div style="margin-top: 15px">
  24. <el-form
  25. :inline="true"
  26. :model="listQuery"
  27. size="small"
  28. label-width="140px"
  29. >
  30. <el-form-item label="输入搜索:">
  31. <el-input
  32. style="width: 203px"
  33. v-model="listQuery.keyword"
  34. placeholder="商品名称"
  35. ></el-input>
  36. </el-form-item>
  37. <el-form-item label="商品货号:">
  38. <el-input
  39. style="width: 203px"
  40. v-model="listQuery.productSn"
  41. placeholder="商品货号"
  42. ></el-input>
  43. </el-form-item>
  44. <el-form-item label="商品分类:">
  45. <el-cascader
  46. clearable
  47. v-model="selectProductCateValue"
  48. :options="productCateOptions"
  49. >
  50. </el-cascader>
  51. </el-form-item>
  52. <el-form-item label="商品品牌:">
  53. <el-select
  54. v-model="listQuery.brandId"
  55. placeholder="请选择品牌"
  56. clearable
  57. >
  58. <el-option
  59. v-for="item in brandOptions"
  60. :key="item.value"
  61. :label="item.label"
  62. :value="item.value"
  63. >
  64. </el-option>
  65. </el-select>
  66. </el-form-item>
  67. <el-form-item label="上架状态:">
  68. <el-select
  69. v-model="listQuery.publishStatus"
  70. placeholder="全部"
  71. clearable
  72. >
  73. <el-option
  74. v-for="item in publishStatusOptions"
  75. :key="item.value"
  76. :label="item.label"
  77. :value="item.value"
  78. >
  79. </el-option>
  80. </el-select>
  81. </el-form-item>
  82. <el-form-item label="是否缺货">
  83. <el-select
  84. v-model="listQuery.stock"
  85. placeholder="是否缺货"
  86. clearable
  87. style="width:203px"
  88. >
  89. <el-option
  90. v-for="item in stockOptions"
  91. :key="item.value"
  92. :label="item.label"
  93. :value="item.value"
  94. >
  95. </el-option>
  96. </el-select>
  97. </el-form-item>
  98. </el-form>
  99. </div>
  100. </el-card>
  101. <el-card class="operate-container" shadow="never">
  102. <i class="el-icon-tickets"></i>
  103. <span>数据列表</span>
  104. <div class="btn-add">
  105. <el-button @click="handleAddProduct()" size="mini">
  106. 添加
  107. </el-button>
  108. <el-button type="primary" @click="handleDownloadStock()" size="mini">
  109. 导出库存
  110. </el-button>
  111. <el-button type="primary" @click="handleDownloadProductStock()" size="mini">
  112. 导出进货清单
  113. </el-button>
  114. </div>
  115. </el-card>
  116. <div class="table-container">
  117. <el-table
  118. ref="productTable"
  119. :data="list"
  120. style="width: 100%"
  121. @selection-change="handleSelectionChange"
  122. v-loading="listLoading"
  123. border
  124. >
  125. <el-table-column
  126. type="selection"
  127. width="60"
  128. align="center"
  129. ></el-table-column>
  130. <el-table-column label="编号" width="100" align="center">
  131. <template slot-scope="scope">{{ scope.row.id }}</template>
  132. </el-table-column>
  133. <el-table-column label="商品图片" width="120" align="center">
  134. <template slot-scope="scope"
  135. ><img style="height: 80px" :src="scope.row.pic"
  136. /></template>
  137. </el-table-column>
  138. <el-table-column label="商品名称" align="center">
  139. <template slot-scope="scope">
  140. <p>{{ scope.row.name }}</p>
  141. <p>品牌:{{ scope.row.brandName }}</p>
  142. <p>类型:{{ scope.row.productType | goodsTypeFilter }}</p>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="价格/货号" width="120" align="center">
  146. <template slot-scope="scope">
  147. <p>价格:¥{{ scope.row.price }}</p>
  148. <p>货号:{{ scope.row.productSn }}</p>
  149. </template>
  150. </el-table-column>
  151. <el-table-column label="标签" width="140" align="center">
  152. <template slot-scope="scope">
  153. <p>
  154. 上架:
  155. <el-switch
  156. @change="handlePublishStatusChange(scope.$index, scope.row)"
  157. :active-value="1"
  158. :inactive-value="0"
  159. v-model="scope.row.publishStatus"
  160. >
  161. </el-switch>
  162. </p>
  163. <!-- <p>
  164. 新品:
  165. <el-switch
  166. @change="handleNewStatusChange(scope.$index, scope.row)"
  167. :active-value="1"
  168. :inactive-value="0"
  169. v-model="scope.row.newStatus"
  170. >
  171. </el-switch>
  172. </p> -->
  173. <p>
  174. 推荐:
  175. <el-switch
  176. @change="handleRecommendStatusChange(scope.$index, scope.row)"
  177. :active-value="1"
  178. :inactive-value="0"
  179. v-model="scope.row.recommandStatus"
  180. >
  181. </el-switch>
  182. </p>
  183. </template>
  184. </el-table-column>
  185. <el-table-column label="排序" width="100" align="center">
  186. <template slot-scope="scope">{{ scope.row.sort }}</template>
  187. </el-table-column>
  188. <el-table-column label="SKU库存" width="100" align="center">
  189. <template slot-scope="scope">
  190. <el-button
  191. type="primary"
  192. icon="el-icon-edit"
  193. @click="handleShowSkuEditDialog(scope.$index, scope.row)"
  194. circle
  195. ></el-button>
  196. </template>
  197. </el-table-column>
  198. <el-table-column label="销量" width="100" align="center">
  199. <template slot-scope="scope">{{ scope.row.sale }}</template>
  200. </el-table-column>
  201. <!-- <el-table-column label="审核状态" width="100" align="center">
  202. <template slot-scope="scope">
  203. <p>{{scope.row.verifyStatus | verifyStatusFilter}}</p>
  204. <p>
  205. <el-button
  206. type="text"
  207. @click="handleShowVerifyDetail(scope.$index, scope.row)">审核详情
  208. </el-button>
  209. </p>
  210. </template>
  211. </el-table-column> -->
  212. <el-table-column label="操作" width="220" align="center">
  213. <template slot-scope="scope">
  214. <p class="table-btn-group">
  215. <el-button
  216. size="mini"
  217. @click="handleShowProduct(scope.$index, scope.row)"
  218. >查看
  219. </el-button>
  220. <el-button
  221. size="mini"
  222. @click="handleUpdateProduct(scope.$index, scope.row)"
  223. >编辑
  224. </el-button>
  225. <el-button
  226. size="mini"
  227. type="danger"
  228. @click="handleDelete(scope.$index, scope.row)"
  229. >删除
  230. </el-button>
  231. <el-button
  232. size="mini"
  233. @click="handleShowPurchase(scope.row)">进货清单
  234. </el-button>
  235. </p>
  236. <p>
  237. <!-- <el-button
  238. size="mini"
  239. @click="handleShowLog(scope.$index, scope.row)">日志
  240. </el-button> -->
  241. </p>
  242. </template>
  243. </el-table-column>
  244. </el-table>
  245. </div>
  246. <!-- <div class="batch-operate-container">
  247. <el-select size="small" v-model="operateType" placeholder="批量操作">
  248. <el-option
  249. v-for="item in operates"
  250. :key="item.value"
  251. :label="item.label"
  252. :value="item.value"
  253. >
  254. </el-option>
  255. </el-select>
  256. <el-button
  257. style="margin-left: 20px"
  258. class="search-button"
  259. @click="handleBatchOperate()"
  260. type="primary"
  261. size="small"
  262. >
  263. 确定
  264. </el-button>
  265. </div> -->
  266. <div class="pagination-container">
  267. <el-pagination
  268. background
  269. @size-change="handleSizeChange"
  270. @current-change="handleCurrentChange"
  271. layout="total, sizes,prev, pager, next,jumper"
  272. :page-size="listQuery.pageSize"
  273. :page-sizes="[5, 10, 15]"
  274. :current-page.sync="listQuery.pageNum"
  275. :total="total"
  276. >
  277. </el-pagination>
  278. </div>
  279. <el-dialog
  280. title="编辑货品信息"
  281. :visible.sync="editSkuInfo.dialogVisible"
  282. width="60%"
  283. >
  284. <span>商品货号:</span>
  285. <span>{{ editSkuInfo.productSn }}</span>
  286. <el-input
  287. placeholder="按sku编号搜索"
  288. v-model="editSkuInfo.keyword"
  289. size="small"
  290. style="width: 50%; margin-left: 20px"
  291. >
  292. <el-button
  293. slot="append"
  294. icon="el-icon-search"
  295. @click="handleSearchEditSku"
  296. ></el-button>
  297. </el-input>
  298. <el-table
  299. style="width: 100%; margin-top: 20px"
  300. :data="editSkuInfo.stockList"
  301. border
  302. >
  303. <el-table-column label="SKU编号" align="center">
  304. <template slot-scope="scope">
  305. <el-input v-model="scope.row.skuCode"></el-input>
  306. <!-- {{ scope.row.skuCode }} -->
  307. </template>
  308. </el-table-column>
  309. <el-table-column
  310. v-for="(item, index) in editSkuInfo.productAttr"
  311. :label="item.name"
  312. :key="item.id"
  313. align="center"
  314. >
  315. <template slot-scope="scope">
  316. {{ getProductSkuSp(scope.row, index) }}
  317. </template>
  318. </el-table-column>
  319. <el-table-column label="销售价格" align="center">
  320. <template slot-scope="scope">
  321. <!-- <el-input v-model="scope.row.price"></el-input> -->
  322. <el-input-number :controls="false" class="number-input" v-model="scope.row.price" :min="0.01" :max="999999" :precision="2"
  323. type="number"></el-input-number>
  324. </template>
  325. </el-table-column>
  326. <el-table-column label="内部库存" align="center">
  327. <template slot-scope="scope">
  328. {{ scope.row.internalStock }}
  329. </template>
  330. </el-table-column>
  331. <el-table-column label="税务库存" align="center">
  332. <template slot-scope="scope">
  333. {{scope.row.taxStock}}
  334. </template>
  335. </el-table-column>
  336. <el-table-column label="库存预警值" width="100" align="center">
  337. <template slot-scope="scope">
  338. <!-- <el-input v-model="scope.row.lowStock"></el-input> -->
  339. <el-input-number :controls="false" class="number-input" v-model="scope.row.lowStock" :min="0" :max="999999" :precision="0"
  340. type="number"></el-input-number>
  341. </template>
  342. </el-table-column>
  343. </el-table>
  344. <span slot="footer" class="dialog-footer">
  345. <el-button @click="editSkuInfo.dialogVisible = false">取 消</el-button>
  346. <el-button type="primary" @click="handleEditSkuConfirm"
  347. >确 定</el-button
  348. >
  349. </span>
  350. </el-dialog>
  351. </div>
  352. </template>
  353. <script>
  354. import {goodsType} from './components/ProductInfoDetail.vue'
  355. import {
  356. fetchList,
  357. updateDeleteStatus,
  358. updateNewStatus,
  359. updateRecommendStatus,
  360. updatePublishStatus,
  361. } from "@/api/product";
  362. import {
  363. fetchList as fetchSkuStockList,
  364. update as updateSkuStockList,
  365. } from "@/api/skuStock";
  366. import { fetchList as fetchProductAttrList } from "@/api/productAttr";
  367. import { fetchList as fetchBrandList } from "@/api/brand";
  368. import { fetchListWithChildren } from "@/api/productCate";
  369. import { Export } from "@/utils/downLoadFile";
  370. const defaultListQuery = {
  371. keyword: null,
  372. pageNum: 1,
  373. pageSize: 5,
  374. publishStatus: null,
  375. verifyStatus: null,
  376. productSn: null,
  377. productCategoryId: null,
  378. brandId: null,
  379. stock:null
  380. };
  381. export default {
  382. name: "productList",
  383. data() {
  384. return {
  385. editSkuInfo: {
  386. dialogVisible: false,
  387. productId: null,
  388. productSn: "",
  389. productAttributeCategoryId: null,
  390. stockList: [],
  391. productAttr: [],
  392. keyword: null,
  393. },
  394. operates: [
  395. {
  396. label: "商品上架",
  397. value: "publishOn",
  398. },
  399. {
  400. label: "商品下架",
  401. value: "publishOff",
  402. },
  403. {
  404. label: "设为推荐",
  405. value: "recommendOn",
  406. },
  407. {
  408. label: "取消推荐",
  409. value: "recommendOff",
  410. },
  411. {
  412. label: "设为新品",
  413. value: "newOn",
  414. },
  415. {
  416. label: "取消新品",
  417. value: "newOff",
  418. },
  419. {
  420. label: "转移到分类",
  421. value: "transferCategory",
  422. },
  423. {
  424. label: "移入回收站",
  425. value: "recycle",
  426. },
  427. ],
  428. operateType: null,
  429. listQuery: Object.assign({}, defaultListQuery),
  430. list: null,
  431. total: null,
  432. listLoading: true,
  433. selectProductCateValue: null,
  434. multipleSelection: [],
  435. productCateOptions: [],
  436. brandOptions: [],
  437. publishStatusOptions: [
  438. {
  439. value: 1,
  440. label: "上架",
  441. },
  442. {
  443. value: 0,
  444. label: "下架",
  445. },
  446. ],
  447. verifyStatusOptions: [
  448. {
  449. value: 1,
  450. label: "审核通过",
  451. },
  452. {
  453. value: 0,
  454. label: "未审核",
  455. },
  456. ],
  457. stockOptions: [
  458. {
  459. value: 1,
  460. label: "是",
  461. },
  462. {
  463. value: 0,
  464. label: "否",
  465. },
  466. ],
  467. };
  468. },
  469. created() {
  470. if (this.$route.params.stock + "") {
  471. this.listQuery.stock = this.$route.params.stock;
  472. }
  473. this.getList();
  474. this.getBrandList();
  475. this.getProductCateList();
  476. },
  477. watch: {
  478. selectProductCateValue: function (newValue) {
  479. if (newValue != null && newValue.length == 2) {
  480. this.listQuery.productCategoryId = newValue[1];
  481. } else {
  482. this.listQuery.productCategoryId = null;
  483. }
  484. },
  485. },
  486. filters: {
  487. verifyStatusFilter(value) {
  488. if (value === 1) {
  489. return "审核通过";
  490. } else {
  491. return "未审核";
  492. }
  493. },
  494. goodsTypeFilter(value) {
  495. let name = '--';
  496. (goodsType || []).forEach(item => {
  497. if(item.value === value) {
  498. name = item.label
  499. }
  500. });
  501. return name
  502. }
  503. },
  504. methods: {
  505. getProductSkuSp(row, index) {
  506. let spData = JSON.parse(row.spData);
  507. if (spData != null && index < spData.length) {
  508. return spData[index].value;
  509. } else {
  510. return null;
  511. }
  512. },
  513. getList() {
  514. this.listLoading = true;
  515. fetchList(this.listQuery).then((response) => {
  516. this.listLoading = false;
  517. this.list = response.data.list;
  518. this.total = response.data.total;
  519. });
  520. },
  521. getBrandList() {
  522. fetchBrandList({ pageNum: 1, pageSize: 100 }).then((response) => {
  523. this.brandOptions = [];
  524. let brandList = response.data.list;
  525. for (let i = 0; i < brandList.length; i++) {
  526. this.brandOptions.push({
  527. label: brandList[i].name,
  528. value: brandList[i].id,
  529. });
  530. }
  531. });
  532. },
  533. getProductCateList() {
  534. fetchListWithChildren().then((response) => {
  535. let list = response.data;
  536. this.productCateOptions = [];
  537. for (let i = 0; i < list.length; i++) {
  538. let children = [];
  539. if (list[i].children != null && list[i].children.length > 0) {
  540. for (let j = 0; j < list[i].children.length; j++) {
  541. children.push({
  542. label: list[i].children[j].name,
  543. value: list[i].children[j].id,
  544. });
  545. }
  546. }
  547. this.productCateOptions.push({
  548. label: list[i].name,
  549. value: list[i].id,
  550. children: children,
  551. });
  552. }
  553. });
  554. },
  555. handleShowSkuEditDialog(index, row) {
  556. this.editSkuInfo.dialogVisible = true;
  557. this.editSkuInfo.productId = row.id;
  558. this.editSkuInfo.productSn = row.productSn;
  559. this.editSkuInfo.productAttributeCategoryId =
  560. row.productAttributeCategoryId;
  561. this.editSkuInfo.keyword = null;
  562. fetchSkuStockList(row.id, { keyword: this.editSkuInfo.keyword }).then(
  563. (response) => {
  564. this.editSkuInfo.stockList = response.data;
  565. }
  566. );
  567. if (row.productAttributeCategoryId != null) {
  568. fetchProductAttrList(row.productAttributeCategoryId, { type: 0 }).then(
  569. (response) => {
  570. this.editSkuInfo.productAttr = response.data.list;
  571. }
  572. );
  573. }
  574. },
  575. handleSearchEditSku() {
  576. fetchSkuStockList(this.editSkuInfo.productId, {
  577. keyword: this.editSkuInfo.keyword,
  578. }).then((response) => {
  579. this.editSkuInfo.stockList = response.data;
  580. });
  581. },
  582. handleEditSkuConfirm() {
  583. if (
  584. this.editSkuInfo.stockList == null ||
  585. this.editSkuInfo.stockList.length <= 0
  586. ) {
  587. this.$message({
  588. message: "暂无sku信息",
  589. type: "warning",
  590. duration: 1000,
  591. });
  592. return;
  593. }
  594. this.$confirm("是否要进行修改", "提示", {
  595. confirmButtonText: "确定",
  596. cancelButtonText: "取消",
  597. type: "warning",
  598. }).then(() => {
  599. updateSkuStockList(
  600. this.editSkuInfo.productId,
  601. this.editSkuInfo.stockList
  602. ).then((response) => {
  603. this.$message({
  604. message: "修改成功",
  605. type: "success",
  606. duration: 1000,
  607. });
  608. this.editSkuInfo.dialogVisible = false;
  609. });
  610. });
  611. },
  612. handleSearchList() {
  613. this.listQuery.pageNum = 1;
  614. this.getList();
  615. },
  616. handleAddProduct() {
  617. this.$router.push({ path: "/pms/addProduct" });
  618. },
  619. handleDownloadStock() {
  620. Export(
  621. this,
  622. {
  623. url: "/api-mall-admin/export/productExport",
  624. fileName: "库存列表.xls",
  625. method: "get",
  626. params: { ...this.listQuery },
  627. },
  628. "您确定导出库存?"
  629. );
  630. },
  631. handleDownloadProductStock() {
  632. Export(
  633. this,
  634. {
  635. url: "/api-mall-admin/export/productStockRecordExport",
  636. fileName: "进货清单.xls",
  637. method: "get",
  638. params: { ...this.listQuery },
  639. },
  640. "您确定导出进货清单?"
  641. );
  642. },
  643. handleBatchOperate() {
  644. if (this.operateType == null) {
  645. this.$message({
  646. message: "请选择操作类型",
  647. type: "warning",
  648. duration: 1000,
  649. });
  650. return;
  651. }
  652. if (this.multipleSelection == null || this.multipleSelection.length < 1) {
  653. this.$message({
  654. message: "请选择要操作的商品",
  655. type: "warning",
  656. duration: 1000,
  657. });
  658. return;
  659. }
  660. this.$confirm("是否要进行该批量操作?", "提示", {
  661. confirmButtonText: "确定",
  662. cancelButtonText: "取消",
  663. type: "warning",
  664. }).then(() => {
  665. let ids = [];
  666. for (let i = 0; i < this.multipleSelection.length; i++) {
  667. ids.push(this.multipleSelection[i].id);
  668. }
  669. ids = ids.join(",");
  670. switch (this.operateType) {
  671. case this.operates[0].value:
  672. this.updatePublishStatus(1, ids);
  673. break;
  674. case this.operates[1].value:
  675. this.updatePublishStatus(0, ids);
  676. break;
  677. case this.operates[2].value:
  678. this.updateRecommendStatus(1, ids);
  679. break;
  680. case this.operates[3].value:
  681. this.updateRecommendStatus(0, ids);
  682. break;
  683. case this.operates[4].value:
  684. this.updateNewStatus(1, ids);
  685. break;
  686. case this.operates[5].value:
  687. this.updateNewStatus(0, ids);
  688. break;
  689. case this.operates[6].value:
  690. break;
  691. case this.operates[7].value:
  692. this.updateDeleteStatus(1, ids);
  693. break;
  694. default:
  695. break;
  696. }
  697. this.getList();
  698. });
  699. },
  700. handleSizeChange(val) {
  701. this.listQuery.pageNum = 1;
  702. this.listQuery.pageSize = val;
  703. this.getList();
  704. },
  705. handleCurrentChange(val) {
  706. this.listQuery.pageNum = val;
  707. this.getList();
  708. },
  709. handleSelectionChange(val) {
  710. this.multipleSelection = val;
  711. },
  712. handlePublishStatusChange(index, row) {
  713. let ids = [];
  714. ids.push(row.id);
  715. ids = ids.join(",");
  716. this.updatePublishStatus(row.publishStatus, ids);
  717. },
  718. handleNewStatusChange(index, row) {
  719. let ids = [];
  720. ids.push(row.id);
  721. ids = ids.join(",");
  722. this.updateNewStatus(row.newStatus, ids);
  723. },
  724. handleRecommendStatusChange(index, row) {
  725. let ids = [];
  726. ids.push(row.id);
  727. ids = ids.join(",");
  728. this.updateRecommendStatus(row.recommandStatus, ids);
  729. },
  730. handleResetSearch() {
  731. this.selectProductCateValue = [];
  732. this.listQuery = Object.assign({}, defaultListQuery);
  733. },
  734. handleDelete(index, row) {
  735. this.$confirm("是否要进行删除操作?", "提示", {
  736. confirmButtonText: "确定",
  737. cancelButtonText: "取消",
  738. type: "warning",
  739. }).then(() => {
  740. let ids = [];
  741. ids.push(row.id);
  742. ids = ids.join(",");
  743. this.updateDeleteStatus(1, ids);
  744. });
  745. },
  746. handleUpdateProduct(index, row) {
  747. this.$router.push({ path: "/pms/updateProduct", query: { id: row.id } });
  748. },
  749. handleShowProduct(index, row) {
  750. this.$router.push({ path: "/pms/detailProduct", query: { id: row.id } });
  751. // console.log("handleShowProduct",row);
  752. },
  753. handleShowVerifyDetail(index, row) {
  754. console.log("handleShowVerifyDetail", row);
  755. },
  756. handleShowPurchase(row) {
  757. this.$router.push({ path: "/pms/purchaseList", query: { id: row.id, name: row.name } });
  758. },
  759. handleShowLog(index, row) {
  760. console.log("handleShowLog", row);
  761. },
  762. updatePublishStatus(publishStatus, ids) {
  763. let obj = {
  764. ids,
  765. publishStatus,
  766. };
  767. updatePublishStatus(obj).then((response) => {
  768. this.$message({
  769. message: "修改成功",
  770. type: "success",
  771. duration: 1000,
  772. });
  773. });
  774. },
  775. updateNewStatus(newStatus, ids) {
  776. let obj = {
  777. ids,
  778. newStatus,
  779. };
  780. updateNewStatus(obj).then((response) => {
  781. this.$message({
  782. message: "修改成功",
  783. type: "success",
  784. duration: 1000,
  785. });
  786. });
  787. },
  788. updateRecommendStatus(recommendStatus, ids) {
  789. let obj = {
  790. ids,
  791. recommendStatus,
  792. };
  793. updateRecommendStatus(obj).then((response) => {
  794. this.$message({
  795. message: "修改成功",
  796. type: "success",
  797. duration: 1000,
  798. });
  799. });
  800. },
  801. updateDeleteStatus(deleteStatus, ids) {
  802. let obj = {
  803. ids,
  804. deleteStatus,
  805. };
  806. updateDeleteStatus(obj).then((response) => {
  807. this.$message({
  808. message: "删除成功",
  809. type: "success",
  810. duration: 1000,
  811. });
  812. });
  813. this.getList();
  814. },
  815. },
  816. };
  817. </script>
  818. <style lang="scss" scoped>
  819. ::v-deep.el-select--small {
  820. width: 203px !important;
  821. }
  822. .number-input {
  823. input {
  824. text-align: left;
  825. }
  826. width: 100%;
  827. }
  828. .table-btn-group {
  829. .el-button {
  830. margin: 5px 3px;
  831. }
  832. }
  833. </style>