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