263 lines
10 KiB
HTML
263 lines
10 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8"/>
|
||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
|
||
<title></title>
|
||
<script src="./lib/jquery/dist/jquery.js"></script>
|
||
<script src="./lib/vuejs/vue.js"></script>
|
||
<script src="./lib/vuejs/axios.min.js"></script>
|
||
<script src="./lib/elementui/index.js"></script>
|
||
<!--<script src="./lib/linq.js/Content/Scripts/linq.min.js"></script>-->
|
||
<script src="Scripts/linq.js"></script>
|
||
<link href="./lib/elementui/index.css" rel="stylesheet"/>
|
||
|
||
</head>
|
||
<body>
|
||
<div id="app">
|
||
<el-container>
|
||
<el-header>食品生产许可信息及环节替换操作集合</el-header>
|
||
<el-main v-loading="loading" v-loading.fullscreen.lock="false" :element-loading-text="showLoadingTip"
|
||
element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.1)">
|
||
|
||
<el-row>
|
||
<el-form :inline="true" class="demo-form-inline" label-width="100px" size="small"
|
||
style=" box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); padding-top: 20px">
|
||
<el-form-item>
|
||
<el-button type="primary" :loading="btnLoading[0]" round @click="changeXKZ">
|
||
食品生产许可证状态替换
|
||
</el-button>
|
||
<el-button type="primary" :loading="btnLoading[0]" round @click="changeHuanJie">
|
||
刷新环节替换
|
||
</el-button>
|
||
<el-button type="primary" :loading="btnLoading[0]" round
|
||
@click="changeSuoShuJieZhen">
|
||
更换所属街镇
|
||
</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
</el-row>
|
||
|
||
<el-row>
|
||
<el-input type="textarea"
|
||
:rows="10"
|
||
placeholder="替换操作状态提示"
|
||
v-model="textarea">
|
||
</el-input>
|
||
</el-row>
|
||
</el-main>
|
||
<el-footer>
|
||
|
||
</el-footer>
|
||
</el-container>
|
||
|
||
|
||
</div>
|
||
|
||
</body>
|
||
</html>
|
||
|
||
|
||
<script>
|
||
///////////////////////////////////////////////////
|
||
//该部分是Vue应用封装
|
||
var app = new Vue({
|
||
el: '#app',
|
||
data() {
|
||
return {
|
||
|
||
//提示内容显示
|
||
textarea: "",
|
||
//等待提示
|
||
loading: false,
|
||
btnLoading: [false, false, false, false, false, false, false, false, false, false, false, false],
|
||
//正在进行实时更新替换, 大约需要30秒钟至几分钟不等, 请等待...
|
||
showLoadingTip: '系统正在操作中,请耐心的等待...',
|
||
//2-许可证状态的替换字典
|
||
DistrictDict: [
|
||
{"source": "10", "dest": "有效"}, {"source": "101", "dest": "首次有效"}, {
|
||
"source": "102",
|
||
"dest": "延续有效"
|
||
}, {"source": "103", "dest": "变更有效"},
|
||
{"source": "20", "dest": "过期"}, {"source": "30", "dest": "失效"}, {
|
||
"source": "301",
|
||
"dest": "注销"
|
||
}, {"source": "302", "dest": "被撤销"},
|
||
{"source": "303", "dest": "被吊销"}, {"source": "304", "dest": "被撤回"},
|
||
{"source": "1", "dest": "有效"}, {"source": "2", "dest": "过期"},
|
||
{"source": "3", "dest": "被撤销"}, {"source": "4", "dest": "被吊销"}, {
|
||
"source": "5",
|
||
"dest": "被撤回"
|
||
}, {"source": "6", "dest": "注销"},
|
||
{"source": "9", "dest": "其他"}
|
||
],
|
||
|
||
//新增加的环节替换
|
||
|
||
|
||
}
|
||
},
|
||
mounted() {
|
||
var _this = this; //this指向vue
|
||
Vue.prototype.$loading = this.loading
|
||
//_this.loading = true;
|
||
},
|
||
methods: {
|
||
|
||
//显示进度内容
|
||
addNote(str) {
|
||
var aData = new Date().toLocaleString();
|
||
;
|
||
this.textarea = aData + " " + str + '\r\n' + this.textarea;
|
||
},
|
||
//显示提示信息
|
||
showTip(strmessage) {
|
||
this.$message({
|
||
message: strmessage,
|
||
type: 'warning'
|
||
});
|
||
},
|
||
|
||
// btnid=当前按钮数组编号,dict=当前的字典,apiname=当前的访问接口名称,desc=当前的接口字段的中文描述
|
||
PublicChange(btnid, dict, apiname, desc) {
|
||
var _this = this; //this指向vue
|
||
_this.loading = true;
|
||
_this.btnLoading[btnid] = true;
|
||
_this.addNote("开始进行" + desc + "替换操作,共有" + dict.length + "个操作需要等待");
|
||
(async () => {
|
||
for (var i = 0; i < dict.length; i++) {
|
||
await axios({
|
||
url: "./ShiPinShengChan/" + apiname + "?source=" + dict[i].source + "&dest=" + dict[i].dest
|
||
}).then((res) => {
|
||
_this.addNote("第" + (i + 1).toString() + "/" + dict.length + "个完成," + res.data.data);
|
||
console.log(res);
|
||
if (i == (dict.length - 1)) {
|
||
_this.addNote("此次" + desc + "替换操作全部完成,谢谢使用!");
|
||
_this.loading = false;
|
||
_this.btnLoading[btnid] = false;
|
||
}
|
||
});
|
||
}
|
||
})();
|
||
},
|
||
//1-许可证状态替换
|
||
changeXKZ() {
|
||
this.PublicChange(1, this.DistrictDict, "ReplaceXKZWithDict", "许可证状态")
|
||
//增加日志20211109
|
||
addlog("SQL查询", "修改数据_替换[区县]")
|
||
},
|
||
//更新环节
|
||
changeHuanJie() {
|
||
var _this = this; //this指向vue
|
||
_this.loading = true;
|
||
//_this.btnLoading[btnid] = true;
|
||
//debugger
|
||
const dictXKZ = [
|
||
{name: '生产环节', value: 'SCHJ'},
|
||
{name: '餐饮环节', value: 'CYHJ'},
|
||
{name: '销售环节', value: 'XSHJ'},
|
||
];
|
||
|
||
_this.addNote("开始进行全局许可证识别以及替换操作,共有" + dictXKZ.length + "种识别替换的操作需要等待");
|
||
_this.addNote("1.许可证编号包含SC的,环节刷新为生产环节。2.主体业态等于1,环节刷新为销售环节。3.主体业态等于2,环节刷新为餐饮环节。4.主体业态等于3,环节刷新为餐饮环节。");
|
||
(async () => {
|
||
for (var i = 0; i < dictXKZ.length; i++) {
|
||
await axios({
|
||
url: "./ShiPinShengChan/ReplaceHuanJie?leixing=" + dictXKZ[i].value
|
||
}).then((res) => {
|
||
_this.addNote("第" + (i + 1).toString() + "/" + dictXKZ.length + "个[" + dictXKZ[i].name + "]识别以及替换操作完成," + res.data.data);
|
||
console.log(res);
|
||
if (i == (dictXKZ.length - 1)) {
|
||
_this.addNote("此次全局许可证识别以及替换操作全部完成,谢谢使用!");
|
||
_this.loading = false;
|
||
_this.btnLoading[btnid] = false;
|
||
}
|
||
});
|
||
}
|
||
})();
|
||
},
|
||
|
||
//按照设置的字典进行更换所属街镇
|
||
changeSuoShuJieZhen() {
|
||
var _this = this; //this指向vue
|
||
_this.loading = true;
|
||
//_this.btnLoading[btnid] = true;
|
||
//debugger
|
||
//const dictXKZ = [
|
||
// { name: '生产环节', value: 'SCHJ' },
|
||
// { name: '餐饮环节', value: 'CYHJ' },
|
||
// { name: '销售环节', value: 'XSHJ' },
|
||
//];
|
||
axios.get('./ShiPinShengChan/GetDistinctReadyJieDao').then((res) => {
|
||
console.log('res.data.data', res.data.data);
|
||
const dictJGJ = res.data.data;
|
||
_this.addNote("开始进行全局所属街镇的替换操作,共有" + dictJGJ.length + "组识别替换的操作需要等待");
|
||
|
||
(async () => {
|
||
for (var i = 0; i < dictJGJ.length; i++) {
|
||
await axios({
|
||
url: "./ShiPinShengChan/ReplaceJieDaoWithDict?str=" + dictJGJ[i]
|
||
}).then((res) => {
|
||
_this.addNote("第" + (i + 1).toString() + "/" + dictJGJ.length + "个[" + dictJGJ[i] + "]识别以及替换操作完成," + res.data.data);
|
||
console.log(res);
|
||
if (i == (dictJGJ.length - 1)) {
|
||
_this.addNote("此次全局所属街镇识别以及替换操作全部完成,谢谢使用!");
|
||
_this.loading = false;
|
||
_this.btnLoading[btnid] = false;
|
||
}
|
||
});
|
||
}
|
||
})();
|
||
|
||
})
|
||
|
||
}
|
||
}
|
||
})
|
||
///////////////////////////////////////////////////
|
||
|
||
|
||
//加上日志20211109
|
||
function addlog(otype, ocontent, ouser) {
|
||
var curUser = "";
|
||
if (sessionStorage['userName'] != null) {
|
||
curUser = sessionStorage['userName']
|
||
} else {
|
||
curUser = ouser
|
||
}
|
||
|
||
$.get("/operatelog/addlog?ouser=" + curUser + "&otype=" + otype + "&ocontent=" + ocontent.substring(0, 2500), {})
|
||
.then(function (e) { return true })
|
||
}
|
||
|
||
|
||
|
||
</script>
|
||
|
||
|
||
<style>
|
||
.el-header, .el-footer {
|
||
background-color: #B3C0D1;
|
||
color: #333;
|
||
text-align: center;
|
||
line-height: 60px;
|
||
}
|
||
|
||
|
||
.el-main {
|
||
background-color: #E9EEF3;
|
||
color: #333;
|
||
text-align: center;
|
||
line-height: 56px;
|
||
}
|
||
|
||
.el-button {
|
||
min-width: 200px;
|
||
}
|
||
|
||
body > .el-container {
|
||
margin-bottom: 40px;
|
||
}
|
||
|
||
</style>
|