Merge branch 'xiaozy_产品列表' of http://121.196.213.68:3000/xiaozhiyong/refinery-admin into xiaozy_产品列表

 Conflicts:
	src/views/customerManagement/companyManagement/index.vue
pull/1/head
KongDuo 2 years ago
commit 18ee829fae
  1. 14
      src/api/financialCenter/enterpriseRecharge.js
  2. 31
      src/components/autocomplete/index.vue
  3. 200
      src/views/financialCenter/enterpriseRecharge/components/add.vue
  4. 59
      src/views/financialCenter/enterpriseRecharge/index.vue
  5. 2
      src/views/financialCenter/enterpriseRechargeDetails/index.vue
  6. 24
      src/views/product/components/add.vue
  7. 21
      src/views/product/index.vue

@ -14,8 +14,22 @@ const get = (query) => {
const getByCompanyId = (query) => { const getByCompanyId = (query) => {
return request.get(`/oil-finance/oilCompanyAccount/getByCompanyId/${query}`); return request.get(`/oil-finance/oilCompanyAccount/getByCompanyId/${query}`);
}; };
// 新增
const save = (params) => {
return request.postJson("/oil-finance/oilCompanyAccountReverse/save", params);
};
// 修改
const update = (params) => {
return request.postJson(
"/oil-finance/oilCompanyAccountReverse/update",
params
);
};
export default { export default {
getByPage, getByPage,
get, get,
getByCompanyId, getByCompanyId,
save,
update,
}; };

@ -1,14 +1,4 @@
<template> <template>
<!-- <el-autocomplete
v-model="text"
:fetch-suggestions="querySearchAsync"
:value-key="config.valueKey"
:placeholder="config.placeholder"
clearable
@select="selectAutocomplete"
@clear="params[config.querykey] = ''"
></el-autocomplete> -->
<el-select <el-select
v-model="params[config.querykey]" v-model="params[config.querykey]"
filterable filterable
@ -18,6 +8,7 @@
:placeholder="config.placeholder" :placeholder="config.placeholder"
:remote-method="remoteMethod" :remote-method="remoteMethod"
@clear="list = []" @clear="list = []"
:disabled="isDisabled"
> >
<el-option <el-option
v-for="(item, index) in list" v-for="(item, index) in list"
@ -46,15 +37,16 @@ export default {
return { return {
text: "", text: "",
list: [], list: [],
isDisabled: false,
}; };
}, },
watch: { watch: {
"config.echoId": { "config.echoId": {
handler(nval, oval) { handler(nval, oval) {
if (nval) { if (nval) {
console.log(nval);
this.remoteMethod(this.config.echoName); this.remoteMethod(this.config.echoName);
} }
this.isDisabled = !!this.config.isDisabled;
}, },
deep: true, deep: true,
immediate: true, immediate: true,
@ -82,23 +74,6 @@ export default {
this.list = []; this.list = [];
} }
}, },
// querySearchAsync(queryString, cb) {
// if (queryString) {
// let params = {};
// params[this.config.autocompleteKey] = queryString;
// this.config.serveTarget(params).then((res) => {
// let timeInstance = setTimeout(() => {
// clearTimeout(timeInstance);
// if (res.data.length) {
// cb(res.data);
// } else cb([]);
// }, 1000 * Math.random());
// });
// } else cb([]);
// },
// selectAutocomplete(item) {
// this.params[this.config.querykey] = item.id;
// },
}, },
}; };
</script> </script>

@ -1,8 +1,8 @@
<template> <template>
<el-drawer <el-drawer
title="企业充值" :title="controlWindows.addInfo.title"
direction="ltr" direction="ltr"
size="40%" size="50%"
:visible="controlWindows.add" :visible="controlWindows.add"
@opened="openDrawer" @opened="openDrawer"
:before-close="closeWindow" :before-close="closeWindow"
@ -12,63 +12,51 @@
<el-form-item label="公司" prop="companyId"> <el-form-item label="公司" prop="companyId">
<autocomplete :params="form" :config="configAutocomplete" /> <autocomplete :params="form" :config="configAutocomplete" />
</el-form-item> </el-form-item>
<el-form-item label="交易类型" prop="productType"> <el-form-item label="交易类型" prop="transactionType">
<el-select v-model="form.productType" placeholder="请选择交易类型"> <el-select
:disabled="form.id"
v-model="form.transactionType"
placeholder="请选择交易类型"
@change="changeTransactionType"
>
<el-option label="赊销" value="CHARGE_SALES" /> <el-option label="赊销" value="CHARGE_SALES" />
<el-option label="消费返利" value="CONSUME_REBATE" /> <el-option label="消费返利" value="CONSUME_REBATE" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="交易金额" prop="belongLibrary"> <el-form-item label="交易金额" prop="transactionAmount">
<el-input <el-input
v-checkNum v-checkNum
v-model="form.belongLibrary" v-model="form.transactionAmount"
placeholder="请输入交易金额" placeholder="请输入交易金额"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="线下汇款公司账户" prop="belongLibrary">
<el-input
v-model="form.belongLibrary"
placeholder="请输入线下汇款公司账户"
></el-input>
</el-form-item>
<el-form-item label="线下交易发起时间" prop="belongLibrary"> <el-form-item
<el-date-picker v-if="form.transactionType === 'CONSUME_REBATE'"
v-model="value1" label="线下交易凭证"
type="datetime" prop="offlineTransactionProof"
placeholder="线下交易发起时间"
> >
</el-date-picker>
</el-form-item>
<el-form-item label="线下交易完成时间" prop="belongLibrary">
<el-date-picker
v-model="value1"
type="datetime"
placeholder="线下交易完成时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="线下交易凭证" prop="belongLibrary">
<el-upload <el-upload
:action="uploadUrl" :action="uploadUrl"
list-type="picture-card" list-type="picture-card"
:on-preview="offlineTransactionProofPreview" :on-preview="handlePictureCardPreview"
:on-success="offlineTransactionProofSuccess" :on-remove="handleRemove"
:before-upload="imgCompress" :on-success="handleSuccess"
:on-remove="offlineTransactionProofRemove"
:data="{ ossKey: 'xingyou', pathKey: 'other', encrypt: 'PUBLIC' }"
:headers="headers"
:limit="1" :limit="1"
> >
<i class="el-icon-plus" /> <i class="el-icon-plus"></i>
</el-upload> </el-upload>
<el-dialog :visible.sync="imgDialog" :modal="false">
<img width="100%" :src="form.offlineTransactionProof" alt="" />
</el-dialog>
</el-form-item> </el-form-item>
<el-form-item label="交易说明" prop="belongLibrary">
<el-form-item label="交易说明" prop="reverseRemark">
<el-input <el-input
type="textarea" type="textarea"
:rows="2" :rows="2"
placeholder="请输入内容" placeholder="请输入交易说明"
v-model="textarea" v-model="form.reverseRemark"
> >
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -82,16 +70,13 @@
</template> </template>
<script> <script>
import serve from "api/financialCenter/enterpriseRechargeDetails.js"; import serve from "api/financialCenter/enterpriseRecharge.js";
import commonServe from "api/common.js"; import commonServe from "api/common.js";
import autocomplete from "components/autocomplete/index.vue"; import autocomplete from "components/autocomplete/index.vue";
import { import utils from "utils/encode";
rechargeTypeEnum, const JSESSIONID = utils.uuid();
rechargeStatusEnum,
repaymentExamineEnum,
} from "utils/dataType.js";
export default { export default {
components: { components: {
@ -105,8 +90,22 @@ export default {
if (this.form.companyId) callback(); if (this.form.companyId) callback();
else callback("请选择公司"); else callback("请选择公司");
}; };
let validatorofflineTransactionProof = (rule, value, callback) => {
if (this.form.offlineTransactionProof) callback();
else callback("请上传凭证");
};
return { return {
uploadUrl: process.env.VUE_APP_UPLOAD_URL, uploadUrl:
process.env.VUE_APP_ENV === "development"
? "/api/oil-oss/obejct/uploadFile"
: "/adminapi/oil-oss/obejct/uploadFile",
imgDialog: false,
headers: {
dataSources: "WEB",
Authorization: localStorage.getItem("token"),
JSESSIONID: JSESSIONID,
token: utils.bcrypt(JSESSIONID),
},
form: {}, form: {},
refineryList: [], refineryList: [],
configAutocomplete: { configAutocomplete: {
@ -116,52 +115,28 @@ export default {
valueKey: "id", valueKey: "id",
placeholder: "企业名称", placeholder: "企业名称",
querykey: "companyId", querykey: "companyId",
echoId: "",
echoName: "",
}, },
productTypeList: [
{
label: "0#柴",
value: "0#",
},
{
label: "-10#柴",
value: "-10#",
},
{
label: "92#汽",
value: "92#",
},
{
label: "95#汽",
value: "95#",
},
],
rules: { rules: {
productName: [
{ required: true, message: "请输入产品名称", trigger: "blur" },
],
productType: [
{ required: true, message: "请选择产品类型", trigger: "change" },
],
companyId: [ companyId: [
{ required: true, validator: validatorcompanyId, trigger: "change" }, { required: true, validator: validatorcompanyId, trigger: "change" },
], ],
belongLibrary: [ transactionType: [
{ required: true, message: "请输入所属炼厂库名", trigger: "blur" }, { required: true, message: "请选择交易类型", trigger: "change" },
],
floorPrice: [
{ required: true, message: "请输入成本价", trigger: "blur" },
], ],
salePrice2company: [ transactionAmount: [
{ required: true, message: "请输入企业销售价", trigger: "blur" }, { required: true, message: "请输入交易金额", trigger: "blur" },
], ],
salePrice2personal: [ offlineTransactionProof: [
{ required: true, message: "请输入个人销售价", trigger: "blur" }, {
], required: true,
measurement: [ validator: validatorofflineTransactionProof,
{ required: true, message: "请输入计量单位", trigger: "blur" }, trigger: "change",
},
], ],
enableMark: [ reverseRemark: [
{ required: true, message: "请选择启用状态", trigger: "change" }, { required: true, message: "请输入交易说明", trigger: "blur" },
], ],
}, },
}; };
@ -169,23 +144,45 @@ export default {
methods: { methods: {
openDrawer() { openDrawer() {
let { id } = this.controlWindows.addInfo; let { id } = this.controlWindows.addInfo;
if (id) {
// //
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); id &&
this.configAutocomplete.echoId = id; (this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)));
this.configAutocomplete.echoName = this.form.refineryName; let configUpdata = id
console.log("this.form", this.form.floorPrice); ? { echoId: id, echoName: this.form.refineryName, isDisabled: true }
: {
echoId: "",
echoName: "",
isDisabled: false,
};
Object.assign(this.configAutocomplete, configUpdata);
},
// change
changeTransactionType(val) {
if (val === "CHARGE_SALES") {
this.handleRemove();
}
},
//img
handlePictureCardPreview(file) {
this.form.offlineTransactionProof = file.url;
this.imgDialog = true;
},
// img remove
handleRemove(file, fileList) {
this.form.offlineTransactionProof = "";
},
//
handleSuccess(response, file, fileList) {
if (response.code === 20000) {
this.form.offlineTransactionProof = response.data.publicUrl;
} }
}, },
submit() { submit() {
console.log("this.form", this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.judgeInterface(this.form).then((res) => { this.judgeInterface(this.form).then((res) => {
if (res.code === 20000) {
this.$message.success(res.msg); this.$message.success(res.msg);
this.closeWindow(); this.closeWindow();
}
}); });
} }
}); });
@ -195,27 +192,6 @@ export default {
if (id) return serve.update(form); if (id) return serve.update(form);
else return serve.save(form); else return serve.save(form);
}, },
//list
// findByEntity() {
// refineryServe.findByEntity().then((res) => {
// this.refineryList = res.data;
// });
// },
//
// querySearchAsync(queryString, cb) {
// if (queryString) {
// refineryServe
// .findByEntity({ refineryName: queryString })
// .then((res) => {
// let timeInstance = setTimeout(() => {
// clearTimeout(timeInstance);
// if (res.data.length) {
// cb(res.data);
// } else cb([]);
// }, 1000 * Math.random());
// });
// } else cb([]);
// },
closeWindow() { closeWindow() {
this.$emit("closeWindow"); this.$emit("closeWindow");
this.form = {}; this.form = {};

@ -224,12 +224,40 @@
<el-table-column label="操作"> <el-table-column label="操作">
<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>
<el-dropdown
@command="
(val) => {
commandMore(val, row);
}
"
>
<span class="el-dropdown-link">
更多<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<template v-if="row.transactionType == 'TURN'"> </template>
<template v-else>
<el-dropdown-item command="update" v-if="row.auditMark === 0"
>编辑</el-dropdown-item
>
</template>
<el-dropdown-item
command="destroy"
v-if="
row.transactionType == 'CHARGE_SALES' &&
row.chargeSalesAuditMark == -2
"
>销账</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<pagination :parameter="parameter" @searchAgain="getByPage" /> <pagination :parameter="parameter" @searchAgain="getByPage" />
</div> </div>
<add :controlWindows="controlWindows" @closeWindow="search" />
<!-- 详情 --> <!-- 详情 -->
<el-drawer <el-drawer
title="详情" title="详情"
@ -261,6 +289,8 @@
import serve from "api/financialCenter/enterpriseRechargeDetails.js"; import serve from "api/financialCenter/enterpriseRechargeDetails.js";
import commonServe from "api/common.js"; import commonServe from "api/common.js";
import add from "./components/add.vue";
import autocomplete from "components/autocomplete/index.vue"; import autocomplete from "components/autocomplete/index.vue";
import pagination from "components/pagination/index.vue"; import pagination from "components/pagination/index.vue";
import generalDetails from "components/generalDetails/index.vue"; import generalDetails from "components/generalDetails/index.vue";
@ -273,12 +303,19 @@ import {
export default { export default {
components: { components: {
add,
pagination, pagination,
autocomplete, autocomplete,
generalDetails, generalDetails,
}, },
data() { data() {
return { return {
controlWindows: {
add: false,
addInfo: {},
detail: false,
},
rechargeTypeEnum: [ rechargeTypeEnum: [
{ {
label: "圈回", label: "圈回",
@ -308,9 +345,7 @@ export default {
value: -1, value: -1,
}, },
], ],
controlWindows: {
detail: false,
},
datetime: [], datetime: [],
tableHeight: 0, tableHeight: 0,
tableData: [], tableData: [],
@ -489,9 +524,22 @@ export default {
}, },
// //
addition() { addition() {
this.controlWindows.addInfo.title = "产品新增"; this.controlWindows.addInfo = {
title: "企业充值",
};
this.controlWindows.add = true; this.controlWindows.add = true;
}, },
//
commandMore(val, row) {
if (val === "update") {
this.controlWindows.addInfo = {
title: "编辑",
...row,
};
this.controlWindows.add = true;
}
},
//
detail(row) { detail(row) {
Promise.all([ Promise.all([
serve.get(row.id), serve.get(row.id),
@ -499,10 +547,10 @@ export default {
]).then(([firstRes, secondRes]) => { ]).then(([firstRes, secondRes]) => {
this.oilCompanyMatch = { ...firstRes.data, ...secondRes.data }; this.oilCompanyMatch = { ...firstRes.data, ...secondRes.data };
console.log("this.oilCompanyMatch", this.oilCompanyMatch);
this.controlWindows.detail = true; this.controlWindows.detail = true;
}); });
}, },
//
getSummaries(param) { getSummaries(param) {
const { columns, data } = param; const { columns, data } = param;
const sums = []; const sums = [];
@ -566,7 +614,6 @@ export default {
this.parameter.params.createTimeStart = val[0]; this.parameter.params.createTimeStart = val[0];
this.parameter.params.createTimeEnd = val[1]; this.parameter.params.createTimeEnd = val[1];
} }
console.log(val);
}, },
// table height // table height
heightHandle() { heightHandle() {

@ -416,7 +416,6 @@ export default {
]).then(([firstRes, secondRes]) => { ]).then(([firstRes, secondRes]) => {
this.oilCompanyMatch = { ...firstRes.data, ...secondRes.data }; this.oilCompanyMatch = { ...firstRes.data, ...secondRes.data };
console.log("this.oilCompanyMatch", this.oilCompanyMatch);
this.controlWindows.detail = true; this.controlWindows.detail = true;
}); });
}, },
@ -483,7 +482,6 @@ export default {
this.parameter.params.createTimeStart = val[0]; this.parameter.params.createTimeStart = val[0];
this.parameter.params.createTimeEnd = val[1]; this.parameter.params.createTimeEnd = val[1];
} }
console.log(val);
}, },
// table height // table height
heightHandle() { heightHandle() {

@ -175,11 +175,9 @@ export default {
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo)); this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.configAutocomplete.echoId = id; this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName; this.configAutocomplete.echoName = this.form.refineryName;
console.log("this.form", this.form.floorPrice);
} }
}, },
submit() { submit() {
console.log("this.form", this.form);
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.judgeInterface(this.form).then((res) => { this.judgeInterface(this.form).then((res) => {
@ -196,27 +194,7 @@ export default {
if (id) return serve.update(form); if (id) return serve.update(form);
else return serve.save(form); else return serve.save(form);
}, },
//list
// findByEntity() {
// refineryServe.findByEntity().then((res) => {
// this.refineryList = res.data;
// });
// },
//
// querySearchAsync(queryString, cb) {
// if (queryString) {
// refineryServe
// .findByEntity({ refineryName: queryString })
// .then((res) => {
// let timeInstance = setTimeout(() => {
// clearTimeout(timeInstance);
// if (res.data.length) {
// cb(res.data);
// } else cb([]);
// }, 1000 * Math.random());
// });
// } else cb([]);
// },
closeWindow() { closeWindow() {
this.$emit("closeWindow"); this.$emit("closeWindow");
this.form = {}; this.form = {};

@ -292,25 +292,7 @@ export default {
this.parameter.total = res.data.totalCount; this.parameter.total = res.data.totalCount;
}); });
}, },
//
// querySearchAsync(queryString, cb) {
// if (queryString) {
// refineryServe
// .findByEntity({ refineryName: queryString })
// .then((res) => {
// let timeInstance = setTimeout(() => {
// clearTimeout(timeInstance);
// if (res.data.length) {
// console.log(res.data);
// cb(res.data);
// } else cb([]);
// }, 1000 * Math.random());
// });
// } else cb([]);
// },
// selectAutocomplete(item) {
// this.parameter.params.refineryId = item.id;
// },
// //
addition() { addition() {
this.controlWindows.addInfo.title = "产品新增"; this.controlWindows.addInfo.title = "产品新增";
@ -320,7 +302,6 @@ export default {
// //
createOrder(row) { createOrder(row) {
this.controlWindows.create = true; this.controlWindows.create = true;
console.log(this.controlWindows.create);
}, },
// //
detail(row) { detail(row) {

Loading…
Cancel
Save