Compare commits
12 Commits
97e0d4035b
...
lixuan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
992fb5ebc1 | ||
|
|
d031b27f49 | ||
| 42f06ace84 | |||
|
|
62eb5ecf81 | ||
|
|
10058dcc5d | ||
|
|
f9687b9e0f | ||
|
|
22c8d4d6dc | ||
|
|
29c97a4251 | ||
|
|
c501324ce0 | ||
| 107e67758c | |||
|
|
a44f29dec6 | ||
|
|
7605fe1356 |
@@ -21,7 +21,7 @@ const save = (params) => {
|
|||||||
};
|
};
|
||||||
// 修改
|
// 修改
|
||||||
const update = (params) => {
|
const update = (params) => {
|
||||||
return request.postPut(
|
return request.putJson(
|
||||||
"/oil-finance/oilCompanyAccountReverse/update",
|
"/oil-finance/oilCompanyAccountReverse/update",
|
||||||
params
|
params
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,13 +11,31 @@
|
|||||||
:disabled="isDisabled"
|
:disabled="isDisabled"
|
||||||
@change="change"
|
@change="change"
|
||||||
>
|
>
|
||||||
|
<template v-if="labelIsMore">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(item, index) in list"
|
v-for="(item, index) in list"
|
||||||
:key="item.id + index"
|
:key="item.id + index"
|
||||||
|
:label="
|
||||||
|
item[config.labelKey[0]] +
|
||||||
|
'(' +
|
||||||
|
item[config.labelKey[1]] +
|
||||||
|
'-' +
|
||||||
|
item[config.labelKey[2]] +
|
||||||
|
')'
|
||||||
|
"
|
||||||
|
:value="item[config.valueKey]"
|
||||||
|
>
|
||||||
|
</el-option>
|
||||||
|
</template>
|
||||||
|
<template>
|
||||||
|
<el-option
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
:label="item[config.labelKey]"
|
:label="item[config.labelKey]"
|
||||||
:value="item[config.valueKey]"
|
:value="item[config.valueKey]"
|
||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
|
</template>
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -37,6 +55,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
text: "",
|
text: "",
|
||||||
|
labelIsMore: false,
|
||||||
|
// labelKeyArr:[],
|
||||||
list: [],
|
list: [],
|
||||||
isDisabled: false,
|
isDisabled: false,
|
||||||
};
|
};
|
||||||
@@ -44,48 +64,68 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
"config.echoId": {
|
"config.echoId": {
|
||||||
handler(nval, oval) {
|
handler(nval, oval) {
|
||||||
|
this.list = [];
|
||||||
|
// this.isDisabled = !!this.config.isDisabled;
|
||||||
if (nval) {
|
if (nval) {
|
||||||
this.remoteMethod(this.config.echoName);
|
let resultName = this.config.echoName.replace(/\s*/g, "");
|
||||||
|
if (!resultName) return;
|
||||||
|
this.remoteMethod(resultName);
|
||||||
}
|
}
|
||||||
this.isDisabled = !!this.config.isDisabled;
|
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
|
"config.isDisabled": {
|
||||||
|
handler(nval, oval) {
|
||||||
|
let type = this.$utils.typeJudgment(nval);
|
||||||
|
if (["Boolean", "String"].includes(type)) {
|
||||||
|
this.isDisabled = !!this.config.isDisabled;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
immediate: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let { labelKey } = this.config;
|
||||||
|
let type = this.$utils.typeJudgment(labelKey);
|
||||||
|
// console.log(type);
|
||||||
|
if (type === "Array") {
|
||||||
|
// let
|
||||||
|
this.labelIsMore = true;
|
||||||
|
// console.log(this.labelIsMore);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 远程搜索
|
// 远程搜索
|
||||||
remoteMethod(query) {
|
remoteMethod(query) {
|
||||||
if (query !== "") {
|
if (query !== "") {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
let params = {};
|
|
||||||
let type = this.$utils.typeJudgment(this.config.autocompleteKey);
|
let type = this.$utils.typeJudgment(this.config.autocompleteKey);
|
||||||
if (!type.includes("Object") && !type.includes("String")) return;
|
|
||||||
|
|
||||||
if (type.includes("Object")) {
|
let params = {};
|
||||||
|
if (["Object"].includes(type)) {
|
||||||
params[this.config.autocompleteKey.key] = query;
|
params[this.config.autocompleteKey.key] = query;
|
||||||
params["enableMark"] = this.config.autocompleteKey.enableMark;
|
params["enableMark"] = this.config.autocompleteKey.enableMark;
|
||||||
}
|
}
|
||||||
if (type.includes("String")) {
|
if (["String", "Undefined", "Null"].includes(type)) {
|
||||||
|
// 接口为get类型时需将autocompleteKey值设为空
|
||||||
this.config.autocompleteKey
|
this.config.autocompleteKey
|
||||||
? (params[this.config.autocompleteKey] = query)
|
? (params[this.config.autocompleteKey] = query)
|
||||||
: (params["queryTypeGet"] = query);
|
: (params = query);
|
||||||
}
|
}
|
||||||
this.config.serveTarget(params).then((res) => {
|
this.config.serveTarget(params).then((res) => {
|
||||||
let timeInstance = setTimeout(() => {
|
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
clearTimeout(timeInstance);
|
|
||||||
if (res.data.length) {
|
if (res.data.length) {
|
||||||
this.list = res.data;
|
this.list = res.data;
|
||||||
} else this.list = [];
|
} else this.list = [];
|
||||||
}, 1000 * Math.random());
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.list = [];
|
this.list = [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
change(val) {
|
change(val) {
|
||||||
this.$emit("change", val);
|
this.$emit("change", val, this.list);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import store from "@/store";
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
import Breadcrumb from "@/components/Breadcrumb";
|
import Breadcrumb from "@/components/Breadcrumb";
|
||||||
import Hamburger from "@/components/Hamburger";
|
import Hamburger from "@/components/Hamburger";
|
||||||
@@ -47,6 +48,7 @@ export default {
|
|||||||
serve.loginOut().then((res) => {
|
serve.loginOut().then((res) => {
|
||||||
if (res.code === 20000) {
|
if (res.code === 20000) {
|
||||||
localStorage.removeItem("customerToken");
|
localStorage.removeItem("customerToken");
|
||||||
|
store.dispatch("user/remove");
|
||||||
this.$router.push("/login");
|
this.$router.push("/login");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
try {
|
try {
|
||||||
let infoRes = await serve.info();
|
let infoRes = await serve.info();
|
||||||
infoRes.data.authList = [1];
|
infoRes.data.authList = [1];
|
||||||
|
|
||||||
store.dispatch("user/info", infoRes.data);
|
store.dispatch("user/info", infoRes.data);
|
||||||
|
|
||||||
let routerRes = await serve.getCustomerRouters();
|
let routerRes = await serve.getCustomerRouters();
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
title: "油批客户管理系统",
|
||||||
title: 'Vue Admin Template',
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {boolean} true | false
|
* @type {boolean} true | false
|
||||||
@@ -12,5 +11,5 @@ module.exports = {
|
|||||||
* @type {boolean} true | false
|
* @type {boolean} true | false
|
||||||
* @description Whether show the logo in sidebar
|
* @description Whether show the logo in sidebar
|
||||||
*/
|
*/
|
||||||
sidebarLogo: false
|
sidebarLogo: false,
|
||||||
}
|
};
|
||||||
|
|||||||
@@ -32,6 +32,10 @@ const actions = {
|
|||||||
commit("SET_NAME", data.name);
|
commit("SET_NAME", data.name);
|
||||||
commit("SET_COMPANYTYPE", data);
|
commit("SET_COMPANYTYPE", data);
|
||||||
},
|
},
|
||||||
|
remove({ commit }, data) {
|
||||||
|
commit("SET_AUTH", null);
|
||||||
|
commit("SET_COMPANYTYPE", "");
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -52,7 +52,9 @@ export function isLicensePlate(no) {
|
|||||||
return instance.test(no);
|
return instance.test(no);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 类型判断
|
||||||
export function typeJudgment(object) {
|
export function typeJudgment(object) {
|
||||||
let res = {}.__proto__.toString.call(object);
|
let res = {}.__proto__.toString.call(object);
|
||||||
return res ? res : "";
|
let type = /(?<= ).+(?=\])/.exec(res);
|
||||||
|
return type.length ? type[0] : "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import Vue from "vue";
|
import Vue from "vue";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import utils from "@/utils/encode";
|
import utils from "@/utils/encode";
|
||||||
|
import store from "@/store";
|
||||||
//加密白名单
|
//加密白名单
|
||||||
const encryptWhite = [];
|
const encryptWhite = [];
|
||||||
const env = process.env.VUE_APP_ENV;
|
const env = process.env.VUE_APP_ENV;
|
||||||
@@ -21,6 +22,7 @@ service.interceptors.request.use(
|
|||||||
const JSESSIONID = utils.uuid();
|
const JSESSIONID = utils.uuid();
|
||||||
config.headers["JSESSIONID"] = JSESSIONID;
|
config.headers["JSESSIONID"] = JSESSIONID;
|
||||||
config.headers["token"] = utils.bcrypt(JSESSIONID);
|
config.headers["token"] = utils.bcrypt(JSESSIONID);
|
||||||
|
config.headers['dataSources'] = 'WEB'
|
||||||
|
|
||||||
if (env === "development") {
|
if (env === "development") {
|
||||||
return config;
|
return config;
|
||||||
@@ -63,7 +65,8 @@ service.interceptors.response.use(
|
|||||||
if (res && res.code) {
|
if (res && res.code) {
|
||||||
if (res.code === 42011) {
|
if (res.code === 42011) {
|
||||||
Vue.prototype.$message.error(res.msg || "您的登录已失效,请重新登录");
|
Vue.prototype.$message.error(res.msg || "您的登录已失效,请重新登录");
|
||||||
localStorage.removeItem("removeItem");
|
localStorage.removeItem("customerToken");
|
||||||
|
store.dispatch("user/remove");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ export default {
|
|||||||
networkId,
|
networkId,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
this.loading = false;
|
||||||
if (res && res.code === 42014) {
|
if (res && res.code === 42014) {
|
||||||
serve
|
serve
|
||||||
.getRefineryByCustomerId(this.loginForm.username)
|
.getRefineryByCustomerId(this.loginForm.username)
|
||||||
@@ -154,7 +155,6 @@ export default {
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log()
|
|
||||||
localStorage.setItem("customerToken", res.data.accessToken);
|
localStorage.setItem("customerToken", res.data.accessToken);
|
||||||
this.$router.replace("/");
|
this.$router.replace("/");
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -253,7 +253,9 @@ export default {
|
|||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
total: 0,
|
total: 0,
|
||||||
params: {},
|
params: {
|
||||||
|
|
||||||
|
},
|
||||||
},
|
},
|
||||||
oilCompanyMatch: {},
|
oilCompanyMatch: {},
|
||||||
billData:[],
|
billData:[],
|
||||||
@@ -335,6 +337,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//table list
|
//table list
|
||||||
getByPage() {
|
getByPage() {
|
||||||
|
this.parameter.params.customerId=this.$store.state.user.companyId
|
||||||
order.getByPage(this.parameter).then((res) => {
|
order.getByPage(this.parameter).then((res) => {
|
||||||
this.tableData = res.data.list;
|
this.tableData = res.data.list;
|
||||||
this.total = res.data.totalCount;
|
this.total = res.data.totalCount;
|
||||||
|
|||||||
@@ -107,14 +107,14 @@ export default {
|
|||||||
"form.salePrice": {
|
"form.salePrice": {
|
||||||
handler(n, o) {
|
handler(n, o) {
|
||||||
if(n){
|
if(n){
|
||||||
this.form.preAmount = this.form.salePrice*(this.form.preQuantity?this.form.preQuantity:0)
|
this.form.preAmount = (this.form.salePrice*(this.form.preQuantity?this.form.preQuantity:0)).toFixed(2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"form.preQuantity": {
|
"form.preQuantity": {
|
||||||
handler(n, o) {
|
handler(n, o) {
|
||||||
if(n){
|
if(n){
|
||||||
this.form.preAmount = this.form.preQuantity*(this.form.salePrice?this.form.salePrice:0)
|
this.form.preAmount = (this.form.preQuantity*(this.form.salePrice?this.form.salePrice:0)).toFixed(2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
>
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<autocomplete :params="parameter.params" :config="configAutocomplete" />
|
<autocomplete :params="parameter.params" :config="configAutocomplete" />
|
||||||
<!-- <el-input
|
<!-- <el-input
|
||||||
v-model="parameter.params.belongLibrary"
|
v-model="parameter.params.belongLibrary"
|
||||||
@@ -72,12 +73,6 @@
|
|||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="productType" label="产品类型"> </el-table-column>
|
<el-table-column prop="productType" label="产品类型"> </el-table-column>
|
||||||
<el-table-column
|
|
||||||
prop="productType"
|
|
||||||
label="产品类型"
|
|
||||||
show-overflow-tooltip
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="refineryName"
|
prop="refineryName"
|
||||||
label="炼厂名称"
|
label="炼厂名称"
|
||||||
@@ -109,7 +104,9 @@
|
|||||||
<template slot-scope="{ row }">
|
<template slot-scope="{ row }">
|
||||||
<span class="el-dropdown-link" @click="detail(row)">详情</span>
|
<span class="el-dropdown-link" @click="detail(row)">详情</span>
|
||||||
|
|
||||||
<span class="el-dropdown-link" @click="updateCreate(row)">下单</span>
|
<span class="el-dropdown-link" @click="updateCreate(row)"
|
||||||
|
>下单</span
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -187,7 +184,7 @@ export default {
|
|||||||
],
|
],
|
||||||
configAutocomplete: {
|
configAutocomplete: {
|
||||||
serveTarget: serve.findByEntity,
|
serveTarget: serve.findByEntity,
|
||||||
autocomplateKey: "name",
|
autocompleteKey: "refineryName",
|
||||||
valueKey: "refineryName",
|
valueKey: "refineryName",
|
||||||
placeholder: "炼厂名称",
|
placeholder: "炼厂名称",
|
||||||
querykey: "refineryId",
|
querykey: "refineryId",
|
||||||
@@ -248,19 +245,19 @@ export default {
|
|||||||
},
|
},
|
||||||
//下单
|
//下单
|
||||||
createOrder(row) {
|
createOrder(row) {
|
||||||
this.controlWindows.addInfo = {}
|
this.controlWindows.addInfo = {};
|
||||||
this.controlWindows.addInfo.title = "创建订单";
|
this.controlWindows.addInfo.title = "创建订单";
|
||||||
this.controlWindows.create = true;
|
this.controlWindows.create = true;
|
||||||
console.log(this.controlWindows,'新增')
|
console.log(this.controlWindows, "新增");
|
||||||
},
|
},
|
||||||
//修改订单
|
//修改订单
|
||||||
updateCreate(row){
|
updateCreate(row) {
|
||||||
this.controlWindows.addInfo = {
|
this.controlWindows.addInfo = {
|
||||||
title: "创建订单",
|
title: "创建订单",
|
||||||
...row,
|
...row,
|
||||||
};
|
};
|
||||||
this.controlWindows.create = true;
|
this.controlWindows.create = true;
|
||||||
console.log('修改')
|
console.log("修改");
|
||||||
},
|
},
|
||||||
//详情
|
//详情
|
||||||
detail(row) {
|
detail(row) {
|
||||||
|
|||||||
@@ -11,11 +11,12 @@ const name = defaultSettings.title || "vue Admin Template";
|
|||||||
const port = process.env.port || process.env.npm_config_port || 9530;
|
const port = process.env.port || process.env.npm_config_port || 9530;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
publicPath: "/",
|
publicPath: "/refineryCus",
|
||||||
outputDir: "dist",
|
outputDir: "dist",
|
||||||
assetsDir: "static",
|
assetsDir: "static",
|
||||||
productionSourceMap: false,
|
productionSourceMap: false,
|
||||||
devServer: {
|
devServer: {
|
||||||
|
disableHostCheck: true,
|
||||||
inline: true,
|
inline: true,
|
||||||
port: port,
|
port: port,
|
||||||
open: false,
|
open: false,
|
||||||
@@ -29,7 +30,7 @@ module.exports = {
|
|||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
// target: `https://3816t6291y.oicp.vip`,
|
// target: `https://3816t6291y.oicp.vip`,
|
||||||
// target: 'https://6l438d1757.zicp.fun',
|
// target: 'https://6l438d1757.zicp.fun',
|
||||||
target: "http://192.168.110.230:38080",
|
target: "http://192.168.0.23:38080",
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
["^" + process.env.VUE_APP_BASE_API]: "",
|
["^" + process.env.VUE_APP_BASE_API]: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user