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. 208
      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) => {
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 {
getByPage,
get,
getByCompanyId,
save,
update,
};

@ -1,14 +1,4 @@
<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
v-model="params[config.querykey]"
filterable
@ -18,6 +8,7 @@
:placeholder="config.placeholder"
:remote-method="remoteMethod"
@clear="list = []"
:disabled="isDisabled"
>
<el-option
v-for="(item, index) in list"
@ -46,15 +37,16 @@ export default {
return {
text: "",
list: [],
isDisabled: false,
};
},
watch: {
"config.echoId": {
handler(nval, oval) {
if (nval) {
console.log(nval);
this.remoteMethod(this.config.echoName);
}
this.isDisabled = !!this.config.isDisabled;
},
deep: true,
immediate: true,
@ -82,23 +74,6 @@ export default {
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>

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

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

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

@ -175,11 +175,9 @@ export default {
this.form = JSON.parse(JSON.stringify(this.controlWindows.addInfo));
this.configAutocomplete.echoId = id;
this.configAutocomplete.echoName = this.form.refineryName;
console.log("this.form", this.form.floorPrice);
}
},
submit() {
console.log("this.form", this.form);
this.$refs["form"].validate((valid) => {
if (valid) {
this.judgeInterface(this.form).then((res) => {
@ -196,27 +194,7 @@ export default {
if (id) return serve.update(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() {
this.$emit("closeWindow");
this.form = {};

@ -292,25 +292,7 @@ export default {
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() {
this.controlWindows.addInfo.title = "产品新增";
@ -320,7 +302,6 @@ export default {
//
createOrder(row) {
this.controlWindows.create = true;
console.log(this.controlWindows.create);
},
//
detail(row) {

Loading…
Cancel
Save