Commit d74ed360 by jack

test 部署

1 parent 7ba6bab0
...@@ -15,12 +15,17 @@ const common = { ...@@ -15,12 +15,17 @@ const common = {
return false; return false;
} }
console.log(options.data); console.log(options.data);
axios({ let oParams = {
method: options.method || 'post', method: options.method || 'post',
url: options.url, url: options.url,
params: options.data,
responseType: 'blob' responseType: 'blob'
}).then(response => { }
if(options.method == 'GET' || options.method == 'get'){
oParams.params = options.data
}else{
oParams.data = options.data;
}
axios(oParams).then(response => {
if (!response) { if (!response) {
return return
}; };
......
...@@ -125,9 +125,7 @@ export default function $axios(options) { ...@@ -125,9 +125,7 @@ export default function $axios(options) {
break; break;
case '-1': case '-1':
if (data.errId == '-200') { if (data.errId == '-200') {
//window.refresh();
location.reload(); location.reload();
//window.reload()
} else { } else {
Util.Info({ Util.Info({
message: data.message || data.msg || '出错了,请联系管理员' message: data.message || data.msg || '出错了,请联系管理员'
...@@ -193,7 +191,7 @@ export default function $axios(options) { ...@@ -193,7 +191,7 @@ export default function $axios(options) {
} }
Util.Info({ Util.Info({
message: err.message + '66666' || '出错了,请联系管理员' message: err.message || '出错了,请联系管理员'
}) })
return Promise.reject(err) // 返回接口返回的错误信息 return Promise.reject(err) // 返回接口返回的错误信息
} }
......
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
<!-- 查看设备详情弹框区域 end --> <!-- 查看设备详情弹框区域 end -->
<!-- 设备初始化弹框 开始 --> <!-- 设备初始化弹框 开始 -->
<glsx-dialog :show="showInitModal" width="30%"> <glsx-dialog :show="showInitModal" width="30%" usefooter @closed="closeInitDialog">
<div class="init_box" v-if="showInitModal"> <div class="init_box" v-if="showInitModal">
<h2 class="h2">请确认是否初始化</h2> <h2 class="h2">请确认是否初始化</h2>
<h3 class="h3"> <h3 class="h3">
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</div> </div>
<div slot="footer"> <div slot="footer">
<el-button type="primary" @click="deviceInit()">确定</el-button> <el-button type="primary" @click="deviceInit()">确定</el-button>
<el-button @click="showInitModal = false">取消</el-button> <el-button @click="closeInitDialog">取消</el-button>
</div> </div>
</glsx-dialog> </glsx-dialog>
<!-- 设备初始化弹框 end --> <!-- 设备初始化弹框 end -->
...@@ -289,12 +289,12 @@ import { ...@@ -289,12 +289,12 @@ import {
FINDSENDMERCHANTNO, FINDSENDMERCHANTNO,
GETMAXDEVICESTATISREPORT, GETMAXDEVICESTATISREPORT,
GETDEVICERELATIONDETAIL, GETDEVICERELATIONDETAIL,
INITDEVICERELATION INITDEVICERELATION,
} from "@/http/interface"; } from '@/http/interface'
import GlsxDialog from "@/components/dialog/index"; import GlsxDialog from '@/components/dialog/index'
export default { export default {
components: { components: {
"glsx-dialog": GlsxDialog 'glsx-dialog': GlsxDialog,
}, },
data() { data() {
return { return {
...@@ -310,17 +310,17 @@ export default { ...@@ -310,17 +310,17 @@ export default {
registerDate: [], registerDate: [],
packageDate: [], packageDate: [],
tdWidth: 170, tdWidth: 170,
DATEFORMATE: str => { DATEFORMATE: (str) => {
return this.$Util.dateFormate(str); return this.$Util.dateFormate(str)
}, },
CUTSTR: (str, num) => { CUTSTR: (str, num) => {
return this.$Util.cutStr(str, num); return this.$Util.cutStr(str, num)
}, },
deviceTypeList: [], deviceTypeList: [],
DEVICESTATUS: { DEVICESTATUS: {
UA: "未激活", UA: '未激活',
AL: "已激活", AL: '已激活',
IN: "已初始化" IN: '已初始化',
}, },
merchantList: [], merchantList: [],
report: {}, report: {},
...@@ -331,195 +331,203 @@ export default { ...@@ -331,195 +331,203 @@ export default {
initForm: {}, initForm: {},
initFormRules: { initFormRules: {
reason: [ reason: [
{ required: true, message: "请选择初始化原因", trigger: "change" } { required: true, message: '请选择初始化原因', trigger: 'change' },
],
remark: [
{ required: true, message: '请输入原因描述', trigger: 'blur' },
], ],
remark: [{ required: true, message: "请输入原因描述", trigger: "blur" }]
}, },
currentSn:'' currentSn: '',
}; }
}, },
created() {}, created() {},
mounted: function() { mounted: function () {
this.getList(0, "100107"); this.getList(0, '100107')
this.getDeviceList(); this.getDeviceList()
this.getMerchantList(); this.getMerchantList()
this.getStatistics(); this.getStatistics()
}, },
methods: { methods: {
/** /**
* 查询列表 * 查询列表
*/ */
getList: function(current, code) { getList: function (current, code) {
const _this = this; const _this = this
const oParams = _this.getParams(); const oParams = _this.getParams()
console.log(current); console.log(current)
oParams.pageNum = current || _this.currentPage; oParams.pageNum = current || _this.currentPage
//oParams.currentPage = current || _this.currentPage; //oParams.currentPage = current || _this.currentPage;
if (code) { if (code) {
oParams.deviceCode = "100107"; oParams.deviceCode = '100107'
} else { } else {
delete oParams.deviceCode; delete oParams.deviceCode
} }
oParams.pageStart = (oParams.pageNum - 1) * 10; oParams.pageStart = (oParams.pageNum - 1) * 10
_this.tableLoading = true; _this.tableLoading = true
GETLISTDEVICEFILE(oParams).then(res => { GETLISTDEVICEFILE(oParams).then((res) => {
console.log(res); console.log(res)
_this.tableLoading = false; _this.tableLoading = false
if (res.returnCode == 0) { if (res.returnCode == 0) {
const { data } = res; const { data } = res
const { total, list } = data; const { total, list } = data
_this.tableData = list || []; _this.tableData = list || []
_this.pageTotal = total; _this.pageTotal = total
} }
}); })
}, },
/** /**
* 获取查询参数 * 获取查询参数
*/ */
getParams: function() { getParams: function () {
const oParams = this.formInline; const oParams = this.formInline
const m = this.registerDate; const m = this.registerDate
const n = this.packageDate; const n = this.packageDate
if (m && m.length > 0) { if (m && m.length > 0) {
oParams.outStorageStartDate = m[0]; oParams.outStorageStartDate = m[0]
oParams.outStorageEndDate = m[1]; oParams.outStorageEndDate = m[1]
} else { } else {
delete this.formInline.startDate; delete this.formInline.startDate
delete this.formInline.endDate; delete this.formInline.endDate
} }
if (n && n.length > 0) { if (n && n.length > 0) {
oParams.packageUserStartDate = n[0]; oParams.packageUserStartDate = n[0]
oParams.packageUserEndDate = n[1]; oParams.packageUserEndDate = n[1]
} else { } else {
delete this.formInline.startDate; delete this.formInline.startDate
delete this.formInline.endDate; delete this.formInline.endDate
} }
oParams.pageSize = this.pageSize; oParams.pageSize = this.pageSize
return oParams; return oParams
}, },
/** /**
* 每页展示 * 每页展示
*/ */
changePageSize: function(e) { changePageSize: function (e) {
this.pageSize = e; this.pageSize = e
this.getList(); this.getList()
}, },
/** /**
* 获取设备类型列表 * 获取设备类型列表
*/ */
getDeviceList: function() { getDeviceList: function () {
const _this = this; const _this = this
GETDEVICETYPE().then(res => { GETDEVICETYPE().then((res) => {
const { data } = res; const { data } = res
_this.deviceTypeList = data || []; _this.deviceTypeList = data || []
}); })
}, },
/** /**
* 获取所有信息 * 获取所有信息
*/ */
getMerchantList: function() { getMerchantList: function () {
const _this = this; const _this = this
FINDSENDMERCHANTNO().then(res => { FINDSENDMERCHANTNO().then((res) => {
_this.merchantList = res.data || []; _this.merchantList = res.data || []
}); })
}, },
/** /**
* 切换搜索条件 * 切换搜索条件
*/ */
changeCondition: function(e) { changeCondition: function (e) {
console.log(e); console.log(e)
/* if (e == 'SM') { /* if (e == 'SM') {
delete this.formInline.searchValue delete this.formInline.searchValue
} */ } */
delete this.formInline.searchValue; delete this.formInline.searchValue
}, },
/** /**
* 获取统计信息 * 获取统计信息
*/ */
getStatistics: function() { getStatistics: function () {
let _this = this; let _this = this
GETMAXDEVICESTATISREPORT().then(res => { GETMAXDEVICESTATISREPORT().then((res) => {
console.log(res); console.log(res)
_this.report = res.data || {}; _this.report = res.data || {}
}); })
}, },
/** /**
* 查看详情 * 查看详情
*/ */
lookDetail: function(id) { lookDetail: function (id) {
if (!id) { if (!id) {
return false; return false
} }
let _this = this; let _this = this
let oParams = {}; let oParams = {}
oParams.id = id; oParams.id = id
_this.showModal = true; _this.showModal = true
_this.modalLoading = true; _this.modalLoading = true
GETDEVICERELATIONDETAIL(oParams).then(res => { GETDEVICERELATIONDETAIL(oParams).then((res) => {
console.log(res); console.log(res)
_this.modalLoading = false; _this.modalLoading = false
if (res.returnCode == 0) { if (res.returnCode == 0) {
let _obj = res.data || {}; let _obj = res.data || {}
_this.detailInfo = _obj || {}; _this.detailInfo = _obj || {}
} }
}); })
}, },
/** /**
* 监听关闭弹框 * 监听关闭弹框
*/ */
closeModal: function() { closeModal: function () {
this.showModal = false; this.showModal = false
this.detailInfo = {}; this.detailInfo = {}
}, },
/** /**
* 打开初始化弹框 * 打开初始化弹框
*/ */
openInitModal:function(sn){ openInitModal: function (sn) {
this.currentSn = sn; this.currentSn = sn
this.showInitModal = true; this.showInitModal = true
},
/**关闭初始化弹框 */
closeInitDialog: function () {
this.currentSn = ''
this.showInitModal = false
}, },
/** /**
* 初始化设备 * 初始化设备
*/ */
deviceInit: function() { deviceInit: function () {
let _this = this; let _this = this
let o = _this.initForm; let o = _this.initForm
_this.$refs.initForm.validate(valid => { _this.$refs.initForm.validate((valid) => {
if (!valid) { if (!valid) {
return false; return false
} }
let oParams = {}; let oParams = {}
oParams.sn = _this.currentSn; oParams.sn = _this.currentSn
oParams.remark = o.reason == 1?'机器返厂翻新售卖':'其他原因:' + o.remark; oParams.remark =
INITDEVICERELATION(oParams).then(res => { o.reason == 1 ? '机器返厂翻新售卖' : '其他原因:' + o.remark
console.log(res); INITDEVICERELATION(oParams).then((res) => {
if(res.returnCode == 0){ console.log(res)
if (res.returnCode == 0) {
_this.$Util.Info({ _this.$Util.Info({
message:'操作成功', message: '操作成功',
type:'success' type: 'success',
}) })
_this.showInitModal = false; _this.showInitModal = false
_this.getList(); _this.getList()
} }
}); })
})
}); },
} },
} }
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!