张同海 2 years ago
commit 4211e5a655

@ -0,0 +1,36 @@
import { axios } from '@/utils/request'
/**
* 查询品名台账
*
*/
export function GetParaGoodsCategoryPage (parameter) {
return axios({
url: '/Para/GetParaGoodsCategoryPage',
method: 'post',
data: parameter
})
}
export function SaveParaGoodsCategoryInfo (parameter) {
return axios({
url: '/Para/SaveParaGoodsCategoryInfo',
method: 'post',
data: parameter
})
}
export function DeleteParaGoodsCategoryInfo (parameter) {
return axios({
url: '/Para/DeleteParaGoodsCategoryInfo?Ids=' + parameter,
method: 'post'
})
}
export function GetParaGoodsCategoryInfo (parameter) {
return axios({
url: '/Para/GetParaGoodsCategoryInfo',
method: 'get',
params: parameter
})
}

@ -0,0 +1,45 @@
import { axios } from '@/utils/request'
/**
* 查询品名台账
*
*/
export function GetParaGoodsPage (parameter) {
return axios({
url: '/Para/GetParaGoodsPage',
method: 'post',
data: parameter
})
}
export function SaveParaGoodsInfo (parameter) {
return axios({
url: '/Para/SaveParaGoodsInfo',
method: 'post',
data: parameter
})
}
export function DeleteParaGoodsInfo (parameter) {
return axios({
url: '/Para/DeleteParaGoodsInfo',
method: 'post',
data: parameter
})
}
export function GetParaGoodsInfo (parameter) {
return axios({
url: '/Para/GetParaGoodsInfo',
method: 'get',
params: parameter
})
}
export function QueryParaGoodsCategoryInfo (parameter) {
return axios({
url: '/Para/QueryParaGoodsCategoryInfo',
method: 'get',
params: parameter
})
}

@ -169,7 +169,7 @@ export default {
pageNo: currentPage, pageNo: currentPage,
pageSize: pageSize pageSize: pageSize
}).then(res => { }).then(res => {
const _data = res.data.rows.map((item, index) => { const _data = res.data.items.map((item, index) => {
item.row_id = (currentPage - 1) * pageSize + index item.row_id = (currentPage - 1) * pageSize + index
return item return item
}) })
@ -192,7 +192,7 @@ export default {
console.log(this.addFromData) console.log(this.addFromData)
this.$refs.addForm.add() this.$refs.addForm.add()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
}, },
@ -202,7 +202,7 @@ export default {
this.$message.success('删除成功') this.$message.success('删除成功')
this.init() this.init()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
}, },
@ -237,7 +237,7 @@ export default {
this.$message.success('删除成功') this.$message.success('删除成功')
this.init() this.init()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
}, },
@ -263,7 +263,7 @@ export default {
this.$refs.addForm.handleCancel() this.$refs.addForm.handleCancel()
this.init() this.init()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)

@ -1,6 +1,6 @@
<template> <template>
<a-modal <a-modal
:title="`规则项目编辑(${type=='edit' ? '修改' : '新增'}`" :title="`合约号编辑(${type=='edit' ? '修改' : '新增'}`"
:width="900" :width="900"
:visible="visible" :visible="visible"
:confirmLoading="confirmLoading" :confirmLoading="confirmLoading"

@ -0,0 +1,297 @@
<template>
<div>
<a-row :gutter="24">
<a-col :md="24" :sm="24" style="padding: 0 0 0 0" class="content-box">
<x-card>
<div slot="content" class="table-page-search-wrapper">
<a-form layout="inline" :form="form">
<a-row :gutter="48">
<a-col :md="6" :sm="24">
<a-form-item label="品名分类">
<a-input
placeholder="请输入品名分类"
v-decorator="['goodsCategory', { rules: [{ required: false, message: '请输入品名分类' }] }]"
/>
</a-form-item>
</a-col>
<a-col :md="6" :sm="24">
<a-form-item label="品名分类名称">
<a-input
placeholder="请输入品名分类名称"
v-decorator="['goodsCategoryName', { rules: [{ required: false, message: '请输入品名分类名称' }] }]"
/>
</a-form-item>
</a-col>
<a-col :md="12" :sm="24" :labelCol="{span: 2, offset: 12}">
<span class="table-page-search-submitButtons" style="text-align: right">
<a-button type="primary" @click="tableRefresh"></a-button>
<a-button style="margin-left: 8px" @click="tableReset"></a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
</x-card>
<x-card class="content-table">
<div slot="content" class="table-page-search-wrapper" :style="{ marginTop: '-8px' }">
<vxe-toolbar>
<template #buttons>
<a-button type="primary" icon="edit" @click="addProject"></a-button>
</template>
<template #tools>
<div class="right">
<span class="tab-btn" @click="tableRefresh">
<a-icon type="redo" :style="{ fontSize: '16px' }" /> 刷新
</span>
</div>
</template>
</vxe-toolbar>
<vxe-grid
ref="xGrid"
v-bind="gridOptions"
row-class-name="line-box"
@page-change="handlePageChange"
style="margin-top: 6px"
>
<template #operate="{ row }">
<vxe-button type="text" icon="vxe-icon-edit" @click="editColumns(row)"></vxe-button>
<vxe-button type="text" icon="vxe-icon-delete" @click="removeColumns(row)"></vxe-button>
</template>
</vxe-grid>
</div>
</x-card>
</a-col>
</a-row>
<add-form ref="addForm" :fromData="addFromData" :type="addFromType" @ok="handleOk" />
</div>
</template>
<script>
import { XCard } from '@/components'
import initData from './modules/initData'
import columnSetting from '@/components/tableColumnSetting'
import addForm from './modules/addFrom'
import {
GetParaGoodsCategoryPage,
SaveParaGoodsCategoryInfo,
DeleteParaGoodsCategoryInfo,
GetParaGoodsCategoryInfo
} from '@/api/modular/main/ProductCategoryList'
export default {
name: 'BookingLedger',
components: {
XCard,
columnSetting,
addForm
},
data() {
return {
form: this.$form.createForm(this),
setVisible: false,
showColumns: null,
gridOptions: {
border: false,
resizable: true,
showOverflow: true,
loading: true,
round: true,
autoResize: true,
align: 'center',
columnConfig: { resizable: true },
importConfig: {},
exportConfig: {},
pagerConfig: {
total: 0,
currentPage: 1,
pageSize: 10,
pageSizes: [10, 20, 50, 100, 200, 500]
},
columns: JSON.parse(JSON.stringify(initData.columns)),
data: []
},
addFromData: {},
addFromType: 'add'
}
},
created() {
this.showColumns = JSON.parse(JSON.stringify(initData.columns))
this.getList()
},
mounted() {},
methods: {
init(queryParam = {}) {
this.gridOptions.pagerConfig = {
total: 0,
currentPage: 1,
pageSize: 10,
pageSizes: [10, 20, 50, 100, 200, 500]
}
this.gridOptions.data = []
this.getList(queryParam)
},
handlePageChange({ currentPage, pageSize }) {
console.log(currentPage, pageSize)
const {
form: { validateFields }
} = this
validateFields((err, values) => {
if (!err) {
if (values.createdTime) {
const time = values.createdTime.map((item, index) => {
const str = this.dateFtt('YYYY-MM-DD', item._d)
return str
})
console.log(time)
values.createdTime = time
}
if (values.updataTime) {
const _time = values.updataTime.map((item, index) => {
const str = this.dateFtt('YYYY-MM-DD', item._d)
return str
})
console.log(_time)
values.updataTime = _time
}
this.gridOptions.pagerConfig.currentPage = currentPage
this.gridOptions.pagerConfig.pageSize = pageSize
this.getList(values)
}
})
},
getList(queryParam = {}) {
const { currentPage, pageSize } = this.gridOptions.pagerConfig
GetParaGoodsCategoryPage({
goodsCategory: queryParam.goodsCategory,
goodsCategoryName: queryParam.goodsCategoryName,
pageNo: currentPage,
pageSize: pageSize
})
.then((res) => {
const _data = res.data.items.map((item, index) => {
item.row_id = (currentPage - 1) * pageSize + index
return item
})
this.$set(this.gridOptions.pagerConfig, 'total', res.data.totalCount)
this.$set(this.gridOptions, 'data', JSON.parse(JSON.stringify(_data)))
this.$set(this.gridOptions, 'loading', false)
this.$forceUpdate()
})
.catch((err) => {
console.log(err)
})
},
editColumns(data) {
this.addFromType = 'edit'
this.addFromId = data.id
GetParaGoodsCategoryInfo({
id: this.addFromId
}).then((res) => {
if (res.success) {
this.addFromData = res.data
console.log(this.addFromData)
this.$refs.addForm.add()
} else {
this.$message.error(res.message)
}
})
},
removeColumns(data) {
debugger
DeleteParaGoodsCategoryInfo(data.id).then((res) => {
if (res.success) {
this.$message.success('删除成功')
this.init()
} else {
this.$message.error(res.message)
}
})
},
addProject() {
this.addFromData = {}
this.addFromType = 'add'
this.addFromId = ''
this.$refs.addForm.add()
},
columnChange(data) {
const arr = []
data.map((item, index) => {
if (item.checked) {
arr.push(item)
}
})
this.showColumns = []
this.showColumns = arr
this.gridOptions.columns = arr
this.$forceUpdate()
},
confirmRemove(e) {
console.log(e)
const select = this.$refs.xGrid.getCheckboxRecords()
const pkIdArr = select.map((item, index) => {
return Number(item.id)
})
console.log(pkIdArr)
debugger
DeleteParaGoodsCategoryInfo({
Ids: pkIdArr
}).then((res) => {
if (res.success) {
this.$message.success('删除成功')
this.init()
} else {
this.$message.error(res.message)
}
})
},
cancelRemove(e) {
console.log(e)
this.$message.error('取消操作')
},
handleOk() {
const form = this.$refs.addForm.form
form.validateFields((errors, values) => {
if (!errors) {
console.log('values', values)
SaveParaGoodsCategoryInfo({
id: this.addFromId,
goodsCode: values.goodsCode,
goodsNameCN: values.goodsNameCN,
goodsNameEN: values.goodsNameEN,
goodsDesp: values.goodsDesp,
goodsCategory: values.goodsCategory,
goodsCategoryName: values.goodsCategoryName
})
.then((res) => {
this.$refs.addForm.$data.confirmLoading = false
if (res.success) {
this.$message.success('保存成功')
this.$refs.addForm.handleCancel()
this.init()
} else {
this.$message.error(res.message)
}
})
.catch((err) => {
console.log(err)
})
}
})
},
tableRefresh() {
const {
form: { validateFields }
} = this
validateFields((err, values) => {
if (!err) {
this.init(values)
}
})
},
tableReset() {
this.form.resetFields()
this.init()
},
tableHeaderEdit() {}
}
}
</script>

@ -0,0 +1,169 @@
<template>
<a-modal
:title="`品名编辑(${type=='edit' ? '修改' : '新增'}`"
:width="900"
:visible="visible"
:confirmLoading="confirmLoading"
cancelText="关闭"
okText="保存"
@ok="handleSubmit"
@cancel="handleCancel"
>
<a-spin :spinning="formLoading">
<a-form :form="form">
<a-row :gutter="16">
<a-col :span="12">
<a-form-item
label="品名分类"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input placeholder="请输入品名分类" v-decorator="['goodsCategory', {rules: [{required: true, message: ''}]}]" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="品名分类名称"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input placeholder="请输入品名分类名称" v-decorator="['goodsCategoryName']" />
</a-form-item>
</a-col>
</a-col>
</a-row>
</a-form>
</a-spin>
</a-modal>
</template>
<script>
import { AutoComplete } from 'ant-design-vue'
import {
QueryParaGoodsCategoryInfo
} from '@/api/modular/main/ProductNameList'
export default {
props: {
type: {
type: String,
default: 'add'
},
fromData: {
type: Object,
default: null
}
},
components: {
AutoComplete
},
data () {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 6 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
},
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 18 }
},
visible: false,
confirmLoading: false,
formLoading: true,
form: this.$form.createForm(this),
goodsCategory: []
}
},
computed: {
goodsCategoryArr () {
if (this.goodsCategory) {
const arr = []
this.goodsCategory.map((item, index) => {
if (!arr.includes(item.goodsCategory)) {
arr.push(item.goodsCategory)
}
})
return arr
} else {
return []
}
}
},
watch: {
fromData: {
handler (nval, oval) {
if (!this.formLoading) {
this.$nextTick(() => {
this.form.setFieldsValue(nval)
})
}
},
deep: true
}
},
methods: {
add () {
this.visible = true
this.formLoading = false
},
handleSubmit () {
const { form: { validateFields } } = this
this.confirmLoading = true
validateFields((errors, values) => {
if (!errors) {
this.$emit('ok', values)
} else {
this.confirmLoading = false
}
})
},
handleCancel () {
this.form.resetFields()
this.visible = false
},
getGoodsCategory(name = '') {
// console.log('', name, this.goodsCategory, this.goodsCategoryArr)
QueryParaGoodsCategoryInfo({
queryItem: name,
top: 50
}).then((res) => {
this.goodsCategory = res.data
})
},
goodsCategorySelect(value) {
const index = this.goodsCategoryArr.indexOf(value)
this.form.setFieldsValue({
goodsCategory: this.goodsCategory[index].goodsCategory || '',
goodsCategoryName: this.goodsCategory[index].goodsCategoryName || ''
})
},
goodsCategoryChange(value) {
this.getGoodsCategory(value)
}
}
}
</script>
<style lang="less" scoped>
.line{
height: 30px;
line-height:30px;
text-align: right;
font-size: 14px;
span{
margin-left: 20px;
}
span:nth-of-type(2){
width: 120px;
display: inline-block;
text-align: left;
}
}
</style>

@ -0,0 +1,11 @@
export default {
columns: [
{ type: 'seq', width: 60, noDraggable: true },
{ field: 'goodsCategory', title: '品名分类', showHeaderOverflow: true, sortable: true },
{ field: 'goodsCategoryName', title: '品名分类名称', showHeaderOverflow: true, sortable: true },
{ field: 'createUserName', title: '创建者名称', showHeaderOverflow: true, sortable: true },
{ field: 'createTime', title: '创建时间', showHeaderOverflow: true, sortable: true },
{ field: 'updateTime', title: '更新时间', showHeaderOverflow: true, sortable: true },
{ field: 'operate', title: '操作', width: 150, noDraggable: true, slots: { default: 'operate' }, fixed: 'right', resizable: false }
]
}

@ -1,38 +1,44 @@
<template> <template>
<div> <div>
品名维护 <a-row :gutter="24">
<a-row :gutter="24" v-if="false">
<a-col :md="24" :sm="24" style="padding: 0 0 0 0" class="content-box"> <a-col :md="24" :sm="24" style="padding: 0 0 0 0" class="content-box">
<x-card> <x-card>
<div slot="content" class="table-page-search-wrapper"> <div slot="content" class="table-page-search-wrapper">
<a-form layout="inline" :form="form"> <a-form layout="inline" :form="form">
<a-row :gutter="48"> <a-row :gutter="48">
<a-col :md="6" :sm="24"> <a-col :md="5" :sm="24">
<a-form-item label="合约号编号"> <a-form-item label="品名编码">
<a-input <a-input
placeholder="请输入合约号编号" placeholder="请输入品名编码"
v-decorator="['contractNo', { rules: [{ required: false, message: '请输入合约号编号' }] }]" v-decorator="['goodsCode', { rules: [{ required: false, message: '请输入品名编码' }] }]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="5" :sm="24">
<a-form-item label="合约号名称"> <a-form-item label="品名中文">
<a-input <a-input
placeholder="请输入合约号名称" placeholder="请输入品名中文"
v-decorator="['contractName', { rules: [{ required: false, message: '请输入合约号名称' }] }]" v-decorator="['goodsNameCN', { rules: [{ required: false, message: '请输入品名中文' }] }]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="6" :sm="24"> <a-col :md="5" :sm="24">
<a-form-item label="创建者名称"> <a-form-item label="品名英文">
<a-input <a-input
placeholder="请输入创建者名称" placeholder="请输入品名英文"
v-decorator="['createUserName', { rules: [{ required: false, message: '请输入创建者名称' }] }]" v-decorator="['goodsNameEN', { rules: [{ required: false, message: '请输入品名英文' }] }]"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md="5" :sm="24">
<a-col :md="6" :sm="24"> <a-form-item label="品名分类">
<a-input
placeholder="请输入品名分类"
v-decorator="['goodsCategory', { rules: [{ required: false, message: '请输入品名分类' }] }]"
/>
</a-form-item>
</a-col>
<a-col :md="4" :sm="24" :labelCol="{span: 2, offset: 12}">
<span class="table-page-search-submitButtons" style="text-align: right"> <span class="table-page-search-submitButtons" style="text-align: right">
<a-button type="primary" @click="tableRefresh"></a-button> <a-button type="primary" @click="tableRefresh"></a-button>
<a-button style="margin-left: 8px" @click="tableReset"></a-button> <a-button style="margin-left: 8px" @click="tableReset"></a-button>
@ -81,11 +87,11 @@ import initData from './modules/initData'
import columnSetting from '@/components/tableColumnSetting' import columnSetting from '@/components/tableColumnSetting'
import addForm from './modules/addFrom' import addForm from './modules/addFrom'
import { import {
GetParaContractNoPage, GetParaGoodsPage,
SaveParaContractNoInfo, SaveParaGoodsInfo,
DeleteParaContractNoInfo, DeleteParaGoodsInfo,
GetParaContractNoInfo GetParaGoodsInfo
} from '@/api/modular/main/ContractnoList' } from '@/api/modular/main/ProductNameList'
export default { export default {
name: 'BookingLedger', name: 'BookingLedger',
@ -170,15 +176,16 @@ export default {
}, },
getList(queryParam = {}) { getList(queryParam = {}) {
const { currentPage, pageSize } = this.gridOptions.pagerConfig const { currentPage, pageSize } = this.gridOptions.pagerConfig
GetParaContractNoPage({ GetParaGoodsPage({
contractNo: queryParam.contractNo, goodsCode: queryParam.goodsCode,
contractName: queryParam.contractName, goodsNameCN: queryParam.goodsNameCN,
createUserName: queryParam.createUserName, goodsNameEN: queryParam.goodsNameEN,
goodsCategory: queryParam.goodsCategory,
pageNo: currentPage, pageNo: currentPage,
pageSize: pageSize pageSize: pageSize
}) })
.then((res) => { .then((res) => {
const _data = res.data.rows.map((item, index) => { const _data = res.data.items.map((item, index) => {
item.row_id = (currentPage - 1) * pageSize + index item.row_id = (currentPage - 1) * pageSize + index
return item return item
}) })
@ -194,7 +201,7 @@ export default {
editColumns(data) { editColumns(data) {
this.addFromType = 'edit' this.addFromType = 'edit'
this.addFromId = data.id this.addFromId = data.id
GetParaContractNoInfo({ GetParaGoodsInfo({
id: this.addFromId id: this.addFromId
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
@ -202,17 +209,18 @@ export default {
console.log(this.addFromData) console.log(this.addFromData)
this.$refs.addForm.add() this.$refs.addForm.add()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
}, },
removeColumns(data) { removeColumns(data) {
DeleteParaContractNoInfo(data.id).then((res) => { debugger
DeleteParaGoodsInfo([data.id]).then((res) => {
if (res.success) { if (res.success) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.init() this.init()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
}, },
@ -242,12 +250,14 @@ export default {
}) })
console.log(pkIdArr) console.log(pkIdArr)
debugger debugger
DeleteParaContractNoInfo(pkIdArr).then((res) => { DeleteParaGoodsInfo({
Ids: pkIdArr
}).then((res) => {
if (res.success) { if (res.success) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.init() this.init()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
}, },
@ -260,12 +270,14 @@ export default {
form.validateFields((errors, values) => { form.validateFields((errors, values) => {
if (!errors) { if (!errors) {
console.log('values', values) console.log('values', values)
debugger SaveParaGoodsInfo({
SaveParaContractNoInfo({
id: this.addFromId, id: this.addFromId,
contractNo: values.contractNo, goodsCode: values.goodsCode,
contractName: values.contractName, goodsNameCN: values.goodsNameCN,
contractNote: values.contractNote goodsNameEN: values.goodsNameEN,
goodsDesp: values.goodsDesp,
goodsCategory: values.goodsCategory,
goodsCategoryName: values.goodsCategoryName
}) })
.then((res) => { .then((res) => {
this.$refs.addForm.$data.confirmLoading = false this.$refs.addForm.$data.confirmLoading = false
@ -274,7 +286,7 @@ export default {
this.$refs.addForm.handleCancel() this.$refs.addForm.handleCancel()
this.init() this.init()
} else { } else {
this.$message.error(res.msg) this.$message.error(res.message)
} }
}) })
.catch((err) => { .catch((err) => {

@ -1,6 +1,6 @@
<template> <template>
<a-modal <a-modal
:title="`规则项目编辑(${type=='edit' ? '修改' : '新增'}`" :title="`品名编辑(${type=='edit' ? '修改' : '新增'}`"
:width="900" :width="900"
:visible="visible" :visible="visible"
:confirmLoading="confirmLoading" :confirmLoading="confirmLoading"
@ -12,34 +12,75 @@
<a-spin :spinning="formLoading"> <a-spin :spinning="formLoading">
<a-form :form="form"> <a-form :form="form">
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24">
<a-form-item
label="品名编码"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<a-input placeholder="请输入品名编码" v-decorator="['goodsCode', {rules: [{required: true, message: ''}]}]" />
</a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
label="合约号编号" label="品名中文"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input placeholder="请输入合约号编号" v-decorator="['contractNo', {rules: [{required: true, message: ''}]}]" /> <a-input placeholder="请输入品名中文" v-decorator="['goodsNameCN']" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
label="合约号名称" label="品名英文"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-input placeholder="请输入合约号名称" v-decorator="['contractName', {rules: [{required: true, message: ''}]}]" /> <a-input :rows="4" placeholder="请输入品名英文" v-decorator="['goodsNameEN']"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item <a-form-item
label="合约号备注" label="品名分类"
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
> >
<a-textarea :rows="4" placeholder="请输入合约号备注" v-decorator="['contractNote']"></a-textarea> <auto-complete
:allowClear="true"
placeholder="请输入品名分类"
v-decorator="['goodsCategory']"
class="customer-input"
:data-source="goodsCategoryArr"
:dropdown-match-select-width="false"
:dropdown-style="{ width: '200px' }"
@select="goodsCategorySelect"
@change="goodsCategoryChange"
@focus="goodsCategoryChange"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item
label="品名分类名称"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input :rows="4" placeholder="请输入品名分类名称" v-decorator="['goodsCategoryName']"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item
label="品名描述"
:labelCol="labelCol2"
:wrapperCol="wrapperCol2"
has-feedback
>
<a-textarea :rows="4" placeholder="请输入品名描述" v-decorator="['goodsDesp']"></a-textarea>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -48,6 +89,10 @@
</a-modal> </a-modal>
</template> </template>
<script> <script>
import { AutoComplete } from 'ant-design-vue'
import {
QueryParaGoodsCategoryInfo
} from '@/api/modular/main/ProductNameList'
export default { export default {
props: { props: {
type: { type: {
@ -59,20 +104,47 @@
default: null default: null
} }
}, },
components: {
AutoComplete
},
data () { data () {
return { return {
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 } sm: { span: 6 }
}, },
wrapperCol: { wrapperCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 15 } sm: { span: 15 }
}, },
labelCol2: {
xs: { span: 24 },
sm: { span: 3 }
},
wrapperCol2: {
xs: { span: 24 },
sm: { span: 18 }
},
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
formLoading: true, formLoading: true,
form: this.$form.createForm(this) form: this.$form.createForm(this),
goodsCategory: []
}
},
computed: {
goodsCategoryArr () {
if (this.goodsCategory) {
const arr = []
this.goodsCategory.map((item, index) => {
if (!arr.includes(item.goodsCategory)) {
arr.push(item.goodsCategory)
}
})
return arr
} else {
return []
}
} }
}, },
watch: { watch: {
@ -106,6 +178,25 @@
handleCancel () { handleCancel () {
this.form.resetFields() this.form.resetFields()
this.visible = false this.visible = false
},
getGoodsCategory(name = '') {
// console.log('', name, this.goodsCategory, this.goodsCategoryArr)
QueryParaGoodsCategoryInfo({
queryItem: name,
top: 50
}).then((res) => {
this.goodsCategory = res.data
})
},
goodsCategorySelect(value) {
const index = this.goodsCategoryArr.indexOf(value)
this.form.setFieldsValue({
goodsCategory: this.goodsCategory[index].goodsCategory || '',
goodsCategoryName: this.goodsCategory[index].goodsCategoryName || ''
})
},
goodsCategoryChange(value) {
this.getGoodsCategory(value)
} }
} }
} }

@ -1,10 +1,15 @@
export default { export default {
columns: [ columns: [
{ type: 'seq', width: 60, noDraggable: true }, { type: 'seq', width: 60, noDraggable: true },
{ field: 'contractNo', title: '合约号编号', showHeaderOverflow: true, sortable: true }, { field: 'goodsCode', title: '品名编码', showHeaderOverflow: true, sortable: true },
{ field: 'contractName', title: '合约号名称', showHeaderOverflow: true, sortable: true }, { field: 'goodsNameCN', title: '品名中文', showHeaderOverflow: true, sortable: true },
{ field: 'contractNote', title: '合约号备注', showHeaderOverflow: true, sortable: true }, { field: 'goodsNameEN', title: '品名英文', showHeaderOverflow: true, sortable: true },
{ field: 'goodsDesp', title: '品名描述', showHeaderOverflow: true, sortable: true },
{ field: 'goodsCategory', title: '品名分类', showHeaderOverflow: true, sortable: true },
{ field: 'createUserName', title: '创建者名称', showHeaderOverflow: true, sortable: true }, { field: 'createUserName', title: '创建者名称', showHeaderOverflow: true, sortable: true },
// { field: 'updateUserName', title: '修改者名称', showHeaderOverflow: true, sortable: true },
{ field: 'createTime', title: '创建时间', showHeaderOverflow: true, sortable: true },
{ field: 'updateTime', title: '更新时间', showHeaderOverflow: true, sortable: true },
{ field: 'operate', title: '操作', width: 150, noDraggable: true, slots: { default: 'operate' }, fixed: 'right', resizable: false } { field: 'operate', title: '操作', width: 150, noDraggable: true, slots: { default: 'operate' }, fixed: 'right', resizable: false }
] ]
} }

Loading…
Cancel
Save