客户参数

master
sunzehua 7 months ago
parent a6022f0162
commit 51e2a64fb3

12
.env

@ -1,8 +1,8 @@
NODE_ENV=production
VUE_APP_PREVIEW=true
# VUE_APP_TYPE = 'customer'
VUE_APP_TYPE = 'hechuan'
# VUE_APP_TYPE = 'yunyingduan'
# VUE_APP_TYPE = 'hechuan'
VUE_APP_TYPE = 'yunyingduan'
# VUE_APP_TYPE = 'gangjie'
# 打包部署的三个端 客户端customer 和川端hechuan 运营端djy
@ -11,8 +11,8 @@ VUE_APP_TYPE = 'hechuan'
# VUE_APP_SOCKET_BASE_URL=http://47.104.85.216:12345
# 和川大简云测试
VUE_APP_API_BASE_URL=http://60.209.125.238:35100
VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:35100
# VUE_APP_API_BASE_URL=http://60.209.125.238:35100
# VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:35100
# 客户端测试
# VUE_APP_API_BASE_URL=http://60.209.125.238:30813
@ -31,5 +31,5 @@ VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:35100
# VUE_APP_SOCKET_BASE_URL=http://118.190.144.189:6001
# 运营端正式
# VUE_APP_API_BASE_URL=http://118.190.144.189:6002
# VUE_APP_SOCKET_BASE_URL=http://118.190.144.189:6002
VUE_APP_API_BASE_URL=http://118.190.144.189:6002
VUE_APP_SOCKET_BASE_URL=http://118.190.144.189:6002

@ -1,8 +1,8 @@
NODE_ENV=development
VUE_APP_PREVIEW=true
# VUE_APP_TYPE = 'customer'
VUE_APP_TYPE = 'hechuan'
# VUE_APP_TYPE = 'yunyingduan'
# VUE_APP_TYPE = 'hechuan'
VUE_APP_TYPE = 'yunyingduan'
# VUE_APP_TYPE = 'gangjie'
# 打包部署的三个端 客户端customer 和川端hechuan 运营端yunyingduan
@ -11,8 +11,8 @@ VUE_APP_TYPE = 'hechuan'
# VUE_APP_SOCKET_BASE_URL=http://47.104.85.216:12345
# 和川大简云测试
VUE_APP_API_BASE_URL=http://60.209.125.238:35100
VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:35100
# VUE_APP_API_BASE_URL=http://60.209.125.238:35100
# VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:35100
# 客户端测试
# VUE_APP_API_BASE_URL=http://60.209.125.238:30813
@ -30,8 +30,8 @@ VUE_APP_SOCKET_BASE_URL=http://60.209.125.238:35100
# VUE_APP_SOCKET_BASE_URL=http://118.190.144.189:5001
# 运营端正式
# VUE_APP_API_BASE_URL=http://118.190.144.189:6002
# VUE_APP_SOCKET_BASE_URL=http://118.190.144.189:6002
VUE_APP_API_BASE_URL=http://118.190.144.189:6002
VUE_APP_SOCKET_BASE_URL=http://118.190.144.189:6002
# 客户端正式
# VUE_APP_API_BASE_URL=http://118.190.144.189:6001

@ -165,3 +165,43 @@ export function SysTenantPage(parameter) {
params: parameter
})
}
export function PageParamValue(parameter) {
return axios({
url: '/DJYCustomerParam/PageParamValue',
method: 'post',
data: parameter
})
}
export function ParamList(parameter) {
return axios({
url: '/DJYCustomerParam/ParamList',
method: 'get',
params: parameter
})
}
export function ParamItemList(parameter) {
return axios({
url: '/DJYCustomerParam/ParamItemList',
method: 'get',
params: parameter
})
}
export function saveParamValue(parameter) {
return axios({
url: '/DJYCustomerParam/saveParamValue',
method: 'post',
data: parameter
})
}
export function deleteParamValue(parameter) {
return axios({
url: '/DJYCustomerParam/deleteParamValue',
method: 'post',
params: parameter
})
}

@ -1238,8 +1238,9 @@ export default {
WserviceItem.push(item.split('[')[1])
}
})
this.details.saveServiceList = WserviceItem
this.$emit('handleSaveService', WserviceItem)
console.log(WserviceItem)
// this.details.saveServiceList = WserviceItem
// this.$emit('handleSaveService', WserviceItem)
} else {
this.details.saveServiceList = []
this.$emit('handleSaveService', [])

@ -385,8 +385,10 @@
@click="TxxpLink(row)"></span>
<div style="display: flex;align-items: center;">
<div>
<div v-if="row.extendState && row.extendState.txxpEndTime">{{ row.extendState.txxpEndTime.substring(0, 16) }}</div>
<div> <a @click="openStop(row)" style="font-size: 12px;" href="javascript:;">修改到期时间</a></div>
<div >
<span v-if="row.extendState && row.extendState.txxpEndTime"> {{ row.extendState.txxpEndTime.substring(0, 16) }}</span>
<a-icon title="修改到期时间" @click="openStop(row)" style="font-size: 12px;color: #36cfc9" type="edit" />
</div>
</div>
<div
v-if="row.extendState && row.extendState.txxpPdfUrl"

@ -1230,9 +1230,11 @@ export default {
WserviceItem.push(item.split('[')[1])
}
})
this.$emit('handleSaveService', WserviceItem)
console.log(WserviceItem)
// this.details.saveServiceList = WserviceItem
// this.$emit('handleSaveService', WserviceItem)
} else {
this.details.item = []
this.details.saveServiceList = []
this.$emit('handleSaveService', [])
}
} else if (type === 'carrierid') {

@ -377,13 +377,11 @@
class="iconfont icon-dayinxiaopiao"
@click="TxxpLink(row)"
></span>
<div style="display: flex; align-items: center">
<div>
<div v-if="row.extendState && row.extendState.txxpEndTime">
{{ row.extendState.txxpEndTime.substring(0, 16) }}
</div>
<div >
<div>
<a @click="openStop(row)" style="font-size: 12px" href="javascript:;">修改到期时间</a>
<div >
<span v-if="row.extendState && row.extendState.txxpEndTime"> {{ row.extendState.txxpEndTime.substring(0, 16) }}</span>
<a-icon title="修改到期时间" @click="openStop(row)" style="font-size: 12px;color: #36cfc9" type="edit" />
</div>
</div>
<div

@ -98,25 +98,25 @@
v-if="item.checked"
>
</vxe-column>
<vxe-column title="操作" fixed="right" width="120" align="center">
<vxe-column title="操作" fixed="right" width="80" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="TabsEdit(row)">
<div style="display: flex;align-items: center;">
<a-icon type="form" :style="{ color: '#13c2c2' }" />
</vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
cancel-text="否"
style="margin: 0 5px;"
@confirm="
e => {
confirm(e, row)
}
"
>
<vxe-button type="text">
<a-icon type="delete" :style="{ color: '#13c2c2' }" />
</vxe-button>
</a-popconfirm>
<i @click="handleAdd(row)" style="cursor: pointer;" title="设置客户参数" class="iconfont icon-jiahao2fill" :style="{ color: '#13c2c2' }"></i>
</div>
</template>
</vxe-column>
</vxe-table>
@ -130,12 +130,10 @@
>
</vxe-pager>
</a-card>
<!-- </div> -->
<!-- <add-form ref="addForm" v-if="pane.title == ''" @ok="handleOk" /> -->
<!-- <edit-form ref="editForm" v-if="pane.title == ''" :RowData="pane.row" @ok="handleOk" /> -->
<!-- <addForm ></addForm> -->
<!-- </a-tab-pane>
</a-tabs> -->
<a-modal title="客户参数" :width="1300" @cancel="settingFlag=false" :visible="settingFlag" :footer="null">
<custList ref="custList"></custList>
</a-modal>
<custAddForm ref="custAddForm" @ok="handleOkCust" />
</div>
</template>
<script>
@ -149,6 +147,8 @@ import {
// import editForm from './editForm.vue'
import selectView from '../BookingLedger/detail/components/selectView'
import columnSetting from '@/components/tableColumnSetting'
import custAddForm from '../customerParam/addItemForm.vue'
import custList from '../customerParam/index.vue'
const addForm = () => import('./addForm.vue')
const editForm = () => import('./editForm.vue')
const columns = [
@ -290,7 +290,9 @@ export default {
addForm,
editForm,
columnSetting,
selectView
selectView,
custList,
custAddForm
},
data() {
const panes = [
@ -304,6 +306,7 @@ export default {
TableType: false,
advanced: false,
loading: false,
settingFlag: false,
setVisible: false,
setVisible1: false,
queryParam: {
@ -343,6 +346,15 @@ export default {
})
}
return propString
},
handleAdd(row) {
this.settingFlag = true
setTimeout(() => {
this.$refs.custList.initQuery(row)
}, 100)
},
handleOkCust() {
},
getSelectViewRes({ type, res }) {
this.queryParam.sale = res.name

@ -301,7 +301,7 @@ export default {
loading: false,
setVisible: false,
setVisible1: false,
loadingTable:false,
loadingTable: false,
queryParam: {
currentPage: 1,
pageSize: 10,
@ -322,7 +322,9 @@ export default {
{ code: 'order', name: '主单' },
{ code: 'ctn', name: '箱信息' },
{ code: 'edi', name: 'edi信息' },
{ code: 'userinfo', name: '用户信息' }
{ code: 'userinfo', name: '用户信息' },
{ code: 'other', name: '其他' },
{ code: 'suborder', name: '分单' }
]
}
},
@ -359,6 +361,7 @@ export default {
}
})
})
console.log(fieldData)
this.fieldData = fieldData
this.fieldData1 = fieldData
setTimeout(() => {
@ -406,24 +409,7 @@ export default {
return false
}
const children = [...tableData, ...insertRecords]
// if (removeRecords.length) {
// children.forEach((item, index) => {
// removeRecords.forEach(ele => {
// if (item.id == ele.id) {
// children.splice(index, 1)
// }
// })
// })
// }
// if (updateRecords.length) {
// children.forEach((item, index) => {
// updateRecords.forEach(ele => {
// if (item.id == ele.id) {
// children[index] = ele
// }
// })
// })
// }
console.log(children, this.fieldList)
BookingTemplateAddOrUpdateExcelTemplate({
pid: this.ExcelPid,
@ -581,33 +567,6 @@ export default {
BookingOrderGetFieldName().then(res => {
console.log(res.data)
this.data1 = res.data
// let fieldList = [
// { code: 'order', name: '' },
// { code: 'ctn', name: 'ctn' },
// { code: 'edi', name: 'edi' },
// { code: 'userinfo', name: 'userinfo' }
// ]
// Object.keys(res.data).forEach(ele => {
// this.fieldListData.forEach(item => {
// if (ele == item.code) {
// fieldList.push({
// code: ele,
// name: item.name
// })
// }
// })
// })
// this.fieldList = fieldList
// Object.keys(res.data[0]).forEach(ele => {
// Arr.push({ code: ele, name: res.data[0][ele] })
// })
// res.data.forEach(item => {
// Object.keys(item).forEach(ele => {
// Arr.push({ code: ele, name: item[ele] })
// })
// })
// this.fieldData = Arr
// this.data1 = Arr
})
DjyCustomerGet({ type: 'printing_list_col' }).then(res => {
if (res.data && JSON.parse(res.data.configJson).length) {

@ -0,0 +1,222 @@
<template>
<a-modal
title="新增参数"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
show-search
v-decorator="['customerId', { rules: [{ required: true, message: '请选择客户!' }] }]"
placeholder="请选择客户"
style="width: 200px"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="tenantIdSearch">
<a-select-option v-for="item in TenantData" :key="item.id" :value="item.id">
{{ item.shortName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="客户参数类别" :labelCol="{ sm: { span: 8 } }" :wrapperCol="{ sm: { span: 15 } }" has-feedback>
<a-select
placeholder="请选择客户参数类别"
v-decorator="['paraCode', { rules: [{ required: true, message: '请选择客户参数类别!' }] }]"
@change="FnChangeTypeCode">
<a-select-option v-for="(item) in WTypeData" :key="item.id" :value="item.paraCode">
{{ item.paraName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="客户参数名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback disabled>
<a-input
placeholder="请输入客户参数名称"
v-decorator="['itemCode', { rules: [{ required: true, message: '请输入客户参数名称!' }] }]"
:disabled="ItemCodeDisabled"
v-if="ItemData.length == 0" />
<a-select
placeholder="请选择客户参数名称"
v-decorator="['itemCode', { rules: [{ required: true, message: '请选择客户参数名称!' }] }]"
:disabled="ItemCodeDisabled"
v-else>
<a-select-option v-for="item in ItemData" :key="item.id" :value="item.itemCode">
{{ item.itemName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input-number style="width: 198px;" v-decorator="['sort']" />
</a-form-item>
</a-col>
<a-col :span="16">
<a-form-item
label="备注"
:labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
has-feedback>
<a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import {
ParamList,
ParamItemList,
saveParamValue
} from '@/api/modular/main/DJYTenantParam'
import { DjyCustomerSuggest } from '@/api/modular/main/BookingLedger'
export default {
data() {
return {
TypeData: [],
WTypeData: [],
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),
TenantData: [],
ItemData: [],
ItemCodeDisabled: true,
YWData: []
}
},
mounted() {
},
methods: {
FnTypeD(data) {
let Rdata = ''
this.YWData.forEach(item => {
if (item.code == data) {
Rdata = item.name
}
})
return Rdata
},
FnChangeTypeCode(e) {
this.form.setFieldsValue({
itemCode: ''
})
if (e) {
this.ItemCodeDisabled = false
ParamItemList({ paraCode: e }).then(res => {
this.ItemData = res.data
})
}
},
tenantIdSearch(value) {
if (value) {
DjyCustomerSuggest({ keyword: value }).then(res => {
this.TenantData = res.data.rows
})
}
},
//
add(data) {
this.visible = true
DjyCustomerSuggest().then(res => {
this.TenantData = res.data.rows
if (data) {
this.form.setFieldsValue({
customerId: data
})
this.$forceUpdate()
}
})
ParamList().then(res => {
this.WTypeData = res.data
})
},
/**
* 提交表单
*/
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
this.TenantData.forEach(item => {
if (item.id == values.customerId) {
values.customerName = item.shortName
}
})
this.WTypeData.forEach(item => {
if (item.paraCode == values.paraCode) {
values.paraName = item.paraName
values.paramType = item.type
}
})
this.ItemData.forEach(item => {
if (item.itemCode == values.itemCode) {
values.itemName = item.itemName
}
})
saveParamValue(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>

@ -0,0 +1,229 @@
<template>
<a-modal
title="编辑参数"
:width="1100"
:visible="visible"
:confirmLoading="confirmLoading"
@ok="handleSubmit"
@cancel="handleCancel">
<a-spin :spinning="confirmLoading">
<a-form :form="form">
<a-row>
<a-col :span="8">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-select
show-search
v-decorator="['customerId', { rules: [{ required: true, message: '请选择客户!' }] }]"
placeholder="请选择客户"
style="width: 200px"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="tenantIdSearch">
<a-select-option v-for="item in TenantData" :key="item.id" :value="item.id">
{{ item.shortName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="客户参数类别" :labelCol="{ sm: { span: 8 } }" :wrapperCol="{ sm: { span: 15 } }" has-feedback>
<a-select
placeholder="请选择客户参数类别"
v-decorator="['paraCode', { rules: [{ required: true, message: '请选择客户参数类别!' }] }]"
@change="FnChangeTypeCode">
<a-select-option v-for="(item) in WTypeData" :key="item.id" :value="item.paraCode">
{{ item.paraName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="客户参数名称" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback disabled>
<a-spin :spinning="ItemCodeLoad">
<a-input
placeholder="请输入客户参数名称"
v-decorator="['itemCode', { rules: [{ required: true, message: '请输入客户参数名称!' }] }]"
:disabled="ItemCodeDisabled"
v-if="ItemData.length == 0" />
<a-select
placeholder="请选择客户参数名称"
v-decorator="['itemCode', { rules: [{ required: true, message: '请选择客户参数名称!' }] }]"
:disabled="ItemCodeDisabled"
v-else>
<a-select-option v-for="item in ItemData" :key="item.id" :value="item.itemCode">
{{ item.itemName }}
</a-select-option>
</a-select>
</a-spin>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="排序" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input-number style="width: 198px;" v-decorator="['sort']" />
</a-form-item>
</a-col>
<a-col :span="16">
<a-form-item
label="备注"
:labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 19 } }"
has-feedback>
<a-textarea :rows="4" placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import {
ParamList,
ParamItemList,
saveParamValue
} from '@/api/modular/main/DJYTenantParam'
import { DjyCustomerSuggest } from '@/api/modular/main/BookingLedger'
export default {
data() {
return {
TypeData: [],
WTypeData: [],
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,
ItemCodeLoad: false,
confirmLoading: false,
form: this.$form.createForm(this),
data: {},
TenantData: [],
ItemData: [],
ItemCodeDisabled: true,
YWData: []
}
},
mounted() {
},
methods: {
FnTypeD(data) {
let Rdata = ''
this.YWData.forEach(item => {
if (item.code == data) {
Rdata = item.name
}
})
return Rdata
},
FnChangeTypeCode(e) {
this.form.setFieldsValue({
itemCode: ''
})
if (e) {
this.ItemCodeDisabled = false
ParamItemList({ paraCode: e }).then(res => {
this.ItemData = res.data
})
}
},
tenantIdSearch(value) {
if (value) {
DjyCustomerSuggest({ keyword: value }).then(res => {
this.TenantData = res.data.rows
})
}
},
//
edit(record) {
console.log(record)
this.data = record
this.visible = true
DjyCustomerSuggest().then(res => {
this.TenantData = res.data.rows
})
ParamList().then(res => {
this.WTypeData = res.data
})
setTimeout(() => {
this.form.setFieldsValue({
paraCode: record.paraCode,
itemCode: record.itemCode,
itemName: record.itemName,
remark: record.remark,
sort: record.sort,
customerId: record.customerId
})
}, 100)
},
handleSubmit() {
const {
form: { validateFields }
} = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
values.id = this.data.id
this.TenantData.forEach(item => {
if (item.id == values.customerId) {
values.customerName = item.shortName
}
})
this.WTypeData.forEach(item => {
if (item.paraCode == values.paraCode) {
values.paraName = item.paraName
values.paramType = item.type
}
})
this.ItemData.forEach(item => {
if (item.itemCode == values.itemCode) {
values.itemName = item.itemName
}
})
saveParamValue(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>

@ -0,0 +1,399 @@
<template>
<div>
<a-card :bordered="false" :bodyStyle="tstyle">
<div
class="table-page-search-wrapper"
:class="advanced ? 'Open' : 'Close'"
>
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="18">
<a-row :gutter="48">
<a-col
:md="8"
:sm="16"
v-for="item in ColumnsQuery"
:key="`${item.dataIndex}1`"
v-show="item.dataIndex != 'itemName' && item.dataIndex != 'remark'"
>
<a-form-item :label="item.title">
<a-select
show-search
style="width: 200px"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
@search="tenantIdSearch"
v-model="queryParam.customerId"
allow-clear
v-if="item.title == '客户'"
:style="{ width: '100%' }"
>
<a-select-option v-for="itemS in TenantData" :key="itemS.id" :value="itemS.id">
{{ itemS.shortName }}
</a-select-option>
</a-select>
<a-select
v-model="queryParam.paraCode"
v-else-if="item.title == '客户参数类别'"
allow-clear
>
<a-select-option v-for="(item1) in WTypeData" :key="item1.id" :value="item1.paraCode">
{{ item1.paraName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :md="6" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="FnGetData"></a-button>
<a-button style="margin-left: 8px" @click="init"></a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
</a-card>
<a-card :bordered="false">
<vxe-toolbar>
<template #buttons>
<div class="nav-box">
<div class="nav" @click="handleAdd"><i class="iconfont icon-jiahao2fill"></i>新建</div>
</div>
</template>
</vxe-toolbar>
<vxe-table
:data="loadData"
stripe
resizable
round
:loading="loading"
empty-text="没有更多数据了!">
<vxe-column type="seq" width="40" fixed="left"></vxe-column>
<vxe-column
v-for="item in columns"
:key="`${item.dataIndex}3`"
:field="item.dataIndex"
:min-width="item.width"
:title="item.title"
:align="item.align"
>
</vxe-column>
<vxe-column title="操作" fixed="right" width="200" align="center">
<template #default="{ row }">
<vxe-button type="text" @click="$refs.editForm.edit(row)">
<a-icon type="form" :style="{ color: '#13c2c2' }" />
</vxe-button>
<a-popconfirm
title="请确认删除?"
ok-text="是"
cancel-text="否"
@confirm="
e => {
confirm(e, row)
}
"
>
<a-icon type="delete" :style="{ color: '#13c2c2' }" />
</a-popconfirm>
</template>
</vxe-column>
</vxe-table>
<vxe-pager
:loading="loading"
:current-page="queryParam.pageNo"
:page-size="queryParam.pageSize"
:total="queryParam.totalResult"
:layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
@page-change="handlePageChange"
>
</vxe-pager>
<add-form ref="addForm" @ok="handleOk" />
<edit-form ref="editForm" @ok="handleOk" />
</a-card>
</div>
</template>
<script>
import {
DJYTenantParamDeleteParamValue,
PageParamValue,
ParamList,
deleteParamValue
} from '@/api/modular/main/DJYTenantParam'
import { DjyCustomerSuggest } from '@/api/modular/main/BookingLedger'
import addForm from './addItemForm.vue'
import editForm from './editItemForm.vue'
import columnSetting from '@/components/tableColumnSetting'
export default {
components: {
addForm,
editForm,
columnSetting
},
data() {
return {
TypeData: [],
WTypeData: [],
advanced: false,
loading: false,
setVisible: false,
setVisible1: false,
queryParam: {
pageNo: 1,
pageSize: 10
},
ColumnsQuery: [],
customerQuery:"",
columns: [
{
title: '客户',
align: 'center',
width: '80',
dataIndex: 'customerName'
},
{
title: '客户参数类别',
align: 'center',
width: '100',
dataIndex: 'paraName'
},
{
title: '客户参数名称',
align: 'center',
width: '80',
dataIndex: 'itemName'
},
{
title: '备注',
align: 'center',
width: '80',
dataIndex: 'remark'
}
],
tstyle: { 'padding-bottom': '0px', 'margin-bottom': '10px' },
loadData: [],
TenantData: [],
YWData: []
}
},
watch: {
'$route.query': {
immediate: true,
handler(nval, oval) {
if (this.$route.name === 'customerParam') {
this.init()
}
}
}
},
created() {},
mounted() {
},
methods: {
tenantIdSearch(value) {
if (value) {
DjyCustomerSuggest({ type: 'consignor', keyword: value }).then(res => {
this.TenantData = res.data.rows
})
}
},
toggleAdvanced() {
this.advanced = !this.advanced
},
init() {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.FnGetData()
this.customerQuery = ''
ParamList().then(res => {
this.WTypeData = res.data
})
DjyCustomerSuggest({ type: 'consignor' }).then(res => {
this.TenantData = res.data.rows
})
},
initQuery(row) {
Object.assign(this.$data, this.$options.data())
this.ColumnsQuery = this.columns
this.queryParam.customerId = row.id
this.customerQuery = row.id
this.FnGetData()
ParamList().then(res => {
this.WTypeData = res.data
})
DjyCustomerSuggest({ type: 'consignor' }).then(res => {
this.TenantData = res.data.rows
})
},
handlePageChange({ currentPage, pageSize }) {
this.queryParam.pageNo = currentPage
this.queryParam.pageSize = pageSize
this.FnGetData()
},
FnGetData() {
this.loading = true
const data = { ...this.queryParam }
PageParamValue(data).then(res => {
this.loadData = res.data.items
this.loading = false
this.queryParam.pageNo = res.data.pageIndex
this.queryParam.pageSize = res.data.pageSize
this.queryParam.totalResult = res.data.totalCount
})
},
/**
* 查询参数组装
*/
switchingDate() {
const obj = JSON.parse(JSON.stringify(this.queryParam))
return obj
},
confirm(e, data) {
this.DJYTenantParamDeleteParamValue(data)
},
handleAdd() {
const data = this.customerQuery ? this.customerQuery : ''
this.$refs.addForm.add(data)
},
DJYTenantParamDeleteParamValue(record) {
deleteParamValue({ id: record.id }).then(res => {
if (res.success) {
this.$message.success('删除成功')
this.FnGetData()
} else {
this.$message.error(`删除失败,${res.message}`)
}
})
},
handleOk() {
this.FnGetData()
}
}
}
</script>
<style lang="less">
.table-operator {
margin-bottom: 18px;
}
button {
margin-right: 8px;
}
.Open {
}
.Close {
height: 45px;
overflow: hidden;
}
.vxe-table--render-default .vxe-body--row.row--stripe {
background: #f5f9fe;
}
.ant-card-body {
padding-top: 10px;
}
.nav-box {
padding: 0 10px;
.nav {
display: inline-block;
margin-right: 8px;
cursor: pointer;
border: 1px solid rgba(255, 255, 255, 0);
padding: 0 10px;
height: 28px;
line-height: 26px;
.iconfont {
margin-right: 6px;
}
&:hover {
border: 1px solid rgba(255, 255, 255, 0);
border-radius: 4px;
}
&:nth-of-type(1) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(2) {
.iconfont {
color: #865ef8;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(3) {
.iconfont {
color: #ff9702;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(4) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(5) {
.iconfont {
color: #ff1062;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(6) {
.iconfont {
color: #1ebeca;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(7) {
.iconfont {
color: #82c93d;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
&:nth-of-type(8) {
.iconfont {
color: #1d8aff;
}
&:hover {
background: #fff;
box-shadow: 0 0 10px #eee;
}
}
}
}
</style>
Loading…
Cancel
Save