dev
张同海 2 years ago
parent 0cf03912cc
commit 0c8582b3d7

@ -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
})
}

@ -102,14 +102,29 @@
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-col :span="6">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入地址"
v-decorator="['addr', { rules: [{ required: true, message: '请输入地址!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="属性字符串" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
mode="multiple"
placeholder="请选择属性字符串"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择属性字符串!' }] }]"
>
<a-select-option value="委托单位">委托单位</a-select-option>
<a-select-option value="车队">车队</a-select-option>
<a-select-option value="报关行">报关行</a-select-option>
<a-select-option value="订舱管理">订舱管理</a-select-option>
<a-select-option value="代理">代理</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
@ -146,12 +161,12 @@
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="WroleCode" title="角色" :edit-render="{}">
<vxe-column field="roleCode" title="角色" :edit-render="{}">
<template #default="{ row }">
<span>{{ formatRole(row.WroleCode) }}</span>
<span>{{ formatRole(row.roleCode) }}</span>
</template>
<template #edit="{ row }">
<vxe-select v-model="row.WroleCode" multiple transfer>
<vxe-select v-model="row.roleCode" transfer>
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.value"></vxe-option>
</vxe-select>
</template>
@ -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('新增成功')

@ -102,14 +102,29 @@
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="地址" :labelCol="labelCol2" :wrapperCol="wrapperCol2" has-feedback>
<a-col :span="6">
<a-form-item label="地址" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入地址"
v-decorator="['addr', { rules: [{ required: true, message: '请输入地址!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="属性字符串" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
mode="multiple"
placeholder="请选择属性字符串"
v-decorator="['WpropString', { rules: [{ required: true, message: '请选择属性字符串!' }] }]"
>
<a-select-option value="委托单位">委托单位</a-select-option>
<a-select-option value="车队">车队</a-select-option>
<a-select-option value="报关行">报关行</a-select-option>
<a-select-option value="订舱管理">订舱管理</a-select-option>
<a-select-option value="代理">代理</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
@ -146,12 +161,12 @@
>
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="WroleCode" title="角色" :edit-render="{}">
<vxe-column field="roleCode" title="角色" :edit-render="{}">
<template #default="{ row }">
<span>{{ formatRole(row.WroleCode) }}</span>
<span>{{ formatRole(row.roleCode) }}</span>
</template>
<template #edit="{ row }">
<vxe-select v-model="row.WroleCode" multiple transfer>
<vxe-select v-model="row.roleCode" transfer>
<vxe-option v-for="item in TypeData" :key="item.code" :value="item.code" :label="item.value"></vxe-option>
</vxe-select>
</template>
@ -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
// }
}
}
</script>

@ -219,7 +219,7 @@ const columns = [
{
title: '属性字符串',
align: 'center',
width: '80',
width: '100',
dataIndex: 'propString'
},
{

@ -56,7 +56,7 @@
<vxe-column title="操作" fixed="right" width="260" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
<vxe-button type="text" @click="$refs.editForm.edit(row)"></vxe-button>
<vxe-button type="text" @click="$refs.editItemForm.edit(row)"></vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
@ -72,7 +72,7 @@
</template>
</vxe-column>
</vxe-table>
<vxe-pager
<!-- <vxe-pager
:loading="loading"
:current-page="queryParam.currentPage"
:page-size="queryParam.pageSize"
@ -80,9 +80,10 @@
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange"
>
</vxe-pager>
</vxe-pager> -->
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
<editItemForm ref="editItemForm" @ok="handleOk" />
</a-card>
</div>
</template>
@ -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() {

@ -71,7 +71,7 @@
</template>
</vxe-column>
</vxe-table>
<vxe-pager
<!-- <vxe-pager
:loading="loading"
:current-page="queryParam.currentPage"
:page-size="queryParam.pageSize"
@ -79,7 +79,7 @@
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange"
>
</vxe-pager>
</vxe-pager> -->
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>

@ -0,0 +1,172 @@
<template>
<a-modal
title="参数选项"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel"
>
<template slot="footer"> </template>
<a-spin :spinning="confirmLoading">
<vxe-toolbar>
<template #buttons>
<vxe-button icon="vxe-icon-square-plus" @click="insertEvent()"></vxe-button>
</template>
</vxe-toolbar>
<vxe-table
border
resizable
show-overflow
ref="xTable"
height="500"
:row-config="{ isHover: true }"
:data="tableData"
@cell-dblclick="cellDBLClickEvent"
>
<vxe-column type="seq" width="60"></vxe-column>
<vxe-column field="name" title="Name"></vxe-column>
<vxe-column field="sex" title="Sex" :formatter="formatterSex"></vxe-column>
<vxe-column field="age" title="Age"></vxe-column>
<vxe-column field="address" title="Address" show-overflow></vxe-column>
<vxe-column title="操作" width="100" show-overflow>
<template #default="{ row }">
<vxe-button type="text" icon="vxe-icon-edit" @click="editEvent(row)"></vxe-button>
<vxe-button type="text" icon="vxe-icon-delete" @click="removeEvent(row)"></vxe-button>
</template>
</vxe-column>
</vxe-table>
</a-spin>
</a-modal>
</template>
<script>
import { DJYTenantParamGetParamItem, DJYTenantParamEdit } from '@/api/modular/main/DJYTenantParam'
import { sysDictDataPage } from '@/api/modular/system/dictDataManage'
export default {
data() {
return {
TypeData: [],
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 21 }
},
typeData: [],
visible: false,
confirmLoading: false,
form: this.$form.createForm(this),
data: {},
tableData: []
}
},
mounted() {
// sysDictDataPage({ pageNo: 1, pageSize: 999, typeId: '349716496130117' }).then(res => {
// this.TypeData = res.data.rows
// console.log(this.TypeData)
// })
},
methods: {
async insertEvent(row) {
const $table = this.$refs.xTable
const record = {
itemName: '',
remark: ''
}
const { row: newRow } = await $table.insertAt(record, row)
await $table.setActiveCell(newRow, 'name')
},
editRowEvent(row) {
const $table = this.$refs.xTable
$table.setActiveRow(row)
},
cancelRowEvent(row) {
const $table = this.$refs.xTable
$table.clearActived().then(() => {
//
$table.revertData(row)
})
},
saveRowEvent() {
const $table = this.$refs.xTable
$table.clearActived().then(() => {
this.loading = true
setTimeout(() => {
this.loading = false
VXETable.modal.message({ content: '保存成功!', status: 'success' })
}, 300)
})
},
//
edit(record) {
this.data = record
console.log(record)
DJYTenantParamGetParamItem({ paraCode: record.paraCode }).then(res => {
this.tableData = res.data
})
this.visible = true
// const typeOption = this.$options
// this.typeData = typeOption.filters['dictData']('edi_type')
// setTimeout(() => {
// this.form.setFieldsValue({
// paraName: record.paraName,
// paraCode: record.paraCode,
// remark: record.remark
// })
// console.log(this.form.getFieldsValue())
// }, 100)
},
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
console.log(errors, values)
if (!errors) {
for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
console.log(this.form, values.id)
values.id = this.data.id
console.log(values)
DJYTenantParamEdit(values)
.then(res => {
if (res.success) {
this.$message.success('编辑成功')
this.confirmLoading = false
this.$emit('ok', values)
this.handleCancel()
} else {
this.$message.error(`编辑失败,${res.message}`)
}
})
.finally(res => {
this.confirmLoading = false
})
} else {
this.confirmLoading = false
}
})
},
handleCancel() {
this.form.resetFields()
this.visible = false
}
}
}
</script>
Loading…
Cancel
Save