|
@@ -10,32 +10,21 @@
|
|
|
highlight-current-row
|
|
|
:selectConfig="selectConfig"
|
|
|
:table-events="{
|
|
|
- //element talbe事件都能传
|
|
|
select: select,
|
|
|
}"
|
|
|
:action-list="[]"
|
|
|
@get-list="getList"
|
|
|
>
|
|
|
- <template #phoneNumber="{ item }">
|
|
|
- <div>
|
|
|
- <span v-for="(x, index) in getTypeData(item, 0)">
|
|
|
- {{ x.contactNumber }}
|
|
|
- <span v-if="index < getTypeData(item, 0).length - 1">,</span>
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <template #email="{ item }">
|
|
|
- <div>
|
|
|
- <span v-for="(x, index) in getTypeData(item, 1)">
|
|
|
- {{ x.contactNumber }}
|
|
|
- <span v-if="index < getTypeData(item, 1).length - 1">,</span>
|
|
|
- </span>
|
|
|
+ <template #amount="{ item }">
|
|
|
+ <div :style="`color: ${item.amount <= 0 ? 'red' : '#39C55A'}`">
|
|
|
+ {{dictDataEcho(item.currency,dictsData.account_currency) + ' ' + item.amount}}
|
|
|
</div>
|
|
|
</template>
|
|
|
+
|
|
|
</byTable>
|
|
|
</div>
|
|
|
<el-dialog
|
|
|
- :title="modalType == 'add' ? '添加IoT平台' : '编辑'"
|
|
|
+ title="拆分"
|
|
|
v-model="dialogVisible"
|
|
|
width="600"
|
|
|
v-loading="loading"
|
|
@@ -57,60 +46,63 @@
|
|
|
label-width="0px"
|
|
|
style="margin-top: 15px"
|
|
|
>
|
|
|
- <el-table :data="formData.data.internalAddressBookList">
|
|
|
- <el-table-column prop="type" label="部门">
|
|
|
+ <el-table :data="formData.data.accountDeptRunningWaterDetailList">
|
|
|
+ <el-table-column prop="deptId" label="部门">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
- :prop="'internalAddressBookList.' + $index + '.type123'"
|
|
|
- :rules="rules.type"
|
|
|
+ :prop="'accountDeptRunningWaterDetailList.' + $index + '.deptId'"
|
|
|
+ :rules="rules.deptId"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
- <el-select v-model="row.type" placeholder="请选择">
|
|
|
- <el-option
|
|
|
- v-for="item in contactInformationType"
|
|
|
- :label="item.dictValue"
|
|
|
- :value="item.dictKey"
|
|
|
- >
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <el-cascader
|
|
|
+ v-model="row.deptId"
|
|
|
+ :options="deptTreeData"
|
|
|
+ :props="{
|
|
|
+ value: 'deptId',
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="contactNumber"
|
|
|
+ prop="amount"
|
|
|
label="分拆金额"
|
|
|
|
|
|
>
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
:prop="
|
|
|
- 'internalAddressBookList.' + $index + '.type456'
|
|
|
+ 'accountDeptRunningWaterDetailList.' + $index + '.amount'
|
|
|
"
|
|
|
- :rules="rules.contactNumber"
|
|
|
+ :rules="rules.amount"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="row.contactNumber"
|
|
|
+ v-model="row.amount"
|
|
|
placeholder="请输入"
|
|
|
+ type="number"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="contactNumber"
|
|
|
+ prop="remarks"
|
|
|
label="备注"
|
|
|
|
|
|
>
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-form-item
|
|
|
:prop="
|
|
|
- 'internalAddressBookList.' + $index + '.type789'
|
|
|
+ 'accountDeptRunningWaterDetailList.' + $index + '.remarks'
|
|
|
"
|
|
|
- :rules="rules.contactNumber"
|
|
|
+ :rules="rules.remarks"
|
|
|
:inline-message="true"
|
|
|
>
|
|
|
<el-input
|
|
|
- v-model="row.contactNumber"
|
|
|
+ v-model="row.remarks"
|
|
|
placeholder="请输入"
|
|
|
/>
|
|
|
</el-form-item>
|
|
@@ -140,6 +132,35 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ title="调整部门"
|
|
|
+ v-model="depModal"
|
|
|
+ width="600"
|
|
|
+ v-loading="loading"
|
|
|
+ >
|
|
|
+ <p>部门名称</p>
|
|
|
+ <el-cascader
|
|
|
+ v-model="departmentId"
|
|
|
+ :options="deptTreeData"
|
|
|
+ :props="{
|
|
|
+ value: 'deptId',
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ filterable
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="depModal = false" size="large">取 消</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="submitDeptForm(departmentId)"
|
|
|
+ size="large"
|
|
|
+ :loading="submitLoading"
|
|
|
+ >
|
|
|
+ 确 定
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -170,65 +191,59 @@ let rules = ref({
|
|
|
{ required: true, message: "请输入联系号码", trigger: "blur" },
|
|
|
],
|
|
|
});
|
|
|
+import Cookies from 'js-cookie'
|
|
|
+
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
const selectConfig = [];
|
|
|
const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "归属部门",
|
|
|
- },
|
|
|
- render(row) {
|
|
|
- return row.dept.deptName;
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- attrs: {
|
|
|
label: "资金账户",
|
|
|
- prop: "deptId",
|
|
|
+ prop: "accountManagementName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "交易时间",
|
|
|
- prop: "nickName",
|
|
|
+ prop: "transactionTime",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- type: "slot",
|
|
|
- slot: "phoneNumber",
|
|
|
label: "交易金额",
|
|
|
+ prop: "amount",
|
|
|
+ slot:'amount'
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- slot: "email",
|
|
|
+ prop: "accountOpening",
|
|
|
label: "对方账户",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- slot: "email",
|
|
|
+ prop: "openingBank",
|
|
|
label: "对方银行",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- slot: "email",
|
|
|
+ prop: "name",
|
|
|
label: "对方账号",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- slot: "email",
|
|
|
+ prop: "remarks",
|
|
|
label: "摘要",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
- width: "100",
|
|
|
+ width: "200",
|
|
|
align: "right",
|
|
|
},
|
|
|
// 渲染 el-button,一般用在最后一列。
|
|
@@ -236,7 +251,20 @@ const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "分析",
|
|
|
+ label: "调整部门",
|
|
|
+ type: "primary",
|
|
|
+ text: true,
|
|
|
+ },
|
|
|
+ el: "button",
|
|
|
+ click() {
|
|
|
+ depModal.value = true;
|
|
|
+ runningWaterId = row.id
|
|
|
+ departmentId.value = []
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "分拆",
|
|
|
type: "primary",
|
|
|
text: true,
|
|
|
},
|
|
@@ -265,27 +293,86 @@ const formOption = reactive({
|
|
|
});
|
|
|
const byform = ref(null);
|
|
|
const treeData = ref([]);
|
|
|
+const depModal = ref(false);
|
|
|
+let deptTreeData = ref([]);
|
|
|
+let departmentId = ref([])
|
|
|
+let runningWaterId = ''
|
|
|
+const getDept = async (row) => {
|
|
|
+ // 部门树
|
|
|
+ proxy
|
|
|
+ .get("/tenantDept/list", {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ tenantId: Cookies.get('tenantId')
|
|
|
+ })
|
|
|
+ .then((message) => {
|
|
|
+ recursive(message.data);
|
|
|
+ deptTreeData.value = proxy.handleTree(message.data, "corporationId");
|
|
|
+ });
|
|
|
+};
|
|
|
+getDept()
|
|
|
+
|
|
|
+const submitDeptForm = async (departmentId) => {
|
|
|
+
|
|
|
+ if (departmentId.length == 0) {
|
|
|
+ ElMessage.error("请选择部门");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ deptId: departmentId[departmentId.length - 1],
|
|
|
+ accountDeptRunningWaterId: runningWaterId
|
|
|
+ };
|
|
|
+ proxy
|
|
|
+ .post("/accountDeptRunningWaterDetail/add", params)
|
|
|
+ .then((message) => {
|
|
|
+ ElMessage.success("调整部门成功");
|
|
|
+ depModal.value = false;
|
|
|
+ getList();
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ ElMessage.error(error);
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const recursive = (data) => {
|
|
|
+ data.map((item) => {
|
|
|
+ item.label = item.deptName;
|
|
|
+ item.id = item.corporationId;
|
|
|
+ if (item.children) {
|
|
|
+ recursive(item.children);
|
|
|
+ } else {
|
|
|
+ item.children = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
const formConfig = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
- type: "input",
|
|
|
- prop: "deptName",
|
|
|
- label: "选择账户",
|
|
|
+ type: 'select',
|
|
|
+ prop: 'accountManagementId',
|
|
|
+ label: '付款账户',
|
|
|
+ required: true,
|
|
|
disabled: true,
|
|
|
- },
|
|
|
+ isLoad: {
|
|
|
+ url: '/accountManagement/page',
|
|
|
+ req: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 9999,
|
|
|
+ },
|
|
|
+ labelKey: 'name',
|
|
|
+ labelVal: 'id',
|
|
|
+ method: 'post',
|
|
|
+ resUrl: 'rows',
|
|
|
+ },
|
|
|
+ },
|
|
|
{
|
|
|
type: "date",
|
|
|
- prop: "nickName",
|
|
|
+ prop: "transactionTime",
|
|
|
label: "交易时间",
|
|
|
disabled: true,
|
|
|
},
|
|
|
{
|
|
|
- type: "select",
|
|
|
- label: "交易金额",
|
|
|
- itemWidth: 20,
|
|
|
- data:[]
|
|
|
- },
|
|
|
- {
|
|
|
type: "selectInput",
|
|
|
label: "交易金额",
|
|
|
itemWidth: 60,
|
|
@@ -293,24 +380,16 @@ const formConfig = computed(() => {
|
|
|
placeholder: "请输入",
|
|
|
selectPlaceholder: "币种",
|
|
|
selectProp: "currency",
|
|
|
- isLoad: {
|
|
|
- url: "/supplierInfo/page",
|
|
|
- req: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 9999,
|
|
|
- },
|
|
|
- labelKey: "name",
|
|
|
- labelVal: "id",
|
|
|
- method: "post",
|
|
|
- resUrl: "rows",
|
|
|
- },
|
|
|
+ prop: "amount",
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
- prop: "deptName",
|
|
|
+ prop: "remarks",
|
|
|
label: "摘要",
|
|
|
disabled: true,
|
|
|
itemType: "textarea",
|
|
|
+ disabled: true,
|
|
|
},
|
|
|
{
|
|
|
type:'slot',
|
|
@@ -326,6 +405,7 @@ const getList = async (req) => {
|
|
|
proxy
|
|
|
.post("/accountDeptRunningWater/page", sourceList.value.pagination)
|
|
|
.then((message) => {
|
|
|
+ console.log(message)
|
|
|
sourceList.value.data = message.rows;
|
|
|
sourceList.value.pagination.total = message.total;
|
|
|
setTimeout(() => {
|
|
@@ -333,21 +413,45 @@ const getList = async (req) => {
|
|
|
}, 200);
|
|
|
});
|
|
|
};
|
|
|
+let dictsData = reactive({})
|
|
|
+proxy
|
|
|
+ .getDict(['payment_status', 'payment_type','account_currency'])
|
|
|
+ .then((res) => {
|
|
|
+ dictsData = res
|
|
|
+ console.log(res)
|
|
|
+ formConfig.value[2].data = res.account_currency.map(item => {
|
|
|
+ return {
|
|
|
+ label: item.dictValue,
|
|
|
+ value: item.dictKey,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
|
|
|
const openModal = () => {
|
|
|
dialogVisible.value = true;
|
|
|
modalType.value = "add";
|
|
|
formData.data = {};
|
|
|
};
|
|
|
-openModal()
|
|
|
+
|
|
|
|
|
|
const submitForm = () => {
|
|
|
byform.value.handleSubmit((valid) => {
|
|
|
submitLoading.value = true;
|
|
|
- proxy.post("/internalAddressBook/" + modalType.value, formData.data).then(
|
|
|
+ const params = {
|
|
|
+ id: formData.data.id,
|
|
|
+ deptRunningWaterDetailList: formData.data.accountDeptRunningWaterDetailList,
|
|
|
+ accountDeptRunningWaterId: formData.data.accountDeptRunningWaterId,
|
|
|
+ };
|
|
|
+ params.deptRunningWaterDetailList.map((item) => {
|
|
|
+ item.deptId = item.deptId[item.deptId.length - 1];
|
|
|
+ })
|
|
|
+ proxy.post("/accountDeptRunningWaterDetail/add", {
|
|
|
+ ...params
|
|
|
+ }).then(
|
|
|
(res) => {
|
|
|
ElMessage({
|
|
|
- message: modalType.value == "add" ? "添加成功" : "编辑成功",
|
|
|
+ message: "拆分成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
dialogVisible.value = false;
|
|
@@ -361,34 +465,30 @@ const submitForm = () => {
|
|
|
|
|
|
const getDtl = (row) => {
|
|
|
modalType.value = "edit";
|
|
|
+ dialogVisible.value = true;
|
|
|
proxy
|
|
|
- .post("/internalAddressBook/detail", { userId: row.userId })
|
|
|
+ .post("/accountDeptRunningWaterDetail/detail", { id: row.id })
|
|
|
.then((res) => {
|
|
|
- res.forEach((x) => {
|
|
|
- x.type = x.type + "";
|
|
|
+ console.log(res)
|
|
|
+ res.accountDeptRunningWaterDetailList = res.deptRunningWaterDetailList.map((item) => {
|
|
|
+ item.deptId = [item.deptId];
|
|
|
+ return item;
|
|
|
});
|
|
|
- formData.data = {
|
|
|
- deptName: row.dept.deptName,
|
|
|
- nickName: row.nickName,
|
|
|
- internalAddressBookList: res,
|
|
|
- userId: row.userId,
|
|
|
- };
|
|
|
+ formData.data = res
|
|
|
dialogVisible.value = true;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const addRow = () => {
|
|
|
- console.log(formData.data)
|
|
|
- formData.data.internalAddressBookList = []
|
|
|
- formData.data.internalAddressBookList.push({
|
|
|
- type789: "",
|
|
|
- type456: "",
|
|
|
- type123: "",
|
|
|
+ formData.data.accountDeptRunningWaterDetailList.push({
|
|
|
+ remarks: "",
|
|
|
+ amount: null,
|
|
|
+ deptId: [],
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const handleRemove = (index) => {
|
|
|
- formData.data.internalAddressBookList.splice(index, 1);
|
|
|
+ formData.data.accountDeptRunningWaterDetailList.splice(index, 1);
|
|
|
return ElMessage({
|
|
|
message: "删除成功!",
|
|
|
type: "success",
|
|
@@ -396,27 +496,14 @@ const handleRemove = (index) => {
|
|
|
};
|
|
|
|
|
|
const contactInformationType = ref([]);
|
|
|
-const getDict = () => {
|
|
|
- const tenantId = useUserStore().user.tenantId;
|
|
|
- proxy
|
|
|
- .post("/dictTenantData/page", {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 999,
|
|
|
- tenantId: tenantId,
|
|
|
- dictCode: "contact_information",
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- contactInformationType.value = res.rows;
|
|
|
- });
|
|
|
-};
|
|
|
|
|
|
const getTypeData = (item, type) => {
|
|
|
- if (item.internalAddressBookList)
|
|
|
- return item.internalAddressBookList.filter((x) => x.type === type) || [];
|
|
|
+ if (item.accountDeptRunningWaterDetailList)
|
|
|
+ return item.accountDeptRunningWaterDetailList.filter((x) => x.type === type) || [];
|
|
|
};
|
|
|
|
|
|
-//getList();
|
|
|
-getDict();
|
|
|
+getList();
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|