index.php 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('components/com-goods-detail', \Yii::$app->controller->module->viewPath);
  4. ?>
  5. <meta name="referrer" content="no-referrer">
  6. <div id="app" v-cloak>
  7. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  8. <div slot="header">
  9. <div>
  10. <span>选品库</span>
  11. </div>
  12. </div>
  13. <div class="table-body">
  14. <el-form
  15. :inline="true"
  16. :model="searchData"
  17. size="small"
  18. >
  19. <el-row>
  20. <el-form-item label="供应链">
  21. <el-select v-model="searchData.supply_id" @change="searchSupply">
  22. <el-option v-for="(item, index) in supplyList" :key="index" :label="item.app_name" :value="item.id">
  23. </el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="一级分类">
  27. <el-select v-model="category_1_id" @change="searchCategory(1)">
  28. <el-option v-for="(item, index) in category_1" :key="index" :label="item.name" :value="item.id">
  29. </el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="二级分类">
  33. <el-select v-model="category_2_id" @change="searchCategory(2)">
  34. <el-option v-for="(item, index) in category_2" :key="index" :label="item.name" :value="item.id">
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item label="三级分类">
  39. <el-select v-model="category_3_id" @change="searchCategory(3)">
  40. <el-option v-for="(item, index) in category_3" :key="index" :label="item.name" :value="item.id">
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. </el-row>
  45. <el-row>
  46. <el-form-item label="商品名称">
  47. <el-input placeholder="商品名称" v-model="searchData.search_words" clearable @clear="search"></el-input>
  48. </el-form-item>
  49. <el-form-item label="是否导入">
  50. <el-select v-model="searchData.is_import">
  51. <el-option key="-1" label="全部" value="-1"></el-option>
  52. <el-option key="1" label="已导入" value="1"></el-option>
  53. <el-option key="0" label="未导入" value="0"></el-option>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="商品状态">
  57. <el-select v-model="searchData.is_display">
  58. <el-option label="全部" value="-1"></el-option>
  59. <el-option label="已下架" value="0"></el-option>
  60. <el-option label="销售中" value="1"></el-option>
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item label="渠道类型">
  64. <el-select v-model="searchData.source_id">
  65. <el-option :key="-1" label="全部" value="-1"></el-option>
  66. <el-option v-for="(item, index) in chain_map" :key="index" :label="item" :value="index"></el-option>
  67. </el-select>
  68. </el-form-item>
  69. </el-row>
  70. <el-row>
  71. <el-button type="primary" size="small" @click="search">查询</el-button>
  72. <el-button size="small" @click="resetForm">重置</el-button>
  73. </el-row>
  74. </el-form>
  75. </div>
  76. <div class="table-body">
  77. <el-row>
  78. <el-button size="mini" type="success" @click="batchCheck">下架检测</el-button>
  79. <el-button size="mini" type="primary" @click="batchRemove">批量移除</el-button>
  80. <el-button size="mini" type="primary" @click="batchImport">批量导入</el-button>
  81. </el-row>
  82. <!--商品信息-->
  83. <template>
  84. <el-table class="table-info" ref="multipleTable" @selection-change="handleSelectionChange" stripe :data="goods_list" style="width: 100%" v-loading="listLoading">
  85. <!-- 空数据 -->
  86. <template slot="empty">
  87. <el-empty description="暂无选品"></el-empty>
  88. </template>
  89. <el-table-column type="selection">
  90. </el-table-column>
  91. <el-table-column prop="goods_id" align="center" label="商品ID">
  92. <template slot-scope="scope">
  93. <span v-if="scope.row.goods_id">{{scope.row.goods_id}}</span>
  94. <span v-else>{{scope.row.id}}</span>
  95. </template>
  96. </el-table-column>
  97. <el-table-column prop="middle_goods_id" align="center" label="供应链商品ID">
  98. <template slot-scope="scope">
  99. {{scope.row.middle_goods_id}}
  100. </template>
  101. </el-table-column>
  102. <el-table-column prop="title" align="center" label="商品标题">
  103. <template slot-scope="scope">
  104. <div class="ellipsis" style="clear:both;">{{scope.row.title}}</div>
  105. </template>
  106. </el-table-column>
  107. <el-table-column prop="title" align="center" label="商品图片">
  108. <template slot-scope="scope">
  109. <div class="goods-image">
  110. <com-image mode="aspectFill" :src="scope.row.image_url"></com-image>
  111. </div>
  112. </template>
  113. </el-table-column>
  114. <el-table-column prop="category_text" align="center" label="分类">
  115. </el-table-column>
  116. <!-- <el-table-column prop="source" label="来源" align="center">
  117. <template slot-scope="scope">
  118. {{scope.row.source}}
  119. </template>
  120. </el-table-column> -->
  121. <el-table-column prop="is_display" label="商品状态" align="center">
  122. <template slot-scope="scope">
  123. {{scope.row.is_display === 0 ? '下架' : '正常'}}
  124. </template>
  125. </el-table-column>
  126. <el-table-column prop="guide_price" label="指导价" align="center">
  127. <template slot-scope="scope">
  128. {{scope.row.guide_price|addZero}}
  129. </template>
  130. </el-table-column>
  131. <el-table-column prop="agreement_price" label="协议价" align="center">
  132. <template slot-scope="scope">
  133. {{scope.row.agreement_price|addZero}}
  134. </template>
  135. </el-table-column>
  136. <el-table-column prop="activity_price" label="营销价" align="center">
  137. <template slot-scope="scope">
  138. {{scope.row.activity_price|addZero}}
  139. </template>
  140. </el-table-column>
  141. <el-table-column prop="cost_price" label="成本价" align="center">
  142. <template slot-scope="scope">
  143. {{scope.row.cost_price|addZero}}
  144. </template>
  145. </el-table-column>
  146. <el-table-column label="添加时间" align="center">
  147. <template slot-scope="scope">
  148. {{scope.row.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  149. </template>
  150. </el-table-column>
  151. <el-table-column prop="storage" label="是否导入" align="center">
  152. <template slot-scope="scope">
  153. <a href="javascript:void(0)" v-if="scope.row.is_import == 2" @click="goodsDetail(scope.row.mall_goods_id)">{{scope.row.mall_goods_id}}</a>
  154. <span v-else-if="scope.row.is_import == 1" style="color: green">导入中</span>
  155. <span v-else-if="scope.row.is_import == 0">
  156. {{ scope.row.import_msg ? '导入失败' : '未导入'}}
  157. <el-tooltip class="item" effect="dark" :content="scope.row.import_msg" placement="top-end">
  158. <i class="el-icon-warning" v-if="scope.row.import_msg"></i>
  159. </el-tooltip>
  160. </span>
  161. <span v-else-if="scope.row.is_import == 3">中台已删除商品</span>
  162. </template>
  163. </el-table-column>
  164. <el-table-column prop="storage" label="导入时间" align="center">
  165. <template slot-scope="scope">
  166. {{scope.row.import_at|dateTimeFormat('Y-m-d H:i:s')}}
  167. </template>
  168. </el-table-column>
  169. <el-table-column align="center" label="操作">
  170. <template slot-scope="scope">
  171. <el-button @click="remove(scope.row)" type="text" size="small">移除</el-button>
  172. <el-button v-if="scope.row.is_import == 0" @click="oneImport(scope.row)" type="text" size="small">导入</el-button>
  173. <el-button @click="showGoodsDetail(scope.row.middle_goods_id)" type="text" size="small">详情</el-button>
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. </template>
  178. <!-- 分页 -->
  179. <el-row type="flex" class="page" justify="end">
  180. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="goods_list"></el-pagination>
  181. </el-row>
  182. </div>
  183. </el-card>
  184. <com-goods-detail :goods-id="goodsId"></com-goods-detail>
  185. </div>
  186. </el-card>
  187. </div>
  188. <script>
  189. var activity_id = <?php echo 1 ?>;
  190. const app = new Vue({
  191. el: '#app',
  192. filters: {
  193. addZero: function(data) {
  194. return data == undefined
  195. ? '未定义'
  196. : Math.round((data / 100) * 100) / 100 + '元';
  197. },
  198. },
  199. data() {
  200. return {
  201. searchData: {
  202. search_words: '',
  203. source: '',
  204. range_type: '',
  205. range_from: '',
  206. range_to: '',
  207. is_free_shipping: '',
  208. is_import: '',
  209. supply_id: '',
  210. is_display: '',
  211. source_id: '',
  212. },
  213. goods_list: [],
  214. supplyList: [],
  215. category_1: [],
  216. category_2: [],
  217. category_3: [],
  218. category_1_id: '',
  219. category_2_id: '',
  220. category_3_id: '',
  221. level: 0,
  222. parent_id: 0,
  223. pageCount: 0,
  224. page: 1,
  225. member_page: 1,
  226. currentPage: null,
  227. listLoading: false,
  228. btnLoading: false,
  229. checked: false,
  230. sort_list: [{
  231. name: "最新上架",
  232. key: 'created_time',
  233. is_active: false,
  234. sort: '',
  235. },
  236. {
  237. name: "本月销量",
  238. key: 'real_month_sale',
  239. is_active: false,
  240. sort: '',
  241. },
  242. {
  243. name: "协议价",
  244. key: 'agreement_price',
  245. is_active: false,
  246. sort: '',
  247. },
  248. {
  249. name: "指导价",
  250. key: 'guide_price',
  251. is_active: false,
  252. sort: '',
  253. },
  254. {
  255. name: "营销价",
  256. key: 'activity_price',
  257. is_active: false,
  258. sort: '',
  259. },
  260. {
  261. name: "常规利润率",
  262. key: 'promotion_rate',
  263. is_active: false,
  264. sort: '',
  265. },
  266. ],
  267. type: '',
  268. sort: '',
  269. source_text: [],
  270. selectGoods: [],
  271. goodsId: 0,
  272. suppliers: [],
  273. source_list:[],
  274. chain_map: <?= $chain_map ?>,
  275. };
  276. },
  277. methods: {
  278. // 平台选择
  279. searchSupply() {
  280. this.category_1 = [];
  281. this.category_2 = [];
  282. this.category_3 = [];
  283. this.category_1_id = '';
  284. this.category_2_id = '';
  285. this.category_3_id = '';
  286. this.parent_id = 0;
  287. this.level = 0;
  288. this.getCategoryList();
  289. this.getGoodsList();
  290. this.getSource();
  291. },
  292. getSupply() {
  293. request({
  294. params: {
  295. r: 'qi-juhe/supplys/index',
  296. },
  297. method: 'get',
  298. }).then(e => {
  299. if (e.data.code === 0) {
  300. this.supplyList = e.data.data.list
  301. this.searchData.supply_id = this.supplyList[0].id
  302. this.getCategoryList();
  303. this.getGoodsList()
  304. this.getSource();
  305. } else {
  306. this.$message.error(e.data.msg);
  307. }
  308. }).catch(e => {});
  309. },
  310. handleSelectionChange(val) {
  311. this.selectGoods = val;
  312. },
  313. // 移除选品库
  314. remove(goods) {
  315. this.selectGoods.push(goods);
  316. let self = this;
  317. self.$confirm('是否把该商品从选品库中移除? 如需下架商品请前往商品列表进行下架操作', '提示', {
  318. confirmButtonText: '确定',
  319. cancelButtonText: '取消',
  320. type: 'warning'
  321. }).then(() => {
  322. self.removeReq([goods.storage_id])
  323. }).catch(() => {
  324. self.$message.info('已取消删除')
  325. })
  326. },
  327. batchRemove() {
  328. let num = 0;
  329. let goods_id = new Array();
  330. this.selectGoods.forEach(function(item, index) {
  331. num++;
  332. goods_id.push(item.storage_id);
  333. })
  334. if (num <= 0) {
  335. this.$message.error('请选择商品');
  336. return false;
  337. }
  338. let self = this;
  339. self.$confirm('是否把该商品从选品库中移除?', '提示', {
  340. confirmButtonText: '确定',
  341. cancelButtonText: '取消',
  342. type: 'warning'
  343. }).then(() => {
  344. this.removeReq(goods_id);
  345. }).catch(() => {
  346. self.$message.info('已取消删除')
  347. })
  348. },
  349. removeReq(goods_ids) {
  350. let self = this;
  351. self.listLoading = true;
  352. request({
  353. params: {
  354. r: 'qi-juhe/storage/remove',
  355. },
  356. method: 'post',
  357. data: {
  358. ids: goods_ids,
  359. }
  360. }).then(e => {
  361. self.listLoading = false;
  362. if (e.data.code === 0) {
  363. this.selectGoods.forEach(function(item, key) {
  364. index = self.goods_list.indexOf(item)
  365. if (index >= 0) {
  366. self.goods_list.splice(index, 1);
  367. }
  368. })
  369. this.selectGoods = [];
  370. self.$message.success(e.data.msg);
  371. this.getGoodsList()
  372. } else {
  373. self.$message.error(e.data.msg);
  374. }
  375. }).
  376. catch(e => {
  377. console.log(e);
  378. })
  379. },
  380. // 跳转商品详情
  381. goodsDetail(goods_id) {
  382. navigateTo({
  383. r: 'mall/goods/edit',
  384. id: goods_id,
  385. }, true);
  386. },
  387. // 重新加载商品
  388. oneReload(goods) {
  389. this.reloadGoods([goods.storage.goods_id])
  390. },
  391. // 重新加载商品
  392. reloadGoods(goods_ids) {
  393. var self = this
  394. request({
  395. params: {
  396. r: 'juhe-shop/goods/store-reload',
  397. },
  398. method: 'post',
  399. data: {
  400. goods_ids: goods_ids,
  401. }
  402. }).then(e => {
  403. self.listLoading = false;
  404. if (e.data.code === 0) {
  405. self.$message.success(e.data.msg);
  406. setTimeout(() => {
  407. self.getGoodsList()
  408. }, 1500)
  409. } else {
  410. self.$message.error(e.data.msg);
  411. }
  412. }).
  413. catch(e => {
  414. console.log(e);
  415. })
  416. },
  417. // 单个导入
  418. oneImport(goods) {
  419. this.selectGoods.push(goods);
  420. let self = this;
  421. self.$confirm('是否导入该商品?', '提示', {
  422. confirmButtonText: '确定',
  423. cancelButtonText: '取消',
  424. type: 'warning'
  425. }).then(() => {
  426. if (typeof goods.juhe_goods_id != 'undefined') {
  427. self.storageImport([goods.juhe_goods_id])
  428. } else {
  429. self.storageImport([goods.id])
  430. }
  431. }).catch(() => {
  432. self.$message.info('已取消导入')
  433. })
  434. },
  435. // 批量导入
  436. batchImport() {
  437. let num = 0;
  438. let goods_id = new Array();
  439. this.selectGoods.forEach(function(item, index) {
  440. num++;
  441. if (typeof item.juhe_goods_id != 'undefined') {
  442. goods_id.push(item.juhe_goods_id)
  443. } else {
  444. goods_id.push(item.id)
  445. }
  446. })
  447. if (num <= 0) {
  448. this.$message.error('请选择商品');
  449. return false;
  450. }
  451. let self = this;
  452. self.$confirm('是否批量导入' + num + '个商品?', '提示', {
  453. confirmButtonText: '确定',
  454. cancelButtonText: '取消',
  455. type: 'warning'
  456. }).then(() => {
  457. this.storageImport(goods_id);
  458. }).catch(() => {
  459. self.$message.info('已取消导入')
  460. })
  461. },
  462. // 区间筛选
  463. rangeChange() {
  464. if (this.searchData.range_type == '') {
  465. this.$message.error('请选择区间类型');
  466. return false;
  467. }
  468. let from = parseInt(this.searchData.range_from);
  469. let to = parseInt(this.searchData.range_to);
  470. if (from > to) {
  471. this.$message.error('区间开始不能大于区间结束');
  472. return false;
  473. }
  474. },
  475. // 排序
  476. searchSort(event) {
  477. let el = event.currentTarget;
  478. this.type = el.dataset.key;
  479. let index = el.dataset.index;
  480. let data = this.sort_list[index];
  481. if (data.sort == '' || data.sort == 'asc') {
  482. this.sort_list[index].sort = 'desc';
  483. } else {
  484. this.sort_list[index].sort = 'asc';
  485. }
  486. this.sort_list.forEach(function(item, key) {
  487. if (key != index) {
  488. item.sort = '';
  489. }
  490. })
  491. this.sort = this.sort_list[index].sort;
  492. this.getGoodsList();
  493. },
  494. // 平台选择
  495. searchSource() {
  496. this.category_1 = [];
  497. this.category_2 = [];
  498. this.category_3 = [];
  499. this.category_1_id = '';
  500. this.category_2_id = '';
  501. this.category_3_id = '';
  502. this.parent_id = 0;
  503. this.level = 0;
  504. this.getCategoryList();
  505. },
  506. // 分类选择
  507. searchCategory(level) {
  508. this.level = level;
  509. if (level == 1) {
  510. this.parent_id = this.category_1_id;
  511. this.category_2 = [];
  512. this.category_3 = [];
  513. this.category_2_id = '';
  514. this.category_3_id = '';
  515. }
  516. if (level == 2) {
  517. this.parent_id = this.category_2_id == 0 ? this.category_1_id : this.category_2_id;
  518. this.category_3 = [];
  519. this.category_3_id = '';
  520. }
  521. if (level == 3) {
  522. this.parent_id = this.category_3_id == 0 ? this.category_2_id : this.category_3_id;
  523. return true;
  524. }
  525. console.log('parent_id' + this.parent_id);
  526. this.getCategoryList()
  527. },
  528. //搜索
  529. search() {
  530. this.page = 1;
  531. this.getGoodsList();
  532. },
  533. pagination(currentPage) {
  534. this.page = currentPage;
  535. this.getGoodsList();
  536. },
  537. getGoodsList() {
  538. this.listLoading = true;
  539. var param = {
  540. r: 'qi-juhe/storage/index',
  541. page: this.page,
  542. search_words: this.searchData.search_words,
  543. source: this.searchData.source,
  544. range_type: this.searchData.range_type,
  545. range_from: this.searchData.range_from,
  546. range_to: this.searchData.range_to,
  547. is_free_shipping: this.searchData.is_free_shipping,
  548. is_import: this.searchData.is_import,
  549. supply_id: this.searchData.supply_id,
  550. source_id: this.searchData.source_id,
  551. is_display: this.searchData.is_display,
  552. type: this.type, // 排序
  553. sort: this.sort,
  554. category_1_id: this.category_1_id,
  555. category_2_id: this.category_2_id,
  556. category_3_id: this.category_3_id,
  557. limit: 30
  558. }
  559. request({
  560. params: param,
  561. }).then(e => {
  562. if (e.data.code === 0) {
  563. this.goods_list = e.data.data.list;
  564. this.pageCount = e.data.data.page_count;
  565. this.currentPage = e.data.data.current_page;
  566. } else {
  567. this.$message.error(e.data.msg);
  568. }
  569. this.listLoading = false;
  570. }).catch(e => {
  571. this.listLoading = false;
  572. });
  573. },
  574. getCategoryList() {
  575. request({
  576. params: {
  577. r: 'qi-juhe/category/list',
  578. parent_id: this.parent_id,
  579. level: this.level,
  580. source: this.searchData.source,
  581. supply_id: this.searchData.supply_id,
  582. },
  583. }).then(e => {
  584. if (e.data.code === 0) {
  585. if (this.level == 0) {
  586. this.category_1 = e.data.data.list;
  587. } else if (this.level == 1) {
  588. this.category_2 = e.data.data.list;
  589. } else {
  590. this.category_3 = e.data.data.list;
  591. }
  592. } else {
  593. this.$message.error(e.data.msg);
  594. }
  595. this.listLoading = false;
  596. }).catch(e => {
  597. this.listLoading = false;
  598. });
  599. },
  600. storageImport(goods_id) {
  601. let self = this;
  602. this.listLoading = true;
  603. request({
  604. method: 'post',
  605. data: {
  606. ids: goods_id,
  607. },
  608. params: {
  609. r: 'qi-juhe/storage/import',
  610. },
  611. }).then(e => {
  612. if (e.data.code === 0) {
  613. this.$message.success(e.data.msg);
  614. this.goods_list.forEach(function(item, key) {
  615. index = goods_id.indexOf(item.id)
  616. if (index >= 0) {
  617. Vue.set(item.storage, 'is_import', 1)
  618. }
  619. })
  620. this.selectGoods.forEach(function(item, key) {
  621. index = self.goods_list.indexOf(item)
  622. if (index >= 0) {
  623. Vue.set(self.goods_list[index].storage, 'is_import', 1)
  624. }
  625. })
  626. this.selectGoods = [];
  627. self.$refs.multipleTable.clearSelection();
  628. this.getGoodsList()
  629. } else {
  630. this.$message.error(e.data.msg);
  631. }
  632. this.listLoading = false;
  633. }).catch(e => {
  634. this.listLoading = false;
  635. });
  636. },
  637. //重置
  638. resetForm() {
  639. this.searchData.search_words = '';
  640. this.searchData.source = '';
  641. this.searchData.range_type = '';
  642. this.searchData.range_from = '';
  643. this.searchData.range_to = '';
  644. this.searchData.is_free_shipping = '';
  645. this.searchData.is_import = '';
  646. this.category_1_id = '';
  647. this.category_2_id = '';
  648. this.category_3_id = '';
  649. this.searchData.supply_id = ''
  650. this.searchData.source_id = ''
  651. this.searchData.is_display = ''
  652. },
  653. /* scFormTab(sel) {
  654. if(sel.length == this.form.length){
  655. this.checkedAll = true;
  656. }else {
  657. this.checkedAll = false;
  658. }
  659. this.selFormArr = sel;
  660. }, */
  661. /**
  662. * 显示商品供应链端详情
  663. */
  664. showGoodsDetail(id) {
  665. this.goodsId = 0
  666. setTimeout(() => {
  667. this.goodsId = id
  668. }, 50)
  669. },
  670. batchCheck () {
  671. var self = this
  672. self.$confirm('检测比较耗时,是否检测?', '提示', {
  673. confirmButtonText: '确定',
  674. cancelButtonText: '取消',
  675. type: 'warning'
  676. }).then(() => {
  677. request({
  678. method: 'post',
  679. data: {
  680. supply_id: this.searchData.supply_id,
  681. },
  682. params: {
  683. r: 'qi-juhe/storage/check-pull',
  684. },
  685. }).then(e => {
  686. if (e.data.code === 0) {
  687. this.$message.success(e.data.msg);
  688. } else {
  689. this.$message.error(e.data.msg);
  690. }
  691. this.listLoading = false;
  692. }).catch(e => {
  693. this.listLoading = false;
  694. });
  695. }).catch(() => {
  696. self.$message.info('已取消导入')
  697. })
  698. },
  699. getSuppliers () {
  700. request({
  701. params: {
  702. r: 'qi-juhe/supplys/suppliers',
  703. supply_id: this.searchData.supply_id
  704. },
  705. method: 'get',
  706. }).then(e => {
  707. if (e.data.code === 0) {
  708. this.suppliers = e.data.data
  709. } else {
  710. this.$message.error(e.data.msg);
  711. }
  712. }).catch(e => {});
  713. },
  714. getSource(){
  715. request({
  716. method: 'get',
  717. params: {
  718. r: 'qi-juhe/goods/source',
  719. supply_id: this.searchData.supply_id
  720. },
  721. }).then(e => {
  722. if (e.data.code === 0) {
  723. this.source_list = e.data.data
  724. } else {
  725. this.$message.error(e.data.msg);
  726. }
  727. }).catch(e => {
  728. });
  729. },
  730. },
  731. mounted: function() {
  732. this.page = getQuery('page') ? getQuery('page') : 1;
  733. this.getSupply()
  734. }
  735. });
  736. </script>
  737. <style>
  738. .table-info .el-button {
  739. /* padding: 0; */
  740. border: 0;
  741. margin: 0 5px;
  742. }
  743. .table-body {
  744. padding: 20px;
  745. background-color: #fff;
  746. }
  747. /* .table-info .el-button {
  748. padding: 0 !important;
  749. border: 0;
  750. margin: 0 5px;
  751. } */
  752. .input-item {
  753. display: inline-block;
  754. width: 150px;
  755. margin: 0 0 20px;
  756. }
  757. .input-item .el-input__inner {
  758. border-right: 1px solid #dcdfe6;
  759. }
  760. .input-item .el-input__inner:hover {
  761. border: 1px solid #dcdfe6;
  762. border-right: 0;
  763. outline: 0;
  764. }
  765. .input-item .el-input__inner:focus {
  766. border: 1px solid #dcdfe6;
  767. border-right: 0;
  768. outline: 0;
  769. }
  770. .input-item .el-input-group__append {
  771. background-color: #fff;
  772. border-left: 0;
  773. width: 10%;
  774. padding: 0;
  775. }
  776. .input-item .el-input-group__append .el-button {
  777. padding: 0;
  778. }
  779. .input-item .el-input-group__append .el-button {
  780. margin: 0;
  781. }
  782. .select {
  783. float: left;
  784. width: 100px;
  785. margin-right: 10px;
  786. }
  787. .goods-image {
  788. display: flex;
  789. justify-content: center;
  790. }
  791. .el-table th>.cell {
  792. color: #333;
  793. font-weight: bold;
  794. font-size: 14px;
  795. }
  796. .el-table__footer-wrapper,
  797. .el-table__header-wrapper {
  798. border-bottom: 1.4px solid #D6D6D6;
  799. }
  800. .search-sort {
  801. display: inline-block;
  802. margin: 0px 10px;
  803. cursor: pointer;
  804. color: rgb(51, 51, 51);
  805. }
  806. .caret-wrapper {
  807. display: inline-flex;
  808. flex-direction: column;
  809. align-items: center;
  810. height: 25px;
  811. width: 11px;
  812. vertical-align: middle;
  813. cursor: pointer;
  814. overflow: initial;
  815. position: relative;
  816. }
  817. .caret-top {
  818. border: 5px solid transparent;
  819. margin: 1px 0;
  820. border-bottom-color: rgb(51, 51, 51);
  821. }
  822. .caret-bottom {
  823. border: 5px solid transparent;
  824. margin: 1px 0;
  825. border-top-color: rgb(51, 51, 51);
  826. }
  827. .active {
  828. border-top-color: rgb(41, 186, 156);
  829. }
  830. .ellipsis {
  831. height: 40px;
  832. font-size: 12px;
  833. color: #333;
  834. overflow: hidden;
  835. text-overflow: ellipsis;
  836. }
  837. .goods-wrapper {
  838. border: 2px solid #CCCCCC;
  839. display: inline-block
  840. }
  841. .goods-select {
  842. border: 2px solid #bb730c;
  843. }
  844. .goods-price {
  845. text-align: center;
  846. }
  847. .goods-price .number {
  848. color: red;
  849. font-weight: 600;
  850. font-size: .18rem;
  851. }
  852. .goods-price .title {
  853. padding: 5px 0;
  854. color: #999;
  855. ;
  856. font-size: 10px;
  857. font-weight: 600;
  858. }
  859. .bottom-price .title {
  860. padding: 5px 0;
  861. color: #8b8888;
  862. ;
  863. font-size: .1rem;
  864. }
  865. .bottom-price .number {
  866. color: #ff5100;
  867. font-size: .1rem;
  868. }
  869. .goods-action {
  870. margin-top: 0.8rem;
  871. }
  872. .goods-action .title {
  873. color: #0634aa;
  874. }
  875. .bottom-active {
  876. border-bottom-color: rgb(186, 41, 92);
  877. }
  878. .top-active {
  879. border-top-color: rgb(186, 41, 92);
  880. }
  881. .price {
  882. white-space: nowrap;
  883. }
  884. .page {
  885. padding: 10px 0;
  886. }
  887. </style>