Merge remote-tracking branch 'origin/main'

product
wangchuang 2 years ago
commit ab44ebb63f

@ -87,9 +87,9 @@ public class MaterialController {
//处理id字段转名称若无需转或者为空可删除
for(MaterialEntity entity:list){
Map<String,Object> outAreaMap = new HashMap<>();
entity.setOutArea(generaterSwapUtil.swapRelationFormValue("comInputField102",entity.getOutArea(),"294012196529150981",outAreaMap));
entity.setOutArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",entity.getOutArea(),outAreaMap));
Map<String,Object> inAreaMap = new HashMap<>();
entity.setInArea(generaterSwapUtil.swapRelationFormValue("comInputField102",entity.getInArea(),"294012196529150981",inAreaMap));
entity.setInArea(generaterSwapUtil.getPopupSelectValue("381404161809350213","id","areaname",entity.getInArea(),inAreaMap));
}
List<MaterialListVO> listVO=JsonUtil.getJsonToList(list,MaterialListVO.class);
for(MaterialListVO materialVO:listVO){

@ -87,7 +87,7 @@ public class ReservoirareaController {
//处理id字段转名称若无需转或者为空可删除
for(ReservoirareaEntity entity:list){
Map<String,Object> warehouseIdMap = new HashMap<>();
entity.setWarehouseId(generaterSwapUtil.swapRelationFormValue("comInputField109",entity.getWarehouseId(),"294090217084722181",warehouseIdMap));
entity.setWarehouseId(generaterSwapUtil.getPopupSelectValue("380988259175524165","id","name",entity.getWarehouseId(),warehouseIdMap));
entity.setOrgnizeId(generaterSwapUtil.comSelectValues(entity.getOrgnizeId()));
entity.setDepartmentId(generaterSwapUtil.comSelectValues(entity.getDepartmentId()));
}

@ -1,12 +1,12 @@
{
"name": "linkage-web",
"version": "3.4.1",
"version": "1.1.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "linkage-web",
"version": "3.4.1",
"version": "1.1.2",
"license": "MIT",
"dependencies": {
"@fullcalendar/bootstrap": "^4.4.0",

@ -1,6 +1,6 @@
{
"name": "linkage-web",
"version": "3.4.1",
"version": "1.1.2",
"description": "LINKAGE-快速开发平台",
"author": "LINKAGE-快速开发平台",
"license": "MIT",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -144,7 +144,8 @@ export default {
logIn: '登录',
username: '请输入账号',
password: '请输入密码',
rule: '子账户规则:手机号@账户 例18577778888@101001',
// rule: '子账户规则:手机号@账户 例18577778888@101001',
rule: '',
version: '版本',
upper: '大写已锁定',
scanTip: '扫码登录',

@ -32,12 +32,12 @@ module.exports = {
* If you want to also use it in dev, you can pass ['production', 'development']
*/
sysConfig: {
sysVersion: 'V3.4.1',
sysVersion: 'V1.0.2',
copyright: 'LINKAGE-BOOT版权所有',
navigationIcon: '',
logoIcon: '',
loginIcon: '',
sysName: 'LINKAGE-快速开发平台'
sysName: 'LINKAGE-BOOT快速开发平台'
},
themeClass: 'blue',
layoutType: 'classic',

@ -1,7 +1,8 @@
<template>
<div class="login-container">
<div class="login-version" v-if="sysConfig && sysConfig.sysVersion">
<p class="login-version-text">{{sysConfig.sysVersion}}</p>
<p class="login-version-text">V1.0.2</p>
<!-- <p class="login-version-text">{{sysConfig.sysVersion}}</p>-->
</div>
<div class="login-left">
<a class="login-company-logo" target="_blank" href="">
@ -9,9 +10,9 @@
</a>
<img class="login-banner" src="@/assets/images/login-banner.png" alt="">
<div class="login-left-txt" v-if="showTxt">
<p class="title1">在线自动化可视化系统开发零代码实现80%的基础功能</p>
<p class="title2">已帮助<span>20000+</span>企业完成数字化转型升级</p>
<a class="link" target="_blank" href="">了解更多</a>
<p class="title1">在线自动化流程可视化 DevOps开发模式实现业务需求核心功能</p>
<p class="title2">企业宗旨<span>致力于</span>传统制造型企业完成数字化转型升级</p>
<!-- <a class="link" target="_blank" href="">了解更多</a>-->
</div>
</div>
<div class="login-content">

@ -1,188 +1,182 @@
<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="800px">
<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="24" >
<el-form-item label="区域名称"
prop="mName" >
<el-input v-model="dataForm.mName"
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="24">
<el-form-item label="区域名称" prop="mName">
<el-input v-model="dataForm.mName" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<el-date-picker v-model="dataForm.lastmodifytime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<el-input v-model="dataForm.lastmodifyusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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-input>
</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>
</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: {
mName : '',
creatortime : '',
creatorusername : '',
lastmodifytime : '',
lastmodifyusername : '',
},
rules:
{
mName: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
}
},
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/areasetting/Areasetting/'+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/areasetting/Areasetting',
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/areasetting/Areasetting/'+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
},
},
}
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: {
mName: '',
creatortime: '',
creatorusername: '',
lastmodifytime: '',
lastmodifyusername: '',
},
rules: {
mName: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
}
},
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/areasetting/Areasetting/' + 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/areasetting/Areasetting',
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/areasetting/Areasetting/' + 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,250 +1,275 @@
<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-input v-model="query.mName" 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="mName" label="区域名称" width="0" align="left"
/>
<el-table-column prop="creatortime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left"
/>
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left"
/>
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.mName" 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="mName" label="区域名称" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
mName: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: 'mName', label: '区域名称'},
{prop: 'creatortime', label: '创建时间'},
{prop: 'creatorusername', label: '创建人名称'},
{prop: 'lastmodifytime', label: '修改时间'},
{prop: 'lastmodifyusername', label: '修改人名称'},
],
}
},
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/areasetting/Areasetting/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
mName: 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: 'mName',
label: '区域名称'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
],
}
},
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/areasetting/Areasetting/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/areasetting/Areasetting/${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/areasetting/Areasetting/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/areasetting/Areasetting/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/areasetting/Areasetting/${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/areasetting/Areasetting/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/areasetting/Areasetting/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>

File diff suppressed because it is too large Load Diff

@ -1,294 +1,358 @@
<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-input v-model="query.contractCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同名称">
<el-input v-model="query.contractName" 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="contractCode" label="合同编码" width="0" align="left"
/>
<el-table-column prop="contractName" label="合同名称" width="0" align="left"
/>
<el-table-column prop="contractNo" label="对方合同号" width="0" align="left"
/>
<el-table-column label="合同类型 " width="0" prop="contractType" algin="left"
>
<template slot-scope="scope">
{{ scope.row.contractType | dynamicText(contractTypeOptions) }}
</template>
</el-table-column>
<el-table-column prop="classification" label="合同分类 " width="0" align="left"
/>
<el-table-column prop="declarationDate" label="申报日期" width="0" align="left"
/>
<el-table-column prop="name" label="供应商/客户名" width="0" align="left"
/>
<el-table-column prop="num" label="数量" width="0" align="left"
/>
<el-table-column prop="amount" label="金额" width="0" align="left"
/>
<el-table-column prop="deptName" label="部门名称" width="0" align="left"
/>
<el-table-column prop="remark" label="备注" width="0" align="left"
/>
<el-table-column prop="creatorusername" label="录入人" width="0" align="left"
/>
<el-table-column prop="status" label="合同状态" width="0" align="left"
/>
<el-table-column prop="approval" 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>
<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>
<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-input v-model="query.contractCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同名称">
<el-input v-model="query.contractName" 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="contractCode" label="合同编码" width="0" align="left" />
<el-table-column prop="contractName" label="合同名称" width="0" align="left" />
<el-table-column prop="contractNo" label="对方合同号" width="0" align="left" />
<el-table-column label="合同类型 " width="0" prop="contractType" algin="left">
<template slot-scope="scope">
{{ scope.row.contractType | dynamicText(contractTypeOptions) }}
</template>
</el-table-column>
<el-table-column prop="classification" label="合同分类 " width="0" align="left" />
<el-table-column prop="declarationDate" label="申报日期" width="0" align="left" />
<el-table-column prop="name" label="供应商/客户名" width="0" align="left" />
<el-table-column prop="num" label="数量" width="0" align="left" />
<el-table-column prop="amount" label="金额" width="0" align="left" />
<el-table-column prop="deptName" label="部门名称" width="0" align="left" />
<el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" />
<el-table-column prop="status" label="合同状态" width="0" align="left" />
<el-table-column prop="approval" 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>
<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: {
contractCode:undefined,
contractName: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: 'contractCode', label: '合同编码'},
{prop: 'contractName', label: '合同名称'},
{prop: 'contractNo', label: '对方合同号'},
{prop: 'contractType', label: '合同类型 '},
{prop: 'classification', label: '合同分类 '},
{prop: 'declarationDate', label: '申报日期'},
{prop: 'name', label: '供应商/客户名'},
{prop: 'num', label: '数量'},
{prop: 'amount', label: '金额'},
{prop: 'deptName', label: '部门名称'},
{prop: 'remark', label: '备注'},
{prop: 'creatorusername', label: '录入人'},
{prop: 'status', label: '合同状态'},
{prop: 'approval', label: '集团审批'},
],
contractTypeOptions:[{"fullName":"采购合同","id":"1"},{"fullName":"销售合同","id":"2"},
{"fullName":"租赁合同","id":"3"},{"fullName":"仓储合同","id":"4"},{"fullName":"运输合同","id":"5"},
{"fullName":"施工合同","id":"6"}],
contractTypeProps:{"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/example/ContractFile/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
contractCode: undefined,
contractName: 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: 'contractCode',
label: '合同编码'
},
{
prop: 'contractName',
label: '合同名称'
},
{
prop: 'contractNo',
label: '对方合同号'
},
{
prop: 'contractType',
label: '合同类型 '
},
{
prop: 'classification',
label: '合同分类 '
},
{
prop: 'declarationDate',
label: '申报日期'
},
{
prop: 'name',
label: '供应商/客户名'
},
{
prop: 'num',
label: '数量'
},
{
prop: 'amount',
label: '金额'
},
{
prop: 'deptName',
label: '部门名称'
},
{
prop: 'remark',
label: '备注'
},
{
prop: 'creatorusername',
label: '录入人'
},
{
prop: 'status',
label: '合同状态'
},
{
prop: 'approval',
label: '集团审批'
},
],
contractTypeOptions: [{
"fullName": "采购合同",
"id": "1"
}, {
"fullName": "销售合同",
"id": "2"
},
{
"fullName": "租赁合同",
"id": "3"
}, {
"fullName": "仓储合同",
"id": "4"
}, {
"fullName": "运输合同",
"id": "5"
},
{
"fullName": "施工合同",
"id": "6"
}
],
contractTypeProps: {
"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/example/ContractFile/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/ContractFile/${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/example/ContractFile/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/example/ContractFile/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: "contractCode",
}
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/ContractFile/${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/example/ContractFile/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/example/ContractFile/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: "contractCode",
}
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>

@ -1,241 +1,235 @@
<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="600px">
<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="supplierCd" >
<el-input v-model="dataForm.supplierCd"
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="supplierCd">
<el-input v-model="dataForm.supplierCd" placeholder="请输入客户编码" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="客户名称"
prop="supplierNm" >
<el-input v-model="dataForm.supplierNm"
placeholder="请输入客户名称" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="supplierNm">
<el-input v-model="dataForm.supplierNm" placeholder="请输入客户名称" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="所属公司ID"
prop="orgId" >
<el-input v-model="dataForm.orgId"
placeholder="请输入所属公司ID" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属公司ID" prop="orgId">
<el-input v-model="dataForm.orgId" placeholder="请输入所属公司ID" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="公司代码"
prop="orgName" >
<el-input v-model="dataForm.orgName"
placeholder="请输入公司代码" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司代码" prop="orgName">
<el-input v-model="dataForm.orgName" placeholder="请输入公司代码" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="客户等级"
prop="customerLevel" >
<el-select v-model="dataForm.customerLevel"
placeholder="请选择客户等级" :style='{"width":"100%"}'>
<el-option v-for="(item, index) in customerLevelOptions" :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="customerLevel">
<el-select v-model="dataForm.customerLevel" placeholder="请选择客户等级" :style='{"width":"100%"}'>
<el-option v-for="(item, index) in customerLevelOptions" :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="contactName" >
<el-input v-model="dataForm.contactName"
placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="contactName">
<el-input v-model="dataForm.contactName" placeholder="请输入联系人" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="地址"
prop="address" >
<el-input v-model="dataForm.address"
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地址" prop="address">
<el-input v-model="dataForm.address" placeholder="请输入地址" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="电话"
prop="contactPhone" >
<el-input v-model="dataForm.contactPhone"
placeholder="请输入电话" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="电话" prop="contactPhone">
<el-input v-model="dataForm.contactPhone" placeholder="请输入电话" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="是否启用"
prop="status" >
<el-switch v-model="dataForm.status"
:active-value="1" :inactive-value="0" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否启用" prop="status">
<el-switch v-model="dataForm.status" :active-value="1" :inactive-value="0">
</el-switch>
</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-switch>
</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>
</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: {
supplierCd : '',
supplierNm : '',
orgId : '',
orgName : '',
customerLevel : "1",
contactName : '',
address : '',
contactPhone : '',
status : 1,
},
rules:
{
supplierCd: [
{
required: true,
message: '请输入客户编码',
trigger: 'blur'
},
],
supplierNm: [
{
required: true,
message: '请输入客户名称',
trigger: 'blur'
},
],
contactPhone: [
],
},
customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
}
},
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/customer/Customer/'+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/customer/Customer',
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/customer/Customer/'+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));
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.status = parseInt( _dataAll.status)
this.dataForm = _dataAll
},
},
}
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: {
supplierCd: '',
supplierNm: '',
orgId: '',
orgName: '',
customerLevel: "1",
contactName: '',
address: '',
contactPhone: '',
status: 1,
},
rules: {
supplierCd: [{
required: true,
message: '请输入客户编码',
trigger: 'blur'
}, ],
supplierNm: [{
required: true,
message: '请输入客户名称',
trigger: 'blur'
}, ],
contactPhone: [],
},
customerLevelOptions: [{
"fullName": "一级",
"id": "1"
}, {
"fullName": "二级",
"id": "2"
}, {
"fullName": "三级",
"id": "3"
}],
}
},
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/customer/Customer/' + 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/customer/Customer',
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/customer/Customer/' + 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));
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.status = parseInt(_dataAll.status)
this.dataForm = _dataAll
},
},
}
</script>

@ -1,277 +1,321 @@
<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-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称">
<el-input v-model="query.supplierNm" 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="supplierCd" label="客户编码" width="0" align="left"
sortable="custom" />
<el-table-column prop="supplierNm" label="客户名称" width="0" align="left"
sortable="custom" />
<el-table-column prop="orgId" label="所属公司ID" width="0" align="left"
sortable="custom" />
<el-table-column prop="orgName" label="公司代码" width="0" align="left"
sortable="custom" />
<el-table-column label="客户等级" width="0" prop="customerLevel" algin="left"
sortable="custom" >
<template slot-scope="scope">
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
</template>
</el-table-column>
<el-table-column prop="contactName" label="联系人" width="0" align="left"
sortable="custom" />
<el-table-column prop="address" label="地址" width="0" align="left"
sortable="custom" />
<el-table-column prop="contactPhone" label="电话" width="0" align="left"
sortable="custom" />
<el-table-column prop="status" 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>
<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>
<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-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="客户名称">
<el-input v-model="query.supplierNm" 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="supplierCd" label="客户编码" width="0" align="left" sortable="custom" />
<el-table-column prop="supplierNm" label="客户名称" width="0" align="left" sortable="custom" />
<el-table-column prop="orgId" label="所属公司ID" width="0" align="left" sortable="custom" />
<el-table-column prop="orgName" label="公司代码" width="0" align="left" sortable="custom" />
<el-table-column label="客户等级" width="0" prop="customerLevel" algin="left" sortable="custom">
<template slot-scope="scope">
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
</template>
</el-table-column>
<el-table-column prop="contactName" label="联系人" width="0" align="left" sortable="custom" />
<el-table-column prop="address" label="地址" width="0" align="left" sortable="custom" />
<el-table-column prop="contactPhone" label="电话" width="0" align="left" sortable="custom" />
<el-table-column prop="status" 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>
<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: {
supplierCd:undefined,
supplierNm:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "supplierCd",
},
formVisible: false,
exportBoxVisible: false,
columnList: [
{prop: 'supplierCd', label: '客户编码'},
{prop: 'supplierNm', label: '客户名称'},
{prop: 'orgId', label: '所属公司ID'},
{prop: 'orgName', label: '公司代码'},
{prop: 'customerLevel', label: '客户等级'},
{prop: 'contactName', label: '联系人'},
{prop: 'address', label: '地址'},
{prop: 'contactPhone', label: '电话'},
{prop: 'status', label: '是否启用'},
],
customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
customerLevelProps:{"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/customer/Customer/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
supplierCd: undefined,
supplierNm: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [],
total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "supplierCd",
},
formVisible: false,
exportBoxVisible: false,
columnList: [{
prop: 'supplierCd',
label: '客户编码'
},
{
prop: 'supplierNm',
label: '客户名称'
},
{
prop: 'orgId',
label: '所属公司ID'
},
{
prop: 'orgName',
label: '公司代码'
},
{
prop: 'customerLevel',
label: '客户等级'
},
{
prop: 'contactName',
label: '联系人'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'contactPhone',
label: '电话'
},
{
prop: 'status',
label: '是否启用'
},
],
customerLevelOptions: [{
"fullName": "一级",
"id": "1"
}, {
"fullName": "二级",
"id": "2"
}, {
"fullName": "三级",
"id": "3"
}],
customerLevelProps: {
"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/customer/Customer/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/customer/Customer/${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/customer/Customer/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/customer/Customer/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: "supplierCd",
}
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/customer/Customer/${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/customer/Customer/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/customer/Customer/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: "supplierCd",
}
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>

@ -1,337 +1,359 @@
<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="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="organizationCode" >
<el-input v-model="dataForm.organizationCode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="库存组织代码" prop="organizationCode">
<el-input v-model="dataForm.organizationCode" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="主单位代码"
prop="primaryUomCode" >
<el-input v-model="dataForm.primaryUomCode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主单位代码" prop="primaryUomCode">
<el-input v-model="dataForm.primaryUomCode" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="主单位名称"
prop="primaryUnitOmeasure" >
<el-input v-model="dataForm.primaryUnitOmeasure"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主单位名称" prop="primaryUnitOmeasure">
<el-input v-model="dataForm.primaryUnitOmeasure" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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-input>
</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" >
<relationForm v-model="dataForm.outArea"
placeholder="请选择" clearable field="outArea" modelId ="294012196529150981" :columnOptions="outAreacolumnOptions" relationField="comInputField102" >
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="默认出库区" prop="outArea">
<relationForm v-model="dataForm.outArea" placeholder="请选择" clearable field="outArea"
modelId="294012196529150981" :columnOptions="outAreacolumnOptions"
relationField="comInputField102">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="默认入库区"
prop="inArea" >
<relationForm v-model="dataForm.inArea"
placeholder="请选择" clearable field="inArea" modelId ="294012196529150981" :columnOptions="inAreacolumnOptions" relationField="comInputField102" >
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="默认入库区" prop="inArea">
<relationForm v-model="dataForm.inArea" placeholder="请选择" clearable field="inArea"
modelId="294012196529150981" :columnOptions="inAreacolumnOptions"
relationField="comInputField102">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="创建时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<el-input v-model="dataForm.lastmodifyusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<el-date-picker v-model="dataForm.lastmodifytime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</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-date-picker>
</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>
<el-col :span="12" >
<el-form-item label="处理类型"
prop="processingType" >
<el-select v-model="dataForm.processingType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in processingTypeOptions" :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="processingType">
<el-select v-model="dataForm.processingType" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in processingTypeOptions" :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="readTag" >
<el-select v-model="dataForm.readTag"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in readTagOptions" :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="readTag">
<el-select v-model="dataForm.readTag" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in readTagOptions" :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="readDate" >
<el-time-picker v-model="dataForm.readDate"
placeholder="请选择" clearable :style='{"width":"100%"}' format="HH:mm:ss" value-format="HH:mm:ss" :picker-options='{"selectableRange":"00:00:00-23:59:59"}'>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="读取时间" prop="readDate">
<el-time-picker v-model="dataForm.readDate" placeholder="请选择" clearable
:style='{"width":"100%"}' format="HH:mm:ss" value-format="HH:mm:ss"
:picker-options='{"selectableRange":"00:00:00-23:59:59"}'>
</el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="错误信息"
prop="errorMessage" >
<el-input v-model="dataForm.errorMessage"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-time-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="错误信息" prop="errorMessage">
<el-input v-model="dataForm.errorMessage" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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-input>
</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>
</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 : '',
description : '',
organizationCode : '',
primaryUomCode : '',
primaryUnitOmeasure : '',
purchaseFlag : "",
salesFlag : "",
outArea : "",
inArea : "",
creatorusername : '',
creatortime : '',
lastmodifyusername : '',
lastmodifytime : '',
effectiveStatus : "",
processingType : "",
readTag : "",
readDate : '',
errorMessage : '',
},
rules:
{
itemCode: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
description: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
purchaseFlagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
salesFlagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
outAreacolumnOptions:[ {"label":"购药人","value":"comInputField102"},],
inAreacolumnOptions:[ {"label":"姓名","value":"comInputField102"},],
effectiveStatusOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
processingTypeOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
readTagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","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/Material/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/Material/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/Material/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
},
},
}
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: '',
description: '',
organizationCode: '',
primaryUomCode: '',
primaryUnitOmeasure: '',
purchaseFlag: "",
salesFlag: "",
outArea: "",
inArea: "",
creatorusername: '',
creatortime: '',
lastmodifyusername: '',
lastmodifytime: '',
effectiveStatus: "",
processingType: "",
readTag: "",
readDate: '',
errorMessage: '',
},
rules: {
itemCode: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
description: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
purchaseFlagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
salesFlagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
outAreacolumnOptions: [{
"label": "购药人",
"value": "comInputField102"
}, ],
inAreacolumnOptions: [{
"label": "姓名",
"value": "comInputField102"
}, ],
effectiveStatusOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
processingTypeOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
readTagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"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/Material/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/Material/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/Material/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,319 +1,411 @@
<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-input v-model="query.itemCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称">
<el-input v-model="query.description" 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="itemCode" label="物料编码" width="0" align="left"
/>
<el-table-column prop="description" label="物料名称" width="0" align="left"
/>
<el-table-column prop="outArea" label="默认出库区" width="0" align="left"
/>
<el-table-column prop="inArea" label="默认入库区" width="0" align="left"
/>
<el-table-column prop="primaryUnitOmeasure" label="主单位名称" width="0" align="left"
/>
<el-table-column label="是否可采购" width="0" prop="purchaseFlag" algin="left"
>
<template slot-scope="scope">
{{ scope.row.purchaseFlag | dynamicText(purchaseFlagOptions) }}
</template>
</el-table-column>
<el-table-column label="是否可销售 " width="0" prop="salesFlag" algin="left"
>
<template slot-scope="scope">
{{ scope.row.salesFlag | dynamicText(salesFlagOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left"
/>
<el-table-column prop="creatortime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left"
/>
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left"
/>
<el-table-column label="生效状态" width="0" prop="effectiveStatus" algin="left"
>
<template slot-scope="scope">
{{ scope.row.effectiveStatus | dynamicText(effectiveStatusOptions) }}
</template>
</el-table-column>
<el-table-column label="处理类型" width="0" prop="processingType" algin="left"
>
<template slot-scope="scope">
{{ scope.row.processingType | dynamicText(processingTypeOptions) }}
</template>
</el-table-column>
<el-table-column label="读取标记" width="0" prop="readTag" algin="left"
>
<template slot-scope="scope">
{{ scope.row.readTag | dynamicText(readTagOptions) }}
</template>
</el-table-column>
<el-table-column prop="readDate" label="读取时间" width="0" align="left"
/>
<el-table-column prop="errorMessage" label="错误信息" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.itemCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="物料名称">
<el-input v-model="query.description" 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="itemCode" label="物料编码" width="0" align="left" />
<el-table-column prop="description" label="物料名称" width="0" align="left" />
<el-table-column prop="outArea" label="默认出库区" width="0" align="left" />
<el-table-column prop="inArea" label="默认入库区" width="0" align="left" />
<el-table-column prop="primaryUnitOmeasure" label="主单位名称" width="0" align="left" />
<el-table-column label="是否可采购" width="0" prop="purchaseFlag" algin="left">
<template slot-scope="scope">
{{ scope.row.purchaseFlag | dynamicText(purchaseFlagOptions) }}
</template>
</el-table-column>
<el-table-column label="是否可销售 " width="0" prop="salesFlag" algin="left">
<template slot-scope="scope">
{{ scope.row.salesFlag | dynamicText(salesFlagOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column label="生效状态" width="0" prop="effectiveStatus" algin="left">
<template slot-scope="scope">
{{ scope.row.effectiveStatus | dynamicText(effectiveStatusOptions) }}
</template>
</el-table-column>
<el-table-column label="处理类型" width="0" prop="processingType" algin="left">
<template slot-scope="scope">
{{ scope.row.processingType | dynamicText(processingTypeOptions) }}
</template>
</el-table-column>
<el-table-column label="读取标记" width="0" prop="readTag" algin="left">
<template slot-scope="scope">
{{ scope.row.readTag | dynamicText(readTagOptions) }}
</template>
</el-table-column>
<el-table-column prop="readDate" label="读取时间" width="0" align="left" />
<el-table-column prop="errorMessage" label="错误信息" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
itemCode:undefined,
description: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: 'itemCode', label: '物料编码'},
{prop: 'description', label: '物料名称'},
{prop: 'outArea', label: '默认出库区'},
{prop: 'inArea', label: '默认入库区'},
{prop: 'primaryUnitOmeasure', label: '主单位名称'},
{prop: 'purchaseFlag', label: '是否可采购'},
{prop: 'salesFlag', label: '是否可销售 '},
{prop: 'creatorusername', label: '创建人名称'},
{prop: 'creatortime', label: '创建时间'},
{prop: 'lastmodifyusername', label: '修改人名称'},
{prop: 'lastmodifytime', label: '修改时间'},
{prop: 'effectiveStatus', label: '生效状态'},
{prop: 'processingType', label: '处理类型'},
{prop: 'readTag', label: '读取标记'},
{prop: 'readDate', label: '读取时间'},
{prop: 'errorMessage', label: '错误信息'},
],
purchaseFlagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
purchaseFlagProps:{"label":"fullName","value":"id"},
salesFlagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
salesFlagProps:{"label":"fullName","value":"id"},
effectiveStatusOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
effectiveStatusProps:{"label":"fullName","value":"id"},
processingTypeOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
processingTypeProps:{"label":"fullName","value":"id"},
readTagOptions:[{"fullName":"Y","id":"Y"},{"fullName":"N","id":"N"}],
readTagProps:{"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/Material/Material/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
itemCode: undefined,
description: 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: 'itemCode',
label: '物料编码'
},
{
prop: 'description',
label: '物料名称'
},
{
prop: 'outArea',
label: '默认出库区'
},
{
prop: 'inArea',
label: '默认入库区'
},
{
prop: 'primaryUnitOmeasure',
label: '主单位名称'
},
{
prop: 'purchaseFlag',
label: '是否可采购'
},
{
prop: 'salesFlag',
label: '是否可销售 '
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'effectiveStatus',
label: '生效状态'
},
{
prop: 'processingType',
label: '处理类型'
},
{
prop: 'readTag',
label: '读取标记'
},
{
prop: 'readDate',
label: '读取时间'
},
{
prop: 'errorMessage',
label: '错误信息'
},
],
purchaseFlagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
purchaseFlagProps: {
"label": "fullName",
"value": "id"
},
salesFlagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
salesFlagProps: {
"label": "fullName",
"value": "id"
},
effectiveStatusOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
effectiveStatusProps: {
"label": "fullName",
"value": "id"
},
processingTypeOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
processingTypeProps: {
"label": "fullName",
"value": "id"
},
readTagOptions: [{
"fullName": "Y",
"id": "Y"
}, {
"fullName": "N",
"id": "N"
}],
readTagProps: {
"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/Material/Material/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/Material/Material/${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/Material/Material/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/Material/Material/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/Material/Material/${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/Material/Material/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/Material/Material/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>

@ -1,245 +1,228 @@
<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="800px">
<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="24" >
<el-form-item label="设备名称"
prop="mName" >
<el-input v-model="dataForm.mName"
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="24">
<el-form-item label="设备名称" prop="mName">
<el-input v-model="dataForm.mName" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="设备序列号"
prop="serialnumber" >
<el-input v-model="dataForm.serialnumber"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="设备序列号" prop="serialnumber">
<el-input v-model="dataForm.serialnumber" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="ip地址"
prop="ip" >
<el-input v-model="dataForm.ip"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ip地址" prop="ip">
<el-input v-model="dataForm.ip" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="端口号"
prop="port" >
<el-input v-model="dataForm.port"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="端口号" prop="port">
<el-input v-model="dataForm.port" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="账号"
prop="account" >
<el-input v-model="dataForm.account"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="账号" prop="account">
<el-input v-model="dataForm.account" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="密码"
prop="password" >
<el-input v-model="dataForm.password"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="密码" prop="password">
<el-input v-model="dataForm.password" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<el-input v-model="dataForm.lastmodifyusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<el-date-picker v-model="dataForm.lastmodifytime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</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-date-picker>
</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>
</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: {
mName : '',
serialnumber : '',
ip : '',
port : '',
account : '',
password : '',
creatorusername : '',
creatortime : '',
lastmodifyusername : '',
lastmodifytime : '',
},
rules:
{
mName: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
serialnumber: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
}
},
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/monitormanage/Monitormanage/'+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/monitormanage/Monitormanage',
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/monitormanage/Monitormanage/'+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
},
},
}
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: {
mName: '',
serialnumber: '',
ip: '',
port: '',
account: '',
password: '',
creatorusername: '',
creatortime: '',
lastmodifyusername: '',
lastmodifytime: '',
},
rules: {
mName: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
serialnumber: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
}
},
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/monitormanage/Monitormanage/' + 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/monitormanage/Monitormanage',
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/monitormanage/Monitormanage/' + 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,265 +1,300 @@
<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-input v-model="query.mName" 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="mName" label="设备名称" width="0" align="left"
/>
<el-table-column prop="serialnumber" label="设备序列号" width="0" align="left"
/>
<el-table-column prop="ip" label="ip地址" width="0" align="left"
/>
<el-table-column prop="port" label="端口号" width="0" align="left"
/>
<el-table-column prop="account" label="账号" width="0" align="left"
/>
<el-table-column prop="password" label="密码" width="0" align="left"
/>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left"
/>
<el-table-column prop="creatortime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left"
/>
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.mName" 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="mName" label="设备名称" width="0" align="left" />
<el-table-column prop="serialnumber" label="设备序列号" width="0" align="left" />
<el-table-column prop="ip" label="ip地址" width="0" align="left" />
<el-table-column prop="port" label="端口号" width="0" align="left" />
<el-table-column prop="account" label="账号" width="0" align="left" />
<el-table-column prop="password" label="密码" width="0" align="left" />
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
mName: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: 'mName', label: '设备名称'},
{prop: 'serialnumber', label: '设备序列号'},
{prop: 'ip', label: 'ip地址'},
{prop: 'port', label: '端口号'},
{prop: 'account', label: '账号'},
{prop: 'password', label: '密码'},
{prop: 'creatorusername', label: '创建人名称'},
{prop: 'creatortime', label: '创建时间'},
{prop: 'lastmodifyusername', label: '修改人名称'},
{prop: 'lastmodifytime', label: '修改时间'},
],
}
},
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/monitormanage/Monitormanage/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
mName: 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: 'mName',
label: '设备名称'
},
{
prop: 'serialnumber',
label: '设备序列号'
},
{
prop: 'ip',
label: 'ip地址'
},
{
prop: 'port',
label: '端口号'
},
{
prop: 'account',
label: '账号'
},
{
prop: 'password',
label: '密码'
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
],
}
},
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/monitormanage/Monitormanage/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/monitormanage/Monitormanage/${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/monitormanage/Monitormanage/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/monitormanage/Monitormanage/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/monitormanage/Monitormanage/${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/monitormanage/Monitormanage/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/monitormanage/Monitormanage/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>

@ -1,491 +1,480 @@
<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="800px">
<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="materialCode" >
<relationForm v-model="dataForm.materialCode"
placeholder="请选择" clearable field="materialCode" modelId ="294090217084722181" :columnOptions="materialCodecolumnOptions" relationField="selectField121" >
<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="materialCode">
<relationForm v-model="dataForm.materialCode" placeholder="请选择" clearable
field="materialCode" modelId="294090217084722181"
:columnOptions="materialCodecolumnOptions" relationField="selectField121">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="物料名称"
prop="materialName" >
<el-input v-model="dataForm.materialName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="dataForm.materialName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="销售合同"
prop="salesName" >
<relationForm v-model="dataForm.salesName"
placeholder="请选择" clearable field="salesName" modelId ="294090217084722181" :columnOptions="salesNamecolumnOptions" relationField="selectField121" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售合同" prop="salesName">
<relationForm v-model="dataForm.salesName" placeholder="请选择" clearable field="salesName"
modelId="294090217084722181" :columnOptions="salesNamecolumnOptions"
relationField="selectField121">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="客户名称"
prop="customerName" >
<el-input v-model="dataForm.customerName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="customerName">
<el-input v-model="dataForm.customerName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="是否垫资"
prop="advance" >
<el-select v-model="dataForm.advance"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :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="advance">
<el-select v-model="dataForm.advance" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :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="salesPrice" >
<el-input-number v-model="dataForm.salesPrice"
placeholder="数字文本" :step="1" >
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售价格" prop="salesPrice">
<el-input-number v-model="dataForm.salesPrice" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="运输方式"
prop="transportType" >
<el-select v-model="dataForm.transportType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运输方式" prop="transportType">
<el-select v-model="dataForm.transportType" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in transportTypeOptions" :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="departmentId" >
<el-input-number v-model="dataForm.departmentId"
placeholder="数字文本" :step="1" >
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运费" prop="departmentId">
<el-input-number v-model="dataForm.departmentId" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="车号"
prop="licenseNo" >
<relationForm v-model="dataForm.licenseNo"
placeholder="请选择" clearable field="licenseNo" modelId ="294090217084722181" :columnOptions="licenseNocolumnOptions" relationField="selectField122" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车号" prop="licenseNo">
<relationForm v-model="dataForm.licenseNo" placeholder="请选择" clearable field="licenseNo"
modelId="294090217084722181" :columnOptions="licenseNocolumnOptions"
relationField="selectField122">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="业务员名称"
prop="businessName" >
<el-input v-model="dataForm.businessName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务员名称" prop="businessName">
<el-input v-model="dataForm.businessName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="磅单图片"
prop="poundPictures" >
<JNPF-UploadImg v-model="dataForm.poundPictures"
:fileSize="500" sizeUnit="MB" :limit="9" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="磅单图片" prop="poundPictures">
<JNPF-UploadImg v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="9">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="皮重"
prop="tareWeight" >
<el-input-number v-model="dataForm.tareWeight"
placeholder="数字文本" :step="1" >
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="皮重" prop="tareWeight">
<el-input-number v-model="dataForm.tareWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="毛重"
prop="grossWeight" >
<el-input-number v-model="dataForm.grossWeight"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="毛重" prop="grossWeight">
<el-input-number v-model="dataForm.grossWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="扣重"
prop="buckleWeight" >
<el-input-number v-model="dataForm.buckleWeight"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="扣重" prop="buckleWeight">
<el-input-number v-model="dataForm.buckleWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="净重"
prop="netWeight" >
<el-input-number v-model="dataForm.netWeight"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="净重" prop="netWeight">
<el-input-number v-model="dataForm.netWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="备注"
prop="remark" >
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="司机名称"
prop="driverName" >
<el-input v-model="dataForm.driverName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="司机名称" prop="driverName">
<el-input v-model="dataForm.driverName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="车辆图片"
prop="vehiclePictures" >
<JNPF-UploadImg v-model="dataForm.vehiclePictures"
:fileSize="500" sizeUnit="MB" :limit="9" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="车辆图片" prop="vehiclePictures">
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="制单人"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="制单人" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="供应商名称"
prop="supplierName" >
<el-input v-model="dataForm.supplierName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商名称" prop="supplierName">
<el-input v-model="dataForm.supplierName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="采购合同"
prop="purchaseName" >
<relationForm v-model="dataForm.purchaseName"
placeholder="请选择" clearable field="purchaseName" modelId ="294090217084722181" :columnOptions="purchaseNamecolumnOptions" relationField="selectField121" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购合同" prop="purchaseName">
<relationForm v-model="dataForm.purchaseName" placeholder="请选择" clearable
field="purchaseName" modelId="294090217084722181"
:columnOptions="purchaseNamecolumnOptions" relationField="selectField121">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="单位"
prop="unit" >
<el-select v-model="dataForm.unit"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unit">
<el-select v-model="dataForm.unit" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :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="settlement" >
<el-input v-model="dataForm.settlement"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="结算重量" prop="settlement">
<el-input v-model="dataForm.settlement" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="采购单价"
prop="purchasePrice" >
<el-input v-model="dataForm.purchasePrice"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购单价" prop="purchasePrice">
<el-input v-model="dataForm.purchasePrice" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="进项票日期"
prop="inputDate" >
<el-date-picker v-model="dataForm.inputDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="进项票日期" prop="inputDate">
<el-date-picker v-model="dataForm.inputDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="销项票日期"
prop="outputDate" >
<el-date-picker v-model="dataForm.outputDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销项票日期" prop="outputDate">
<el-date-picker v-model="dataForm.outputDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="付款日期"
prop="payDate" >
<el-date-picker v-model="dataForm.payDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="付款日期" prop="payDate">
<el-date-picker v-model="dataForm.payDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="回款日期"
prop="paymentDate" >
<el-date-picker v-model="dataForm.paymentDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="回款日期" prop="paymentDate">
<el-date-picker v-model="dataForm.paymentDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="磅单日期"
prop="poundDate" >
<el-date-picker v-model="dataForm.poundDate"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="磅单日期" prop="poundDate">
<el-date-picker v-model="dataForm.poundDate" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</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-date-picker>
</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>
</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: {
materialCode : "",
materialName : '',
salesName : "",
customerName : '',
advance : "",
salesPrice : '',
transportType : "",
departmentId : 11.225,
licenseNo : "",
businessName : '',
poundPictures : [],
tareWeight : '',
grossWeight : '',
buckleWeight : '',
netWeight : '',
remark : '',
driverName : '',
vehiclePictures : [],
creatorusername : '',
supplierName : '',
purchaseName : "",
unit : "",
settlement : '',
purchasePrice : '',
inputDate : '',
outputDate : '',
payDate : '',
paymentDate : '',
poundDate : '',
},
rules:
{
materialCode: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
salesName: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
licenseNo: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
poundPictures: [
{
required: true,
message: '请至少选择一个',
trigger: 'click'
},
],
tareWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
grossWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
buckleWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
netWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
},
materialCodecolumnOptions:[ {"label":"事件等级","value":"selectField121"},],
salesNamecolumnOptions:[ {"label":"事件等级","value":"selectField121"},],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
licenseNocolumnOptions:[ {"label":"事件级别","value":"selectField122"},],
purchaseNamecolumnOptions:[ {"label":"事件等级","value":"selectField121"},],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
}
},
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/poundlist/Poundlist/'+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/poundlist/Poundlist',
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/poundlist/Poundlist/'+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));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.poundPictures = JSON.parse( _dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse( _dataAll.vehiclePictures)
this.dataForm = _dataAll
},
},
}
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: {
materialCode: "",
materialName: '',
salesName: "",
customerName: '',
advance: "",
salesPrice: '',
transportType: "",
departmentId: 11.225,
licenseNo: "",
businessName: '',
poundPictures: [],
tareWeight: '',
grossWeight: '',
buckleWeight: '',
netWeight: '',
remark: '',
driverName: '',
vehiclePictures: [],
creatorusername: '',
supplierName: '',
purchaseName: "",
unit: "",
settlement: '',
purchasePrice: '',
inputDate: '',
outputDate: '',
payDate: '',
paymentDate: '',
poundDate: '',
},
rules: {
materialCode: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
salesName: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
licenseNo: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
poundPictures: [{
required: true,
message: '请至少选择一个',
trigger: 'click'
}, ],
tareWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
grossWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
buckleWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
netWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
},
materialCodecolumnOptions: [{
"label": "事件等级",
"value": "selectField121"
}, ],
salesNamecolumnOptions: [{
"label": "事件等级",
"value": "selectField121"
}, ],
advanceOptions: [{
"fullName": "是",
"id": "1"
}, {
"fullName": "否",
"id": "0"
}],
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
licenseNocolumnOptions: [{
"label": "事件级别",
"value": "selectField122"
}, ],
purchaseNamecolumnOptions: [{
"label": "事件等级",
"value": "selectField121"
}, ],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
}
},
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/poundlist/Poundlist/' + 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/poundlist/Poundlist',
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/poundlist/Poundlist/' + 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));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
this.dataForm = _dataAll
},
},
}
</script>

@ -1,318 +1,439 @@
<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-input v-model="query.materialName" 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="licenseNo" label="车号" width="0" align="left"
/>
<el-table-column prop="customerName" label="客户名称" width="0" align="left"
/>
<el-table-column prop="salesName" label="销售合同" width="0" align="left"
/>
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
/>
<el-table-column prop="purchaseName" label="采购合同" width="0" align="left"
/>
<el-table-column prop="materialCode" label="物料编码" width="0" align="left"
/>
<el-table-column prop="materialName" 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="unit" algin="left"
>
<template slot-scope="scope">
{{ scope.row.unit | dynamicText(unitOptions) }}
</template>
</el-table-column>
<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="settlement" label="结算重量" width="0" align="left"
/>
<el-table-column prop="purchasePrice" label="采购单价" width="0" align="left"
/>
<el-table-column prop="salesPrice" label="销售价格" width="0" align="left"
/>
<el-table-column prop="inputDate" label="进项票日期" width="0" align="left"
/>
<el-table-column prop="outputDate" label="销项票日期" width="0" align="left"
/>
<el-table-column prop="payDate" label="付款日期" width="0" align="left"
/>
<el-table-column prop="paymentDate" label="回款日期" width="0" align="left"
/>
<el-table-column prop="poundDate" label="磅单日期" width="0" align="left"
/>
<el-table-column prop="businessName" label="业务员名称" width="0" align="left"
/>
<el-table-column prop="remark" label="备注" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.materialName" 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="licenseNo" label="车号" width="0" align="left" />
<el-table-column prop="customerName" label="客户名称" width="0" align="left" />
<el-table-column prop="salesName" label="销售合同" width="0" align="left" />
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left" />
<el-table-column prop="purchaseName" label="采购合同" width="0" align="left" />
<el-table-column prop="materialCode" label="物料编码" width="0" align="left" />
<el-table-column prop="materialName" 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="unit" algin="left">
<template slot-scope="scope">
{{ scope.row.unit | dynamicText(unitOptions) }}
</template>
</el-table-column>
<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="settlement" label="结算重量" width="0" align="left" />
<el-table-column prop="purchasePrice" label="采购单价" width="0" align="left" />
<el-table-column prop="salesPrice" label="销售价格" width="0" align="left" />
<el-table-column prop="inputDate" label="进项票日期" width="0" align="left" />
<el-table-column prop="outputDate" label="销项票日期" width="0" align="left" />
<el-table-column prop="payDate" label="付款日期" width="0" align="left" />
<el-table-column prop="paymentDate" label="回款日期" width="0" align="left" />
<el-table-column prop="poundDate" label="磅单日期" width="0" align="left" />
<el-table-column prop="businessName" label="业务员" width="0" align="left" />
<el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column prop="poundPictures" label="磅单图片" width="0" align="left">
<template slot-scope="scope">
<span v-for="(item,index) in JSON.parse(scope.row.poundPictures)" :key="index">
<el-popover placement="bottom" trigger="click" width="1000">
<img :src="`/dev${item.url}`" width="100%" />
<img
slot="reference"
:src="`/dev${item.url}`"
:alt="`/dev${item.url}`"
style="max-height: 70px;max-width: 70px; padding: 5px"
/>
</el-popover>
</span>
</template>
</el-table-column>
<el-table-column prop="vehiclePictures" label="车辆图片" width="0" align="left">
<template slot-scope="scope">
<span v-for="(item,index) in JSON.parse(scope.row.vehiclePictures)" :key="index">
<el-popover placement="bottom" trigger="click" width="1000">
<img :src="`/dev${item.url}`" width="100%" />
<img
slot="reference"
:src="`/dev${item.url}`"
:alt="`/dev${item.url}`"
style="max-height: 70px;max-width: 70px; padding: 5px"
/>
</el-popover>
</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
materialName: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: 'licenseNo', label: '车号'},
{prop: 'customerName', label: '客户名称'},
{prop: 'salesName', label: '销售合同'},
{prop: 'supplierName', label: '供应商名称'},
{prop: 'purchaseName', label: '采购合同'},
{prop: 'materialCode', label: '物料编码'},
{prop: 'materialName', label: '物料名称'},
{prop: 'advance', label: '是否垫资'},
{prop: 'unit', label: '单位'},
{prop: 'grossWeight', label: '毛重'},
{prop: 'tareWeight', label: '皮重'},
{prop: 'buckleWeight', label: '扣重'},
{prop: 'netWeight', label: '净重'},
{prop: 'settlement', label: '结算重量'},
{prop: 'purchasePrice', label: '采购单价'},
{prop: 'salesPrice', label: '销售价格'},
{prop: 'inputDate', label: '进项票日期'},
{prop: 'outputDate', label: '销项票日期'},
{prop: 'payDate', label: '付款日期'},
{prop: 'paymentDate', label: '回款日期'},
{prop: 'poundDate', label: '磅单日期'},
{prop: 'businessName', label: '业务员名称'},
{prop: 'remark', label: '备注'},
],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
advanceProps:{"label":"fullName","value":"id"},
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
transportTypeProps:{"label":"fullName","value":"id"},
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
unitProps:{"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/poundlist/Poundlist/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
materialName: 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: 'licenseNo',
label: '车号'
},
{
prop: 'customerName',
label: '客户名称'
},
{
prop: 'salesName',
label: '销售合同'
},
{
prop: 'supplierName',
label: '供应商名称'
},
{
prop: 'purchaseName',
label: '采购合同'
},
{
prop: 'materialCode',
label: '物料编码'
},
{
prop: 'materialName',
label: '物料名称'
},
{
prop: 'advance',
label: '是否垫资'
},
{
prop: 'unit',
label: '单位'
},
{
prop: 'grossWeight',
label: '毛重'
},
{
prop: 'tareWeight',
label: '皮重'
},
{
prop: 'buckleWeight',
label: '扣重'
},
{
prop: 'netWeight',
label: '净重'
},
{
prop: 'settlement',
label: '结算重量'
},
{
prop: 'purchasePrice',
label: '采购单价'
},
{
prop: 'salesPrice',
label: '销售价格'
},
{
prop: 'inputDate',
label: '进项票日期'
},
{
prop: 'outputDate',
label: '销项票日期'
},
{
prop: 'payDate',
label: '付款日期'
},
{
prop: 'paymentDate',
label: '回款日期'
},
{
prop: 'poundDate',
label: '磅单日期'
},
{
prop: 'businessName',
label: '业务员名称'
},
{
prop: 'remark',
label: '备注'
},
],
advanceOptions: [{
"fullName": "是",
"id": "1"
}, {
"fullName": "否",
"id": "0"
}],
advanceProps: {
"label": "fullName",
"value": "id"
},
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
transportTypeProps: {
"label": "fullName",
"value": "id"
},
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
unitProps: {
"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/poundlist/Poundlist/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/poundlist/Poundlist/${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/poundlist/Poundlist/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/poundlist/Poundlist/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/poundlist/Poundlist/${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/poundlist/Poundlist/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/poundlist/Poundlist/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>

@ -1,467 +1,517 @@
<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="8" >
<el-form-item label="单据编号"
prop="documentno" >
<el-input v-model="dataForm.documentno"
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="8">
<el-form-item label="单据编号" prop="documentno">
<el-input v-model="dataForm.documentno" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="供应商名称"
prop="suppliername" >
<el-input v-model="dataForm.suppliername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="供应商名称" prop="suppliername">
<el-input v-model="dataForm.suppliername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="合同名称"
prop="contractname" >
<el-input v-model="dataForm.contractname"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="合同名称" prop="contractname">
<el-input v-model="dataForm.contractname" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="制单人"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="制单人" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="采购部门"
prop="departmentId" >
<dep-select v-model="dataForm.departmentId"
placeholder="请选择" clearable >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="采购部门" prop="departmentId">
<dep-select v-model="dataForm.departmentId" placeholder="请选择" clearable>
</dep-select>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="对方合同号"
prop="contractno" >
<el-input v-model="dataForm.contractno"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</dep-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="对方合同号" prop="contractno">
<el-input v-model="dataForm.contractno" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="数量"
prop="num" >
<el-input-number v-model="dataForm.num"
placeholder="数字文本" :step="1" controls-position='right' >
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="数量" prop="num">
<el-input-number v-model="dataForm.num" placeholder="数字文本" :step="1"
controls-position='right'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="金额"
prop="amount" >
<el-input v-model="dataForm.amount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="金额" prop="amount">
<el-input v-model="dataForm.amount" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="不含税金额"
prop="notamount" >
<el-input v-model="dataForm.notamount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="不含税金额" prop="notamount">
<el-input v-model="dataForm.notamount" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="币别 "
prop="currency" >
<el-select v-model="dataForm.currency"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="币别 " prop="currency">
<el-select v-model="dataForm.currency" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in currencyOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16" >
<el-form-item label="备注"
prop="remark" >
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-select>
</el-form-item>
</el-col>
<el-col :span="16">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="ERP订单号"
prop="erpno" >
<el-input v-model="dataForm.erpno"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="ERP订单号" prop="erpno">
<el-input v-model="dataForm.erpno" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="已付款金额"
prop="payprice" >
<el-input v-model="dataForm.payprice"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="已付款金额" prop="payprice">
<el-input v-model="dataForm.payprice" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票数量"
prop="invoicenum" >
<el-input v-model="dataForm.invoicenum"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票数量" prop="invoicenum">
<el-input v-model="dataForm.invoicenum" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="发票金额"
prop="invoiceamount" >
<el-input v-model="dataForm.invoiceamount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发票金额" prop="invoiceamount">
<el-input v-model="dataForm.invoiceamount" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="垫资金额"
prop="advanceamount" >
<el-input v-model="dataForm.advanceamount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="垫资金额" prop="advanceamount">
<el-input v-model="dataForm.advanceamount" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="单据状态"
prop="status" >
<el-select v-model="dataForm.status"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="单据状态" prop="status">
<el-select v-model="dataForm.status" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in statusOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" >
<el-form-item label="制单时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-select>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="制单时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activebgsnko" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24" >
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.purchaseorder_item0List" size='mini' >
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="licensenum" label="车牌号">
<template slot-scope="scope">
<el-input v-model="scope.row.licensenum"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="materialname" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialname"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pounttype" label="类型 ">
<template slot-scope="scope">
<el-select v-model="scope.row.pounttype"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in pounttypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="netweight" label="净重">
<template slot-scope="scope">
<el-input v-model="scope.row.netweight"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
<template slot-scope="scope">
<el-select v-model="scope.row.unit"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="advance" label="是否垫资">
<template slot-scope="scope">
<el-select v-model="scope.row.advance"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="单价">
<template slot-scope="scope">
<el-input v-model="scope.row.price"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量">
<template slot-scope="scope">
<el-input v-model="scope.row.settlement"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率 ">
<template slot-scope="scope">
<el-select v-model="scope.row.rate"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in rateOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notamount" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.notamount"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50" >
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn" @click="delpurchaseorder_item0List(scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpurchaseorder_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</el-tab-pane >
</el-tabs>
</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-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-tabs v-model="activebgsnko" tab-position="top" class="mb-20">
<el-tab-pane label="磅单明细">
<el-col :span="24">
<el-form-item label-width="0">
<div class="JNPF-common-title">
<h2></h2>
</div>
<el-table :data="dataForm.purchaseorder_item0List" size='mini'>
<el-table-column type="index" width="50" label="序号" align="center" />
<el-table-column prop="licensenum" label="车牌号">
<template slot-scope="scope">
<el-input v-model="scope.row.licensenum" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="materialname" label="物料名称">
<template slot-scope="scope">
<el-input v-model="scope.row.materialname" placeholder="请输入"
clearable :style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="pounttype" label="类型 ">
<template slot-scope="scope">
<el-select v-model="scope.row.pounttype" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in pounttypeOptions"
:key="index" :label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="netweight" label="净重">
<template slot-scope="scope">
<el-input v-model="scope.row.netweight" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="unit" label="单位">
<template slot-scope="scope">
<el-select v-model="scope.row.unit" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="advance" label="是否垫资">
<template slot-scope="scope">
<el-select v-model="scope.row.advance" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="price" label="单价">
<template slot-scope="scope">
<el-input v-model="scope.row.price" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="settlement" label="结算重量">
<template slot-scope="scope">
<el-input v-model="scope.row.settlement" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="rate" label="税率 ">
<template slot-scope="scope">
<el-select v-model="scope.row.rate" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in rateOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="amount" label="金额">
<template slot-scope="scope">
<el-input v-model="scope.row.amount" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="notamount" label="不含税金额">
<template slot-scope="scope">
<el-input v-model="scope.row.notamount" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
<template slot-scope="scope">
<el-input v-model="scope.row.remark" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</template>
</el-table-column>
<el-table-column label="操作" width="50">
<template slot-scope="scope">
<el-button size="mini" type="text" class="JNPF-table-delBtn"
@click="delpurchaseorder_item0List(scope.$index)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="table-actions" @click="addpurchaseorder_item0List()">
<el-button type="text" icon="el-icon-plus">添加</el-button>
</div>
</el-form-item>
</el-col>
</el-tab-pane>
</el-tabs>
</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>
</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: {
documentno : '',
suppliername : '',
contractname : '',
creatorusername : '',
departmentId : '',
contractno : '',
num : '',
amount : '',
notamount : '',
currency : "",
remark : '',
erpno : '',
payprice : '',
invoicenum : '',
invoiceamount : '',
advanceamount : '',
status : "",
creatortime : '',
purchaseorder_item0List:[],
},
activebgsnko:'0',
rules:
{
},
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款申请","id":"2"},{"fullName":"待付款","id":"3"},{"fullName":"付款中","id":"4"},{"fullName":"归档","id":"5"}],
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: {
documentno: '',
suppliername: '',
contractname: '',
creatorusername: '',
departmentId: '',
contractno: '',
num: '',
amount: '',
notamount: '',
currency: "",
remark: '',
erpno: '',
payprice: '',
invoicenum: '',
invoiceamount: '',
advanceamount: '',
status: "",
creatortime: '',
purchaseorder_item0List: [],
},
activebgsnko: '0',
rules: {},
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "开票中",
"id": "1"
}, {
"fullName": "付款申请",
"id": "2"
}, {
"fullName": "待付款",
"id": "3"
}, {
"fullName": "付款中",
"id": "4"
}, {
"fullName": "归档",
"id": "5"
}],
pounttypeOptions:[{"fullName":"贸易","id":"0"},{"fullName":"其他","id":"1"}],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
rateOptions:[{"fullName":"13","id":"0"},{"fullName":"9","id":"1"},{"fullName":"6","id":"2"},{"fullName":"5","id":"3"},{"fullName":"3","id":"4"},{"fullName":"0","id":"5"}],
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
purchaseorder_item0Exist() {
pounttypeOptions: [{
"fullName": "贸易",
"id": "0"
}, {
"fullName": "其他",
"id": "1"
}],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
advanceOptions: [{
"fullName": "是",
"id": "1"
}, {
"fullName": "否",
"id": "0"
}],
rateOptions: [{
"fullName": "13",
"id": "0"
}, {
"fullName": "9",
"id": "1"
}, {
"fullName": "6",
"id": "2"
}, {
"fullName": "5",
"id": "3"
}, {
"fullName": "3",
"id": "4"
}, {
"fullName": "0",
"id": "5"
}],
}
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
purchaseorder_item0Exist() {
let isOk = true;
for(let i=0;i<this.dataForm.purchaseorder_item0List.length;i++){
const e = this.dataForm.purchaseorder_item0List[i];
}
for (let i = 0; i < this.dataForm.purchaseorder_item0List.length; i++) {
const e = this.dataForm.purchaseorder_item0List[i];
}
return isOk;
},
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/purchaseorder/Purchaseorder/'+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) {
if (!this.purchaseorder_item0Exist()) return
this.request()
}
})
},
request() {
var _data =this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/purchaseorder/Purchaseorder',
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/purchaseorder/Purchaseorder/'+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)
}
})
})
}
},
addpurchaseorder_item0List(){
let item = {
licensenum:undefined,
materialname:undefined,
pounttype:undefined,
netweight:undefined,
unit:undefined,
advance:undefined,
price:undefined,
settlement:undefined,
rate:undefined,
amount:undefined,
notamount:undefined,
remark:undefined,
}
this.dataForm.purchaseorder_item0List.push(item)
},
delpurchaseorder_item0List(index) {
this.dataForm.purchaseorder_item0List.splice(index, 1);
},
dataList(){
var _data = JSON.parse(JSON.stringify(this.dataForm));
for(let i=0;i<_data.purchaseorder_item0List.length;i++){
var _list = _data.purchaseorder_item0List[i];
}
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
for(let i=0;i<_dataAll.purchaseorder_item0List.length;i++){
var _list = _dataAll.purchaseorder_item0List[i];
}
this.dataForm = _dataAll
},
},
}
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/purchaseorder/Purchaseorder/' + 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) {
if (!this.purchaseorder_item0Exist()) return
this.request()
}
})
},
request() {
var _data = this.dataList()
if (!this.dataForm.id) {
request({
url: '/api/purchaseorder/Purchaseorder',
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/purchaseorder/Purchaseorder/' + 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)
}
})
})
}
},
addpurchaseorder_item0List() {
let item = {
licensenum: undefined,
materialname: undefined,
pounttype: undefined,
netweight: undefined,
unit: undefined,
advance: undefined,
price: undefined,
settlement: undefined,
rate: undefined,
amount: undefined,
notamount: undefined,
remark: undefined,
}
this.dataForm.purchaseorder_item0List.push(item)
},
delpurchaseorder_item0List(index) {
this.dataForm.purchaseorder_item0List.splice(index, 1);
},
dataList() {
var _data = JSON.parse(JSON.stringify(this.dataForm));
for (let i = 0; i < _data.purchaseorder_item0List.length; i++) {
var _list = _data.purchaseorder_item0List[i];
}
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
for (let i = 0; i < _dataAll.purchaseorder_item0List.length; i++) {
var _list = _dataAll.purchaseorder_item0List[i];
}
this.dataForm = _dataAll
},
},
}
</script>

@ -1,289 +1,365 @@
<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-input v-model="query.documentno" 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="documentno" label="单据编号" width="0" align="left"
/>
<el-table-column prop="erpno" label="ERP订单号" width="0" align="left"
/>
<el-table-column prop="contractname" label="合同名称" width="0" align="left"
/>
<el-table-column prop="suppliername" label="供应商名称" width="0" align="left"
/>
<el-table-column prop="amount" label="金额" width="0" align="left"
/>
<el-table-column prop="num" label="数量" width="0" align="left"
/>
<el-table-column label="币别 " width="0" prop="currency" algin="left"
>
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column prop="payprice" label="已付款金额" width="0" align="left"
/>
<el-table-column prop="invoicenum" label="发票数量" width="0" align="left"
/>
<el-table-column prop="invoiceamount" label="发票金额" width="0" align="left"
/>
<el-table-column prop="advanceamount" label="垫资金额" width="0" align="left"
/>
<el-table-column prop="creatortime" label="制单时间" width="0" align="left"
/>
<el-table-column label="单据状态" width="0" prop="status" algin="left"
>
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="制单人" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.documentno" 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="documentno" label="单据编号" width="0" align="left" />
<el-table-column prop="erpno" label="ERP订单号" width="0" align="left" />
<el-table-column prop="contractname" label="合同名称" width="0" align="left" />
<el-table-column prop="suppliername" label="供应商名称" width="0" align="left" />
<el-table-column prop="amount" label="金额" width="0" align="left" />
<el-table-column prop="num" label="数量" width="0" align="left" />
<el-table-column label="币别 " width="0" prop="currency" algin="left">
<template slot-scope="scope">
{{ scope.row.currency | dynamicText(currencyOptions) }}
</template>
</el-table-column>
<el-table-column prop="payprice" label="已付款金额" width="0" align="left" />
<el-table-column prop="invoicenum" label="发票数量" width="0" align="left" />
<el-table-column prop="invoiceamount" label="发票金额" width="0" align="left" />
<el-table-column prop="advanceamount" label="垫资金额" width="0" align="left" />
<el-table-column prop="creatortime" label="制单时间" width="0" align="left" />
<el-table-column label="单据状态" width="0" prop="status" algin="left">
<template slot-scope="scope">
{{ scope.row.status | dynamicText(statusOptions) }}
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="制单人" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
documentno: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: 'documentno', label: '单据编号'},
{prop: 'erpno', label: 'ERP订单号'},
{prop: 'contractname', label: '合同名称'},
{prop: 'suppliername', label: '供应商名称'},
{prop: 'amount', label: '金额'},
{prop: 'num', label: '数量'},
{prop: 'currency', label: '币别 '},
{prop: 'payprice', label: '已付款金额'},
{prop: 'invoicenum', label: '发票数量'},
{prop: 'invoiceamount', label: '发票金额'},
{prop: 'advanceamount', label: '垫资金额'},
{prop: 'creatortime', label: '制单时间'},
{prop: 'status', label: '单据状态'},
{prop: 'creatorusername', label: '制单人'},
],
currencyOptions:[{"fullName":"人民币","id":"0"},{"fullName":"美元","id":"1"},{"fullName":"英镑","id":"2"}],
currencyProps:{"label":"fullName","value":"id"},
statusOptions:[{"fullName":"已保存","id":"0"},{"fullName":"开票中","id":"1"},{"fullName":"付款申请","id":"2"},{"fullName":"待付款","id":"3"},{"fullName":"付款中","id":"4"},{"fullName":"归档","id":"5"}],
statusProps:{"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/purchaseorder/Purchaseorder/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
documentno: 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: 'documentno',
label: '单据编号'
},
{
prop: 'erpno',
label: 'ERP订单号'
},
{
prop: 'contractname',
label: '合同名称'
},
{
prop: 'suppliername',
label: '供应商名称'
},
{
prop: 'amount',
label: '金额'
},
{
prop: 'num',
label: '数量'
},
{
prop: 'currency',
label: '币别 '
},
{
prop: 'payprice',
label: '已付款金额'
},
{
prop: 'invoicenum',
label: '发票数量'
},
{
prop: 'invoiceamount',
label: '发票金额'
},
{
prop: 'advanceamount',
label: '垫资金额'
},
{
prop: 'creatortime',
label: '制单时间'
},
{
prop: 'status',
label: '单据状态'
},
{
prop: 'creatorusername',
label: '制单人'
},
],
currencyOptions: [{
"fullName": "人民币",
"id": "0"
}, {
"fullName": "美元",
"id": "1"
}, {
"fullName": "英镑",
"id": "2"
}],
currencyProps: {
"label": "fullName",
"value": "id"
},
statusOptions: [{
"fullName": "已保存",
"id": "0"
}, {
"fullName": "开票中",
"id": "1"
}, {
"fullName": "付款申请",
"id": "2"
}, {
"fullName": "待付款",
"id": "3"
}, {
"fullName": "付款中",
"id": "4"
}, {
"fullName": "归档",
"id": "5"
}],
statusProps: {
"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/purchaseorder/Purchaseorder/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseorder/Purchaseorder/${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/purchaseorder/Purchaseorder/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/purchaseorder/Purchaseorder/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/purchaseorder/Purchaseorder/${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/purchaseorder/Purchaseorder/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/purchaseorder/Purchaseorder/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>

@ -1,274 +1,270 @@
<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="600px">
<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="24" >
<el-form-item label="库区编码"
prop="areacode" >
<el-input v-model="dataForm.areacode"
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="24">
<el-form-item label="库区编码" prop="areacode">
<el-input v-model="dataForm.areacode" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="库区名称"
prop="areaname" >
<el-input v-model="dataForm.areaname"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="库区名称" prop="areaname">
<el-input v-model="dataForm.areaname" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="最高库存"
prop="maximum" >
<el-input-number v-model="dataForm.maximum"
placeholder="数字文本" :step="1" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="最高库存" prop="maximum">
<el-input-number v-model="dataForm.maximum" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="安全库存"
prop="safety" >
<el-input-number v-model="dataForm.safety"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="安全库存" prop="safety">
<el-input-number v-model="dataForm.safety" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="最低库存"
prop="minimum" >
<el-input-number v-model="dataForm.minimum"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="最低库存" prop="minimum">
<el-input-number v-model="dataForm.minimum" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="计量单位"
prop="unit" >
<el-select v-model="dataForm.unit"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="计量单位" prop="unit">
<el-select v-model="dataForm.unit" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in unitOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="仓库"
prop="warehouseId" >
<popupSelect v-model="dataForm.warehouseId"
placeholder="请选择" clearable field="warehouseId" interfaceId="380988259175524165" :columnOptions="warehouseIdcolumnOptions" propsValue="id" relationField="name" popupType="dialog"
popupTitle="选择数据" popupWidth="800px">
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="仓库" prop="warehouseId">
<popupSelect v-model="dataForm.warehouseId" placeholder="请选择" clearable field="warehouseId"
interfaceId="380988259175524165" :columnOptions="warehouseIdcolumnOptions"
propsValue="id" relationField="name" popupType="dialog" popupTitle="选择数据"
popupWidth="800px">
</popupSelect >
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="组织"
prop="orgnizeId" >
<com-select v-model="dataForm.orgnizeId"
placeholder="请选择" clearable >
</popupSelect>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="组织" prop="orgnizeId">
<com-select v-model="dataForm.orgnizeId" placeholder="请选择" clearable>
</com-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="部门"
prop="departmentId" >
<dep-select v-model="dataForm.departmentId"
placeholder="请选择" clearable >
</com-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="部门" prop="departmentId">
<dep-select v-model="dataForm.departmentId" placeholder="请选择" clearable>
</dep-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</dep-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<el-date-picker v-model="dataForm.lastmodifytime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<el-input v-model="dataForm.lastmodifyusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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-input>
</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>
</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: {
areacode : '',
areaname : '',
maximum : 1,
safety : 1,
minimum : 1,
unit : "",
warehouseId : "",
orgnizeId : '',
departmentId : '',
creatortime : '',
creatorusername : '',
lastmodifytime : '',
lastmodifyusername : '',
},
rules:
{
areacode: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
warehouseIdcolumnOptions:[ {"label":"ID","value":"id"}, {"label":"仓库号","value":"code"}, {"label":"仓库名称","value":"name"},],
}
},
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/reservoirarea/Reservoirarea/'+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/reservoirarea/Reservoirarea',
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/reservoirarea/Reservoirarea/'+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));
_data.orgnizeId = JSON.stringify(_data.orgnizeId)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.orgnizeId = JSON.parse( _dataAll.orgnizeId)
this.dataForm = _dataAll
},
},
}
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: {
areacode: '',
areaname: '',
maximum: 1,
safety: 1,
minimum: 1,
unit: "",
warehouseId: "",
orgnizeId: '',
departmentId: '',
creatortime: '',
creatorusername: '',
lastmodifytime: '',
lastmodifyusername: '',
},
rules: {
areacode: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
warehouseIdcolumnOptions: [{
"label": "ID",
"value": "id"
}, {
"label": "仓库号",
"value": "code"
}, {
"label": "仓库名称",
"value": "name"
}, ],
}
},
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/reservoirarea/Reservoirarea/' + 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/reservoirarea/Reservoirarea',
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/reservoirarea/Reservoirarea/' + 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));
_data.orgnizeId = JSON.stringify(_data.orgnizeId)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.orgnizeId = JSON.parse(_dataAll.orgnizeId)
this.dataForm = _dataAll
},
},
}
</script>

@ -1,286 +1,336 @@
<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-input v-model="query.areacode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="库区名称">
<el-input v-model="query.areaname" 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="areacode" label="库区编码" width="0" align="left"
/>
<el-table-column prop="areaname" label="库区名称" width="0" align="left"
/>
<el-table-column prop="maximum" label="最高库存" width="0" align="left"
/>
<el-table-column prop="safety" label="安全库存" width="0" align="left"
/>
<el-table-column prop="minimum" label="最低库存" width="0" align="left"
/>
<el-table-column label="计量单位" width="0" prop="unit" algin="left"
>
<template slot-scope="scope">
{{ scope.row.unit | dynamicText(unitOptions) }}
</template>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库" width="0" align="left"
/>
<el-table-column prop="orgnizeId" label="组织" width="0" align="left"
/>
<el-table-column prop="departmentId" label="部门" width="0" align="left"
/>
<el-table-column prop="creatortime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left"
/>
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left"
/>
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.areacode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="库区名称">
<el-input v-model="query.areaname" 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="areacode" label="库区编码" width="0" align="left" />
<el-table-column prop="areaname" label="库区名称" width="0" align="left" />
<el-table-column prop="maximum" label="最高库存" width="0" align="left" />
<el-table-column prop="safety" label="安全库存" width="0" align="left" />
<el-table-column prop="minimum" label="最低库存" width="0" align="left" />
<el-table-column label="计量单位" width="0" prop="unit" algin="left">
<template slot-scope="scope">
{{ scope.row.unit | dynamicText(unitOptions) }}
</template>
</el-table-column>
<el-table-column prop="warehouseId" label="仓库" width="0" align="left" />
<el-table-column prop="orgnizeId" label="组织" width="0" align="left" />
<el-table-column prop="departmentId" label="部门" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
areacode:undefined,
areaname: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: 'areacode', label: '库区编码'},
{prop: 'areaname', label: '库区名称'},
{prop: 'maximum', label: '最高库存'},
{prop: 'safety', label: '安全库存'},
{prop: 'minimum', label: '最低库存'},
{prop: 'unit', label: '计量单位'},
{prop: 'warehouseId', label: '仓库'},
{prop: 'orgnizeId', label: '组织'},
{prop: 'departmentId', label: '部门'},
{prop: 'creatortime', label: '创建时间'},
{prop: 'creatorusername', label: '创建人名称'},
{prop: 'lastmodifytime', label: '修改时间'},
{prop: 'lastmodifyusername', label: '修改人名称'},
],
unitOptions:[{"fullName":"吨","id":"0"},{"fullName":"千克","id":"1"}],
unitProps:{"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/reservoirarea/Reservoirarea/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
areacode: undefined,
areaname: 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: 'areacode',
label: '库区编码'
},
{
prop: 'areaname',
label: '库区名称'
},
{
prop: 'maximum',
label: '最高库存'
},
{
prop: 'safety',
label: '安全库存'
},
{
prop: 'minimum',
label: '最低库存'
},
{
prop: 'unit',
label: '计量单位'
},
{
prop: 'warehouseId',
label: '仓库'
},
{
prop: 'orgnizeId',
label: '组织'
},
{
prop: 'departmentId',
label: '部门'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
],
unitOptions: [{
"fullName": "吨",
"id": "0"
}, {
"fullName": "千克",
"id": "1"
}],
unitProps: {
"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/reservoirarea/Reservoirarea/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/reservoirarea/Reservoirarea/${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/reservoirarea/Reservoirarea/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/reservoirarea/Reservoirarea/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/reservoirarea/Reservoirarea/${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/reservoirarea/Reservoirarea/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/reservoirarea/Reservoirarea/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>

@ -1,266 +1,264 @@
<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="24" >
<el-form-item label-width="0">
<JNPF-Text :style='{"width":"100%"}'
:textStyle='{"color":"#000000","font-weight":"bold","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}' value="供应商编辑">
</JNPF-Text>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="供应商编码"
prop="supplierCode" >
<el-input v-model="dataForm.supplierCode"
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="24">
<el-form-item label-width="0">
<JNPF-Text :style='{"width":"100%"}'
:textStyle='{"color":"#000000","font-weight":"bold","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}'
value="供应商编辑">
</JNPF-Text>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商编码" prop="supplierCode">
<el-input v-model="dataForm.supplierCode" placeholder="请输入供应商编码" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="供应商名称"
prop="supplierName" >
<el-input v-model="dataForm.supplierName"
placeholder="请输入供应商名称" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供应商名称" prop="supplierName">
<el-input v-model="dataForm.supplierName" placeholder="请输入供应商名称" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="地点ID"
prop="supplierSiteId" >
<el-input v-model="dataForm.supplierSiteId"
placeholder="请输入供应商地点ID" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地点ID" prop="supplierSiteId">
<el-input v-model="dataForm.supplierSiteId" placeholder="请输入供应商地点ID" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="地点名称"
prop="supplierSiteCode" >
<el-input v-model="dataForm.supplierSiteCode"
placeholder="请输入供应商地点名称" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地点名称" prop="supplierSiteCode">
<el-input v-model="dataForm.supplierSiteCode" placeholder="请输入供应商地点名称" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="所属公司编码"
prop="companyId" >
<el-input v-model="dataForm.companyId"
placeholder="请输入所属公司编码" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属公司编码" prop="companyId">
<el-input v-model="dataForm.companyId" placeholder="请输入所属公司编码" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="所属公司名称"
prop="companyName" >
<el-input v-model="dataForm.companyName"
placeholder="请输入公司名称" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属公司名称" prop="companyName">
<el-input v-model="dataForm.companyName" placeholder="请输入公司名称" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="联系人"
prop="contactName" >
<el-input v-model="dataForm.contactName"
placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系人" prop="contactName">
<el-input v-model="dataForm.contactName" placeholder="请输入联系人" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="联系电话"
prop="contactPhone" >
<el-input v-model="dataForm.contactPhone"
placeholder="请输入联系电话" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="contactPhone">
<el-input v-model="dataForm.contactPhone" placeholder="请输入联系电话" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="供应商等级"
prop="supplierLevel" >
<el-select v-model="dataForm.supplierLevel"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in supplierLevelOptions" :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="supplierLevel">
<el-select v-model="dataForm.supplierLevel" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in supplierLevelOptions" :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="address" >
<el-input v-model="dataForm.address"
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="地址" prop="address">
<el-input v-model="dataForm.address" placeholder="请输入地址" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="启用"
prop="status" >
<el-switch v-model="dataForm.status"
:active-value="1" :inactive-value="0" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="启用" prop="status">
<el-switch v-model="dataForm.status" :active-value="1" :inactive-value="0">
</el-switch>
</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-switch>
</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>
</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: {
supplierCode : '',
supplierName : '',
supplierSiteId : '',
supplierSiteCode : '',
companyId : '',
companyName : '',
contactName : '',
contactPhone : '',
supplierLevel : "1",
address : '',
status : 1,
},
rules:
{
supplierCode: [
{
required: true,
message: '请输入供应商编码',
trigger: 'blur'
},
],
supplierName: [
{
required: true,
message: '请输入供应商名称',
trigger: 'blur'
},
],
},
supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
}
},
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/supplier/Supplier/'+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/supplier/Supplier',
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/supplier/Supplier/'+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));
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.status = parseInt( _dataAll.status)
this.dataForm = _dataAll
},
},
}
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: {
supplierCode: '',
supplierName: '',
supplierSiteId: '',
supplierSiteCode: '',
companyId: '',
companyName: '',
contactName: '',
contactPhone: '',
supplierLevel: "1",
address: '',
status: 1,
},
rules: {
supplierCode: [{
required: true,
message: '请输入供应商编码',
trigger: 'blur'
}, ],
supplierName: [{
required: true,
message: '请输入供应商名称',
trigger: 'blur'
}, ],
},
supplierLevelOptions: [{
"fullName": "一级",
"id": "1"
}, {
"fullName": "二级",
"id": "2"
}, {
"fullName": "三级",
"id": "3"
}, {
"fullName": "四级",
"id": "4"
}],
}
},
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/supplier/Supplier/' + 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/supplier/Supplier',
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/supplier/Supplier/' + 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));
_data.status = parseInt(_data.status)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.status = parseInt(_dataAll.status)
this.dataForm = _dataAll
},
},
}
</script>

@ -1,293 +1,345 @@
<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-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商名称">
<el-input v-model="query.supplierName" 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="supplierCode" label="供应商编码" width="0" align="left"
sortable="custom" />
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
sortable="custom" />
<el-table-column prop="supplierSiteId" label="地点ID" width="0" align="left"
sortable="custom" />
<el-table-column prop="supplierSiteCode" label="地点名称" width="0" align="left"
sortable="custom" />
<el-table-column prop="companyId" label="所属公司编码" width="0" align="left"
sortable="custom" />
<el-table-column prop="companyName" label="所属公司名称" width="0" align="left"
sortable="custom" />
<el-table-column prop="contactName" label="联系人" width="0" align="left"
sortable="custom" />
<el-table-column prop="contactPhone" label="联系电话" width="0" align="left"
sortable="custom" />
<el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left"
sortable="custom" >
<template slot-scope="scope">
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
</template>
</el-table-column>
<el-table-column prop="address" label="地址" width="0" align="left"
sortable="custom" />
<!-- <el-table-column prop="status" label="启用" width="0" align="left"
<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-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="供应商名称">
<el-input v-model="query.supplierName" 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="supplierCode" label="供应商编码" width="0" align="left" sortable="custom" />
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left" sortable="custom" />
<el-table-column prop="supplierSiteId" label="地点ID" width="0" align="left" sortable="custom" />
<el-table-column prop="supplierSiteCode" label="地点名称" width="0" align="left" sortable="custom" />
<el-table-column prop="companyId" label="所属公司编码" width="0" align="left" sortable="custom" />
<el-table-column prop="companyName" label="所属公司名称" width="0" align="left" sortable="custom" />
<el-table-column prop="contactName" label="联系人" width="0" align="left" sortable="custom" />
<el-table-column prop="contactPhone" label="联系电话" width="0" align="left" sortable="custom" />
<el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left" sortable="custom">
<template slot-scope="scope">
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
</template>
</el-table-column>
<el-table-column prop="address" label="地址" width="0" align="left" sortable="custom" />
<!-- <el-table-column prop="status" label="启用" width="0" align="left"
sortable="custom" /> -->
<el-table-column prop="status" label="状态" width="0" align="left">
<template slot-scope="scope">
<el-tag type="success" disable-transitions v-if="scope.row.status == 1">
</el-tag>
<el-tag type="danger" disable-transitions v-else></el-tag>
</template>
</el-table-column>
<el-table-column prop="status" label="状态" width="0" align="left">
<template slot-scope="scope">
<el-tag type="success" disable-transitions v-if="scope.row.status == 1">
</el-tag>
<el-tag type="danger" disable-transitions v-else></el-tag>
</template>
</el-table-column>
<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>
<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: {
supplierCode:undefined,
supplierName:undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "supplierCode",
},
formVisible: false,
exportBoxVisible: false,
columnList: [
{prop: 'supplierCode', label: '供应商编码'},
{prop: 'supplierName', label: '供应商名称'},
{prop: 'supplierSiteId', label: '地点ID'},
{prop: 'supplierSiteCode', label: '地点名称'},
{prop: 'companyId', label: '所属公司编码'},
{prop: 'companyName', label: '所属公司名称'},
{prop: 'contactName', label: '联系人'},
{prop: 'contactPhone', label: '联系电话'},
{prop: 'supplierLevel', label: '供应商等级'},
{prop: 'address', label: '地址'},
{prop: 'status', label: '启用'},
],
supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
supplierLevelProps:{"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/supplier/Supplier/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
supplierCode: undefined,
supplierName: undefined,
},
treeProps: {
children: 'children',
label: 'fullName',
value: 'id'
},
list: [],
listLoading: true,
multipleSelection: [],
total: 0,
listQuery: {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "supplierCode",
},
formVisible: false,
exportBoxVisible: false,
columnList: [{
prop: 'supplierCode',
label: '供应商编码'
},
{
prop: 'supplierName',
label: '供应商名称'
},
{
prop: 'supplierSiteId',
label: '地点ID'
},
{
prop: 'supplierSiteCode',
label: '地点名称'
},
{
prop: 'companyId',
label: '所属公司编码'
},
{
prop: 'companyName',
label: '所属公司名称'
},
{
prop: 'contactName',
label: '联系人'
},
{
prop: 'contactPhone',
label: '联系电话'
},
{
prop: 'supplierLevel',
label: '供应商等级'
},
{
prop: 'address',
label: '地址'
},
{
prop: 'status',
label: '启用'
},
],
supplierLevelOptions: [{
"fullName": "一级",
"id": "1"
}, {
"fullName": "二级",
"id": "2"
}, {
"fullName": "三级",
"id": "3"
}, {
"fullName": "四级",
"id": "4"
}],
supplierLevelProps: {
"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/supplier/Supplier/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/supplier/Supplier/${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/supplier/Supplier/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/supplier/Supplier/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: "supplierCode",
}
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/supplier/Supplier/${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/supplier/Supplier/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/supplier/Supplier/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: "supplierCode",
}
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>

@ -1,388 +1,374 @@
<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="800px">
<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="materialCode" >
<relationForm v-model="dataForm.materialCode"
placeholder="请选择" clearable field="materialCode" modelId ="294090217084722181" :columnOptions="materialCodecolumnOptions" relationField="selectField121" >
<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="materialCode">
<relationForm v-model="dataForm.materialCode" placeholder="请选择" clearable
field="materialCode" modelId="294090217084722181"
:columnOptions="materialCodecolumnOptions" relationField="selectField121">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="物料名称"
prop="materialName" >
<el-input v-model="dataForm.materialName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="dataForm.materialName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="销售合同"
prop="salesName" >
<relationForm v-model="dataForm.salesName"
placeholder="请选择" clearable field="salesName" modelId ="294090217084722181" :columnOptions="salesNamecolumnOptions" relationField="selectField121" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售合同" prop="salesName">
<relationForm v-model="dataForm.salesName" placeholder="请选择" clearable field="salesName"
modelId="294090217084722181" :columnOptions="salesNamecolumnOptions"
relationField="selectField121">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="客户名称"
prop="customerName" >
<el-input v-model="dataForm.customerName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="客户名称" prop="customerName">
<el-input v-model="dataForm.customerName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="是否垫资"
prop="advance" >
<el-select v-model="dataForm.advance"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :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="advance">
<el-select v-model="dataForm.advance" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in advanceOptions" :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="salesPrice" >
<el-input v-model="dataForm.salesPrice"
placeholder="数字文本" clearable :style='{"width":"100%"}' >
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="销售价格" prop="salesPrice">
<el-input-number v-model="dataForm.salesPrice" placeholder="数字文本" :step="1">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="运输方式"
prop="transportType" >
<el-select v-model="dataForm.transportType"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in transportTypeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运输方式" prop="transportType">
<el-select v-model="dataForm.transportType" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in transportTypeOptions" :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="departmentId" >
<el-input-number v-model="dataForm.departmentId"
placeholder="数字文本" :step="1" >
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="运费" prop="departmentId">
<el-input-number v-model="dataForm.departmentId" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="车号"
prop="licenseNo" >
<relationForm v-model="dataForm.licenseNo"
placeholder="请选择" clearable field="licenseNo" modelId ="294090217084722181" :columnOptions="licenseNocolumnOptions" relationField="selectField122" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车号" prop="licenseNo">
<relationForm v-model="dataForm.licenseNo" placeholder="请选择" clearable field="licenseNo"
modelId="294090217084722181" :columnOptions="licenseNocolumnOptions"
relationField="selectField122">
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="业务员名称"
prop="businessName" >
<el-input v-model="dataForm.businessName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</relationForm>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="业务员名称" prop="businessName">
<el-input v-model="dataForm.businessName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="磅单图片"
prop="poundPictures" >
<JNPF-UploadImg v-model="dataForm.poundPictures"
:fileSize="500" sizeUnit="MB" :limit="9" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="磅单图片" prop="poundPictures">
<JNPF-UploadImg v-model="dataForm.poundPictures" :fileSize="500" sizeUnit="MB" :limit="9">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="皮重"
prop="tareWeight" >
<el-input-number v-model="dataForm.tareWeight"
placeholder="数字文本" :step="1" >
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="皮重" prop="tareWeight">
<el-input-number v-model="dataForm.tareWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="毛重"
prop="grossWeight" >
<el-input-number v-model="dataForm.grossWeight"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="毛重" prop="grossWeight">
<el-input-number v-model="dataForm.grossWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="扣重"
prop="buckleWeight" >
<el-input-number v-model="dataForm.buckleWeight"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="扣重" prop="buckleWeight">
<el-input-number v-model="dataForm.buckleWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12" >
<el-form-item label="净重"
prop="netWeight" >
<el-input-number v-model="dataForm.netWeight"
placeholder="数字文本" :step="1" >
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="净重" prop="netWeight">
<el-input-number v-model="dataForm.netWeight" placeholder="数字文本" :step="1">
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="备注"
prop="remark" >
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input-number>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="司机名称"
prop="driverName" >
<el-input v-model="dataForm.driverName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="司机名称" prop="driverName">
<el-input v-model="dataForm.driverName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="车辆图片"
prop="vehiclePictures" >
<JNPF-UploadImg v-model="dataForm.vehiclePictures"
:fileSize="500" sizeUnit="MB" :limit="9" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="车辆图片" prop="vehiclePictures">
<JNPF-UploadImg v-model="dataForm.vehiclePictures" :fileSize="500" sizeUnit="MB" :limit="9">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="制单人"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JNPF-UploadImg>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="制单人" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</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-input>
</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>
</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: {
materialCode : "",
materialName : '',
salesName : "",
customerName : '',
advance : "",
salesPrice : '',
transportType : "",
departmentId : 11.225,
licenseNo : "",
businessName : '',
poundPictures : [],
tareWeight : '',
grossWeight : '',
buckleWeight : '',
netWeight : '',
remark : '',
driverName : '',
vehiclePictures : [],
creatorusername : '',
},
rules:
{
materialCode: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
salesName: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
licenseNo: [
{
required: true,
message: '请选择',
trigger: 'change'
},
],
// poundPictures: [
// {
// required: true,
// message: '',
// trigger: 'click'
// },
// ],
tareWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
grossWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
buckleWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
netWeight: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
},
materialCodecolumnOptions:[ {"label":"事件等级","value":"selectField121"},],
salesNamecolumnOptions:[ {"label":"事件等级","value":"selectField121"},],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
licenseNocolumnOptions:[ {"label":"事件级别","value":"selectField122"},],
}
},
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/tradeupload/Tradeupload/'+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/tradeupload/Tradeupload',
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/tradeupload/Tradeupload/'+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));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.poundPictures = JSON.parse( _dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse( _dataAll.vehiclePictures)
this.dataForm = _dataAll
},
},
}
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: {
materialCode: "",
materialName: '',
salesName: "",
customerName: '',
advance: "",
salesPrice: '',
transportType: "",
departmentId: 11.225,
licenseNo: "",
businessName: '',
poundPictures: [],
tareWeight: '',
grossWeight: '',
buckleWeight: '',
netWeight: '',
remark: '',
driverName: '',
vehiclePictures: [],
creatorusername: '',
},
rules: {
materialCode: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
salesName: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
licenseNo: [{
required: true,
message: '请选择',
trigger: 'change'
}, ],
// poundPictures: [
// {
// required: true,
// message: '',
// trigger: 'click'
// },
// ],
tareWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
grossWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
buckleWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
netWeight: [{
required: true,
message: '数字文本',
trigger: ["blur", "change"]
}, ],
},
materialCodecolumnOptions: [{
"label": "事件等级",
"value": "selectField121"
}, ],
salesNamecolumnOptions: [{
"label": "事件等级",
"value": "selectField121"
}, ],
advanceOptions: [{
"fullName": "是",
"id": "1"
}, {
"fullName": "否",
"id": "0"
}],
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
licenseNocolumnOptions: [{
"label": "事件级别",
"value": "selectField122"
}, ],
}
},
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/tradeupload/Tradeupload/' + 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/tradeupload/Tradeupload',
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/tradeupload/Tradeupload/' + 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));
_data.poundPictures = JSON.stringify(_data.poundPictures)
_data.vehiclePictures = JSON.stringify(_data.vehiclePictures)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.poundPictures = JSON.parse(_dataAll.poundPictures)
_dataAll.vehiclePictures = JSON.parse(_dataAll.vehiclePictures)
this.dataForm = _dataAll
},
},
}
</script>

@ -1,295 +1,393 @@
<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-input v-model="query.materialName" 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="licenseNo" label="车号" width="0" align="left"
/>
<el-table-column prop="materialName" 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="driverName" label="司机名称" width="0" align="left"
/>
<el-table-column prop="customerName" label="客户名称" width="0" align="left"
/>
<el-table-column prop="salesName" 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="departmentId" 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="businessName" label="业务员名称" width="0" align="left"
/>
<el-table-column prop="remark" label="备注" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-input v-model="query.materialName" 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="licenseNo" label="车号" width="0" align="left" />
<el-table-column prop="materialName" 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="driverName" label="司机名称" width="0" align="left" />
<el-table-column prop="customerName" label="客户名称" width="0" align="left" />
<el-table-column prop="salesName" 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="departmentId" 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="businessName" label="业务员" width="0" align="left" />
<el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column prop="poundPictures" label="磅单图片" width="0" align="left">
<template slot-scope="scope">
<span v-for="(item,index) in JSON.parse(scope.row.poundPictures)" :key="index">
<el-popover placement="bottom" trigger="click" width="1000">
<img :src="`/dev${item.url}`" width="100%" />
<img
slot="reference"
:src="`/dev${item.url}`"
:alt="`/dev${item.url}`"
style="max-height: 70px;max-width: 70px; padding: 5px"
/>
</el-popover>
</span>
</template>
</el-table-column>
<el-table-column prop="vehiclePictures" label="车辆图片" width="0" align="left">
<template slot-scope="scope">
<span v-for="(item,index) in JSON.parse(scope.row.vehiclePictures)" :key="index">
<el-popover placement="bottom" trigger="click" width="1000">
<img :src="`/dev${item.url}`" width="100%" />
<img
slot="reference"
:src="`/dev${item.url}`"
:alt="`/dev${item.url}`"
style="max-height: 70px;max-width: 70px; padding: 5px"
/>
</el-popover>
</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
materialName: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: 'licenseNo', label: '车号'},
{prop: 'materialName', label: '物料名称'},
{prop: 'grossWeight', label: '毛重'},
{prop: 'tareWeight', label: '皮重'},
{prop: 'buckleWeight', label: '扣重'},
{prop: 'netWeight', label: '净重'},
{prop: 'driverName', label: '司机名称'},
{prop: 'customerName', label: '客户名称'},
{prop: 'salesName', label: '销售合同'},
{prop: 'advance', label: '是否垫资'},
{prop: 'transportType', label: '运输方式'},
{prop: 'departmentId', label: '运费'},
{prop: 'salesPrice', label: '销售价格'},
{prop: 'creatorusername', label: '制单人'},
{prop: 'businessName', label: '业务员名称'},
{prop: 'remark', label: '备注'},
],
advanceOptions:[{"fullName":"是","id":"1"},{"fullName":"否","id":"0"}],
advanceProps:{"label":"fullName","value":"id"},
transportTypeOptions:[{"fullName":"汽运","id":"0"},{"fullName":"船运","id":"1"},{"fullName":"火车","id":"2"}],
transportTypeProps:{"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++){
let _data = res.data.list[i];
_list.push(_data)
}
this.list = _list
this.total = res.data.pagination.total
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
materialName: 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: 'licenseNo',
label: '车号'
},
{
prop: 'materialName',
label: '物料名称'
},
{
prop: 'grossWeight',
label: '毛重'
},
{
prop: 'tareWeight',
label: '皮重'
},
{
prop: 'buckleWeight',
label: '扣重'
},
{
prop: 'netWeight',
label: '净重'
},
{
prop: 'driverName',
label: '司机名称'
},
{
prop: 'customerName',
label: '客户名称'
},
{
prop: 'salesName',
label: '销售合同'
},
{
prop: 'advance',
label: '是否垫资'
},
{
prop: 'transportType',
label: '运输方式'
},
{
prop: 'departmentId',
label: '运费'
},
{
prop: 'salesPrice',
label: '销售价格'
},
{
prop: 'creatorusername',
label: '制单人'
},
{
prop: 'businessName',
label: '业务员名称'
},
{
prop: 'remark',
label: '备注'
},
],
advanceOptions: [{
"fullName": "是",
"id": "1"
}, {
"fullName": "否",
"id": "0"
}],
advanceProps: {
"label": "fullName",
"value": "id"
},
transportTypeOptions: [{
"fullName": "汽运",
"id": "0"
}, {
"fullName": "船运",
"id": "1"
}, {
"fullName": "火车",
"id": "2"
}],
transportTypeProps: {
"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++) {
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.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
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.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
for (let key in this.query) {
this.query[key] = undefined
}
this.search()
}
}
}
</script>

@ -1,55 +1,50 @@
<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="600px">
<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="24" >
<el-form-item label-width="0">
<JNPF-Text :style='{"width":"100%"}'
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}' value="车辆信息">
</JNPF-Text>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="车牌号"
prop="ticketno" >
<el-input v-model="dataForm.ticketno"
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="24">
<el-form-item label-width="0">
<JNPF-Text :style='{"width":"100%"}'
:textStyle='{"color":"#000000","font-weight":"normal","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}'
value="车辆信息">
</JNPF-Text>
</el-form-item>
</el-col> -->
<el-col :span="24">
<el-form-item label="车牌号" prop="ticketno">
<el-input v-model="dataForm.ticketno" placeholder="请输入车牌号" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="司机名称"
prop="drivername" >
<el-input v-model="dataForm.drivername"
placeholder="请输入司机名称" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="司机名称" prop="drivername">
<el-input v-model="dataForm.drivername" placeholder="请输入司机名称" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="手机号"
prop="contact" >
<el-input v-model="dataForm.contact"
placeholder="请输入手机号" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="手机号" prop="contact">
<el-input v-model="dataForm.contact" placeholder="请输入手机号" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="车辆照片"
prop="vehiclephotos" >
<JNPF-UploadImg v-model="dataForm.vehiclephotos"
:fileSize="5" sizeUnit="MB" :limit="9" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="车辆照片" prop="vehiclephotos">
<JNPF-UploadImg v-model="dataForm.vehiclephotos" :fileSize="5" sizeUnit="MB" :limit="9">
</JNPF-UploadImg>
</el-form-item>
</el-col>
<!-- <el-col :span="12" >
</JNPF-UploadImg>
</el-form-item>
</el-col>
<!-- <el-col :span="12" >
<el-form-item label="录入人"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
@ -67,148 +62,153 @@
</el-input>
</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>
</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>
</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: {
ticketno : '',
drivername : '',
contact : '',
vehiclephotos : [{"name":"006-1 (3).jpg","url":"/api/file/Image/annex/20230105_380637081082287813.jpg","fileId":"20230105_380637081082287813.jpg"},{"name":"微信图片_20220617141029.jpg","url":"/api/file/Image/annex/20230105_380637561959241413.jpg","fileId":"20230105_380637561959241413.jpg"}],
creatorusername : '',
creatortime : "",
},
rules:
{
ticketno: [
{
required: true,
message: '请输入车牌号',
trigger: 'blur'
},
],
drivername: [
{
required: true,
message: '请输入司机名称',
trigger: 'blur'
},
],
},
}
},
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/Vehicle/'+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/Vehicle',
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/Vehicle/'+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));
_data.vehiclephotos = JSON.stringify(_data.vehiclephotos)
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
_dataAll.vehiclephotos = JSON.parse( _dataAll.vehiclephotos)
this.dataForm = _dataAll
},
},
}
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: {
ticketno: '',
drivername: '',
contact: '',
vehiclephotos: [{
"name": "006-1 (3).jpg",
"url": "/api/file/Image/annex/20230105_380637081082287813.jpg",
"fileId": "20230105_380637081082287813.jpg"
}, {
"name": "微信图片_20220617141029.jpg",
"url": "/api/file/Image/annex/20230105_380637561959241413.jpg",
"fileId": "20230105_380637561959241413.jpg"
}],
creatorusername: '',
creatortime: "",
},
rules: {
ticketno: [{
required: true,
message: '请输入车牌号',
trigger: 'blur'
}, ],
drivername: [{
required: true,
message: '请输入司机名称',
trigger: 'blur'
}, ],
},
}
},
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/Vehicle/' + 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/Vehicle',
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/Vehicle/' + 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));
_data.vehiclephotos = JSON.stringify(_data.vehiclephotos)
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
_dataAll.vehiclephotos = JSON.parse(_dataAll.vehiclephotos)
this.dataForm = _dataAll
},
},
}
</script>

@ -47,10 +47,9 @@
<el-table-column prop="drivername" label="司机名称" width="0" align="left" />
<el-table-column prop="contact" label="手机号" width="0" align="left" />
<el-table-column prop="vehiclephotos" label="车辆照片" width="0" align="left">
<template slot-scope="scope">
<span v-for="(item,index) in JSON.parse(scope.row.vehiclephotos)" :key="index">
<el-popover placement="left" trigger="click" width="300">
<el-popover placement="bottom" trigger="click" width="1000">
<img :src="`/dev${item.url}`" width="100%" />
<img
slot="reference"
@ -61,7 +60,6 @@
</el-popover>
</span>
</template>
</el-table-column>
<el-table-column prop="creatorusername" label="录入人" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />

@ -1,299 +1,336 @@
<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="800px">
<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="24" >
<el-form-item label="仓库编码"
prop="code" >
<el-input v-model="dataForm.code"
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="150px"
label-position="right">
<template v-if="!loading">
<el-col :span="24">
<el-form-item label="仓库编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="公司代码"
prop="companyCode" >
<el-input v-model="dataForm.companyCode"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="公司代码" prop="companyCode">
<el-input v-model="dataForm.companyCode" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="公司名称"
prop="companyName" >
<el-input v-model="dataForm.companyName"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="公司名称" prop="companyName">
<el-input v-model="dataForm.companyName" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="仓库位置"
prop="location" >
<el-input v-model="dataForm.location"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="仓库位置" prop="location">
<el-input v-model="dataForm.location" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="仓库类型"
prop="type" >
<el-select v-model="dataForm.type"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="仓库类型" prop="type">
<el-select v-model="dataForm.type" placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in typeOptions" :key="index" :label="item.fullName"
:value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="ERP库存组织"
prop="organization" >
<el-select v-model="dataForm.organization"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in organizationOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ERP库存组织" prop="organization">
<el-select v-model="dataForm.organization" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in organizationOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="ERP子库"
prop="sublibrary" >
<el-select v-model="dataForm.sublibrary"
placeholder="请选择" clearable :style='{"width":"100%"}'>
<el-option v-for="(item, index) in sublibraryOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ERP子库" prop="sublibrary">
<el-select v-model="dataForm.sublibrary" placeholder="请选择" clearable
:style='{"width":"100%"}'>
<el-option v-for="(item, index) in sublibraryOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="激活状态 "
prop="activestate" >
<el-radio-group v-model="dataForm.activestate"
size="small" >
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id" :disabled="item.disabled" >
{{item.fullName}}
</el-radio>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="激活状态 " prop="activestate">
<!-- <el-radio-group v-model="dataForm.activestate" size="small">
<el-radio v-for="(item, index) in activestateOptions" :key="index" :label="item.id"
:disabled="item.disabled">
{{item.fullName}}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="备注"
prop="remark" >
<el-input v-model="dataForm.remark"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-radio-group> -->
<el-switch v-model="dataForm.activestate" :active-value="1" :inactive-value="0">
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建人名称"
prop="creatorusername" >
<el-input v-model="dataForm.creatorusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-switch>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="创建时间"
prop="creatortime" >
<el-date-picker v-model="dataForm.creatortime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建人名称" prop="creatorusername">
<el-input v-model="dataForm.creatorusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改人名称"
prop="lastmodifyusername" >
<el-input v-model="dataForm.lastmodifyusername"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="创建时间" prop="creatortime">
<el-date-picker v-model="dataForm.creatortime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-input>
</el-form-item>
</el-col>
<el-col :span="24" >
<el-form-item label="修改时间"
prop="lastmodifytime" >
<el-date-picker v-model="dataForm.lastmodifytime"
placeholder="请选择" clearable :style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss" value-format="timestamp" >
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改人名称" prop="lastmodifyusername">
<el-input v-model="dataForm.lastmodifyusername" placeholder="请输入" clearable
:style='{"width":"100%"}'>
</el-date-picker>
</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-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="修改时间" prop="lastmodifytime">
<el-date-picker v-model="dataForm.lastmodifytime" placeholder="请选择" clearable
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss"
value-format="timestamp">
</el-date-picker>
</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>
</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: {
code : '',
companyCode : '',
companyName : '',
location : '',
type : "",
organization : "",
sublibrary : "",
activestate : "2",
remark : '',
creatorusername : '',
creatortime : '',
lastmodifyusername : '',
lastmodifytime : '',
},
rules:
{
code: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
type: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
organization: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
sublibrary: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
organizationOptions:[{"fullName":"济钢集团","id":"0"},{"fullName":"日照","id":"1"}],
sublibraryOptions:[{"fullName":"城市矿产钢材库","id":"0"},{"fullName":"黄河爆破待发库","id":"1"},{"fullName":"黄河爆破完工库","id":"2"}],
activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
}
},
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/warehouse/Warehouse/'+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/warehouse/Warehouse',
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/warehouse/Warehouse/'+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
},
},
}
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: {
code: '',
companyCode: '',
companyName: '',
location: '',
type: "",
organization: "",
sublibrary: "",
activestate: "1",
remark: '',
creatorusername: '',
creatortime: '',
lastmodifyusername: '',
lastmodifytime: '',
},
rules: {
code: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
type: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
organization: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
sublibrary: [{
required: true,
message: '请输入',
trigger: 'blur'
}, ],
},
typeOptions: [{
"fullName": "原料库",
"id": "0"
}, {
"fullName": "中间库",
"id": "1"
}, {
"fullName": "成品库",
"id": "2"
}, {
"fullName": "副产品库",
"id": "3"
}, {
"fullName": "废次品库",
"id": "4"
}, {
"fullName": "备件辅材库",
"id": "5"
}, {
"fullName": "贸易虚拟库",
"id": "6"
}, {
"fullName": "仓储库",
"id": "7"
}, {
"fullName": "能源库",
"id": "8"
}, {
"fullName": "其他库",
"id": "9"
}, {
"fullName": "帐外库",
"id": "10"
}],
organizationOptions: [{
"fullName": "济钢集团",
"id": "0"
}, {
"fullName": "日照",
"id": "1"
}],
sublibraryOptions: [{
"fullName": "城市矿产钢材库",
"id": "0"
}, {
"fullName": "黄河爆破待发库",
"id": "1"
}, {
"fullName": "黄河爆破完工库",
"id": "2"
}],
/* activestateOptions: [{
"fullName": "激活",
"id": "1"
}, {
"fullName": "未激活",
"id": "0"
}], */
}
},
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/warehouse/Warehouse/' + 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/warehouse/Warehouse',
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/warehouse/Warehouse/' + 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,309 +1,414 @@
<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-select v-model="query.activestate" placeholder="请选择"
clearable>
<el-option v-for="(item, index) in activestateOptions" :key="index"
:label="item.fullName" :value="item.id"
:disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="仓库编码">
<el-input v-model="query.code" 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="code" label="仓库编码" width="0" align="left"
/>
<el-table-column label="激活状态 " width="0" prop="activestate" algin="left"
>
<template slot-scope="scope">
{{ scope.row.activestate | dynamicText(activestateOptions) }}
</template>
</el-table-column>
<el-table-column prop="companyCode" label="公司代码" width="0" align="left"
/>
<el-table-column prop="companyName" label="公司名称" width="0" align="left"
/>
<el-table-column label="仓库类型" width="0" prop="type" algin="left"
>
<template slot-scope="scope">
{{ scope.row.type | dynamicText(typeOptions) }}
</template>
</el-table-column>
<el-table-column label="ERP库存组织" width="0" prop="organization" algin="left"
>
<template slot-scope="scope">
{{ scope.row.organization | dynamicText(organizationOptions) }}
</template>
</el-table-column>
<el-table-column label="ERP子库" width="0" prop="sublibrary" algin="left"
>
<template slot-scope="scope">
{{ scope.row.sublibrary | dynamicText(sublibraryOptions) }}
</template>
</el-table-column>
<el-table-column prop="location" label="仓库位置" width="0" align="left"
/>
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left"
/>
<el-table-column prop="creatortime" label="创建时间" width="0" align="left"
/>
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left"
/>
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left"
/>
<el-table-column prop="remark" label="备注" width="0" align="left"
/>
<el-table-column label="操作" fixed="right"
width="100" >
<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>
</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>
<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-select v-model="query.activestate" placeholder="请选择" clearable>
<el-option v-for="(item, index) in activestateOptions" :key="index"
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="仓库编码">
<el-input v-model="query.code" 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="code" label="仓库编码" width="0" align="left" />
<el-table-column label="激活状态 " width="0" prop="activestate" algin="left">
<template slot-scope="scope">
{{ scope.row.activestate | dynamicText(activestateOptions) }}
</template>
</el-table-column>
<el-table-column prop="companyCode" label="公司代码" width="0" align="left" />
<el-table-column prop="companyName" label="公司名称" width="0" align="left" />
<el-table-column label="仓库类型" width="0" prop="type" algin="left">
<template slot-scope="scope">
{{ scope.row.type | dynamicText(typeOptions) }}
</template>
</el-table-column>
<el-table-column label="ERP库存组织" width="0" prop="organization" algin="left">
<template slot-scope="scope">
{{ scope.row.organization | dynamicText(organizationOptions) }}
</template>
</el-table-column>
<el-table-column label="ERP子库" width="0" prop="sublibrary" algin="left">
<template slot-scope="scope">
{{ scope.row.sublibrary | dynamicText(sublibraryOptions) }}
</template>
</el-table-column>
<el-table-column prop="location" label="仓库位置" width="0" align="left" />
<el-table-column prop="creatorusername" label="创建人名称" width="0" align="left" />
<el-table-column prop="creatortime" label="创建时间" width="0" align="left" />
<el-table-column prop="lastmodifyusername" label="修改人名称" width="0" align="left" />
<el-table-column prop="lastmodifytime" label="修改时间" width="0" align="left" />
<el-table-column prop="remark" label="备注" width="0" align="left" />
<el-table-column label="操作" fixed="right" width="100">
<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>
</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: {
activestate:undefined,
code: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: 'code', label: '仓库编码'},
{prop: 'activestate', label: '激活状态 '},
{prop: 'companyCode', label: '公司代码'},
{prop: 'companyName', label: '公司名称'},
{prop: 'type', label: '仓库类型'},
{prop: 'organization', label: 'ERP库存组织'},
{prop: 'sublibrary', label: 'ERP子库'},
{prop: 'location', label: '仓库位置'},
{prop: 'creatorusername', label: '创建人名称'},
{prop: 'creatortime', label: '创建时间'},
{prop: 'lastmodifyusername', label: '修改人名称'},
{prop: 'lastmodifytime', label: '修改时间'},
{prop: 'remark', label: '备注'},
],
typeOptions:[{"fullName":"原料库","id":"0"},{"fullName":"中间库","id":"1"},{"fullName":"成品库","id":"2"},{"fullName":"副产品库","id":"3"},{"fullName":"废次品库","id":"4"},{"fullName":"备件辅材库","id":"5"},{"fullName":"贸易虚拟库","id":"6"},{"fullName":"仓储库","id":"7"},{"fullName":"能源库","id":"8"},{"fullName":"其他库","id":"9"},{"fullName":"帐外库","id":"10"}],
typeProps:{"label":"fullName","value":"id"},
organizationOptions:[{"fullName":"济钢集团","id":"0"},{"fullName":"日照","id":"1"}],
organizationProps:{"label":"fullName","value":"id"},
sublibraryOptions:[{"fullName":"城市矿产钢材库","id":"0"},{"fullName":"黄河爆破待发库","id":"1"},{"fullName":"黄河爆破完工库","id":"2"}],
sublibraryProps:{"label":"fullName","value":"id"},
activestateOptions:[{"fullName":"激活","id":"1"},{"fullName":"未激活","id":"0"}],
activestateProps:{"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/warehouse/Warehouse/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
export default {
components: {
JNPFForm,
ExportBox,
Detail
},
data() {
return {
detailVisible: false,
query: {
activestate: undefined,
code: 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: 'code',
label: '仓库编码'
},
{
prop: 'activestate',
label: '激活状态 '
},
{
prop: 'companyCode',
label: '公司代码'
},
{
prop: 'companyName',
label: '公司名称'
},
{
prop: 'type',
label: '仓库类型'
},
{
prop: 'organization',
label: 'ERP库存组织'
},
{
prop: 'sublibrary',
label: 'ERP子库'
},
{
prop: 'location',
label: '仓库位置'
},
{
prop: 'creatorusername',
label: '创建人名称'
},
{
prop: 'creatortime',
label: '创建时间'
},
{
prop: 'lastmodifyusername',
label: '修改人名称'
},
{
prop: 'lastmodifytime',
label: '修改时间'
},
{
prop: 'remark',
label: '备注'
},
],
typeOptions: [{
"fullName": "原料库",
"id": "0"
}, {
"fullName": "中间库",
"id": "1"
}, {
"fullName": "成品库",
"id": "2"
}, {
"fullName": "副产品库",
"id": "3"
}, {
"fullName": "废次品库",
"id": "4"
}, {
"fullName": "备件辅材库",
"id": "5"
}, {
"fullName": "贸易虚拟库",
"id": "6"
}, {
"fullName": "仓储库",
"id": "7"
}, {
"fullName": "能源库",
"id": "8"
}, {
"fullName": "其他库",
"id": "9"
}, {
"fullName": "帐外库",
"id": "10"
}],
typeProps: {
"label": "fullName",
"value": "id"
},
organizationOptions: [{
"fullName": "济钢集团",
"id": "0"
}, {
"fullName": "日照",
"id": "1"
}],
organizationProps: {
"label": "fullName",
"value": "id"
},
sublibraryOptions: [{
"fullName": "城市矿产钢材库",
"id": "0"
}, {
"fullName": "黄河爆破待发库",
"id": "1"
}, {
"fullName": "黄河爆破完工库",
"id": "2"
}],
sublibraryProps: {
"label": "fullName",
"value": "id"
},
activestateOptions: [{
"fullName": "激活",
"id": "1"
}, {
"fullName": "未激活",
"id": "0"
}],
activestateProps: {
"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/warehouse/Warehouse/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
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/warehouse/Warehouse/${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/warehouse/Warehouse/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/warehouse/Warehouse/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()
}
}
}
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/warehouse/Warehouse/${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/warehouse/Warehouse/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/warehouse/Warehouse/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…
Cancel
Save