|
@@ -18,7 +18,8 @@
|
|
|
action: () => addModal(),
|
|
|
},
|
|
|
]"
|
|
|
- @get-list="getList">
|
|
|
+ @get-list="getList"
|
|
|
+ >
|
|
|
<template #amount="{ item }">
|
|
|
<div>
|
|
|
<span style="padding-right: 4px">{{ item.currency }}</span>
|
|
@@ -33,10 +34,27 @@
|
|
|
<el-table :data="departmentList" style="margin-top: 20px">
|
|
|
<el-table-column label="单位名称" prop="name" width="220" />
|
|
|
<el-table-column label="备注" prop="remark" />
|
|
|
- <el-table-column label="操作" align="center" width="120" fixed="right">
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ width="120"
|
|
|
+ fixed="right"
|
|
|
+ >
|
|
|
<template #default="{ row }">
|
|
|
- <el-button type="primary" v-if="row.deptType !== 1" link @click="handleUpdate(row)">修改</el-button>
|
|
|
- <el-button type="primary" v-if="row.deptType !== 1" link @click="handleDelete(row)">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="row.deptType !== 1"
|
|
|
+ link
|
|
|
+ @click="handleUpdate(row)"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="row.deptType !== 1"
|
|
|
+ link
|
|
|
+ @click="handleDelete(row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -46,21 +64,54 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog :title="modalType == 'add' ? '添加单位' : '编辑单位'" v-if="openAddUnit" v-model="openAddUnit" width="400">
|
|
|
- <byForm :formConfig="formUnitConfig" :formOption="formOption" v-model="formUnitData.data" :rules="rulesUnit" ref="unit"></byForm>
|
|
|
+ <el-dialog
|
|
|
+ :title="modalType == 'add' ? '添加单位' : '编辑单位'"
|
|
|
+ v-if="openAddUnit"
|
|
|
+ v-model="openAddUnit"
|
|
|
+ width="400"
|
|
|
+ >
|
|
|
+ <byForm
|
|
|
+ :formConfig="formUnitConfig"
|
|
|
+ :formOption="formOption"
|
|
|
+ v-model="formUnitData.data"
|
|
|
+ :rules="rulesUnit"
|
|
|
+ ref="unit"
|
|
|
+ ></byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="openAddUnit = false" size="large">关 闭</el-button>
|
|
|
- <el-button type="primary" @click="submitUnitForm()" size="large">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitUnitForm()" size="large"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog title="添加往来" v-if="openComeAndGo" v-model="openComeAndGo" width="500">
|
|
|
- <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="comeAndGo">
|
|
|
+ <el-dialog
|
|
|
+ title="添加往来"
|
|
|
+ v-if="openComeAndGo"
|
|
|
+ v-model="openComeAndGo"
|
|
|
+ width="500"
|
|
|
+ >
|
|
|
+ <byForm
|
|
|
+ :formConfig="formConfig"
|
|
|
+ :formOption="formOption"
|
|
|
+ v-model="formData.data"
|
|
|
+ :rules="rules"
|
|
|
+ ref="comeAndGo"
|
|
|
+ >
|
|
|
<template #amount>
|
|
|
<div style="width: 100%">
|
|
|
<el-form-item prop="amount">
|
|
|
- <el-select v-model="formData.data.currency" placeholder="请选择币种" style="width: 100px">
|
|
|
- <el-option v-for="item in accountCurrency" :key="item.value" :label="item.value" :value="item.value" />
|
|
|
+ <el-select
|
|
|
+ v-model="formData.data.currency"
|
|
|
+ placeholder="请选择币种"
|
|
|
+ style="width: 100px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in accountCurrency"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.value"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
<el-input-number
|
|
|
onmousewheel="return false;"
|
|
@@ -69,14 +120,17 @@
|
|
|
style="width: calc(100% - 100px)"
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
- :min="0" />
|
|
|
+ :min="0"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="openComeAndGo = false" size="large">关 闭</el-button>
|
|
|
- <el-button type="primary" @click="submitForm()" size="large">确 定</el-button>
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -92,6 +146,7 @@ const loading = ref(false);
|
|
|
const accountCurrency = ref([]);
|
|
|
const accountList = ref([]);
|
|
|
const departmentList = ref([]);
|
|
|
+const companyData = ref([]);
|
|
|
const isFlowingWater = ref([
|
|
|
{
|
|
|
label: "是",
|
|
@@ -127,10 +182,16 @@ const sourceList = ref({
|
|
|
const selectConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
+ label: "归属公司",
|
|
|
+ prop: "corporationId",
|
|
|
+ data: companyData.value,
|
|
|
+ },
|
|
|
+ {
|
|
|
label: "是否流水",
|
|
|
prop: "isFlowingWater",
|
|
|
data: isFlowingWater.value,
|
|
|
},
|
|
|
+
|
|
|
{
|
|
|
label: "往来单位",
|
|
|
prop: "departmentId",
|
|
@@ -147,9 +208,15 @@ const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
+ label: "归属公司",
|
|
|
+ prop: "corporationName",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
label: "往来单位",
|
|
|
prop: "departmentId",
|
|
|
- "min-width": 180,
|
|
|
+ // "min-width": 180,
|
|
|
},
|
|
|
render(val) {
|
|
|
return proxy.dictValueLabel(val, departmentList.value);
|
|
@@ -159,7 +226,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "往来类型",
|
|
|
prop: "type",
|
|
|
- width: 140,
|
|
|
+ width: 100,
|
|
|
},
|
|
|
render(val) {
|
|
|
return proxy.dictValueLabel(val, type.value);
|
|
@@ -176,7 +243,7 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "是否流水",
|
|
|
prop: "isFlowingWater",
|
|
|
- width: 140,
|
|
|
+ width: 100,
|
|
|
},
|
|
|
render(val) {
|
|
|
return proxy.dictValueLabel(val, isFlowingWater.value);
|
|
@@ -186,19 +253,13 @@ const config = computed(() => {
|
|
|
attrs: {
|
|
|
label: "往来账户",
|
|
|
prop: "accountId",
|
|
|
- "min-width": 180,
|
|
|
+ // "min-width": 180,
|
|
|
},
|
|
|
render(val) {
|
|
|
return proxy.dictValueLabel(val, accountList.value);
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- attrs: {
|
|
|
- label: "归属公司",
|
|
|
- prop: "corporationName",
|
|
|
- width: 140,
|
|
|
- },
|
|
|
- },
|
|
|
+
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "备注",
|
|
@@ -217,33 +278,46 @@ const getDict = () => {
|
|
|
}));
|
|
|
}
|
|
|
});
|
|
|
- proxy.post("/accountManagement/page", { pageNum: 1, pageSize: 9999 }).then((res) => {
|
|
|
- if (res.rows && res.rows.length > 0) {
|
|
|
- accountList.value = res.rows.map((item) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- label: item.alias + " (" + item.accountOpening + ")",
|
|
|
- value: item.id,
|
|
|
- };
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .post("/corporation/page", { pageNum: 1, pageSize: 9999 })
|
|
|
+ .then((res) => {
|
|
|
+ companyData.value = res.rows.map((x) => ({
|
|
|
+ ...x,
|
|
|
+ label: x.name,
|
|
|
+ value: x.id,
|
|
|
+ }));
|
|
|
+ });
|
|
|
+ proxy
|
|
|
+ .post("/accountManagement/page", { pageNum: 1, pageSize: 9999 })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.rows && res.rows.length > 0) {
|
|
|
+ accountList.value = res.rows.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.alias + " (" + item.accountOpening + ")",
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
getDepartmentList();
|
|
|
};
|
|
|
const getDepartmentList = () => {
|
|
|
- proxy.get("/transactionDepartment/list", { pageNum: 1, pageSize: 999 }).then((res) => {
|
|
|
- if (res.data && res.data.length > 0) {
|
|
|
- departmentList.value = res.data.map((item) => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- label: item.name,
|
|
|
- value: item.id,
|
|
|
- };
|
|
|
- });
|
|
|
- } else {
|
|
|
- departmentList.value = [];
|
|
|
- }
|
|
|
- });
|
|
|
+ proxy
|
|
|
+ .get("/transactionDepartment/list", { pageNum: 1, pageSize: 999 })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data && res.data.length > 0) {
|
|
|
+ departmentList.value = res.data.map((item) => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ label: item.name,
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ departmentList.value = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
const getList = async (req) => {
|
|
|
sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
|
|
@@ -275,9 +349,20 @@ const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
type: "select",
|
|
|
+ label: "归属公司",
|
|
|
+ prop: "corporationId",
|
|
|
+ data: companyData.value,
|
|
|
+ itemWidth: 100,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "select",
|
|
|
prop: "departmentId",
|
|
|
label: "往来单位",
|
|
|
data: departmentList.value,
|
|
|
+ fn: (val) => {
|
|
|
+ const current = departmentList.value.find((x) => x.value === val);
|
|
|
+ formData.data.deptType = current.deptType;
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
type: "select",
|
|
@@ -313,10 +398,23 @@ const formConfig = computed(() => {
|
|
|
});
|
|
|
const rules = computed(() => {
|
|
|
return {
|
|
|
- departmentId: [{ required: true, message: "请选择往来单位", trigger: "change" }],
|
|
|
+ corporationId: [
|
|
|
+ { required: true, message: "请选择归属公司", trigger: "change" },
|
|
|
+ ],
|
|
|
+ departmentId: [
|
|
|
+ { required: true, message: "请选择往来单位", trigger: "change" },
|
|
|
+ ],
|
|
|
type: [{ required: true, message: "请选择往来类型", trigger: "change" }],
|
|
|
- isFlowingWater: [{ required: true, message: "请选择是否流水", trigger: "change" }],
|
|
|
- accountId: [{ required: formData.data.isFlowingWater === "1" ? true : false, message: "请选择往来账户", trigger: "change" }],
|
|
|
+ isFlowingWater: [
|
|
|
+ { required: true, message: "请选择是否流水", trigger: "change" },
|
|
|
+ ],
|
|
|
+ accountId: [
|
|
|
+ {
|
|
|
+ required: formData.data.isFlowingWater === "1" ? true : false,
|
|
|
+ message: "请选择往来账户",
|
|
|
+ trigger: "change",
|
|
|
+ },
|
|
|
+ ],
|
|
|
amount: [{ required: true, message: "请输入往来金额", trigger: "blur" }],
|
|
|
};
|
|
|
});
|
|
@@ -410,14 +508,16 @@ const clickAddUnit = () => {
|
|
|
};
|
|
|
const submitUnitForm = () => {
|
|
|
unit.value.handleSubmit(() => {
|
|
|
- proxy.post("/transactionDepartment/" + modalType.value, formUnitData.data).then(() => {
|
|
|
- ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
- type: "success",
|
|
|
+ proxy
|
|
|
+ .post("/transactionDepartment/" + modalType.value, formUnitData.data)
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ openAddUnit.value = false;
|
|
|
+ getDepartmentList();
|
|
|
});
|
|
|
- openAddUnit.value = false;
|
|
|
- getDepartmentList();
|
|
|
- });
|
|
|
});
|
|
|
};
|
|
|
const handleUpdate = (row) => {
|