| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709 |
- @extends('layouts.base')
- @section('title', "商品列表")
- @section('content')
- <link rel="stylesheet" type="text/css" href="{{static_url('yunshop/goods/vue-goods.css')}}"/>
- <style>
- .el-table .cell{
- white-space:pre-line;
- }
- </style>
- <div id="qrcode" ref="qrcode" style="display:none;"></div>
- <div class="rightlist">
- <div id="app" v-cloak v-loading="all_loading">
- <template>
- <div class="second-list">
- <div class="third-list">
- <div class="form-list">
- <el-form :inline="true" :model="search_form" ref="search_form" style="margin-left:10px;">
- <el-row>
- <el-form-item label="" prop="">
- <el-select v-model="search_form.middleground_configuration_id" placeholder="请选择供应链" clearable remote filterable >
- <el-option v-for="item in middleground_configuration" :key="item.id" :label="item.title" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model="search_form.cate_v1" placeholder="请选择一级分类" clearable @change="changeV1()" filterable>
- <el-option v-for="item in category_list" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model="search_form.cate_v2" placeholder="请选择二级分类" clearable @change="changeV2()" filterable>
- <el-option v-for="item in category_list_v2" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model="search_form.cate_v3" placeholder="请选择三级分类" clearable filterable>
- <el-option v-for="item in category_list_v3" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-select v-model="search_form.status" placeholder="请选择上下架" clearable>
- <el-option v-for="item in status_list" :key="item.id" :label="item.label" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="" prop="goods_name">
- <el-input v-model="search_form.goods_name" placeholder="请输入商品名称"></el-input>
- </el-form-item>
- <el-form-item label="价格区间" prop="">
- <el-input v-model="search_form.min_price" placeholder="最低价" style="width:150px;"></el-input>
- 至
- <el-input v-model="search_form.max_price" placeholder="最高价" style="width:150px;"></el-input>
- </el-form-item>
- <el-form-item label="" prop="">
- <el-select v-model="search_form.page_size" placeholder="每页条数" clearable>
- <el-option v-for="item in page_size" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <a href="#">
- <el-button type="primary" icon="el-icon-search" @click="getData(1)">搜索</el-button>
- </a>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <div class="table-list">
- <div style="margin-left:10px;">
- <el-checkbox v-model.number="is_all_choose" :true-label="1" :false-label="0" @change="allChoose">[[is_all_choose==1?'全不选':'全选']]</el-checkbox>
- <el-button size="small" @click="batchStatusOn()">批量上架</el-button>
- <el-button size="small" @click="batchStatusOff()">批量下架</el-button>
- <el-button size="small" @click="batchDestroy">批量删除</el-button>
- <el-button size="small" @click="batchUpdate">批量更新</el-button>
- <el-button size="small" @click="batchUpdateStock">一键更新</el-button>
- <el-button size="small" @click="batchUpdateStockStay">一键更新所有待更新的商品</el-button>
- </div>
- <div>
- @section('search')
- <template>
- <!-- 表格start -->
- <el-table :data="goods_list" style="width: 100%" :class="table_loading==true?'loading-height':''" v-loading="table_loading">
- <el-table-column prop="id" label="选择" width="60" align="center">
- <template slot-scope="scope">
- <el-checkbox v-model.number="scope.row.is_choose" :true-label="1" :false-label="0" @change="oneChange(scope.row)"></el-checkbox>
- </template>
- </el-table-column>
- <el-table-column prop="cloud.goods_id" label="本地ID" width="90" align="center">
- <template slot-scope="scope">
- [[scope.row.cloud.goods_id?scope.row.cloud.goods_id:0]]
- </template>
- </el-table-column>
- <el-table-column prop="goodsId" label="第三方ID" width="90" align="center">
- <template slot-scope="scope">
- [[scope.row.id]]
- </template>
- </el-table-column>
- </el-table-column>
- <el-table-column prop="total" label="商品" width="60" align="center">
- <template slot-scope="scope">
- <img :src="scope.row.image_url" style="width:50px;height:50px;">
- </template>
- </el-table-column>
- <el-table-column prop="down_time" label="" min-width="180" align="left" class="edit-cell">
- <template slot-scope="scope" >
- <p v-if="scope.row.is_cloud == 1"> <a :href="'{{ yzWebFullUrl('plugin.yz-supply.admin.shop-goods.edit', array('id' => '')) }}'+[[scope.row.cloud.goods_id]]">
- [[scope.row.title]]
- </a>
- </p>
- <p v-else>
- [[scope.row.title]]
- </p>
- </template>
- </el-table-column>
- <el-table-column prop="member_num" v-bind:label="'中台商品零售价\n本地原价'" width="150" align="center">
- <template slot-scope="scope">
- ¥[[scope.row.origin_price]]<br>
- ¥[[scope.row.goods.market_price?scope.row.goods.market_price:0.00]]
- </template>
- </el-table-column>
- <el-table-column prop="member_num" v-bind:label="'中台商品指导价\n本地现价'" width="150" align="center">
- <template slot-scope="scope">
- ¥[[scope.row.guide_price]]<br>
- ¥[[scope.row.goods.price?scope.row.goods.price:0.00]]
- </template>
- </el-table-column>
- <el-table-column prop="member_num" v-bind:label="'中台商品成本价\n本地成本价'" width="150" align="center">
- <template slot-scope="scope">
- ¥[[scope.row.cost_price]]<br>
- ¥[[scope.row.goods.cost_price?scope.row.goods.cost_price:0.00]]
- </template>
- </el-table-column>
- <el-table-column prop="member_num" label="物流费" width="80" align="center">
- <template slot-scope="scope">
- ¥[[scope.row.freight]]
- </template>
- </el-table-column>
- <el-table-column prop="member_num" label="运费模板ID" width="80" align="center">
- <template slot-scope="scope">
- [[scope.row.freight_template_id]]
- </template>
- </el-table-column>
- <el-table-column label="库存" align="center" max-width="80">
- <template slot-scope="scope">
- [[scope.row.stock]]
- </template>
- </el-table-column>
- <el-table-column prop="real_sales" label="销量" width="70" align="center">
- <template slot-scope="scope">
- [[scope.row.sales]]
- </template>
- </el-table-column>
- <el-table-column v-bind:label="'云仓状态\n本地状态'" prop="status_message" align="center">
- <template slot-scope="scope">
- [[scope.row.is_display?'上架':'下架']]<br>
- <p v-if="scope.row.goods.status==0 && scope.row.is_cloud == 1">下架</p>
- <p v-if="scope.row.goods.status=='1' && scope.row.is_cloud == 1">上架</p>
- <p v-if="scope.row.goods.status==null && scope.row.is_cloud == 1">失效</p>
- <p v-if="scope.row.is_cloud == 2" style="color:#ff3a3a;">非云仓推送至中台的商品</p>
- </template>
- </el-table-column>
- <el-table-column label="操作" width="300" align="center">
- <template slot-scope="scope">
- <div class="table-option">
- <a @click="statusOn(scope.row.id)">
- 上架
- </a>
- <a @click="statusOff(scope.row.id)">
- 下架
- </a>
- <a v-if="scope.row.is_cloud == 1" @click="update(scope.row)">
- 更新商品 <div v-if="scope.row.cloud.is_update == 1" style="color: #ff3a3a;">待更新</div>
- </a>
- <a @click="delOne(scope.row.id)">
- 删除
- </a>
- <div>
- <input v-model="scope.row.link" :ref="'list'+scope.row.id" style="position:absolute;opacity:0;height:1px;" />
- </div>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <!-- 表格end -->
- </template>
- @show
- </div>
- </div>
- </div>
- <!-- 分页 -->
- <div class="vue-page">
- <el-row>
- <el-col align="right">
- <el-pagination layout="prev, pager, next,jumper" @current-change="getData" :total="total" :page-size="per_size" :current-page="current_page" background v-loading="loading"></el-pagination>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- </div>
- </div>
- <script src="{{resource_get('static/js/qrcode.min.js')}}"></script>
- <script>
- var app = new Vue({
- el:"#app",
- delimiters: ['[[', ']]'],
- data() {
- return{
- id:"",
- img:"",//二维码
- catlevel:0,//是否显示三级分类
- is_all_choose:0,//是否全选
- goods_list:[],//商品列表
- change_title:"",//修改标题弹框赋值
- change_price:"",//修改价格弹框赋值
- change_stock:"",//修改库存弹框赋值
- change_sort:"",//修改排序弹框赋值
- middleground_configuration:[],//中台供应链数组
- all_loading:false,
- page_size:[
- {id:'',name:''},
- {id:20,name:'20条'},
- {id:50,name:'50条'},
- ],
- status_list:[
- {id:0,label:'全部'},
- {id:1,label:'上架'},
- {id:2,label:'下架'},
- {id:3,label:'售罄'},
- ],
- category_list:[],
- category_list_v2:[],
- category_list_v3:[],
- search_form:{
- middleground_configuration_id:0,
- cate_v1:'',
- cate_v2:'',
- cate_v3:'',
- status:0,
- },
- form:{},
- level_list:[],
- loading:false,
- table_loading:false,
- rules:{},
- //分页
- total:0,
- per_size:0,
- current_page:0,
- rules:{},
- }
- },
- created() {
- this.getMiddlegroundConfiguration();
- },
- methods: {
- getMiddlegroundConfiguration(){
- this.$http.post('{!! yzWebFullUrl('plugin.yz-supply.admin.middleground-configuration.get-middleground-configurations') !!}').then(function (response) {
- if (response.data.result) {
- this.middleground_configuration = response.data.data;
- this.search_form.middleground_configuration_id = this.middleground_configuration[0].id;
- this.getData(1);
- this.getThirdCategory()
- } else {
- this.$message({message: response.data.msg, type: 'error'});
- }
- }, function (response) {
- this.$message({message: response.data.msg, type: 'error'});
- })
- },
- getData(page) {
- var that = this;
- let json = {
- page:page,
- search:{
- third_goods_id:that.search_form.third_goods_id,
- goods_name:that.search_form.goods_name,
- min_price:that.search_form.min_price,
- max_price:that.search_form.max_price,
- page_size:that.search_form.page_size,
- cate_v1:that.search_form.cate_v1,
- cate_v2:that.search_form.cate_v2,
- cate_v3:that.search_form.cate_v3,
- status:that.search_form.status,
- },
- middleground_configuration_id:this.search_form.middleground_configuration_id
- };
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.goods-list') !!}",json).then(response => {
- console.log(response.data.data);
- if(response.data.result==1){
- that.goods_list = response.data.data.list.data;
- let arr =[];
- that.goods_list.forEach((item,index) => {
- item.title = that.escapeHTML(item.title)
- item.goods_id = item.cloud.goods_id
- arr.push(Object.assign({},item,{is_choose:0}))//是否选中
- });
- that.goods_list=arr;
- that.total = response.data.data.total;
- that.per_size = response.data.data.page_size;
- that.current_page = response.data.data.page;
- console.log(that.goods_list);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- },
- // 获取第三方分类、
- getThirdCategory(parent_id,level){
- this.$http.post('{!!yzWebFullUrl('plugin.yz-supply.admin.goods-import.getChildrenCategory')!!}', {
- 'parent_id': parent_id,
- 'middleground_configuration_id':this.search_form.middleground_configuration_id
- }).then(res => {
- if (res.data.result == '1') {
- switch (level) {
- case 1:
- this.category_list = res.data.data;
- break;
- case 2:
- this.category_list_v2 = res.data.data;
- break;
- case 3:
- this.category_list_v3 = res.data.data;
- break;
- default:
- this.category_list = res.data.data;
- break;
- }
- } else {
- this.$message({
- type: 'error',
- message: res.data.msg
- })
- }
- })
- },
- // 一级分类改变
- changeV1() {
- this.search_form.cate_v2 = "";
- this.search_form.cate_v3 = "";
- this.category_list_v2 = [];
- this.category_list_v3 = [];
- this.getThirdCategory(this.search_form.cate_v1,2)
- },
- // 二级分类改变
- changeV2() {
- this.search_form.cate_v3 = "";
- this.category_list_v3 = [];
- this.getThirdCategory(this.search_form.cate_v2,3)
- },
- // 单个选择
- oneChange(item) {
- let that = this;
- let is_all = 0;
- that.goods_list.some((item,index) => {
- if(item.is_choose == 1) {
- is_all = 1;
- }
- else {
- is_all = 0;
- return true;
- }
- })
- that.is_all_choose = is_all;
- },
- // 全选
- allChoose() {
- let that = this;
- let status = 0;
- if(that.is_all_choose == 1){
- status = 1;
- }
- else{
- status = 0;
- }
- that.goods_list.forEach((item,index) => {
- item.is_choose = status;
- })
- },
- // 批量上架
- batchStatusOn() {
- var that = this;
- that.$confirm('确定上架吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- let ids = [];
- that.goods_list.forEach((item,index) => {
- if(item.is_choose == 1){
- ids.push(item.id);
- }
- })
- let json = {ids:ids,'middleground_configuration_id':this.search_form.middleground_configuration_id}
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.batch-on-shelf') !!}",json).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success(response.data.msg);
- that.is_all_choose = 0;
- that.getData(1);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- },
- // 批量下架
- batchStatusOff() {
- var that = this;
- that.$confirm('确定下架吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- let ids = [];
- that.goods_list.forEach((item,index) => {
- if(item.is_choose == 1){
- ids.push(item.id);
- }
- })
- let json = {ids:ids,'middleground_configuration_id':this.search_form.middleground_configuration_id}
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.batch-off-shelf') !!}",json).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success(response.data.msg);
- that.is_all_choose = 0;
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- },
- //上架
- statusOn(id) {
- var that = this;
- that.$confirm('确定上架吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.on-shelf') !!}",{id:id,'middleground_configuration_id':this.search_form.middleground_configuration_id}).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success("上架提交成功!");
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- },
- //下架
- statusOff(id) {
- var that = this;
- that.$confirm('确定下架吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.off-shelf') !!}",{id:id,'middleground_configuration_id':this.search_form.middleground_configuration_id}).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success("下架成功!");
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- },
- //上架
- update(goods) {
- var that = this;
- let json = {
- goodsId:goods.id,
- category1_id:goods.category1_id,
- category2_id:goods.category2_id,
- category3_id:goods.category3_id,
- freight:goods.freight,
- freight_template_id:goods.freight_template_id,
- freight_type:goods.freight_type,
- }
- that.$confirm('确定更新吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.update') !!}",{goods:json,'middleground_configuration_id':this.search_form.middleground_configuration_id}).then(response => {
- if(response.data.result==1){
- that.$message.success("更新成功!");
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- },
- // 单个删除
- delOne(id) {
- var that = this;
- that.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.delete') !!}",{id:id,'middleground_configuration_id':this.search_form.middleground_configuration_id}).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success("删除成功!");
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- },
- // 批量删除
- batchDestroy() {
- var that = this;
- that.$confirm('确定删除吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- let ids = [];
- that.goods_list.forEach((item,index) => {
- if(item.is_choose == 1){
- ids.push(item.id);
- }
- })
- let json = {ids:ids,'middleground_configuration_id':this.search_form.middleground_configuration_id}
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.batch-delete') !!}",json).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success('操作成功!');
- that.is_all_choose = 0;
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消修改'});
- });
- },
- // 批量更新
- batchUpdate() {
- var that = this;
- that.$confirm('确定更新吗', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- let search = [];
- that.goods_list.forEach((item,index) => {
- if(item.is_choose == 1){
- let json = {
- goodsId:item.id,
- category1_id:item.category1_id,
- category2_id:item.category2_id,
- category3_id:item.category3_id,
- freight:item.freight,
- freight_template_id:item.freight_template_id,
- freight_type:item.freight_type,
- }
- search.push(json);
- }
- })
- console.log(search);
- let json = {data:search}
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.batch-update') !!}",json).then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success(response.data.msg);
- that.is_all_choose = 0;
- that.getData(that.current_page);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消修改'});
- });
- },
- batchUpdateStock() {
- var that = this;
- let job_num = 0;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.update-job-nums') !!}").then(response => {
- if(response.data.result==1){
- job_num = response.data.data.nums;
- let job = Math.ceil(this.total / 20);
- console.log(job);
- that.$confirm('一键更新所有推送到中台商品。该操作将产生'+job+'条队列。可能造成商城其他队列延迟执行,队列堵塞等情况,建议开启多个队列运行,请谨慎操作(每条队列所需时间约等于批量更新20条商品所需时间,当前约有'+job_num +'条队列等待执行)', '提示', {confirmButtonText: '确定更新',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.update-stock') !!}").then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success('队列生成成功!');
- that.is_all_choose = 0;
- // that.search(1);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- }
- }),function(res){
- console.log(res);
- };
- },
- batchUpdateStockStay(){
- var that = this;
- let job_num = 0;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.shop-goods.update-job-nums') !!}").then(response => {
- if(response.data.result==1){
- job_num = response.data.data.nums;
- let job = Math.ceil(this.total / 20);
- console.log(job);
- that.$confirm('一键更新所有待更新的商品。该操作将产生队列。可能造成商城其他队列延迟执行,队列堵塞等情况,建议开启多个队列运行,请谨慎操作(每条队列所需时间约等于批量更新20条商品所需时间,当前约有'+job_num +'条队列等待执行)', '提示', {confirmButtonText: '确定更新',cancelButtonText: '取消',type: 'warning'}).then(() => {
- that.table_loading = true;
- that.$http.post("{!! yzWebFullUrl('plugin.yz-supply.admin.cloud.cloud-goods.batch-update-stay') !!}").then(response => {
- console.log(response);
- if(response.data.result==1){
- that.$message.success('队列生成成功!');
- that.is_all_choose = 0;
- // that.search(1);
- }
- else{
- that.$message.error(response.data.msg);
- }
- that.table_loading = false;
- }),function(res){
- console.log(res);
- that.table_loading = false;
- };
- }).catch(() => {
- this.$message({type: 'info',message: '已取消'});
- });
- }
- }),function(res){
- console.log(res);
- };
- },
- // 字符转义
- escapeHTML(a) {
- a = "" + a;
- return a.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, "\"").replace(/'/g, "'");;
- },
- },
- })
- </script>
- @endsection
|