goods-manage2.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  1. <template>
  2. <div class="goods-manage-box" v-loading="loading > 0">
  3. <Header :title="title"></Header>
  4. <div class="container">
  5. <div class="content">
  6. <!-- 表格 -->
  7. <div class="filter-box">
  8. <!-- <div class="btn" @click="toGood('add')">+ 新建商品</div> -->
  9. <div class="btn-box">
  10. <div class="label">商品商家:</div>
  11. <!-- <el-select
  12. v-model="filter.sid"
  13. size="small"
  14. class="select"
  15. style="width: 153px"
  16. placeholder="请选择"
  17. >
  18. <el-option :value="null" label="全部"> </el-option>
  19. <el-option
  20. :value="item.id"
  21. :label="item.name"
  22. v-for="item in businessList"
  23. :key="item.id"
  24. >
  25. </el-option>
  26. </el-select> -->
  27. <el-input
  28. class="input"
  29. v-model="filter.shopName"
  30. style="width: 153px;"
  31. placeholder="此框输入商品商家"
  32. size="small"
  33. ></el-input>
  34. <div class="label">商品分类:</div>
  35. <el-cascader
  36. v-model="category"
  37. :options="categoryList"
  38. placeholder="请选择"
  39. size="small"
  40. :props="{
  41. children: 'second',
  42. value: 'id',
  43. label: 'name',
  44. checkStrictly: true,
  45. }"
  46. class="good-input"
  47. style="width: 153px"
  48. ></el-cascader>
  49. <div class="label">商品状态:</div>
  50. <el-select
  51. v-model="filter.auditStatus"
  52. size="small"
  53. class="select"
  54. style="width: 153px"
  55. placeholder="请选择"
  56. >
  57. <el-option :value="null" label="全部"> </el-option>
  58. <el-option :value="0" label="审核通过"> </el-option>
  59. <el-option :value="1" label="待审核"> </el-option>
  60. <el-option :value="2" label="驳回"> </el-option>
  61. </el-select>
  62. <el-input
  63. class="input"
  64. v-model="filter.name"
  65. style="width: 188px; margin-left: 40px"
  66. placeholder="此框输入商品名搜索"
  67. size="small"
  68. ></el-input>
  69. <button class="search" @click="search">搜索</button>
  70. <div class="import-box" style="margin-left: 60px;">
  71. <!-- <div class="btn" @click="batchRejectShopGoodModal">驳回</div> -->
  72. <div
  73. class="btn"
  74. @click="batchPassShopGood"
  75. style="margin-left: 20px;"
  76. >
  77. 通过
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <el-table
  83. :data="goodsList"
  84. class="table table no-border-table"
  85. ref="orderTable"
  86. :header-cell-style="{
  87. border: 'none',
  88. color: '#333',
  89. background: '#f6f6f6',
  90. borderBottom: '1px solid #E8E8E8',
  91. height: '54px',
  92. }"
  93. :row-style="{
  94. height: '54px',
  95. }"
  96. @selection-change="handleSelectionChange"
  97. >
  98. <el-table-column type="selection" width="55" :selectable="selectable">
  99. </el-table-column>
  100. <el-table-column prop="master_pic" align="center" label="商品主图">
  101. <div slot-scope="scope">
  102. <img class="master-pic" :src="scope.row.masterPic" alt="" />
  103. </div>
  104. </el-table-column>
  105. <el-table-column
  106. prop="gid"
  107. align="center"
  108. label="商品ID"
  109. ></el-table-column>
  110. <el-table-column
  111. prop="name"
  112. align="center"
  113. label="商品名称"
  114. ></el-table-column>
  115. <el-table-column
  116. prop="minPrice"
  117. align="center"
  118. label="价格/元"
  119. ></el-table-column>
  120. <el-table-column
  121. prop="minGoldAmount"
  122. align="center"
  123. label="绿通支付金额/元"
  124. ></el-table-column>
  125. <el-table-column prop="groupingName" align="center" label="商品分类">
  126. <div slot-scope="scope">
  127. {{ scope.row.firstSortName + "/" + scope.row.secondSortName }}
  128. </div>
  129. </el-table-column>
  130. <el-table-column
  131. prop="shopName"
  132. align="center"
  133. label="所属商家"
  134. ></el-table-column>
  135. <el-table-column prop="status" align="center" label="审核状态">
  136. <div slot-scope="scope">
  137. {{ auditStatusMap[scope.row.auditStatus] }}
  138. </div>
  139. </el-table-column>
  140. <el-table-column
  141. prop="totalStock"
  142. align="center"
  143. label="库存"
  144. ></el-table-column>
  145. <!-- <el-table-column prop="twig" align="center" label="排序">
  146. <template slot-scope="scope">
  147. <u class="blue" @click="editSort(scope.row)">{{
  148. scope.row.twig
  149. }}</u>
  150. </template>
  151. </el-table-column> -->
  152. <!-- <el-table-column
  153. prop="twig"
  154. align="center"
  155. width="200"
  156. label="会员设置"
  157. >
  158. <div slot-scope="scope" style="display: flex">
  159. <div class="vip-btn" @click="showSetting(scope.row.gid)">
  160. 商品可见用户
  161. </div>
  162. <div class="vip-btn" @click="priceSetting(scope.row.gid)">
  163. 会员价格设置
  164. </div>
  165. </div>
  166. </el-table-column> -->
  167. <el-table-column label="操作" align="center" width="320">
  168. <div slot-scope="scope">
  169. <div
  170. class="table-btn-box"
  171. style="display: flex;justify-content: center;"
  172. >
  173. <button
  174. size="mini"
  175. class="table-btn"
  176. v-if="scope.row.auditStatus !== 1 && scope.row.status === 3"
  177. @click="updateStatus(1, scope.row.id)"
  178. >
  179. 下架
  180. </button>
  181. <button
  182. size="mini"
  183. class="table-btn"
  184. v-if="scope.row.auditStatus !== 1 && scope.row.status === 1"
  185. @click="updateStatus(3, scope.row.id)"
  186. >
  187. 开售
  188. </button>
  189. <button
  190. size="mini"
  191. class="table-btn"
  192. v-if="scope.row.auditStatus === 1"
  193. @click="rejectShopGoodModal(scope.row.id)"
  194. >
  195. 驳回
  196. </button>
  197. <button
  198. size="mini"
  199. class="table-btn"
  200. v-if="scope.row.auditStatus === 1"
  201. @click="passShopGood([scope.row.id])"
  202. >
  203. 通过
  204. </button>
  205. <button
  206. size="mini"
  207. class="table-btn"
  208. @click="toGood(scope.row.gid)"
  209. >
  210. 查看详情
  211. </button>
  212. <button
  213. size="mini"
  214. class="table-btn"
  215. @click="deleteGood(scope.row.gid)"
  216. >
  217. 删除商品
  218. </button>
  219. </div>
  220. </div>
  221. </el-table-column>
  222. </el-table>
  223. </div>
  224. <!-- 分页按钮 -->
  225. <div class="footer" :key="paginationKey">
  226. <el-pagination
  227. @current-change="handleCurrentChange"
  228. :current-page.sync="currentPage"
  229. background
  230. layout="total, prev, pager, next, jumper"
  231. :page-size="size"
  232. :total="total"
  233. ></el-pagination>
  234. </div>
  235. </div>
  236. <!-- 修改排序弹窗 -->
  237. <el-dialog title="更改排序" width="400px" :visible.sync="sortShow">
  238. <el-form label-width="60px" size="mini" ref="editSort" inline-message>
  239. <el-form-item label="排序:" prop="tableData" style="margin-top: 15px">
  240. <el-input v-model="currentSort" type="number" />
  241. </el-form-item>
  242. </el-form>
  243. <div slot="footer" class="dialog-footer">
  244. <el-button class="btn cancel-btn" @click="sortShow = false"
  245. >取 消</el-button
  246. >
  247. <el-button class="btn confirm-btn" @click="saveSort">确 定</el-button>
  248. </div>
  249. </el-dialog>
  250. <el-dialog title="驳回申请" width="480px" :visible.sync="rejectVisible">
  251. <!-- <div class="reject-title"><span>*</span>驳回申请</div> -->
  252. <div style="padding: 0 16px;">
  253. <div class="remark-box">
  254. 驳回申请
  255. <textarea
  256. rows="8"
  257. class="remark"
  258. v-model="remark"
  259. placeholder="驳回理由"
  260. ></textarea>
  261. </div>
  262. </div>
  263. <div slot="footer" class="dialog-footer">
  264. <!-- <el-button @click.native="reject()" class="cancel-btn">驳 回</el-button> -->
  265. <el-button @click.native="rejectVisible = false" class="cancel-btn btn"
  266. >取 消</el-button
  267. >
  268. <el-button
  269. type="primary"
  270. @click.native="rejectShopGood"
  271. class="confirm-btn btn"
  272. >确 定</el-button
  273. >
  274. </div>
  275. </el-dialog>
  276. <el-dialog
  277. :show-close="false"
  278. :close-on-click-modal="false"
  279. title="生成中..."
  280. :visible.sync="showProgressDialog"
  281. width="30%"
  282. center
  283. >
  284. <el-progress
  285. :percentage="progress"
  286. :text-inside="true"
  287. :stroke-width="18"
  288. ></el-progress>
  289. </el-dialog>
  290. </div>
  291. </template>
  292. <script type="text/ecmascript-6">
  293. import dayjs from 'dayjs';
  294. import Header from '../../components/common/header';
  295. import myUtils from '../../components/common/whatever2excel';
  296. export default {
  297. components: {
  298. Header
  299. },
  300. name: 'goods-manage',
  301. data() {
  302. return {
  303. currentPage: 1, // 当前页码
  304. size: 20, // 每页条数
  305. total: 0, // 总页数
  306. loading: 0, // 加载中
  307. title: {
  308. // 页面标题
  309. firstTitile: '商品管理',
  310. secondTitle: '商家商品管理'
  311. },
  312. filter: {
  313. name: '',
  314. // firstSortId: null,
  315. // secondSortId: null,
  316. shopName: '',
  317. auditStatus: null,
  318. },
  319. goodsList: [], // 列表
  320. categoryList: [],
  321. currentId: null,
  322. currentSort: null,
  323. sortShow: false,
  324. paginationKey: +new Date(),
  325. category: [],
  326. businessList: [],
  327. showProgressDialog: false,
  328. progress: 0,
  329. statusMap: {
  330. 1: '仓库中',
  331. 3: '在售'
  332. },
  333. genreMap: {
  334. 1: '自营商品',
  335. 2: '供应链'
  336. },
  337. businessObj: {},
  338. auditStatusMap: {
  339. 0: '审核通过',
  340. 1: '待审核',
  341. 2: '驳回'
  342. },
  343. rejectVisible: false,
  344. remark: '',
  345. id: null,
  346. ids: [],
  347. multipleSelection: []
  348. };
  349. },
  350. beforeRouteEnter(to, from, next) {
  351. if (from.name !== 'good2') {
  352. sessionStorage.setItem('goodManage2', '');
  353. }
  354. next();
  355. },
  356. mounted() {
  357. let data = sessionStorage.getItem('goodManage2')
  358. ? JSON.parse(sessionStorage.getItem('goodManage2'))
  359. : '';
  360. if (data) {
  361. this.filter = {
  362. ...this.filter,
  363. ...data.filter
  364. };
  365. this.currentPage = data.currentPage;
  366. this.paginationKey = +new Date();
  367. this.setSearchData();
  368. }
  369. // 获取列表
  370. this.getCategoryList();
  371. this.getBusinessList();
  372. this.getGoodsList();
  373. },
  374. filters: {
  375. // 时间格式化
  376. dateFormat(date) {
  377. if (!date) return '请选择时间';
  378. let day = dayjs(date);
  379. return day.format('YYYY-MM-DD HH:mm:ss');
  380. }
  381. },
  382. computed: {},
  383. methods: {
  384. setSearchData() {
  385. let goodManage = {
  386. currentPage: this.currentPage,
  387. filter: this.filter
  388. };
  389. sessionStorage.setItem('goodManage2', JSON.stringify(goodManage));
  390. },
  391. // 切换页码
  392. handleCurrentChange(page) {
  393. this.currentPage = page;
  394. this.getGoodsList();
  395. },
  396. // 获取商品列表
  397. getGoodsList() {
  398. this.setSearchData();
  399. this.loading++;
  400. this.httpGet(this.$root.getShopGoodsList, {
  401. page: this.currentPage,
  402. size: this.size,
  403. ...this.filter,
  404. firstSortId: this.category[0] || 0,
  405. secondSortId: this.category[1] || 0
  406. }).then(
  407. (res) => {
  408. this.loading--;
  409. this.goodsList = res.list;
  410. this.total = res.total;
  411. },
  412. (res) => {
  413. this.loading--;
  414. this.$message.error(res);
  415. }
  416. );
  417. },
  418. getBusinessList() {
  419. this.loading++;
  420. this.httpGet(this.$root.getBusinessList, {
  421. size: 9999
  422. }).then(
  423. (res) => {
  424. this.loading--;
  425. this.businessList = res.list;
  426. let businessObj = {};
  427. res.list.forEach(item => {
  428. businessObj[item.id] = item.name;
  429. });
  430. this.businessObj = businessObj;
  431. },
  432. (res) => {
  433. this.loading--;
  434. this.$message.error(res);
  435. }
  436. );
  437. },
  438. // 获取分类列表
  439. getCategoryList() {
  440. this.loading++;
  441. this.httpGet(this.$root.getGoodsCategoryList, {}).then(
  442. (res) => {
  443. this.loading--;
  444. this.categoryList = res.list.filter((item) => item.second.length);
  445. this.categoryList.unshift({
  446. name: '全部',
  447. id: 0
  448. // second: [
  449. // {
  450. // name: '全部',
  451. // id: 0,
  452. // fid: 0
  453. // }
  454. // ]
  455. });
  456. },
  457. (res) => {
  458. this.loading--;
  459. this.$message.error(res);
  460. }
  461. );
  462. },
  463. // 过滤
  464. search() {
  465. console.log(this.filter);
  466. this.currentPage = 1;
  467. this.getGoodsList();
  468. },
  469. editSort(rowData) {
  470. // 更改排序
  471. this.currentId = rowData.id;
  472. this.sortShow = true;
  473. this.currentSort = rowData.twig;
  474. },
  475. saveSort() {
  476. // 保存排序
  477. this.loading++;
  478. this.httpPut(this.$root.updateGoodsTwig, {
  479. id: +this.currentId,
  480. twig: +this.currentSort
  481. }).then(
  482. (res) => {
  483. this.$message({
  484. message: '修改成功!',
  485. type: 'success'
  486. });
  487. this.getGoodsList();
  488. this.loading--;
  489. this.sortShow = false;
  490. },
  491. (err) => {
  492. this.loading--;
  493. this.$message.error(err);
  494. }
  495. );
  496. },
  497. handleSelectionChange(val) {
  498. this.multipleSelection = val;
  499. },
  500. selectable(row, index){
  501. if(row.auditStatus === 1) {
  502. return true
  503. } else {
  504. return false
  505. };
  506. },
  507. updateStatus(status, id) {
  508. this.$confirm(
  509. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要将商品${
  510. status === 1 ? '放入仓库' : '开售'
  511. }吗</p>`,
  512. {
  513. confirmButtonText: '确定',
  514. cancelButtonText: '取消',
  515. cancelButtonClass: 'cancel-btn',
  516. confirmButtonClass: 'confirm-btn',
  517. customClass: 'confirm-box',
  518. dangerouslyUseHTMLString: true,
  519. showClose: false,
  520. type: 'none'
  521. }
  522. ).then(() => {
  523. this.loading++;
  524. this.httpPut(this.$root.updateGoodsStatus, {
  525. id,
  526. status
  527. }).then(
  528. (res) => {
  529. this.loading--;
  530. this.$message({
  531. message: '操作成功',
  532. type: 'success'
  533. });
  534. this.getGoodsList();
  535. },
  536. (res) => {
  537. this.loading--;
  538. this.$message.error(res);
  539. }
  540. );
  541. });
  542. },
  543. batchPassShopGood(){
  544. // console.log(this.multipleSelection);
  545. if(!this.multipleSelection.length){
  546. this.$message({
  547. message: '请选择商品',
  548. type: 'warning'
  549. });
  550. return;
  551. }
  552. this.passShopGood(this.multipleSelection.map(item => item.id))
  553. },
  554. passShopGood(ids) {
  555. this.$confirm(
  556. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确认是否通过审核?</p>`,
  557. {
  558. confirmButtonText: '确定',
  559. cancelButtonText: '取消',
  560. cancelButtonClass: 'cancel-btn',
  561. confirmButtonClass: 'confirm-btn',
  562. customClass: 'confirm-box',
  563. dangerouslyUseHTMLString: true,
  564. showClose: false,
  565. type: 'none'
  566. }
  567. ).then(() => {
  568. this.loading++;
  569. this.httpPut(this.$root.passShopGood, {
  570. list: ids
  571. }).then(
  572. (res) => {
  573. this.loading--;
  574. this.$message({
  575. message: '操作成功',
  576. type: 'success'
  577. });
  578. this.getGoodsList();
  579. },
  580. (res) => {
  581. this.loading--;
  582. this.$message.error(res);
  583. }
  584. );
  585. });
  586. },
  587. rejectShopGoodModal(id){
  588. this.remark = '';
  589. this.rejectVisible = true;
  590. this.id = id;
  591. },
  592. batchRejectShopGoodModal(){
  593. if(!this.multipleSelection.length){
  594. this.$message({
  595. message: '请选择商品',
  596. type: 'warning'
  597. });
  598. return;
  599. }
  600. this.rejectShopGoodModal(this.multipleSelection.map(item => item.id))
  601. },
  602. rejectShopGood(){
  603. this.loading++;
  604. this.httpPost(this.$root.rejectShopGood, {
  605. id: this.id,
  606. auditRejectReason: this.remark
  607. }).then(
  608. (res) => {
  609. this.loading--;
  610. this.$message({
  611. message: '操作成功',
  612. type: 'success'
  613. });
  614. this.rejectVisible = false;
  615. this.getGoodsList();
  616. },
  617. (res) => {
  618. this.loading--;
  619. this.$message.error(res);
  620. }
  621. );
  622. },
  623. // 删除商品
  624. deleteGood(gid) {
  625. this.$confirm(
  626. `<p class='title'><i class='icon el-icon-question'></i>提醒</p><p class='text'>确定要删除商品吗</p>`,
  627. {
  628. confirmButtonText: '确定',
  629. cancelButtonText: '取消',
  630. cancelButtonClass: 'cancel-btn',
  631. confirmButtonClass: 'confirm-btn',
  632. customClass: 'confirm-box',
  633. dangerouslyUseHTMLString: true,
  634. showClose: false,
  635. type: 'none'
  636. }
  637. ).then(() => {
  638. this.loading++;
  639. this.httpDelete(this.$root.deleteGoods, {
  640. gid
  641. }).then(
  642. (res) => {
  643. this.loading--;
  644. this.$message({
  645. message: '操作成功',
  646. type: 'success'
  647. });
  648. this.getGoodsList();
  649. },
  650. (res) => {
  651. this.loading--;
  652. this.$message.error(res);
  653. }
  654. );
  655. });
  656. },
  657. // 添加/编辑商品
  658. toGood(gid) {
  659. this.$router.push({
  660. name: 'good2',
  661. query: {
  662. gid
  663. }
  664. });
  665. },
  666. priceSetting(gid) {
  667. this.$router.push({
  668. name: 'priceSetting',
  669. query: {
  670. gid
  671. }
  672. });
  673. },
  674. showSetting(gid) {
  675. this.$router.push({
  676. name: 'showSetting',
  677. query: {
  678. gid
  679. }
  680. });
  681. },
  682. async order2excel() {
  683. this.loading++;
  684. let goodsList = [];
  685. let totalPage = null;
  686. let data = {
  687. page: this.currentPage,
  688. size: this.size,
  689. ...this.filter,
  690. firstSortId: this.category[0] || 0,
  691. secondSortId: this.category[1] || 0
  692. };
  693. await this.httpGet(this.$root.getGoodsImportList, data).then(
  694. (res) => {
  695. this.loading--;
  696. totalPage = Math.ceil(parseInt(res.total) / this.size);
  697. },
  698. () => {
  699. this.loading--;
  700. }
  701. );
  702. this.showProgressDialog = true;
  703. this.progress = 0;
  704. await this.getAllPages(totalPage, goodsList).then(
  705. () => {
  706. this.showProgressDialog = false;
  707. this.jsonFormatAndToExcel(goodsList);
  708. },
  709. (err) => {
  710. console.error(err);
  711. this.showProgressDialog = false;
  712. }
  713. );
  714. },
  715. async getAllPages(totalPage, list) {
  716. for (let i = 1; i <= totalPage; i++) {
  717. let data = {
  718. page: i,
  719. size: this.size,
  720. ...this.filter,
  721. firstSortId: this.category[0] || 0,
  722. secondSortId: this.category[1] || 0
  723. };
  724. await this.httpGet(this.$root.getGoodsImportList, data).then((res) => {
  725. list.push(...res.list);
  726. this.progress = Math.floor((i / totalPage) * 100);
  727. console.log('page' + i, list.length);
  728. });
  729. // console.log(5555, list);
  730. }
  731. },
  732. getAttrs(attrs) {
  733. return attrs
  734. .map((item) => {
  735. return item.keyName + ':' + item.value;
  736. })
  737. .join('; ');
  738. },
  739. jsonFormatAndToExcel(list) {
  740. let formatList = [];
  741. list.forEach((item) => {
  742. let obj = {
  743. 商品ID: item.gid,
  744. 商品名称: item.name,
  745. 商品分类: item.firstSortName + '-' + item.secondSortName,
  746. 状态: this.statusMap[item.status],
  747. 商品类型: this.genreMap[item.genre],
  748. '当前月销量(含基础销量)': item.monthlySales,
  749. 商品商家: this.businessObj[item.sid],
  750. 成本: item.cost,
  751. 卖价: item.linePrice,
  752. 总库存: item.skuList.reduce((pre, cur) => {
  753. return pre + cur.stock;
  754. }, 0)
  755. };
  756. item.skuList.forEach((sku, index) => {
  757. obj[`规格${index + 1}`] = this.getAttrs(sku.attrs);
  758. obj[`规格${index + 1} 价格`] = sku.price;
  759. obj[`规格${index + 1} 库存`] = sku.stock;
  760. obj[`规格${index + 1} 编码`] = sku.code;
  761. });
  762. formatList.push(obj);
  763. });
  764. // console.log(formatList);
  765. myUtils.json2excel(formatList);
  766. }
  767. }
  768. };
  769. </script>
  770. <style lang="stylus" rel="stylesheet/stylus">
  771. @import '~assets/public.styl';
  772. </style>
  773. <style lang="stylus" rel="stylesheet/stylus" scoped>
  774. @import '~assets/main.styl';
  775. .goods-manage-box {
  776. height: 100%;
  777. width: 100%;
  778. flex-y(flex-start, flex-start);
  779. overflow-y: hidden;
  780. background: bg-color;
  781. .container {
  782. box-sizing: border-box;
  783. height: 100%;
  784. width: 100%;
  785. overflow-y: auto;
  786. flex-y(flex-start, flex-start);
  787. padding: 24px;
  788. .blue {
  789. color: btn-color;
  790. cursor: pointer;
  791. }
  792. // content 表格
  793. .content {
  794. flex: 1;
  795. width: 100%;
  796. font-size: 14px;
  797. background: white;
  798. box-sizing: border-box;
  799. padding: 24px 32px;
  800. border-radius: 2px;
  801. .filter-box {
  802. flex-wrap: wrap;
  803. .btn-box {
  804. margin: 5px 0;
  805. flex-x(flex-start);
  806. flex-wrap: wrap;
  807. .label {
  808. margin-right: 6px;
  809. margin-left: 12px;
  810. word(14px, gray3);
  811. }
  812. .input {
  813. margin-right: 8px;
  814. }
  815. .search {
  816. min-width: 65px;
  817. }
  818. }
  819. }
  820. .import-box {
  821. flex-x(flex-end);
  822. }
  823. // 按钮
  824. .btn {
  825. width: 100px;
  826. height: 32px;
  827. line-height: 32px;
  828. confirm-btn();
  829. font-size: 14px;
  830. margin: 16px 0;
  831. flex-shrink: 0;
  832. }
  833. .table {
  834. .master-pic {
  835. width: auto;
  836. height: 36px;
  837. }
  838. }
  839. .vip-btn {
  840. width: 96px;
  841. height: 24px;
  842. border-radius: 4px;
  843. border: 1px solid #E8E8E8;
  844. background: #F7F7F7;
  845. word(12px, btn-color);
  846. flex-x(center);
  847. white-space: nowrap;
  848. margin: 0 5px;
  849. cursor: pointer;
  850. }
  851. .table-btn-box {
  852. flex-x(flex-end);
  853. .table-btn {
  854. // width: 80px;
  855. // min-width: 80px;
  856. padding: 0 12px;
  857. height: 24px;
  858. line-height: 24px;
  859. color: gray3;
  860. font-size: 12px;
  861. margin-right: 8px;
  862. cancel-btn();
  863. }
  864. }
  865. }
  866. }
  867. .footer {
  868. width: 100%;
  869. padding: 24px;
  870. box-sizing: border-box;
  871. flex-x(flex-end);
  872. background: white;
  873. }
  874. .remark-box {
  875. width: 100%;
  876. padding: 12px 0;
  877. padding-left: 15px;
  878. box-sizing: border-box;
  879. flex-x(flex-start, flex-start);
  880. white-space: nowrap;
  881. .remark {
  882. border: 1px solid #f1f1f1;
  883. width: 100%;
  884. // margin: 0 12px 0;
  885. margin-left: 12px;
  886. padding: 12px;
  887. box-sizing: border-box;
  888. }
  889. }
  890. }
  891. </style>