From 0c8582b3d7af0ecdc0f7f32734af195e2c2fe49a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <963808678@qq.com>
Date: Fri, 11 Nov 2022 17:08:19 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/modular/main/DJYTenantParam.js | 51 ++++++
src/views/main/Customer/addForm.vue | 91 ++++-----
src/views/main/Customer/editForm.vue | 64 +++----
src/views/main/Customer/index.vue | 2 +-
src/views/main/DJYTenantParam/index.vue | 9 +-
src/views/main/DJYTenantParam/indexItem.vue | 4 +-
.../main/DJYTenantParam/itemEditForm.vue | 172 ++++++++++++++++++
7 files changed, 295 insertions(+), 98 deletions(-)
create mode 100644 src/views/main/DJYTenantParam/itemEditForm.vue
diff --git a/src/api/modular/main/DJYTenantParam.js b/src/api/modular/main/DJYTenantParam.js
index 98b154b..dce7d07 100644
--- a/src/api/modular/main/DJYTenantParam.js
+++ b/src/api/modular/main/DJYTenantParam.js
@@ -102,3 +102,54 @@ export function DJYTenantParamDeleteParamValue(parameter) {
params: parameter
})
}
+/**
+ * 获取租户参数
+ *
+ * @author Myshipping
+ */
+export function DJYTenantParamGetParamItem(parameter) {
+ return axios({
+ url: '/DJYTenantParam/getParamItem',
+ method: 'get',
+ params: parameter
+ })
+}
+
+/**
+ * 增加参数
+ *
+ * @author Myshipping
+ */
+export function DJYTenantParamAddParamItem(parameter) {
+ return axios({
+ url: '/DJYTenantParam/addParamItem',
+ method: 'post',
+ data: parameter
+ })
+}
+
+/**
+ * 更新租户参数
+ *
+ * @author Myshipping
+ */
+export function DJYTenantParamEditParamItem(parameter) {
+ return axios({
+ url: '/DJYTenantParam/editParamItem',
+ method: 'post',
+ data: parameter
+ })
+}
+
+/**
+ * 删除租户参数
+ *
+ * @author Myshipping
+ */
+export function DJYTenantParamDeleteParamItem(parameter) {
+ return axios({
+ url: '/DJYTenantParam/deleteParamItem',
+ method: 'post',
+ params: parameter
+ })
+}
diff --git a/src/views/main/Customer/addForm.vue b/src/views/main/Customer/addForm.vue
index 5da8f80..4a1e908 100644
--- a/src/views/main/Customer/addForm.vue
+++ b/src/views/main/Customer/addForm.vue
@@ -102,14 +102,29 @@
/>
-
-
+
+
+
+
+
+ 委托单位
+ 车队
+ 报关行
+ 订舱管理
+ 代理
+
+
+
@@ -146,12 +161,12 @@
>
-
+
- {{ formatRole(row.WroleCode) }}
+ {{ formatRole(row.roleCode) }}
-
+
@@ -300,7 +315,6 @@ export default {
},
methods: {
removeCheckboxRow() {
- console.log(this.$refs.xTable.selection)
this.$refs.xTable.selection.forEach(item => {
this.ContactsData.forEach((item2, index2) => {
if (item.WebKey == item2.WebKey) {
@@ -319,57 +333,22 @@ export default {
qq: '',
remark: ''
})
- console.log(this.ContactsData)
},
formatRole(value) {
let RData = ''
if (value) {
this.TypeData.forEach(item => {
- value.forEach(item2 => {
- if (item.code == item2) {
- RData == '' ? (RData = item.value) : (RData = RData + ',' + item.value)
- }
- })
+ if (item.code == value) {
+ RData = item.value
+ }
})
}
return RData
},
- formatSex(value) {
- if (value === '1') {
- return '男'
- }
- if (value === '0') {
- return '女'
- }
- return ''
- },
- formatMultiSex(values) {
- if (values) {
- return values.map(val => this.formatSex(val)).join(',')
- }
- return ''
- },
// 初始化方法
add(record) {
this.visible = true
- this.typeData = [
- {
- code: 10,
- name: '收货人'
- },
- {
- code: 20,
- name: '发货人'
- },
- {
- code: 30,
- name: '通知人'
- },
- {
- code: 40,
- name: '第二通知人'
- }
- ]
+ this.typeData = []
},
/**
* 提交表单
@@ -386,17 +365,17 @@ export default {
values[key] = JSON.stringify(values[key])
}
}
- this.ContactsData.forEach(item => {
- if (item.WroleCode.length) {
- let data = ''
- item.WroleCode.forEach(item => {
- data = `${data}[${item}]`
- })
- item.roleCode = data
- }
- })
- console.log(this.ContactsData)
- DjyCustomerAdd({ ...values, contacts: this.ContactsData })
+
+ let propString = ''
+
+ values.WpropString.split('["')[1]
+ .split('"]')[0]
+ .split('","')
+ .forEach(item2 => {
+ propString == '' ? (propString = `[${item2}]`) : (propString = `${propString}[${item2}]`)
+ })
+
+ DjyCustomerAdd({ ...values, propString: propString, contacts: this.ContactsData })
.then(res => {
if (res.success) {
this.$message.success('新增成功')
diff --git a/src/views/main/Customer/editForm.vue b/src/views/main/Customer/editForm.vue
index 8dbc9ba..9eb005a 100644
--- a/src/views/main/Customer/editForm.vue
+++ b/src/views/main/Customer/editForm.vue
@@ -102,14 +102,29 @@
/>
-
-
+
+
+
+
+
+ 委托单位
+ 车队
+ 报关行
+ 订舱管理
+ 代理
+
+
+
@@ -146,12 +161,12 @@
>
-
+
- {{ formatRole(row.WroleCode) }}
+ {{ formatRole(row.roleCode) }}
-
+
@@ -300,19 +315,6 @@ export default {
this.form.setFieldsValue({
...res.data
})
-
- res.data.contacts.forEach((item, index) => {
- item.WebKey = index
- let data = []
- item.roleCode.split(']').forEach(item => {
- if (item) {
- data.push(item.split('[')[1])
- }
- })
- item.WroleCode = data
- console.log(item.WroleCode)
- this.ContactsData.push(item)
- })
})
sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '346103538081861' }).then(res => {
this.TypeData = res.data.rows
@@ -341,13 +343,12 @@ export default {
},
formatRole(value) {
let RData = ''
+ console.log(value)
if (value) {
this.TypeData.forEach(item => {
- value.forEach(item2 => {
- if (item.code == item2) {
- RData == '' ? (RData = item.value) : (RData = RData + ',' + item.value)
- }
- })
+ if (item.code == value) {
+ RData = item.value
+ }
})
}
return RData
@@ -386,15 +387,6 @@ export default {
values[key] = JSON.stringify(values[key])
}
}
- this.ContactsData.forEach(item => {
- if (item.WroleCode.length) {
- let data = ''
- item.WroleCode.forEach(item => {
- data = `${data}[${item}]`
- })
- item.roleCode = data
- }
- })
DjyCustomerEdit({ ...this.Data, ...values, contacts: this.ContactsData })
.then(res => {
if (res.success) {
@@ -412,11 +404,11 @@ export default {
this.confirmLoading = false
}
})
- },
- handleCancel() {
- this.form.resetFields()
- this.visible = false
}
+ // handleCancel() {
+ // this.form.resetFields()
+ // this.visible = false
+ // }
}
}
diff --git a/src/views/main/Customer/index.vue b/src/views/main/Customer/index.vue
index cb096c6..624934c 100644
--- a/src/views/main/Customer/index.vue
+++ b/src/views/main/Customer/index.vue
@@ -219,7 +219,7 @@ const columns = [
{
title: '属性字符串',
align: 'center',
- width: '80',
+ width: '100',
dataIndex: 'propString'
},
{
diff --git a/src/views/main/DJYTenantParam/index.vue b/src/views/main/DJYTenantParam/index.vue
index e2a86c3..45c5ad4 100644
--- a/src/views/main/DJYTenantParam/index.vue
+++ b/src/views/main/DJYTenantParam/index.vue
@@ -56,7 +56,7 @@
编辑
- 编辑选项
+ 编辑选项
-
-
+ -->
+
@@ -91,11 +92,13 @@ import { DJYTenantParamGet, DJYTenantParamDelete } from '@/api/modular/main/DJYT
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
import addForm from './addForm.vue'
import editForm from './editForm.vue'
+import editItemForm from './itemEditForm.vue'
import columnSetting from '@/components/tableColumnSetting'
export default {
components: {
addForm,
editForm,
+ editItemForm,
columnSetting
},
data() {
diff --git a/src/views/main/DJYTenantParam/indexItem.vue b/src/views/main/DJYTenantParam/indexItem.vue
index 1deb779..fc4c665 100644
--- a/src/views/main/DJYTenantParam/indexItem.vue
+++ b/src/views/main/DJYTenantParam/indexItem.vue
@@ -71,7 +71,7 @@
-
-
+ -->
diff --git a/src/views/main/DJYTenantParam/itemEditForm.vue b/src/views/main/DJYTenantParam/itemEditForm.vue
new file mode 100644
index 0000000..e9a709f
--- /dev/null
+++ b/src/views/main/DJYTenantParam/itemEditForm.vue
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+