作者 许海潮

合并分支 'brunch_li' 到 'master'

2-25修改



查看合并请求 !10
export function doEncrypt(msgString) {
let msg = msgString;
if (typeof (msgString) !== 'string') {
msg = JSON.stringify(msgString);
}
let sm2 = require('sm-crypto').sm2;
let keypair = sm2.generateKeyPairHex();
let publicKey = keypair.publicKey; // 公钥
let cipherMode = 0; // 1 - C1C3C2,0 - C1C2C3,默认为1
//let publicKey = 'MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAExVea1qP1qKJf5UyrTwmO9fnkGCjELqsodZUBEgecIaC68ELV1pvIk0wYEevJ98UnVeuo5aN+MNdgu7FxPmblgw=='; // 公钥
let encryptData = sm2.doEncrypt(msg, publicKey, cipherMode) + '04'; // 加密结果
return encryptData;
}
/**
* SM2解密
*/
export function decryptSM2(pass) {
let sm2 = require('sm-crypto').sm2;
console.log(sm2)
let keypair = sm2.generateKeyPairHex();
let privateKey = keypair.privateKey; // 私钥
//let privateKey = 'MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAExVea1qP1qKJf5UyrTwmO9fnkGCjELqsodZUBEgecIaC68ELV1pvIk0wYEevJ98UnVeuo5aN+MNdgu7FxPmblgw=='; // 公钥
let cipherMode = 0; // 1 - C1C3C2,0 - C1C2C3,默认为1
let decryptData = sm2.doDecrypt(pass, privateKey, cipherMode) // 解密结果
console.log(decryptData)
return decryptData
}
... ...
... ... @@ -1556,8 +1556,7 @@
"camelcase": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-1.2.1.tgz?cache=0&sync_timestamp=1603921799543&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcamelcase%2Fdownload%2Fcamelcase-1.2.1.tgz",
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=",
"dev": true
"integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
},
"camelcase-keys": {
"version": "2.1.0",
... ... @@ -5187,6 +5186,11 @@
"esprima": "^2.6.0"
}
},
"jsbn": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-1.1.0.tgz",
"integrity": "sha1-sBMHyym2GKHtJux56RH4A8TaAEA="
},
"jsesc": {
"version": "1.3.0",
"resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-1.3.0.tgz?cache=0&sync_timestamp=1603891242793&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsesc%2Fdownload%2Fjsesc-1.3.0.tgz",
... ... @@ -9706,6 +9710,14 @@
"integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=",
"dev": true
},
"sm-crypto": {
"version": "0.2.1",
"resolved": "https://registry.npm.taobao.org/sm-crypto/download/sm-crypto-0.2.1.tgz",
"integrity": "sha1-QLRQZ+Lf9hpBYIDZxVfRf2OLqhY=",
"requires": {
"jsbn": "^1.1.0"
}
},
"snapdragon": {
"version": "0.8.2",
"resolved": "https://registry.npm.taobao.org/snapdragon/download/snapdragon-0.8.2.tgz",
... ... @@ -10638,6 +10650,14 @@
"integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=",
"dev": true
},
"uppercamelcase": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/uppercamelcase/-/uppercamelcase-1.1.0.tgz",
"integrity": "sha1-Mk2YprOvx+iolT4QZBUJsOTiP5c=",
"requires": {
"camelcase": "^1.2.1"
}
},
"uri-js": {
"version": "4.4.0",
"resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.4.0.tgz?cache=0&sync_timestamp=1598814377097&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Furi-js%2Fdownload%2Furi-js-4.4.0.tgz",
... ... @@ -10812,6 +10832,14 @@
"resolved": "https://registry.npm.taobao.org/vue/download/vue-2.6.12.tgz?cache=0&sync_timestamp=1606946160685&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue%2Fdownload%2Fvue-2.6.12.tgz",
"integrity": "sha1-9evU+mvShpQD4pqJau1JBEVskSM="
},
"vue-amap": {
"version": "0.5.10",
"resolved": "https://registry.npmjs.org/vue-amap/-/vue-amap-0.5.10.tgz",
"integrity": "sha512-9ViNCev1vx32+zZ5RvF/TmUZNbwL9QrdA2/OnD2GlXMfQBkJy7D08Vb7379t6guqnopDPtWJ8K6gg72h9+4GUg==",
"requires": {
"uppercamelcase": "^1.1.0"
}
},
"vue-hot-reload-api": {
"version": "2.3.4",
"resolved": "https://registry.npm.taobao.org/vue-hot-reload-api/download/vue-hot-reload-api-2.3.4.tgz",
... ...
... ... @@ -12,8 +12,10 @@
"dependencies": {
"element-china-area-data": "^5.0.2",
"element-ui": "^2.14.1",
"sm-crypto": "^0.2.1",
"store": "^2.0.12",
"vue": "^2.5.2",
"vue-amap": "^0.5.10",
"vue-router": "^3.0.1",
"vuex": "^3.6.2"
},
... ...
<template>
<div id="app">
<router-view />
</div>
</template>
... ... @@ -10,26 +9,27 @@ export default {
name: "App",
data() {
return {
};
},
methods: {
},
created () {
var store = require('store');
//在页面加载时读取sessionStorage里的状态信息
if (sessionStorage.getItem("storedata") ) {
this.$store.replaceState(Object.assign({}, this.$store.state,JSON.parse(sessionStorage.getItem("storedata"))))
created() {
var store = require('store');
//在页面加载时读取sessionStorage里的状态信息
if (sessionStorage.getItem("storedata")) {
this.$store.replaceState(Object.assign({}, this.$store.state, JSON.parse(sessionStorage.getItem("storedata"))))
} //在页面刷新时将vuex里的信息保存到sessionStorage里
window.addEventListener("beforeunload",()=>{
sessionStorage.setItem("storedata",JSON.stringify(this.$store.state))
});
window.addEventListener("beforeunload", () => {
sessionStorage.setItem("storedata", JSON.stringify(this.$store.state))
});
// 兼容iphone手机
window.addEventListener("pagehide",()=>{
sessionStorage.setItem("storedata",JSON.stringify(this.$store.state))
});
window.addEventListener("pagehide", () => {
sessionStorage.setItem("storedata", JSON.stringify(this.$store.state))
});
},
};
</script>
... ...
import Axios from "axios";
import { Message } from 'element-ui';
import router from './router'
// 请求拦截
Axios.interceptors.request.use(
function(config) {
return config;
},
function(err) {
return Promise.reject(error);
}
function (config) {
return config;
},
function (err) {
return Promise.reject(error);
}
);
// 响应拦截
Axios.interceptors.response.use(
function(response) {
console.log(response)
//对响应数据做事情
console.log("请求成功", response);
if (response.data.code == 200) {
return response.data;
} else {
return Promise.reject(response.data);
}
},
function(error) {
console.log(error);
return Promise.reject(error.response.data);
res => {
console.log(res)
//对响应数据做事情
if (res.data.code == 500) {
Message.error(res.data.msg)
setTimeout(()=>{
router.push('/')
},1200)
} else if (res.data.code == 200) {
return res.data;
} else {
return Promise.reject(response.data)
}
// console.log("请求成功", res);
// if (res.data.code == 200) {
// return res.data;
// } else {
// return Promise.reject(response.data);
// }
},
err => {
console.log(err);
return Promise.reject(err.response.data);
}
);
export default Axios;
\ No newline at end of file
export default Axios;
... ...
... ... @@ -206,7 +206,7 @@
</div>
</div>
<div class="a" style="width:33.3%;">
<div class="a" style="width: 33.3%">
<div class="sd">
<div class="fa-ji">当前状况</div>
<div class="conrt">车辆绕路、产品偏移、司机未按路线形式.5</div>
... ... @@ -241,14 +241,19 @@
<div class="conrt">50</div>
</div>
</div>
</div>
<div class="jichuss">
<div class="ges"></div>
<div class="jichusa">产品货运单</div>
</div>
<div class="lista">
<el-table :data="tablelist" border style="width: 100%" height="100%" :header-cell-style="{ background: '#F4F4F5', color: '#303133' }">
<el-table
:data="tablelist"
border
style="width: 100%"
height="100%"
:header-cell-style="{ background: '#F4F4F5', color: '#303133' }"
>
<el-table-column
fixed
prop="date"
... ... @@ -269,17 +274,28 @@
<el-table-column fixed="right" label="操作" width="292">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
<el-button
@click="handleClick(scope.row)"
type="text"
size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="jichuss" style="margin-top: 23px;">
<div class="jichuss" style="margin-top: 23px">
<div class="ges"></div>
<div class="jichusa">异常事件报告</div>
</div>
<div class="lista">
<el-table :data="tablelist" border style="width: 100%" height="100%" :header-cell-style="{ background: '#F4F4F5', color: '#303133' }">
<el-table
:data="tablelist"
border
style="width: 100%"
height="100%"
:header-cell-style="{ background: '#F4F4F5', color: '#303133' }"
>
<el-table-column
fixed
prop="date"
... ... @@ -300,7 +316,12 @@
<el-table-column fixed="right" label="操作" width="292">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
<el-button
@click="handleClick(scope.row)"
type="text"
size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
... ... @@ -311,7 +332,13 @@
<div class="jichusa">途中检查记录</div>
</div>
<div class="lista">
<el-table :data="tablelist" border style="width: 100%" height="100%" :header-cell-style="{ background: '#F4F4F5', color: '#303133' }">
<el-table
:data="tablelist"
border
style="width: 100%"
height="100%"
:header-cell-style="{ background: '#F4F4F5', color: '#303133' }"
>
<el-table-column
fixed
prop="date"
... ... @@ -332,7 +359,12 @@
<el-table-column fixed="right" label="操作" width="292">
<template slot-scope="scope">
<el-button @click="handleClick(scope.row)" type="text" size="small">删除</el-button>
<el-button
@click="handleClick(scope.row)"
type="text"
size="small"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
... ... @@ -345,57 +377,69 @@
</template>
<script>
import Tabbar from "./tabbar.vue";
export default {
components: {
Tabbar,
},
data() {
return {
activeName: "second",
dialogVisible: false,
tablelists: [{
date: "请输入产品型号",
name: "请输入产品编号",
province: "请输入产品数量",
city: "请输入到货时间",
zhuan: "已完成",
}, ],
tablelist: [{
date: "请输入产品型号",
name: "请输入产品编号",
province: "请输入产品数量",
city: "请输入到货时间",
zhuan: "已完成",
}, ],
};
import Tabbar from "./tabbar.vue";
export default {
components: {
Tabbar,
},
data() {
return {
activeName: "second",
dialogVisible: false,
tablelists: [{
date: "请输入产品型号",
name: "请输入产品编号",
province: "请输入产品数量",
city: "请输入到货时间",
zhuan: "已完成",
},],
tablelist: [{
date: "请输入产品型号",
name: "请输入产品编号",
province: "请输入产品数量",
city: "请输入到货时间",
zhuan: "已完成",
},],
};
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
},
},
};
},
created() {
console.log(sessionStorage.getItem('token'))
console.log(this.$axios.defaults.headers['authorization'])
if (sessionStorage.getItem('token') != this.$axios.defaults.headers['authorization']) {
//默认请求头
this.$axios.defaults.headers['authorization'] = sessionStorage.getItem("token");
}
},
mounted(){
},
};
</script>
<style>
.el-tabs .el-tabs--top {
width: 80%;
}
.el-tabs .el-tabs--top {
width: 80%;
}
.is-top {
width:70%;
text-align: center;
}
.is-top {
width: 70%;
text-align: center;
}
.el-dialog {
border-radius: 16px;
}
.el-dialog {
border-radius: 16px;
}
.el-dialog__body {
padding: 0 20px 20px 20px;
}
.el-dialog__body {
padding: 0 20px 20px 20px;
}
</style>
<style scoped>
@import "../css/home.css";
@import "../css/fa.css";
@import "../css/home.css";
@import "../css/fa.css";
</style>
... ...
... ... @@ -55,6 +55,7 @@
</template>
<script>
export default {
name: "HelloWorld",
data() {
... ... @@ -62,11 +63,11 @@ export default {
imgs: "",
uuid: "",
code: "",
name: "",
pass: "",
name: "17696284687",
pass: "admin123",
};
},
methods() {},
methods() { },
created() {
this.codes();
},
... ... @@ -75,6 +76,10 @@ export default {
btn() {
let that = this;
var url = "/api/auth/login";
let word = that.$smEncryption(that.pass)
console.log(word)
let jj = that.$decrypt(word)
console.log(jj)
let params = {
code: that.code,
password: that.pass,
... ... @@ -93,6 +98,7 @@ export default {
that.$router.push("./home");
}, 800);
sessionStorage.setItem("token", res.data.access_token);
})
.catch(function (err) {
console.log(err);
... ...
... ... @@ -190,6 +190,8 @@
:page-size="20"
:pager-count="11"
layout="prev, pager, next"
:current-change="pageNum"
@current-change="changePageNum"
:total="total"
>
</el-pagination>
... ... @@ -239,9 +241,9 @@
<div class="ziliao-list">
<el-upload
class="upload-demo"
action="https://jsonplaceholder.typicode.com/posts/"
:on-preview="handlePreview"
:on-remove="handleRemove"
:action="uploadFile()"
:on-success="uploadSucc"
:on-error="uploadErr"
:before-remove="beforeRemove"
multiple
:limit="3"
... ... @@ -351,8 +353,9 @@
<div class="fa-ji">传真照片</div>
<div class="chuanzheng">
<el-upload
action="https://jsonplaceholder.typicode.com/posts/"
:action="uploadFile()"
list-type="picture-card"
:on-success="uploadPic"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemove"
>
... ... @@ -511,15 +514,13 @@
<div class="sd">
<div class="fa-ji">传真照片</div>
<div class="img-chuan">
<!-- <div class="lisg" v-for="(item,index) in details.photoIds" :key="index">
<img :src="item" class="tu" alt="" />
<img
src="../../assets/fanda.png"
class="fan"
alt=""
@click="chuans"
/>
</div> -->
<el-image
v-for="(bb, index) in details.photoIds"
:key="index"
style="width: 100px; height: 100px"
:src="bb"
:preview-src-list="details.photoIds"
error="我裂开啦" ></el-image>
</div>
</div>
</div>
... ... @@ -569,7 +570,24 @@
<div class="ziliaotu">
<div class="ziliao-left">
<img src="../../assets/21.png" class="ziliao-img" alt="" />
<span class="text-sp">food.jpg</span>
<el-image
v-for="(cc, index1) in details.fileIds"
:key="index1"
style="width: 100px; height: 100px"
:src="cc"
:preview-src-list="details.fileIds"
error="我裂开啦"
>
</el-image>
<el-image
v-for="(cc1, index2) in details.fileIds"
:key="index2"
style="width: 100px; height: 100px"
:src="cc1"
:preview-src-list="details.fileIds"
error="我裂开啦"
>
</el-image>
</div>
</div>
</div>
... ... @@ -634,15 +652,13 @@
<div class="sd">
<div class="fa-ji">传真照片</div>
<div class="img-chuan">
<!-- <div class="lisg" v-for="(item,index) in details.photoIds" :key="index">
<img :src="item" class="tu" alt="" />
<img
src="../../assets/fanda.png"
class="fan"
alt=""
@click="chuans"
/>
</div> -->
<el-image
v-for="(bb, index) in details.photoIds"
:key="index"
style="width: 100px; height: 100px"
:src="bb"
:preview-src-list="details.photoIds"
error="我裂开啦" ></el-image>
</div>
</div>
</div>
... ... @@ -692,7 +708,16 @@
<div class="ziliaotu">
<div class="ziliao-left">
<img src="../../assets/21.png" class="ziliao-img" alt="" />
<span class="text-sp">food.jpg</span>
<el-image
v-for="(cc, index1) in details.fileIds"
:key="index1"
style="width: 100px; height: 100px"
:src="cc"
:preview-src-list="details.fileIds"
error="我裂开啦"
>
</el-image>
</div>
</div>
</div>
... ... @@ -717,23 +742,23 @@
</el-table-column>
<el-table-column fixed="right" label="操作" width="272">
<template slot-scope="scope">
<el-button
@click="handleClick(scope.row.shipId, 3)"
type="text"
size="small"
>确认完成</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="queren">
<el-button type="primary" round @click="dialogVisibleq = false"
>确认</el-button
<div class="queren" >
<el-button type="primary" round @click="handleClick(3)">确认</el-button
>
<el-button round @click="dialogVisibleq = false">取消</el-button>
</div>
</div>
</el-dialog>
<!-- 查看详情 -->
... ... @@ -766,15 +791,13 @@
<div class="sd">
<div class="fa-ji">传真照片</div>
<div class="img-chuan">
<!-- <div class="lisg" v-for="(item,index) in details.photoIds" :key="index">
<img :src="item" class="tu" alt="" />
<img
src="../../assets/fanda.png"
class="fan"
alt=""
@click="chuans"
/>
</div> -->
<el-image
v-for="(bb, index) in details.photoIds"
:key="index"
style="width: 100px; height: 100px"
:src="bb"
:preview-src-list="details.photoIds"
error="我裂开啦" ></el-image>
</div>
</div>
</div>
... ... @@ -823,8 +846,15 @@
<div class="ziliao-lists">
<div class="ziliaotu">
<div class="ziliao-left">
<img src="../../assets/21.png" class="ziliao-img" alt="" />
<span class="text-sp">food.jpg</span>
<el-image
v-for="(cc, index1) in details.fileIds"
:key="index1"
style="width: 100px; height: 100px"
:src="cc"
:preview-src-list="details.fileIds"
error="我裂开啦"
>
</el-image>
</div>
</div>
</div>
... ... @@ -885,24 +915,20 @@ export default {
data() {
return {
tableData: [],
tablelist: [{
productId: "",
num: "",
moneyTime: "",
detailId: "",
lastNum: "",
shipId: "",
status: "",
},],
fileList: [{
name: 'food.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
}, {
name: 'food2.jpeg',
url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100'
}],
tablelist: [
{
productId: "",
num: "",
moneyTime: "",
detailId: "",
lastNum: "",
shipId: "",
status: "",
},
],
fileList: [],
tablelists: [],
tablelists: "",
options: [],
dialogVisible: false,
dialogVisibleg: false,
... ... @@ -929,15 +955,16 @@ export default {
shipId: "", //申请计划
telegramListName: "", //电站名称
pageNum: 1,
photoIds: "",
pageSize: 10,
details: [],
total: null, //总条数
optionsas: [],
name: "",
clickfinishshipId:''// 点击完成发货计划ID
};
},
computed: {
},
computed: {},
mounted() {
this.dian();
this.fahuo();
... ... @@ -952,12 +979,35 @@ export default {
console.log(file);
},
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
this.$message.warning(
`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
files.length + fileList.length
} 个文件`
);
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${file.name}?`);
},
/**上传地址 */
uploadFile() {
return "api/file/upload";
},
/*上传附件成功*/
uploadSucc(fileList) {
this.fileList =
this.fileList == "" ? fileList.msg + "," : this.fileList + fileList.msg;
console.log(this.fileList);
},
/**上传图片 */
uploadPic(fileList) {
this.photoIds =
this.photoIds == "" ? fileList.msg + "," : this.photoIds + fileList.msg;
console.log(this.photoIds);
},
/* 上传失败 */
uploadErr() {
console.log("上传失败");
},
onSubmit(val) {
this.value = val;
this.dian();
... ... @@ -966,6 +1016,9 @@ export default {
chaxun() {
this.fahuo();
},
//select发生改变市
currentSel(selVal) {
console.log(selVal);
... ... @@ -990,10 +1043,15 @@ export default {
console.log(err);
});
},
/* 奥利给分页 */
changePageNum(page){
this.pageNum=page;
this.fahuo();
},
//确认完成
handleClick(id, index) {
handleClick(index) {
let that = this;
var url = "/api/ship/ship/" + id + "/" + index;
var url = "/api/ship/ship/" + that.clickfinishshipId + "/" + index;
let params = {};
that.$axios
.put(url)
... ... @@ -1002,9 +1060,8 @@ export default {
message: "确认完成",
type: "success",
});
// that.dialogVisibleg = false;
// that.fahuo();
// console.log(res);
that.dialogVisibleq = false
that.fahuo();
})
.catch(function (err) {
console.log(err);
... ... @@ -1034,8 +1091,8 @@ export default {
//搜索
getCategoryOptions(val, index, rows) {
console.log(val);
console.log()
this.chanping(val, index, rows)
console.log();
this.chanping(val, index, rows);
// this.chan()
},
//根据产品id搜索
... ... @@ -1047,7 +1104,7 @@ export default {
.get(url)
.then(function (res) {
console.log(index, rows);
rows[index].detailId = res.data.productCoding
rows[index].detailId = res.data.productCoding;
})
.catch(function (err) {
console.log(err);
... ... @@ -1106,25 +1163,26 @@ export default {
},
//获取发货计划列表
fahuo() {
console.log("11")
console.log(this.$axios.defaults.headers)
let that = this;
var url = "/api/ship/ship/list";
let params = {
pageSize: that.pageSize,
createBy: that.createBy,
createTime: that.createTime,
contractCode: that.contractCode,
pageNum: that.pageNum,
pageSize: that.pageSize,
shipId: that.shipId,
telegramListName: that.telegramListName,
} || '';
that.$axios.post(url, params).then(res => {
console.log(res);
that.tableData = res.rows;
that.total = res.total;
})
let params =
{
pageSize: that.pageSize,
createBy: that.createBy,
createTime: that.createTime,
contractCode: that.contractCode,
pageNum: that.pageNum,
pageSize: that.pageSize,
shipId: that.shipId,
telegramListName: that.telegramListName,
} || "";
that.$axios
.post(url, params)
.then((res) => {
console.log(res);
that.tableData = res.rows;
that.total = res.total;
})
.catch(function (err) {
console.log(err);
});
... ... @@ -1138,20 +1196,44 @@ export default {
that.$axios
.get(url)
.then(function (res) {
console.log(res);
res=that.changePicAdress(res)
that.details = res.data;
console.log(that.details);
})
.catch(function (err) {
console.log(err);
});
},
//改变后台数据
changePicAdress(res){
let arr = [];
res.data.photoIds = res.data.photoIds.indexOf(",") > -1? (res.data.photoIds = res.data.photoIds.split(",")): (res.data.photoIds = arr.push(res.data.photoIds));
//添加地址
res.data.photoIds=res.data.photoIds.map((element) => {
element = "http://wisdom.jd.brotop.cn/file/download/" + element;
return element;
});
let brr = [];
res.data.fileIds =res.data.fileIds.indexOf(",") > -1 ? (res.data.fileIds = res.data.fileIds.split(",")): (res.data.fileIds = brr.push(res.data.fileIds));
//添加地址
res.data.fileIds=res.data.fileIds.map((element) => {
element = "http://wisdom.jd.brotop.cn/file/download/" + element;
return element;
});
return res;
},
//新增发货计划确认
btn() {
let that = this;
var url = "/api/ship/ship/add";
let params = {
shipPlan: that.shipPlan, //发货计划
fileIds: "https://zqvcil8xjx.feishu.cn/docs/doccnzYUyK8v7fK3MQrPNodwPMQ", //附带资料
fileIds: that.fileList, //附带资料
moneyContactPerson: that.moneyContactPerson, //到货联系人
telegramList: that.value, //发电站编码集合
latitude: "31.25658", //经度
... ... @@ -1164,23 +1246,23 @@ export default {
productionStatus: that.productionStatus, //生产情况
vehicleRequirements: that.vehicleRequirements, //车辆要求
remarks: that.remarks, //备注
photoIds: "https://images.cnblogs.com/cnblogs_com/s313139232/1258426/o_o_headers.jpg", //传真照片
photoIds: that.photoIds, //传真照片
mainShipDetail: that.tablelist,
};
that.$axios
.post(url, params)
.then(function (res) {
console.log(res);
console.log("确认订单" + res);
that.$message({
message: "添加成功",
type: "success",
});
that.dialogVisible = false;
that.contractCode = ''
that.fahuo()
that.contractCode = "";
that.fahuo();
})
.catch(function (err) {
that.$message.error(err.msg)
that.$message.error(err.msg);
console.log(err);
});
},
... ... @@ -1239,7 +1321,7 @@ export default {
that.$axios
.get(url)
.then(function (res) {
console.log(res);
res=that.changePicAdress(res)
that.details = res.data;
})
.catch(function (err) {
... ... @@ -1248,6 +1330,7 @@ export default {
},
//确认发货
que(id) {
this.clickfinishshipId=id; //我每次都赋值
this.dialogVisibleq = true;
let that = this;
var url = "/api/ship/ship/" + id;
... ... @@ -1255,9 +1338,9 @@ export default {
that.$axios
.get(url)
.then(function (res) {
console.log(res);
that.details = res.data;
that.fahuo()
res=that.changePicAdress(res)
that.details = res.data;
that.fahuo();
})
.catch(function (err) {
console.log(err);
... ...
... ... @@ -166,7 +166,7 @@
size="small"
v-if="scope.row.status == 0"
@click="fason(scope.row.dispatchCarId)"
>发送通知</el-button
>{{scope.row.status == 0||scope.row.status == 1?'发送通知':'通知处理'}}</el-button
>
<el-button
type="text"
... ... @@ -761,4 +761,4 @@ export default {
<style scoped>
@import "../../css/fa.css";
@import "../../css/pai.css";
</style>
\ No newline at end of file
</style>
... ...
... ... @@ -1686,4 +1686,4 @@ export default {
<style scoped>
@import "../../css/fa.css";
@import "../../css/pei.css";
</style>
\ No newline at end of file
</style>
... ...
... ... @@ -15,14 +15,22 @@
<div class="fhuo">
<div class="fahuos">
<div class="fas-text">部门ID</div>
<input type="text" placeholder="请输入部门ID" class="fa-input" />
<input
type="text"
placeholder="请输入部门ID"
class="fa-input"
v-model.trim="getdeptId"
@input="searchSector"
/>
</div>
<div class="fahuos">
<div class="fas-text">部门名称</div>
<input
v-model.trim="getdeptName"
type="text"
placeholder="请输入部门名称"
class="fa-input"
class="inputsad"
@input="searchSector"
/>
</div>
<div class="fahuos">
... ... @@ -35,7 +43,19 @@
</div>
<div class="fahuos">
<div class="fas-text">状态</div>
<input type="text" placeholder="请输入状态" class="fa-input" />
<el-select
v-model.trim="getstatus"
placeholder="请输入状态"
@input="searchSector"
>
<el-option
v-for="item in statusOption"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</div>
</div>
... ... @@ -47,28 +67,34 @@
height="100%"
:header-cell-style="{ background: '#F4F4F5', color: '#303133' }"
>
<el-table-column fixed prop="date" label="部门ID" width="330">
<el-table-column fixed prop="deptId" label="部门ID" width="330">
</el-table-column>
<el-table-column prop="name" label="部门名称" width="330">
<el-table-column prop="deptName" label="部门名称" width="330">
</el-table-column>
<el-table-column prop="province" label="部门类型" width="330">
<el-table-column prop="deptType" label="部门类型" width="330">
</el-table-column>
<el-table-column prop="city" label="状态" width="277">
<el-table-column prop="status" label="状态" width="277">
<template slot-scope="scope">
<span :style="{color: scope.row.status == '正常' ? '#67C23A' : '#EE0A24',}">
{{ scope.row.status }}
</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="277">
<template>
<el-table-column fixed="right" label="操作" width="277">+
<template slot-scope="scope">
<el-button
type="text"
size="small"
@click="dialogVisibleh = true"
>查看</el-button
>
<el-button type="text" size="small">编辑</el-button>
<el-button type="text" size="small" @click="cha"
>审核</el-button
>编辑</el-button
>
<el-button type="text" size="small" @click="que"
>确认完成</el-button
<el-button
type="text"
size="small"
@click="statusChange(scope.row.deptId, scope.row.status)"
>{{ scope.row.status == "正常" ? "禁用" : "解禁" }}</el-button
>
</template>
</el-table-column>
... ... @@ -82,14 +108,13 @@
共{{ tableData.length }}页
</div>
<div class="kls">
<!-- @prev-click="prevPage" -->
<!-- @prev-click="prevPage" -->
<el-pagination
:page-size="10"
:pager-count="11"
layout="prev, pager, next"
:total="tableData.length"
hide-on-single-page
>
</el-pagination>
</div>
... ... @@ -108,7 +133,12 @@
<div class="a">
<div class="sd">
<div class="fa-ji">部门ID</div>
<input type="text" placeholder="448859999" class="inputsad" />
<input
type="text"
placeholder="请输入部门ID"
class="inputsad"
v-model.trim="deptId"
/>
</div>
</div>
... ... @@ -119,6 +149,7 @@
type="text"
placeholder="请输入部门名称"
class="inputsad"
v-model.trim="deptName"
/>
</div>
</div>
... ... @@ -126,19 +157,22 @@
<div class="a">
<div class="sd">
<div class="fa-ji">部门类型</div>
<input
type="text"
placeholder="请输入部门类型"
class="inputsad"
/>
<el-select v-model="deptType" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</div>
</div>
<div class="queren">
<el-button type="primary" round @click="dialogVisible = false"
>确认</el-button
>
<el-button type="primary" round @click="addSector">确认</el-button>
<el-button round @click="dialogVisible = false">取消</el-button>
</div>
</div>
... ... @@ -151,21 +185,121 @@ export default {
data() {
return {
tableData: [
'qqqq'
],
dialogVisible: false,
dialogImageUrl: "",
pages: ''
pages: '',
deptId: '',
deptName: '',
options: [{
value: '1',
label: '事业部门'
}, {
value: '2',
label: '市场部门'
}, {
value: '3',
label: '职能部门'
}],
deptType: '',
statusOption: [{
value: '',
label: '请输入状态'
}, {
value: '0',
label: '正常 '
}, {
value: '1',
label: '停用'
}],
page: 1,
pageSize: 10,
getdeptId: '',
getdeptName: '',
getstatus: ''
};
},
mounted() {
console.log('111')
this.getSector()
},
methods: {
//编辑发货申请
handleClick(row) {
console.log(row);
},
//添加部门cz'
addSector() {
this.dialogVisible = false
if (!this.deptId || !this.deptName || !this.deptType) {
this.$message({
type: 'warning',
message: '缺少必填项',
duration: 1000
})
return;
}
this.$axios.post('api/system/dept/add', { deptId: this.deptId, deptName: this.deptName, deptType: this.deptType }).then(res => {
if (res.code == 200) {
this.$message({
type: 'success',
message: res.msg,
duration: 1000
})
} else {
this.$message({
type: 'warning',
message: res.msg,
duration: 1000
})
}
}).catch(err => {
console.log(err)
})
},
/* 禁用状态 */
statusChange(id, staus) {
staus = staus == '正常' ? '1' : '0'
this.$axios.put('api/system/dept/upldate/' + staus + '/' + id + '').then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
},
/** 获取部门guan里 搜索也是这接口 */
getSector() {
this.$axios.post('api/system/dept/list',
{
pageNum: this.page, pageSize: this.pageSize,
deptId: this.getdeptId,
deptName: this.getdeptName,
status: this.getstatus
}).then(res => {
if (res.code == 200) {
this.tableData = res.rows.map(element => {
element.deptType = element.deptType == 1 ? '事业部门' : (element.deptType == 2 ? '市场部门' : '职能部门')
element.status = element.status == 0 ? '正常' : '停用'
return element;
});
console.log(this.tableData)
} else {
this.$message({
type: 'warning',
message: res.msg,
duration: 1000
})
}
}).catch(err => {
console.log(err)
})
},
//搜索?
searchSector() {
this.getSector();
},
//上传图片
handleRemove(file, fileList) {
console.log(file, fileList);
... ... @@ -229,7 +363,11 @@ export default {
margin-top: 52px;
height: 629px;
}
.el-input__inner {
margin-top: 16px;
border: 1px solid #ccc;
}
</style>
<style scoped>
@import "../../css/fa.css";
</style>
\ No newline at end of file
</style>
... ...
... ... @@ -55,7 +55,7 @@
>
<el-table-column
fixed
prop="productId"
prop="productCoding"
label="产品编码"
width="184"
>
... ... @@ -63,8 +63,13 @@
<el-table-column prop="productName" label="产品名称" width="284">
</el-table-column>
<el-table-column prop="productType" label="产品类型 " width="128">
<template slot-scope="scope">
<span>{{ scope.row.productType == 1 ? "成套" : "标准" }}</span>
</template>
</el-table-column>
<el-table-column prop="breed" label="品种" width="128">
</el-table-column>
<el-table-column prop="breed" label="品种" width="128">
<el-table-column prop="productModel" label="产品型号" width="128">
</el-table-column>
<el-table-column prop="size" label="尺寸" width="160">
</el-table-column>
... ... @@ -72,21 +77,18 @@
</el-table-column>
<el-table-column prop="deptId" label="事业部 " width="160">
</el-table-column>
<el-table-column prop="deptId" label="状态 " width="160">
<el-table-column prop="status" label="状态 " width="160">
<template slot-scope="scope">
<el-button
type="text"
size="small"
v-if="scope.row.status == 0"
style="color: rgba(0, 204, 0, 1)"
>正常</el-button
>
<el-button
<span
type="text"
size="small"
v-if="scope.row.status == 1"
style="color: rgba(255, 0, 0, 1)"
>停用</el-button
:style="{
color:
scope.row.status == 1
? 'rgba(255, 0, 0, 1)'
: 'rgba(0, 204, 0, 1)',
}"
>{{ scope.row.status == 1 ? "停用" : "正常" }}</span
>
</template>
</el-table-column>
... ... @@ -95,9 +97,9 @@
<el-button type="text" size="small" @click="editor(scope.row)"
>编辑</el-button
>
<el-button type="text" size="small" v-if="scope.row.status == 0"
>禁用</el-button
>
<el-button type="text" size="small">{{
scope.row.status == 1 ? "解禁" : "禁用"
}}</el-button>
</template>
</el-table-column>
</el-table>
... ... @@ -108,10 +110,12 @@
<div class="gon">共{{ total }}条</div>
<div class="kls">
<el-pagination
:page-size="20"
:page-size="10"
:pager-count="11"
layout="prev, pager, next"
:total="total"
:current-page="pageNum"
@current-change="handleCurrentChange"
>
</el-pagination>
</div>
... ... @@ -137,6 +141,17 @@
v-model="productModel"
/>
</div>
<div class="sd">
<div class="fa-ji">产品名称</div>
<input
type="text"
placeholder="请输入产品名称"
class="input"
v-model="productName"
/>
</div>
<div class="sd">
<div class="fa-ji">品类</div>
<input
... ... @@ -164,7 +179,7 @@
type="text"
placeholder="请输入产品编号"
class="input"
v-model="productId"
v-model="productCoding"
/>
</div>
<div class="sd">
... ... @@ -181,12 +196,15 @@
<div class="a" style="width: 33.3%">
<div class="sd">
<div class="fa-ji">产品类型</div>
<input
type="text"
placeholder="请输入产品类型"
class="input"
v-model="productType"
/>
<el-select v-model="productType" placeholder="请选择产品类型">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
<div class="sd">
<div class="fa-ji">重量</div>
... ... @@ -214,6 +232,13 @@ export default {
data() {
return {
tableData: [],
options: [{
value: '1',
label: '成套'
}, {
value: '2',
label: '标准'
}],
dialogVisible: false,
dialogImageUrl: "",
productModel: "", //产品型号
... ... @@ -223,6 +248,7 @@ export default {
size: "", //尺寸
productType: "", //产品类型
weight: "", //重量
productName: '',
pageSize: 10,
pageNum: 1,
productId: "", //产品编码
... ... @@ -235,33 +261,64 @@ export default {
mounted() {
this.chanpinliet();
},
watch:{
data(dialogVisible,newdialogVisible){
console.log(dialogVisible)
console.log(newdialogVisible)
}
},
methods: {
//新增产品
//新增产品 修改必须还的用这个
xinzeng() {
let that = this;
var url = "/api/system/product/add";
let params = {
productModel: that.productModel,
breed: that.breed,
deptId: that.deptId,
productCoding: that.productId,
productCoding: that.productCoding,
size: that.size,
productType: that.productType,
weight: that.weight,
productName: that.productName,
};
that.$axios
.post(url, params)
.then(function (res) {
console.log(res);
that.$message({
message: "添加成功",
type: "success",
if (that.editorProduct == '' || that.editorProduct == null) {
let url = "/api/system/product/add";
that.$axios
.post(url, params)
.then(function (res) {
console.log(res);
that.$message({
message: "添加成功",
type: "success",
});
that.dialogVisible = false
that.tableData.unshift(params)
that.total++
})
.catch(function (err) {
console.log(err);
});
that.dialogVisible = false
})
.catch(function (err) {
console.log(err);
});
} else {
let url = "/api/system/product/edit";
that.$axios
.put(url, params)
.then(function (res) {
console.log(res);
that.$message({
message: "修改成功",
type: "success",
});
that.dialogVisible = false
that.editorProduct = ''
})
.catch(function (err) {
console.log(err);
});
}
},
//获取产品信息列表
chanpinliet() {
... ... @@ -301,15 +358,24 @@ export default {
//**编辑商品 * */
editor(val) {
console.log(val)
this.$axios("api/system/product/"+val.productId+"").then(res=>{
console.log(res)
val=res.data
}).catch(err=>{
console.log(err)
})
this.editorProduct = val;
this.dialogVisible = true
this.productModel = val.productModel
this.breed = val.breed
this.deptId = val.deptId
this.productId = val.productId
this.productCoding = val.productCoding
this.size = val.size
this.productType = val.productType
this.weight = val.weight
this.productName = val.productName
this.productId=val.productId
},
/** 添加商品 * */
addEidor() {
... ... @@ -322,11 +388,13 @@ export default {
this.size = ''
this.productType = ''
this.weight = ''
},
handleCurrentChange(pageNum) {
this.pageNum = pageNum;
this.chanpinliet()
}
},
updated() {
this.chanpinliet()
}
};
</script>
... ... @@ -367,4 +435,4 @@ export default {
<style scoped>
@import "../../css/fa.css";
@import "../../css/pei.css";
</style>
\ No newline at end of file
</style>
... ...
... ... @@ -8,7 +8,7 @@
</div>
<div class="peiches">
<el-button type="primary" @click="dialogVisible = true">添加车辆</el-button>
</div>
</div>
<div class="biaoge">
... ... @@ -141,7 +141,7 @@
title="车辆管理"
:visible.sync="dialogVisible"
width="60%"
:append-to-body="true"
style="margin-top: 8%"
>
... ... @@ -251,7 +251,7 @@
</div>
</div>
<div class="queren">
<el-button type="primary" round @click="chebtn">确认</el-button>
<el-button round @click='dialogVisible = false'>取消</el-button>
</div>
... ... @@ -429,6 +429,13 @@ export default {
type: "success",
});
that.dialogVisible = false;
// 清空data数据
Object.assign(that.$data, that.$options.data())
console.log(that.$options.data())
console.log(that.$data)
that.pageNum=1,
that.pageSize= 10,
that.chelians()
})
.catch(function (err) {
... ... @@ -496,4 +503,4 @@ export default {
@import "../../css/fa.css";
@import "../../css/pai.css";
@import "../../css/pei.css";
</style>
\ No newline at end of file
</style>
... ...
... ... @@ -187,7 +187,7 @@
outline: none;
}
.inputsad{
width: 200px;
height: 40px;
background: #ffffff;
border: 1px solid #e4e9ed;
... ...
... ... @@ -6,18 +6,27 @@ import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import store from './vuex/store'
import VueAMap from 'vue-amap'
import {
doEncrypt,
decryptSM2
} from '../config/smEncryption'
Vue.use(ElementUI);
Vue.use(VueAMap)
Vue.config.productionTip = false
import axios from "./common.js";
Vue.prototype.$axios = axios;
Vue.prototype.$smEncryption = doEncrypt
Vue.prototype.$decrypt = decryptSM2
Vue.config.productionTip = false
if (sessionStorage.getItem("token")) {
axios.defaults.headers.common["Authorization"] = sessionStorage.getItem("token");
}
VueAMap.initAMapApiLoader({
key:'afc6b132876a7ef24007cf877f86772d',
plugin:['AMap.MouseTool'], //插件
v: '1.4.4',
uiVersion: '1.0'
})
/* eslint-disable no-new */
new Vue({
el: '#app',
... ... @@ -28,5 +37,4 @@ new Vue({
},
template: '<App/>'
})
console.log(process.env.VUE_APP_URL)
... ...