diff --git a/.env.development b/.env.development index 788479f5faca41b6d744c497db2b46a4535b1673..daa7e72fbe679ce5f27f98317c0570058f126b08 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,10 @@ # å¼€å‘环境é…ç½® ENV = 'development' -# gfast管ç†ç³»ç»Ÿ/å¼€å‘环境 +# æ£å¼çŽ¯å¢ƒ VUE_APP_BASE_API = 'http://sjapi.jxhh.com' +# è¾¾å” å¼€å‘环境 +#VUE_APP_BASE_API = 'http://192.168.111.32:8200' # è·¯ç”±æ‡’åŠ è½½ VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/src/utils/request.js b/src/utils/request.js index 990eea997540e5c3a2023870a5deed5490290c99..6d8d118e6b20eed44b79d524bb3e27d04a7a01b0 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -15,11 +15,11 @@ const service = axios.create({ // request拦截器 service.interceptors.request.use(config => { // 是å¦éœ€è¦è®¾ç½® token - const isToken = (config.headers || {}).isToken === false; + const isToken = (config.headers || {}).isToken === false if (getToken() && !isToken) { config.headers['Authorization'] = 'Bearer ' + getToken() // 让æ¯ä¸ªè¯·æ±‚æºå¸¦è‡ªå®šä¹‰token è¯·æ ¹æ®å®žé™…情况自行修改 } - //config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5Njc2MDMzLCJpc3MiOiJnaW4tYmxvZyJ9.ccnrAoIMRLQV1MAAII6J3F7ATnFDjcgUnMw6VoKuRA0' + //config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5NzQ4NzcxLCJpc3MiOiJnaW4tYmxvZyJ9.sAefBY0yvwxkQN3f6VjiYZellZasfLs7oRLGFi83BBA' return config }, error => { console.log("25reject"); @@ -30,19 +30,36 @@ service.interceptors.request.use(config => { service.interceptors.response.use(res => { // 未设置状æ€ç 则默认æˆåŠŸçŠ¶æ€ const code = res.data.code || 200; + // 返回所有数æ®çš„ç»Ÿä¸€å¤„ç† + const data = res.data; // 获å–é”™è¯¯ä¿¡æ¯ - const message = errorCode[code] || res.data.msg || errorCode['default'] - - if (code === 401 || code == 99999) { - MessageBox.confirm( - '登录状æ€å·²è¿‡æœŸï¼Œæ‚¨å¯ä»¥ç»§ç»ç•™åœ¨è¯¥é¡µé¢ï¼Œæˆ–è€…é‡æ–°ç™»å½•', - '系统æç¤º', - { - confirmButtonText: '釿–°ç™»å½•', - cancelButtonText: 'å–æ¶ˆ', - type: 'warning' + const message = errorCode[code] || res.data.msg || errorCode['default']; + // 200,1æ„å‘³ç€æˆåŠŸè¿”å›žæ•°æ® + if(code === 200 || code === 1) { + if( res.data ) { + return res.data + } else { + if( message ) { + Message({message: message, type: 'error'}); + }else { + Message({message: 'åŽå°æ•°æ®å‡ºé”™äº†ï¼', type: 'error'}); } - ).then(() => { + return Promise.reject('error'); + } + } + else if( code === 500) { + Message({ + message: message, + type: 'error' + }) + return Promise.reject(new Error(message)); + } + else if(code === 401 || code == 99999) { + MessageBox.confirm('登录状æ€å·²è¿‡æœŸï¼Œæ‚¨å¯ä»¥ç»§ç»ç•™åœ¨è¯¥é¡µé¢ï¼Œæˆ–è€…é‡æ–°ç™»å½•', '系统æç¤º', { + confirmButtonText: '釿–°ç™»å½•', + cancelButtonText: 'å–æ¶ˆ', + type: 'warning' + }).then(() => { store.dispatch('LogOut').then(() => { location.reload() // ä¸ºäº†é‡æ–°å®žä¾‹åŒ–vue-router对象 é¿å…bug }) @@ -86,7 +103,7 @@ service.interceptors.response.use(res => { message: message, type: "error" }); - // console.log(message); + console.log(message); // --- end ---- 开呿—¶å€™ç”¨è¿™æ®µï¼ŒæŠŠé”™è¯¯å½»åº•æŠ›å‡ºæ¥ --- end --- // --- start --- æ£å¼ä¸Šçº¿ï¼Œéšè—æŠ¥é”™ä¿¡æ¯ ----- start ---- @@ -101,6 +118,7 @@ service.interceptors.response.use(res => { // }, 1000); // --- end --- æ£å¼ä¸Šçº¿ï¼Œéšè—æŠ¥é”™ä¿¡æ¯ ----- end ---- + return Promise.reject(error) } ) diff --git a/src/views/entry/fillBrandInf.vue b/src/views/entry/fillBrandInf.vue index 6ddce55471a8e5c13c419e48b132494935f3004f..c6907a57d97c4457b2cbfe1cec3731b0249a9e2c 100644 --- a/src/views/entry/fillBrandInf.vue +++ b/src/views/entry/fillBrandInf.vue @@ -487,8 +487,8 @@ //this.resetForm(); getBrandsInf().then(res => { console.log("获å–å“牌:",res); - if(res.code === 1 && res.data) { - this.brandForm = res.data[0]; + if(res.code === 1 && res.data.data) { + this.brandForm = res.data.data[0]; // å•†æ ‡logoå›¾ç‰‡å¤„ç† let brandList = {}; let brandArr = []; diff --git a/src/views/system/asset/balance/index.vue b/src/views/system/asset/balance/index.vue index 772dff970926fc8016b6c40f6d019effb46d67d3..eaeebc4fed30fa084f125a774879a8308a3a9cca 100644 --- a/src/views/system/asset/balance/index.vue +++ b/src/views/system/asset/balance/index.vue @@ -7,7 +7,7 @@ <el-table v-loading="loading" :height="tableHeight" :data="assetList"> <el-table-column label="ID" align="center" prop="Id"/> <el-table-column label="æµæ°´è®¢å•å·" align="center" prop="BalanceSn"/> - <el-table-column label="å˜åЍ金é¢" align="center" :formatter="formatMoney" prop="ChangeMoney"/> + <el-table-column label="å˜åЍ金é¢" align="center" prop="ChangeMoney"/> <el-table-column label="å˜åŠ¨ç±»åž‹" align="center" :formatter="formatType" prop="ChangeType"/> <el-table-column label="æ—¶é—´" align="center" :formatter="formatTime" prop="AddTime"/> <el-table-column label="æè¿°" align="center" prop="Des"/> diff --git a/src/views/system/asset/bankcard/index.vue b/src/views/system/asset/bankcard/index.vue index cfcaaccd5a01078e5ccbda1a61a87479b21d4531..9acbe0419f9c85a42788d948e601a67a7a5d9aa0 100644 --- a/src/views/system/asset/bankcard/index.vue +++ b/src/views/system/asset/bankcard/index.vue @@ -5,7 +5,7 @@ <span>账户管ç†</span> <el-button style='float:right' - :disabled="!addbank" + :disabled="isAddbank" type="primary" icon="el-icon-plus" size="mini" @@ -165,7 +165,7 @@ banktitle: "å¯¹å…¬è´¦æˆ·ï¼ˆæ•°é‡æœ€å¤šä¸º3个)", // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚ open: false, - addbank: false, + isAddbank: false, bank: false, zfb: false, // æŸ¥è¯¢å‚æ•° @@ -245,8 +245,10 @@ this.bankcardList = response.data.list; //console.log(this.bankcardList) this.total = response.data.total; - if (this.total < 3) { - this.addbank = true + if (this.total >= 3) { + this.isAddbank = true; + }else { + this.isAddbank = false; } this.loading = false; }); diff --git a/src/views/system/freight/freight_list/index.vue b/src/views/system/freight/freight_list/index.vue index 96fb6ff3ae01be75461ca2b41215e3e48cd7e2ea..acc9677de8d00957542c6373764d8b70157d3f6e 100644 --- a/src/views/system/freight/freight_list/index.vue +++ b/src/views/system/freight/freight_list/index.vue @@ -2,7 +2,7 @@ <div class="app-container"> <el-card class="box-card"> <div slot="header" class="clearfix"> - <span>æçŽ°è®°å½•</span> + <span>è¿è´¹æ¨¡æ¿</span> <el-button style="float:right;margin-left: 10px;" @@ -13,15 +13,15 @@ @click="handleDelete" >åˆ é™¤ </el-button> - <el-button - style="float:right;" - type="success" - icon="el-icon-edit" - size="mini" - :disabled="single" - @click="handleUpdate" - >修改 - </el-button> +<!-- <el-button--> +<!-- style="float:right;"--> +<!-- type="success"--> +<!-- icon="el-icon-edit"--> +<!-- size="mini"--> +<!-- :disabled="single"--> +<!-- @click="handleUpdate"--> +<!-- >修改--> +<!-- </el-button>--> <el-button style="float:right;margin-left: 20px;" type="primary" @@ -35,13 +35,11 @@ <el-table v-loading="loading" :data="freightList" :height="tableHeight" @selection-change="handleSelectionChange"> <el-table-column type="selection" width="55" align="center"/> <el-table-column label="ID" align="center" prop="Id"/> - <el-table-column label="模æ¿åç§°" align="center" prop="Name"/> <el-table-column label="排åº" align="center" prop="Sort"/> <el-table-column label="æ˜¯å¦æ˜¯é»˜è®¤æ¨¡æ¿" align="center" :formatter="formatDefault" prop="IsDefault"/> <el-table-column label="类型" align="center" :formatter="formatType" prop="ChargeType"/> - - <el-table-column label="æ˜¯å¦æ˜¯é»˜è®¤" align="center" prop="Publish"/> + <el-table-column label="å¯ç”¨çжæ€" align="center" :formatter="formaStatus" prop="Publish"/> <el-table-column label="创建时间" align="center" :formatter="formatTime" prop="Created"/> <el-table-column label="æ“作" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope"> @@ -70,8 +68,8 @@ @pagination="getList" /> <!-- æ·»åŠ æˆ–ä¿®æ”¹freightå¯¹è¯æ¡† --> - <el-dialog :title="title" :visible.sync="open" v-if="open" width="90%" append-to-body> - <IndexBtn :option="form"/> + <el-dialog :title="title" :visible.sync="isOpen" v-if="isOpen" width="70%"> + <IndexBtn :option="form" @closeIndexbtn="closeDialog"/> </el-dialog> </el-card> </div> @@ -104,7 +102,7 @@ // å¼¹å‡ºå±‚æ ‡é¢˜ title: "", // æ˜¯å¦æ˜¾ç¤ºå¼¹å‡ºå±‚ - open: false, + isOpen: false, // æŸ¥è¯¢å‚æ•° queryParams: { pageNum: 1, @@ -142,11 +140,26 @@ }, watch: { fullHeight(val, oldval) { - console.log(val) this.tableHeight = val - 130 } }, methods: { + closeDialog(val) { + this.isOpen = val; + this.getList(); + }, + // æ¨¡æ¿æ˜¯å¦å¯ç”¨çŠ¶æ€ + formaStatus(row) { + let isPublish = row.Publish; + let publish = ''; + if(isPublish === 1) { + publish = 'å¯ç”¨'; + } + if(isPublish === 0) { + publish = 'ç¦ç”¨'; + } + return publish + }, formatType(row) { var typese = row.ChargeType var optDess = '' @@ -188,7 +201,7 @@ }, // å–æ¶ˆæŒ‰é’® cancel() { - this.open = false; + this.isOpen = false; this.reset(); }, // 表å•é‡ç½® @@ -220,14 +233,18 @@ }, // å¤šé€‰æ¡†é€‰ä¸æ•°æ® handleSelectionChange(selection) { - this.ids = selection.map(item => item.id) + this.ids = selection.map(item => item.Id) this.single = selection.length !== 1 this.multiple = !selection.length }, /** 新增按钮æ“作 */ handleAdd() { + if(this.total >= 20) { + this.$message({ message: 'æ‚¨å·²ç»æœ‰20个è¿è´¹æ¨¡æ¿äº†ï¼Œæš‚æ—¶ä¸å†æ”¯æŒæ›´å¤šå“¦ï¼',type: 'warning'}); + return; + } this.reset(); - this.open = true; + this.isOpen = true; this.form = { Id: 0, Sort: 0, @@ -245,19 +262,18 @@ ], Disdispatching: "", Publish: 0, - }, - this.title = "æ·»åŠ è¿è´¹æ¨¡æ¿"; + }; + this.title = "æ·»åŠ è¿è´¹æ¨¡æ¿"; }, /** 修改按钮æ“作 */ handleUpdate(row) { - console.log(row) this.reset(); const id = row.Id getFreight(id).then(response => { let formdate = response.data response.data.Dispatching = JSON.parse(formdate.Dispatching) this.form = response.data - this.open = true; + this.isOpen = true; this.title = "修改è¿è´¹æ¨¡æ¿"; }); }, @@ -269,7 +285,7 @@ updateFreight(this.form).then(response => { if (response.code === 0) { this.msgSuccess("修改æˆåŠŸ"); - this.open = false; + this.isOpen = false; this.getList(); } }); @@ -277,7 +293,7 @@ addFreight(this.form).then(response => { if (response.code === 0) { this.msgSuccess("新增æˆåŠŸ"); - this.open = false; + this.isOpen = false; this.getList(); } }); @@ -285,10 +301,12 @@ } }); }, + /* + * publish å¯ç”¨ç¦ç”¨çŠ¶æ€ 1是å¯ç”¨ï¼Œ0 ç¦ç”¨ + * */ /** åˆ é™¤æŒ‰é’®æ“作 */ handleDelete(row) { - console.log(row) - const ids = row.Id + const ids = row.Id || this.ids; this.$confirm('是å¦ç¡®è®¤åˆ 除è¿è´¹æ¨¡æ¿ç¼–å·ä¸º"' + ids + '"的数æ®é¡¹?', "è¦å‘Š", { confirmButtonText: "确定", cancelButtonText: "å–æ¶ˆ", @@ -298,8 +316,7 @@ }).then(() => { this.getList(); this.msgSuccess("åˆ é™¤æˆåŠŸ"); - }).catch(function () { - }); + }).catch(function () {}); }, } //methodsç»“æŸ }; diff --git a/src/views/system/freight/freight_list/indexbtn.vue b/src/views/system/freight/freight_list/indexbtn.vue index c248dd310fc198a3ef33732cf1ed53121da89713..f53586c0569faf7e92bfa54e9ce7908a06508eb9 100644 --- a/src/views/system/freight/freight_list/indexbtn.vue +++ b/src/views/system/freight/freight_list/indexbtn.vue @@ -105,7 +105,6 @@ </el-row> </el-form-item> <el-form-item label="ä¸é…é€åŒºåŸŸ"> - <p> <el-input v-model="goodsDate.Disdispatching" placeholder="" @@ -118,7 +117,6 @@ > </template> </el-input> - </p> </el-form-item> <el-form-item label="状æ€"> <el-radio-group v-model="goodsDate.Publish"> @@ -126,13 +124,11 @@ <el-radio :label="0">ç¦ç”¨</el-radio> </el-radio-group> </el-form-item> - <el-button class="btns" type="primary" @click="handleinfomationclick()">æäº¤</el-button + <el-button class="btns" type="primary" @click="handleinfomationclick()">æ 交</el-button > </el-form> - - - <el-dialog title="æç¤º" :visible.sync="dialogVisible" width="30%"> + <el-dialog title="选择ä¸é…é€çœ" :visible.sync="dialogVisible" width="30%" append-to-body> <div> <el-checkbox-group v-model="checkList"> <el-checkbox @@ -145,9 +141,7 @@ </div> <span slot="footer" class="dialog-footer"> <el-button @click="dialogVisible = false">å– æ¶ˆ</el-button> - <el-button type="primary" @click="btndisabled()" - >ç¡® 定</el-button - > + <el-button type="primary" @click="btndisabled()">ç¡® 定</el-button> </span> </el-dialog> </div> @@ -247,54 +241,43 @@ export default { }, opendias(type, i, index) { - let _this = this - this.goodsDate.Dispatching.forEach((element) => { //获å–åˆå§‹åŒ–æ•°æ®å·²é€‰ä¸ + this.goodsDate.Dispatching.forEach((element) => { let arrd = element.a.split(',') for(let i=0;i<arrd.length;i++){ - this.disabledate.push(arrd[i]); + this.disabledate.push(arrd[i]); } }); + let arr = this.goodsDate.Disdispatching.split(','); + for(let i=0;i<arr.length;i++){ + this.disabledate.push(arr[i]); + } + this.btnindex = index; + this.arrlist.forEach(item =>{ + item.value = false; + }) + this.checkList = type.split(","); - let arr = this.goodsDate.Disdispatching.split(',') - for(let i=0;i<arr.length;i++){ //获å–åˆå§‹åŒ–æ•°æ®ä¸é…é€ - this.disabledate.push(arr[i]); - } - - this.btnindex = index - this.arrlist.forEach(item =>{ - item.value = false - }) - this.checkList = type.split(","); - - let disabledates = JSON.parse(JSON.stringify(this.disabledate)); //å¯ä»¥å°†jsonå¯¹è±¡è½¬æ¢æˆjson对符串 - let disabarr = this.unique(disabledates,this.checkList) //去掉当å‰é€‰æ‹©çš„disabled效果 - this.arrlist.forEach(item =>{ - if (disabarr.includes(item.lable)) { - item.value = true - } - }) - - console.log(disabarr) - // 区域选择 - if (i == 0) { - //é…é€åŒºåŸŸ - + let disabledates = JSON.parse(JSON.stringify(this.disabledate)); //å¯ä»¥å°†jsonå¯¹è±¡è½¬æ¢æˆjson对符串 + let disabarr = this.unique(disabledates,this.checkList) //去掉当å‰é€‰æ‹©çš„disabled效果 + this.arrlist.forEach(item =>{ + if (disabarr.includes(item.lable)) { + item.value = true + } + }) - } else { - //ä¸é…é€åŒºåŸŸ - } this.dialogVisible = true; }, handleinfomationclick() {//æäº¤ - console.log(this.goodsDate) this.goodsDate.Disdispatching.forEach(item=>{ item.np = Number(item.np*100).toFixed() }) addFreight(this.goodsDate).then(response => { + console.log(296,response); + if(response.data.code === 1) { + this.$message({ message: '新增æˆåŠŸï¼', type: 'success'}); + this.$emit("closeIndexbtn",false); + } - if(response.data.code == 1){ - alert(response.data.msg); - } this.loading = false; }); }, @@ -372,7 +355,7 @@ li { border-bottom: 1px solid #e6ebf5; } .btns{ - width:500px; + width:180px; margin:0 auto; display: block; } diff --git a/src/views/system/goods/onsale/index.vue b/src/views/system/goods/onsale/index.vue index 11d85903df6b7492c894919e255e0eec03943b1c..d4826724bdcb1085e7ae26ede9b1f2ea2c132d8e 100644 --- a/src/views/system/goods/onsale/index.vue +++ b/src/views/system/goods/onsale/index.vue @@ -18,10 +18,18 @@ type="success" icon="el-icon-edit" size="mini" - @click="handleOnsale" >修改</el-button> </el-col> --> + <el-col :span="1.5"> + <el-button + type="success" + icon="" + size="mini" + @click="handleOffGoods" + >商å“下架 + </el-button> + </el-col> <el-col :span="1.5"> <el-button type="danger" @@ -100,7 +108,7 @@ </template> <script> import IndexBtn from '../add' -import { listGoods, getGoods, delGoods, addGoods, updateGoods } from '@/api/module/goods' +import { listGoods, getGoods, delGoods, addGoods, updateGoods, Onsale } from '@/api/module/goods' export default { name: "goods", data() { @@ -156,6 +164,25 @@ export default { } }, methods: { + /*商å“下架*/ + handleOffGoods(row) { + const rowIds = row.roleId || this.ids; + let params = {"ids": rowIds, "status": 0}; + if(!rowIds || rowIds.length === 0) { + this.$message({ message: '请先选择è¦ä¸‹æž¶çš„商哿•°æ®', type: 'warning'}); + return; + } + this.$confirm('是å¦ç¡®è®¤ä¸‹æž¶å•†å“ID为"' + rowIds + '"的数æ®é¡¹?', "è¦å‘Š", { + confirmButtonText: "确定", + cancelButtonText: "å–æ¶ˆ", + type: "warning" + }).then(function() { + return Onsale(params); + }).then(() => { + this.getList(); + this.msgSuccess("下架æˆåŠŸ"); + }) + }, //æ ¼å¼åŒ–ä»·æ ¼ formatePrice(row,s,value,i){ var nm =0