parent
5581a01ccc
commit
0b0fbc4f37
@ -1,285 +1,314 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料编码"
|
||||
prop="itemCode" >
|
||||
<el-input v-model="dataForm.itemCode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料编码"
|
||||
prop="itemCode">
|
||||
<el-input v-model="dataForm.itemCode"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料名称"
|
||||
prop="itemName" >
|
||||
<el-input v-model="dataForm.itemName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料名称"
|
||||
prop="itemName">
|
||||
<el-input v-model="dataForm.itemName"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="物料说明"
|
||||
prop="description" >
|
||||
<el-input v-model="dataForm.description"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="物料说明"
|
||||
prop="description">
|
||||
<el-input v-model="dataForm.description"
|
||||
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="主单位名称"
|
||||
prop="primaryUnitOmeasure" >
|
||||
<el-select v-model="dataForm.primaryUnitOmeasure"
|
||||
placeholder="请选择单位名称" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in primaryUnitOmeasureOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主单位名称"
|
||||
prop="primaryUnitOmeasure">
|
||||
<el-select v-model="dataForm.primaryUnitOmeasure"
|
||||
placeholder="请选择单位名称" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in primaryUnitOmeasureOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="是否可采购"
|
||||
prop="purchaseFlag" >
|
||||
<el-select v-model="dataForm.purchaseFlag"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in purchaseFlagOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否可采购"
|
||||
prop="purchaseFlag">
|
||||
<el-select v-model="dataForm.purchaseFlag"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in purchaseFlagOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="是否可销售 "
|
||||
prop="salesFlag" >
|
||||
<el-select v-model="dataForm.salesFlag"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in salesFlagOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="是否可销售 "
|
||||
prop="salesFlag">
|
||||
<el-select v-model="dataForm.salesFlag"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in salesFlagOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="默认出库区"
|
||||
prop="outArea" >
|
||||
<popupSelect v-model="dataForm.outArea"
|
||||
placeholder="请选择" clearable field="outArea" interfaceId="381404161809350213" :columnOptions="outAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认出库区"
|
||||
prop="outArea">
|
||||
<popupSelect v-model="dataForm.outArea"
|
||||
placeholder="请选择" clearable field="outArea" interfaceId="381404161809350213"
|
||||
:columnOptions="outAreacolumnOptions" propsValue="id" relationField="areaname"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="默认入库区"
|
||||
prop="inArea" >
|
||||
<popupSelect v-model="dataForm.inArea"
|
||||
placeholder="请选择" clearable field="inArea" interfaceId="381404161809350213" :columnOptions="inAreacolumnOptions" propsValue="id" relationField="areaname" popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认入库区"
|
||||
prop="inArea">
|
||||
<popupSelect v-model="dataForm.inArea"
|
||||
placeholder="请选择" clearable field="inArea" interfaceId="381404161809350213"
|
||||
:columnOptions="inAreacolumnOptions" propsValue="id" relationField="areaname"
|
||||
popupType="dialog"
|
||||
popupTitle="选择数据" popupWidth="800px"
|
||||
>
|
||||
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="标准成本"
|
||||
prop="standardCost" >
|
||||
<el-input v-model="dataForm.standardCost"
|
||||
placeholder="请输入标准成本" clearable :style='{"width":"100%"}'>
|
||||
</popupSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标准成本"
|
||||
prop="standardCost">
|
||||
<el-input v-model="dataForm.standardCost"
|
||||
placeholder="请输入标准成本" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="财务类别"
|
||||
prop="financial" >
|
||||
<el-input v-model="dataForm.financial"
|
||||
placeholder="请输入财务类别" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="财务类别"
|
||||
prop="financial">
|
||||
<el-input v-model="dataForm.financial"
|
||||
placeholder="请输入财务类别" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="类别名称"
|
||||
prop="financialName" >
|
||||
<el-input v-model="dataForm.financialName"
|
||||
placeholder="请输入类别名称" clearable :style='{"width":"100%"}'>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="类别名称"
|
||||
prop="financialName">
|
||||
<el-input v-model="dataForm.financialName"
|
||||
placeholder="请输入类别名称" clearable :style='{"width":"100%"}'>
|
||||
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" >
|
||||
<el-form-item label="生效状态"
|
||||
prop="effectiveStatus" >
|
||||
<el-select v-model="dataForm.effectiveStatus"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in effectiveStatusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生效状态"
|
||||
prop="effectiveStatus">
|
||||
<el-select v-model="dataForm.effectiveStatus"
|
||||
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||
<el-option v-for="(item, index) in effectiveStatusOptions" :key="index" :label="item.fullName"
|
||||
:value="item.id" :disabled="item.disabled"></el-option>
|
||||
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
itemCode : '',
|
||||
itemName : '',
|
||||
description : '',
|
||||
primaryUnitOmeasure : "",
|
||||
purchaseFlag : "",
|
||||
salesFlag : "",
|
||||
outArea : "",
|
||||
inArea : "",
|
||||
standardCost : '',
|
||||
financial : '',
|
||||
financialName : '',
|
||||
effectiveStatus : "Y",
|
||||
itemId : '',
|
||||
errorMessage : '',
|
||||
creatorTime : "",
|
||||
lastModifyTime : "",
|
||||
},
|
||||
rules:
|
||||
{
|
||||
itemCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
itemName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
standardCost: [
|
||||
],
|
||||
},
|
||||
primaryUnitOmeasureOptions:[{"fullName":"千克","id":"1"},{"fullName":"吨","id":"0"}],
|
||||
purchaseFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
|
||||
salesFlagOptions:[{"fullName":"是","id":"Y"},{"fullName":"否","id":"N"}],
|
||||
outAreacolumnOptions:[ {"label":"库区编码","value":"areacode"}, {"label":"库区名称","value":"areaname"}, {"label":"仓库","value":"name"}, {"label":"最高库存","value":"maximum"},],
|
||||
inAreacolumnOptions:[ {"label":"库区编码","value":"areacode"}, {"label":"库区名称","value":"areaname"}, {"label":"仓库","value":"name"}, {"label":"最高库存","value":"maximum"},],
|
||||
effectiveStatusOptions:[{"fullName":"生效","id":"Y"},{"fullName":"不生效","id":"N"}],
|
||||
import request from '@/utils/request'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
clearData(data){
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = [];
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key]);
|
||||
} else {
|
||||
data[key] = "";
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.isDetail = isDetail || false;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields();
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Material/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
}else{
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data =this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Material',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}else{
|
||||
request({
|
||||
url: '/api/example/Material/'+this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList(){
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm));
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
loading: false,
|
||||
isDetail: false,
|
||||
dataForm: {
|
||||
itemCode: '',
|
||||
itemName: '',
|
||||
description: '',
|
||||
primaryUnitOmeasure: '',
|
||||
purchaseFlag: '',
|
||||
salesFlag: '',
|
||||
outArea: '',
|
||||
inArea: '',
|
||||
standardCost: '',
|
||||
financial: '',
|
||||
financialName: '',
|
||||
effectiveStatus: 'Y',
|
||||
itemId: '',
|
||||
errorMessage: '',
|
||||
creatorTime: '',
|
||||
lastModifyTime: ''
|
||||
},
|
||||
rules:
|
||||
{
|
||||
itemCode: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
itemName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
outArea: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
inArea: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
standardCost: []
|
||||
},
|
||||
primaryUnitOmeasureOptions: [{ 'fullName': '千克', 'id': '1' }, { 'fullName': '吨', 'id': '0' }],
|
||||
purchaseFlagOptions: [{ 'fullName': '是', 'id': 'Y' }, { 'fullName': '否', 'id': 'N' }],
|
||||
salesFlagOptions: [{ 'fullName': '是', 'id': 'Y' }, { 'fullName': '否', 'id': 'N' }],
|
||||
outAreacolumnOptions: [{ 'label': '库区编码', 'value': 'areacode' }, {
|
||||
'label': '库区名称',
|
||||
'value': 'areaname'
|
||||
}, { 'label': '仓库', 'value': 'name' }, { 'label': '最高库存', 'value': 'maximum' }],
|
||||
inAreacolumnOptions: [{ 'label': '库区编码', 'value': 'areacode' }, {
|
||||
'label': '库区名称',
|
||||
'value': 'areaname'
|
||||
}, { 'label': '仓库', 'value': 'name' }, { 'label': '最高库存', 'value': 'maximum' }],
|
||||
effectiveStatusOptions: [{ 'fullName': '生效', 'id': 'Y' }, { 'fullName': '不生效', 'id': 'N' }]
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
clearData(data) {
|
||||
for (let key in data) {
|
||||
if (data[key] instanceof Array) {
|
||||
data[key] = []
|
||||
} else if (data[key] instanceof Object) {
|
||||
this.clearData(data[key])
|
||||
} else {
|
||||
data[key] = ''
|
||||
}
|
||||
}
|
||||
},
|
||||
init(id, isDetail) {
|
||||
this.dataForm.id = id || 0
|
||||
this.visible = true
|
||||
this.isDetail = isDetail || false
|
||||
this.$nextTick(() => {
|
||||
this.$refs['elForm'].resetFields()
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/Material/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.clearData(this.dataForm)
|
||||
}
|
||||
})
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['elForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
var _data = this.dataList()
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/Material',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/example/Material/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
this.visible = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
dataList() {
|
||||
var _data = JSON.parse(JSON.stringify(this.dataForm))
|
||||
return _data
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -1,306 +1,317 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout">
|
||||
<div class="JNPF-common-layout">
|
||||
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单时间">
|
||||
<el-date-picker v-model="query.poundDate" type="daterange"
|
||||
value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" >
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单号">
|
||||
<el-input v-model="query.poundlistNo" placeholder="请输入" clearable> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||
<el-table-column prop="creatorTime" label="磅单日期" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="vehicleId" label="车牌号" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="materialId" label="物料名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="grossWeight" label="毛重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="tareWeight" label="皮重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="buckleWeight" label="扣重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="netWeight" label="净重" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="customerId" label="客户名称" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="salesId" label="销售合同" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="是否垫资" width="0" prop="advance" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.advance | dynamicText(advanceOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="运输类型" width="0" prop="transportType" algin="left"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.transportType | dynamicText(transportTypeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="transportPrice" label="运费" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="salesPrice" label="销售价格" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="业务员" width="0" align="left"
|
||||
/>
|
||||
<el-table-column prop="remark" label="备注" width="0" align="left"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150" >
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||
</div>
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单时间">
|
||||
<el-date-picker v-model="query.poundDate" type="daterange"
|
||||
value-format="timestamp" format="yyyy-MM-dd" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="磅单号">
|
||||
<el-input v-model="query.poundlistNo" placeholder="请输入" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-download" @click="">导入
|
||||
</el-button>
|
||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right">
|
||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||
@click="reset()"/>
|
||||
</el-tooltip>
|
||||
<screenfull isContainer/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c :hasNO="false"
|
||||
@selection-change="handleSelectionChange" border>
|
||||
<el-table-column type="index" width="50" label="序号" fixed="left" align="center" />
|
||||
<el-table-column prop="creatorTime" label="磅单日期" width="200" align="center" sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="vehicleId" label="车牌号" width="150" align="center" sortable fixed="left"
|
||||
/>
|
||||
<el-table-column prop="materialId" label="物料名称" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="grossWeight" label="毛重" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="tareWeight" label="皮重" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="buckleWeight" label="扣重" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="netWeight" label="净重" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="customerId" label="客户名称" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="salesId" label="销售合同" width="150" align="center" sortable
|
||||
/>
|
||||
|
||||
|
||||
<el-table-column label="是否垫资" width="120" sortable prop="advance" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.advance | dynamicText(advanceOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="运输类型" width="120" sortable prop="transportType" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.transportType | dynamicText(transportTypeOptions) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="transportPrice" label="运费" width="150" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="salesPrice" label="销售价格" width="150" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="creatorUserName" label="业务员" width="120" align="center" sortable
|
||||
/>
|
||||
<el-table-column prop="remark" label="备注" width="200" align="center" sortable
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right"
|
||||
width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text"
|
||||
@click="addOrUpdateHandle(scope.row.id)">编辑
|
||||
</el-button>
|
||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||
</el-button>
|
||||
<el-button type="text"
|
||||
@click="goDetail(scope.row.id)">详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData"/>
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
|
||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
|
||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
import request from '@/utils/request'
|
||||
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||
import JNPFForm from './Form'
|
||||
import ExportBox from './ExportBox'
|
||||
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||
import Detail from './Detail'
|
||||
|
||||
export default {
|
||||
components: {JNPFForm, ExportBox,Detail},
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
poundDate:undefined,
|
||||
poundlistNo:undefined,
|
||||
},
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{prop: 'creatorTime', label: '磅单日期'},
|
||||
{prop: 'vehicleId', label: '车牌号'},
|
||||
{prop: 'materialId', label: '物料名称'},
|
||||
{prop: 'grossWeight', label: '毛重'},
|
||||
{prop: 'tareWeight', label: '皮重'},
|
||||
{prop: 'buckleWeight', label: '扣重'},
|
||||
{prop: 'netWeight', label: '净重'},
|
||||
{prop: 'customerId', label: '客户名称'},
|
||||
{prop: 'salesId', label: '销售合同'},
|
||||
{prop: 'advance', label: '是否垫资'},
|
||||
{prop: 'transportType', label: '运输类型'},
|
||||
{prop: 'transportPrice', label: '运费'},
|
||||
{prop: 'salesPrice', label: '销售价格'},
|
||||
{prop: 'creatorUserName', label: '业务员'},
|
||||
{prop: 'remark', label: '备注'},
|
||||
],
|
||||
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
|
||||
unitProps:{"label":"fullName","value":"id"},
|
||||
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
|
||||
transportTypeProps:{"label":"fullName","value":"id"},
|
||||
advanceOptions:[{"fullName":"否","id":"0"},{"fullName":"是","id":"1"}],
|
||||
advanceProps:{"label":"fullName","value":"id"},
|
||||
}
|
||||
export default {
|
||||
components: { JNPFForm, ExportBox, Detail },
|
||||
data() {
|
||||
return {
|
||||
detailVisible: false,
|
||||
query: {
|
||||
poundDate: undefined,
|
||||
poundlistNo: undefined
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
treeProps: {
|
||||
children: 'children',
|
||||
label: 'fullName',
|
||||
value: 'id'
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
list: [],
|
||||
listLoading: true,
|
||||
multipleSelection: [], total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
},
|
||||
methods: {
|
||||
goDetail(id){
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({column, prop, order}) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId:this.menuId
|
||||
};
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list =[];
|
||||
for(let i=0;i<res.data.list.length;i++){
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
formVisible: false,
|
||||
exportBoxVisible: false,
|
||||
columnList: [
|
||||
{ prop: 'creatorTime', label: '磅单日期' },
|
||||
{ prop: 'vehicleId', label: '车牌号' },
|
||||
{ prop: 'materialId', label: '物料名称' },
|
||||
{ prop: 'grossWeight', label: '毛重' },
|
||||
{ prop: 'tareWeight', label: '皮重' },
|
||||
{ prop: 'buckleWeight', label: '扣重' },
|
||||
{ prop: 'netWeight', label: '净重' },
|
||||
{ prop: 'customerId', label: '客户名称' },
|
||||
{ prop: 'salesId', label: '销售合同' },
|
||||
{ prop: 'advance', label: '是否垫资' },
|
||||
{ prop: 'transportType', label: '运输类型' },
|
||||
{ prop: 'transportPrice', label: '运费' },
|
||||
{ prop: 'salesPrice', label: '销售价格' },
|
||||
{ prop: 'creatorUserName', label: '业务员' },
|
||||
{ prop: 'remark', label: '备注' }
|
||||
],
|
||||
unitOptions: [{ 'fullName': '吨', 'id': '0' }, { 'fullName': '千克', 'id': '1' }],
|
||||
unitProps: { 'label': 'fullName', 'value': 'id' },
|
||||
transportTypeOptions: [{ 'fullName': '汽运', 'id': '0' }, { 'fullName': '船运', 'id': '1' }, {
|
||||
'fullName': '火车',
|
||||
'id': '2'
|
||||
}],
|
||||
transportTypeProps: { 'label': 'fullName', 'value': 'id' },
|
||||
advanceOptions: [{ 'fullName': '否', 'id': '0' }, { 'fullName': '是', 'id': '1' }],
|
||||
advanceProps: { 'label': 'fullName', 'value': 'id' }
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData()
|
||||
},
|
||||
methods: {
|
||||
goDetail(id) {
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(id)
|
||||
})
|
||||
},
|
||||
sortChange({ column, prop, order }) {
|
||||
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||
this.listQuery.sidx = !order ? '' : prop
|
||||
this.initData()
|
||||
},
|
||||
initData() {
|
||||
this.listLoading = true
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
menuId: this.menuId
|
||||
}
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/getList`,
|
||||
method: 'post',
|
||||
data: _query
|
||||
}).then(res => {
|
||||
var _list = []
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
res.data.list[i].creatorTime = res.data.list[i].creatorTime ? res.data.list[i].creatorTime.substring(0, 10) : '';
|
||||
let _data = res.data.list[i]
|
||||
_list.push(_data)
|
||||
}
|
||||
this.list = _list
|
||||
this.total = res.data.pagination.total
|
||||
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500,
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
},
|
||||
handleDel(id) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/${id}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
const res = val.map(item => item.id)
|
||||
this.multipleSelection = res
|
||||
},
|
||||
handleBatchRemoveDel() {
|
||||
if (!this.multipleSelection.length) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '请选择一条数据',
|
||||
duration: 1500
|
||||
})
|
||||
return
|
||||
}
|
||||
const ids = this.multipleSelection.join()
|
||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/batchRemove/${ids}`,
|
||||
method: 'DELETE'
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: res.msg,
|
||||
onClose: () => {
|
||||
this.initData()
|
||||
}
|
||||
})
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
addOrUpdateHandle(id, isDetail) {
|
||||
this.formVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id, isDetail)
|
||||
})
|
||||
},
|
||||
exportData() {
|
||||
this.exportBoxVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ExportBox.init(this.columnList)
|
||||
})
|
||||
},
|
||||
download(data) {
|
||||
let query = { ...data, ...this.listQuery, ...this.query, menuId: this.menuId }
|
||||
request({
|
||||
url: `/api/tradeupload/Tradeupload/Actions/Export`,
|
||||
method: 'GET',
|
||||
data: query
|
||||
}).then(res => {
|
||||
if (!res.data.url) return
|
||||
this.jnpf.downloadFile(res.data.url)
|
||||
this.$refs.ExportBox.visible = false
|
||||
this.exportBoxVisible = false
|
||||
})
|
||||
},
|
||||
search() {
|
||||
this.listQuery = {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: 'desc',
|
||||
sidx: ''
|
||||
}
|
||||
this.initData()
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false
|
||||
if (isrRefresh) this.reset()
|
||||
},
|
||||
reset() {
|
||||
for (let key in this.query) {
|
||||
this.query[key] = undefined
|
||||
}
|
||||
this.search()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Loading…
Reference in new issue