# Conflicts: # SC-web/src/views/scm/basicInformation/material/Form.vueproduct
commit
35741ee8c9
@ -1,235 +1,233 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
:close-on-click-modal="false" append-to-body
|
||||||
<el-row :gutter="15" class="">
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
width="600px">
|
||||||
label-position="right">
|
<el-row :gutter="15" class="">
|
||||||
<template v-if="!loading">
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||||
<el-col :span="12">
|
<template v-if="!loading">
|
||||||
<el-form-item label="客户编码" prop="supplierCd">
|
<el-col :span="12" >
|
||||||
<el-input v-model="dataForm.supplierCd" placeholder="请输入客户编码" clearable
|
<el-form-item label="客户编码"
|
||||||
:style='{"width":"100%"}'>
|
prop="supplierCd" >
|
||||||
|
<el-input v-model="dataForm.supplierCd"
|
||||||
|
placeholder="请输入客户编码" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="客户名称" prop="supplierNm">
|
<el-form-item label="客户名称"
|
||||||
<el-input v-model="dataForm.supplierNm" placeholder="请输入客户名称" clearable
|
prop="supplierNm" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.supplierNm"
|
||||||
|
placeholder="请输入客户名称" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="所属公司ID" prop="orgId">
|
<el-form-item label="公司名称"
|
||||||
<el-input v-model="dataForm.orgId" placeholder="请输入所属公司ID" clearable
|
prop="orgId" >
|
||||||
:style='{"width":"100%"}'>
|
<com-select v-model="dataForm.orgId"
|
||||||
|
placeholder="请选择" clearable >
|
||||||
|
|
||||||
</el-input>
|
</com-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="公司代码" prop="orgName">
|
<el-form-item label="联系人"
|
||||||
<el-input v-model="dataForm.orgName" placeholder="请输入公司代码" clearable
|
prop="contactName" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.contactName"
|
||||||
|
placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="客户等级" prop="customerLevel">
|
<el-form-item label="客户等级"
|
||||||
<el-select v-model="dataForm.customerLevel" placeholder="请选择客户等级" :style='{"width":"100%"}'>
|
prop="customerLevel" >
|
||||||
<el-option v-for="(item, index) in customerLevelOptions" :key="index"
|
<el-select v-model="dataForm.customerLevel"
|
||||||
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
|
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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="联系人" prop="contactName">
|
<el-form-item label="电话"
|
||||||
<el-input v-model="dataForm.contactName" placeholder="请输入联系人" clearable
|
prop="contactPhone" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.contactPhone"
|
||||||
|
placeholder="请输入电话" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="地址" prop="address">
|
<el-form-item label="地址"
|
||||||
<el-input v-model="dataForm.address" placeholder="请输入地址" clearable
|
prop="address" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.address"
|
||||||
|
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="电话" prop="contactPhone">
|
<el-form-item label="是否启用"
|
||||||
<el-input v-model="dataForm.contactPhone" placeholder="请输入电话" clearable
|
prop="status" >
|
||||||
:style='{"width":"100%"}'>
|
<el-switch v-model="dataForm.status"
|
||||||
|
:active-value="1" :inactive-value="0" >
|
||||||
|
|
||||||
</el-input>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
</template>
|
||||||
<el-form-item label="是否启用" prop="status">
|
</el-form>
|
||||||
<el-switch v-model="dataForm.status" :active-value="1" :inactive-value="0">
|
</el-row>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
</el-switch>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
</el-form-item>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</el-col>
|
</span>
|
||||||
</template>
|
</el-dialog>
|
||||||
</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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
getDataInterfaceRes
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
} from '@/api/systemData/dataInterface'
|
export default {
|
||||||
import {
|
components: {},
|
||||||
getDictionaryDataSelector
|
props: [],
|
||||||
} from '@/api/systemData/dictionary'
|
data() {
|
||||||
export default {
|
return {
|
||||||
components: {},
|
visible: false,
|
||||||
props: [],
|
loading: false,
|
||||||
data() {
|
isDetail: false,
|
||||||
return {
|
dataForm: {
|
||||||
visible: false,
|
supplierCd : '',
|
||||||
loading: false,
|
supplierNm : '',
|
||||||
isDetail: false,
|
orgId : [],
|
||||||
dataForm: {
|
contactName : '',
|
||||||
supplierCd: '',
|
customerLevel : "1",
|
||||||
supplierNm: '',
|
contactPhone : '',
|
||||||
orgId: '',
|
address : '',
|
||||||
orgName: '',
|
status : 1,
|
||||||
customerLevel: "1",
|
},
|
||||||
contactName: '',
|
rules:
|
||||||
address: '',
|
{
|
||||||
contactPhone: '',
|
supplierCd: [
|
||||||
status: 1,
|
{
|
||||||
},
|
required: true,
|
||||||
rules: {
|
message: '请输入客户编码',
|
||||||
supplierCd: [{
|
trigger: 'blur'
|
||||||
required: true,
|
},
|
||||||
message: '请输入客户编码',
|
],
|
||||||
trigger: 'blur'
|
supplierNm: [
|
||||||
}, ],
|
{
|
||||||
supplierNm: [{
|
required: true,
|
||||||
required: true,
|
message: '请输入客户名称',
|
||||||
message: '请输入客户名称',
|
trigger: 'blur'
|
||||||
trigger: 'blur'
|
},
|
||||||
}, ],
|
],
|
||||||
contactPhone: [],
|
contactPhone: [
|
||||||
},
|
],
|
||||||
customerLevelOptions: [{
|
},
|
||||||
"fullName": "一级",
|
customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
|
||||||
"id": "1"
|
|
||||||
}, {
|
}
|
||||||
"fullName": "二级",
|
},
|
||||||
"id": "2"
|
computed: {},
|
||||||
}, {
|
watch: {},
|
||||||
"fullName": "三级",
|
created() {
|
||||||
"id": "3"
|
},
|
||||||
}],
|
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.orgId = JSON.stringify(_data.orgId)
|
||||||
|
_data.status = parseInt(_data.status)
|
||||||
|
return _data;
|
||||||
|
},
|
||||||
|
dataInfo(dataAll){
|
||||||
|
let _dataAll =dataAll
|
||||||
|
_dataAll.orgId = JSON.parse( _dataAll.orgId)
|
||||||
|
_dataAll.status = parseInt( _dataAll.status)
|
||||||
|
this.dataForm = _dataAll
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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>
|
</script>
|
||||||
|
@ -1,321 +1,279 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="客户编码">
|
<el-form-item label="客户编码">
|
||||||
<el-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierCd" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="客户名称">
|
<el-form-item label="客户名称">
|
||||||
<el-input v-model="query.supplierNm" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierNm" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="JNPF-common-head-right">
|
<div class="JNPF-common-head-right">
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
@click="reset()" />
|
@click="reset()"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<screenfull isContainer />
|
<screenfull isContainer/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||||
@selection-change="handleSelectionChange">
|
<el-table-column prop="supplierCd" label="客户编码" width="0" align="left"
|
||||||
<el-table-column prop="supplierCd" label="客户编码" width="0" align="left" sortable="custom" />
|
sortable="custom" />
|
||||||
<el-table-column prop="supplierNm" label="客户名称" width="0" align="left" sortable="custom" />
|
<el-table-column prop="supplierNm" label="客户名称" width="0" align="left"
|
||||||
<el-table-column prop="orgId" label="所属公司ID" width="0" align="left" sortable="custom" />
|
sortable="custom" />
|
||||||
<el-table-column prop="orgName" label="公司代码" width="0" align="left" sortable="custom" />
|
<el-table-column prop="orgId" label="公司名称" width="0" align="left"
|
||||||
<el-table-column label="客户等级" width="0" prop="customerLevel" algin="left" sortable="custom">
|
sortable="custom" />
|
||||||
<template slot-scope="scope">
|
<el-table-column label="客户等级" width="0" prop="customerLevel" algin="left"
|
||||||
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
|
sortable="custom" >
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
{{ scope.row.customerLevel | dynamicText(customerLevelOptions) }}
|
||||||
<el-table-column prop="contactName" label="联系人" width="0" align="left" sortable="custom" />
|
</template>
|
||||||
<el-table-column prop="address" label="地址" width="0" align="left" sortable="custom" />
|
</el-table-column>
|
||||||
<el-table-column prop="contactPhone" label="电话" width="0" align="left" sortable="custom" />
|
<el-table-column prop="contactName" label="联系人" width="0" align="left"
|
||||||
<el-table-column prop="status" label="是否启用" width="0" align="left" />
|
sortable="custom" />
|
||||||
<el-table-column label="操作" fixed="right" width="150">
|
<el-table-column prop="contactPhone" label="电话" width="0" align="left"
|
||||||
<template slot-scope="scope">
|
sortable="custom" />
|
||||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
<el-table-column prop="address" label="地址" width="0" align="left"
|
||||||
</el-button>
|
sortable="custom" />
|
||||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
<el-table-column prop="status" label="是否启用" width="0" align="left" sortable="custom" >
|
||||||
</el-button>
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
<el-tag type="success" disable-transitions v-if="scope.row.status == '1'">启用
|
||||||
</el-button>
|
</el-tag>
|
||||||
</template>
|
<el-tag type="danger" disable-transitions v-else>停用</el-tag>
|
||||||
</el-table-column>
|
</template>
|
||||||
</JNPF-table>
|
</el-table-column>
|
||||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
<el-table-column label="操作" fixed="right"
|
||||||
@pagination="initData" />
|
width="150" >
|
||||||
</div>
|
<template slot-scope="scope">
|
||||||
</div>
|
<el-button type="text"
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
</el-button>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||||
</div>
|
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||||
getDictionaryDataSelector
|
import JNPFForm from './Form'
|
||||||
} from '@/api/systemData/dictionary'
|
import ExportBox from './ExportBox'
|
||||||
import JNPFForm from './Form'
|
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||||
import ExportBox from './ExportBox'
|
import Detail from './Detail'
|
||||||
import {
|
|
||||||
getDataInterfaceRes
|
|
||||||
} from '@/api/systemData/dataInterface'
|
|
||||||
import Detail from './Detail'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {JNPFForm, ExportBox,Detail},
|
||||||
JNPFForm,
|
data() {
|
||||||
ExportBox,
|
return {
|
||||||
Detail
|
detailVisible: false,
|
||||||
},
|
query: {
|
||||||
data() {
|
supplierCd:undefined,
|
||||||
return {
|
supplierNm:undefined,
|
||||||
detailVisible: false,
|
},
|
||||||
query: {
|
treeProps: {
|
||||||
supplierCd: undefined,
|
children: 'children',
|
||||||
supplierNm: undefined,
|
label: 'fullName',
|
||||||
},
|
value: 'id'
|
||||||
treeProps: {
|
},
|
||||||
children: 'children',
|
list: [],
|
||||||
label: 'fullName',
|
listLoading: true,
|
||||||
value: 'id'
|
multipleSelection: [], total: 0,
|
||||||
},
|
listQuery: {
|
||||||
list: [],
|
currentPage: 1,
|
||||||
listLoading: true,
|
pageSize: 20,
|
||||||
multipleSelection: [],
|
sort: "desc",
|
||||||
total: 0,
|
sidx: "supplierCd",
|
||||||
listQuery: {
|
},
|
||||||
currentPage: 1,
|
formVisible: false,
|
||||||
pageSize: 20,
|
exportBoxVisible: false,
|
||||||
sort: "desc",
|
columnList: [
|
||||||
sidx: "supplierCd",
|
{prop: 'supplierCd', label: '客户编码'},
|
||||||
},
|
{prop: 'supplierNm', label: '客户名称'},
|
||||||
formVisible: false,
|
{prop: 'orgId', label: '公司名称'},
|
||||||
exportBoxVisible: false,
|
{prop: 'customerLevel', label: '客户等级'},
|
||||||
columnList: [{
|
{prop: 'contactName', label: '联系人'},
|
||||||
prop: 'supplierCd',
|
{prop: 'contactPhone', label: '电话'},
|
||||||
label: '客户编码'
|
{prop: 'address', label: '地址'},
|
||||||
},
|
{prop: 'status', label: '是否启用'},
|
||||||
{
|
],
|
||||||
prop: 'supplierNm',
|
customerLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"}],
|
||||||
label: '客户名称'
|
customerLevelProps:{"label":"fullName","value":"id"},
|
||||||
},
|
}
|
||||||
{
|
},
|
||||||
prop: 'orgId',
|
computed: {
|
||||||
label: '所属公司ID'
|
menuId() {
|
||||||
},
|
return this.$route.meta.modelId || ''
|
||||||
{
|
}
|
||||||
prop: 'orgName',
|
},
|
||||||
label: '公司代码'
|
created() {
|
||||||
},
|
this.initData()
|
||||||
{
|
},
|
||||||
prop: 'customerLevel',
|
methods: {
|
||||||
label: '客户等级'
|
goDetail(id){
|
||||||
},
|
this.detailVisible = true
|
||||||
{
|
this.$nextTick(() => {
|
||||||
prop: 'contactName',
|
this.$refs.Detail.init(id)
|
||||||
label: '联系人'
|
})
|
||||||
},
|
},
|
||||||
{
|
sortChange({column, prop, order}) {
|
||||||
prop: 'address',
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
label: '地址'
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
},
|
this.initData()
|
||||||
{
|
},
|
||||||
prop: 'contactPhone',
|
initData() {
|
||||||
label: '电话'
|
this.listLoading = true;
|
||||||
},
|
let _query = {
|
||||||
{
|
...this.listQuery,
|
||||||
prop: 'status',
|
...this.query,
|
||||||
label: '是否启用'
|
menuId:this.menuId
|
||||||
},
|
};
|
||||||
],
|
request({
|
||||||
customerLevelOptions: [{
|
url: `/api/customer/Customer/getList`,
|
||||||
"fullName": "一级",
|
method: 'post',
|
||||||
"id": "1"
|
data: _query
|
||||||
}, {
|
}).then(res => {
|
||||||
"fullName": "二级",
|
var _list =[];
|
||||||
"id": "2"
|
for(let i=0;i<res.data.list.length;i++){
|
||||||
}, {
|
let _data = res.data.list[i];
|
||||||
"fullName": "三级",
|
_list.push(_data)
|
||||||
"id": "3"
|
}
|
||||||
}],
|
this.list = _list
|
||||||
customerLevelProps: {
|
this.total = res.data.pagination.total
|
||||||
"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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/customer/Customer/${id}`,
|
url: `/api/customer/Customer/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.initData()
|
this.initData()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
},
|
});
|
||||||
handleSelectionChange(val) {
|
},
|
||||||
const res = val.map(item => item.id)
|
handleSelectionChange(val) {
|
||||||
this.multipleSelection = res
|
const res = val.map(item => item.id)
|
||||||
},
|
this.multipleSelection = res
|
||||||
handleBatchRemoveDel() {
|
},
|
||||||
if (!this.multipleSelection.length) {
|
handleBatchRemoveDel() {
|
||||||
this.$message({
|
if (!this.multipleSelection.length) {
|
||||||
type: 'error',
|
this.$message({
|
||||||
message: '请选择一条数据',
|
type: 'error',
|
||||||
duration: 1500,
|
message: '请选择一条数据',
|
||||||
})
|
duration: 1500,
|
||||||
return
|
})
|
||||||
}
|
return
|
||||||
const ids = this.multipleSelection.join()
|
}
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
const ids = this.multipleSelection.join()
|
||||||
type: 'warning'
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
}).then(() => {
|
type: 'warning'
|
||||||
request({
|
}).then(() => {
|
||||||
url: `/api/customer/Customer/batchRemove/${ids}`,
|
request({
|
||||||
method: 'DELETE'
|
url: `/api/customer/Customer/batchRemove/${ids}`,
|
||||||
}).then(res => {
|
method: 'DELETE'
|
||||||
this.$message({
|
}).then(res => {
|
||||||
type: 'success',
|
this.$message({
|
||||||
message: res.msg,
|
type: 'success',
|
||||||
onClose: () => {
|
message: res.msg,
|
||||||
this.initData()
|
onClose: () => {
|
||||||
}
|
this.initData()
|
||||||
});
|
}
|
||||||
})
|
});
|
||||||
}).catch(() => {})
|
})
|
||||||
},
|
}).catch(() => {
|
||||||
addOrUpdateHandle(id, isDetail) {
|
})
|
||||||
this.formVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.$refs.JNPFForm.init(id, isDetail)
|
this.formVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.JNPFForm.init(id, isDetail)
|
||||||
exportData() {
|
})
|
||||||
this.exportBoxVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
exportData() {
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
this.exportBoxVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.ExportBox.init(this.columnList)
|
||||||
download(data) {
|
})
|
||||||
let query = {
|
},
|
||||||
...data,
|
download(data) {
|
||||||
...this.listQuery,
|
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||||
...this.query,
|
request({
|
||||||
menuId: this.menuId
|
url: `/api/customer/Customer/Actions/Export`,
|
||||||
}
|
method: 'GET',
|
||||||
request({
|
data: query
|
||||||
url: `/api/customer/Customer/Actions/Export`,
|
}).then(res => {
|
||||||
method: 'GET',
|
if (!res.data.url) return
|
||||||
data: query
|
this.jnpf.downloadFile(res.data.url)
|
||||||
}).then(res => {
|
this.$refs.ExportBox.visible = false
|
||||||
if (!res.data.url) return
|
this.exportBoxVisible = false
|
||||||
this.jnpf.downloadFile(res.data.url)
|
})
|
||||||
this.$refs.ExportBox.visible = false
|
},
|
||||||
this.exportBoxVisible = false
|
search() {
|
||||||
})
|
this.listQuery = {
|
||||||
},
|
currentPage: 1,
|
||||||
search() {
|
pageSize: 20,
|
||||||
this.listQuery = {
|
sort: "desc",
|
||||||
currentPage: 1,
|
sidx: "supplierCd",
|
||||||
pageSize: 20,
|
}
|
||||||
sort: "desc",
|
this.initData()
|
||||||
sidx: "supplierCd",
|
},
|
||||||
}
|
refresh(isrRefresh) {
|
||||||
this.initData()
|
this.formVisible = false
|
||||||
},
|
if (isrRefresh) this.reset()
|
||||||
refresh(isrRefresh) {
|
},
|
||||||
this.formVisible = false
|
reset() {
|
||||||
if (isrRefresh) this.reset()
|
for (let key in this.query) {
|
||||||
},
|
this.query[key] = undefined
|
||||||
reset() {
|
}
|
||||||
for (let key in this.query) {
|
this.search()
|
||||||
this.query[key] = undefined
|
}
|
||||||
}
|
}
|
||||||
this.search()
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,264 +1,258 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'" :close-on-click-modal="false" append-to-body
|
<el-dialog :title="!dataForm.id ? '新建' : isDetail ? '详情':'编辑'"
|
||||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
:close-on-click-modal="false" append-to-body
|
||||||
<el-row :gutter="15" class="">
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px"
|
width="1000px">
|
||||||
label-position="right">
|
<el-row :gutter="15" class="">
|
||||||
<template v-if="!loading">
|
<el-form ref="elForm" :model="dataForm" :rules="rules" size="small" label-width="100px" label-position="right" >
|
||||||
<el-col :span="24">
|
<template v-if="!loading">
|
||||||
<el-form-item label-width="0">
|
<el-col :span="24" >
|
||||||
<JNPF-Text :style='{"width":"100%"}'
|
<el-form-item label-width="0">
|
||||||
:textStyle='{"color":"#000000","font-weight":"bold","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}'
|
<JNPF-Text :style='{"width":"100%"}'
|
||||||
value="供应商编辑">
|
:textStyle='{"color":"#000000","font-weight":"bold","text-decoration":"none","font-size":18,"line-height":32,"font-style":"normal","text-align":"left"}' value="供应商编辑">
|
||||||
</JNPF-Text>
|
</JNPF-Text>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="供应商编码" prop="supplierCode">
|
<el-form-item label="供应商编码"
|
||||||
<el-input v-model="dataForm.supplierCode" placeholder="请输入供应商编码" clearable
|
prop="supplierCode" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.supplierCode"
|
||||||
|
placeholder="请输入供应商编码" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="供应商名称" prop="supplierName">
|
<el-form-item label="供应商名称"
|
||||||
<el-input v-model="dataForm.supplierName" placeholder="请输入供应商名称" clearable
|
prop="supplierName" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.supplierName"
|
||||||
|
placeholder="请输入供应商名称" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="地点ID" prop="supplierSiteId">
|
<el-form-item label="供应商地点ID"
|
||||||
<el-input v-model="dataForm.supplierSiteId" placeholder="请输入供应商地点ID" clearable
|
prop="supplierSiteId" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.supplierSiteId"
|
||||||
|
placeholder="请输入供应商地点ID" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="地点名称" prop="supplierSiteCode">
|
<el-form-item label="供应商地点名称"
|
||||||
<el-input v-model="dataForm.supplierSiteCode" placeholder="请输入供应商地点名称" clearable
|
prop="supplierSiteCode" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.supplierSiteCode"
|
||||||
|
placeholder="请输入供应商地点名称" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="所属公司编码" prop="companyId">
|
<el-form-item label="公司名称"
|
||||||
<el-input v-model="dataForm.companyId" placeholder="请输入所属公司编码" clearable
|
prop="companyId" >
|
||||||
:style='{"width":"100%"}'>
|
<com-select v-model="dataForm.companyId"
|
||||||
|
placeholder="请选择" clearable >
|
||||||
|
|
||||||
</el-input>
|
</com-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="所属公司名称" prop="companyName">
|
<el-form-item label="地址"
|
||||||
<el-input v-model="dataForm.companyName" placeholder="请输入公司名称" clearable
|
prop="address" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.address"
|
||||||
|
placeholder="请输入地址" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="联系人" prop="contactName">
|
<el-form-item label="联系人"
|
||||||
<el-input v-model="dataForm.contactName" placeholder="请输入联系人" clearable
|
prop="contactName" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.contactName"
|
||||||
|
placeholder="请输入联系人" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="联系电话" prop="contactPhone">
|
<el-form-item label="联系电话"
|
||||||
<el-input v-model="dataForm.contactPhone" placeholder="请输入联系电话" clearable
|
prop="contactPhone" >
|
||||||
:style='{"width":"100%"}'>
|
<el-input v-model="dataForm.contactPhone"
|
||||||
|
placeholder="请输入联系电话" clearable :style='{"width":"100%"}'>
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="供应商等级" prop="supplierLevel">
|
<el-form-item label="供应商等级"
|
||||||
<el-select v-model="dataForm.supplierLevel" placeholder="请选择" clearable
|
prop="supplierLevel" >
|
||||||
:style='{"width":"100%"}'>
|
<el-select v-model="dataForm.supplierLevel"
|
||||||
<el-option v-for="(item, index) in supplierLevelOptions" :key="index"
|
placeholder="请选择" clearable :style='{"width":"100%"}'>
|
||||||
:label="item.fullName" :value="item.id" :disabled="item.disabled"></el-option>
|
<el-option v-for="(item, index) in supplierLevelOptions" :key="index" :label="item.fullName" :value="item.id" :disabled="item.disabled" ></el-option>
|
||||||
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12" >
|
||||||
<el-form-item label="地址" prop="address">
|
<el-form-item label="启用"
|
||||||
<el-input v-model="dataForm.address" placeholder="请输入地址" clearable
|
prop="status" >
|
||||||
:style='{"width":"100%"}'>
|
<el-switch v-model="dataForm.status"
|
||||||
|
:active-value="1" :inactive-value="0" >
|
||||||
|
|
||||||
</el-input>
|
</el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
</template>
|
||||||
<el-form-item label="启用" prop="status">
|
</el-form>
|
||||||
<el-switch v-model="dataForm.status" :active-value="1" :inactive-value="0">
|
</el-row>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
</el-switch>
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
</el-form-item>
|
<el-button type="primary" @click="dataFormSubmit()" v-if="!isDetail"> 确 定</el-button>
|
||||||
</el-col>
|
</span>
|
||||||
</template>
|
</el-dialog>
|
||||||
</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>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
getDataInterfaceRes
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
} from '@/api/systemData/dataInterface'
|
export default {
|
||||||
import {
|
components: {},
|
||||||
getDictionaryDataSelector
|
props: [],
|
||||||
} from '@/api/systemData/dictionary'
|
data() {
|
||||||
export default {
|
return {
|
||||||
components: {},
|
visible: false,
|
||||||
props: [],
|
loading: false,
|
||||||
data() {
|
isDetail: false,
|
||||||
return {
|
dataForm: {
|
||||||
visible: false,
|
supplierCode : '',
|
||||||
loading: false,
|
supplierName : '',
|
||||||
isDetail: false,
|
supplierSiteId : '',
|
||||||
dataForm: {
|
supplierSiteCode : '',
|
||||||
supplierCode: '',
|
companyId : [],
|
||||||
supplierName: '',
|
address : '',
|
||||||
supplierSiteId: '',
|
contactName : '',
|
||||||
supplierSiteCode: '',
|
contactPhone : '',
|
||||||
companyId: '',
|
supplierLevel : "1",
|
||||||
companyName: '',
|
status : 1,
|
||||||
contactName: '',
|
},
|
||||||
contactPhone: '',
|
rules:
|
||||||
supplierLevel: "1",
|
{
|
||||||
address: '',
|
supplierCode: [
|
||||||
status: 1,
|
{
|
||||||
},
|
required: true,
|
||||||
rules: {
|
message: '请输入供应商编码',
|
||||||
supplierCode: [{
|
trigger: 'blur'
|
||||||
required: true,
|
},
|
||||||
message: '请输入供应商编码',
|
],
|
||||||
trigger: 'blur'
|
supplierName: [
|
||||||
}, ],
|
{
|
||||||
supplierName: [{
|
required: true,
|
||||||
required: true,
|
message: '请输入供应商名称',
|
||||||
message: '请输入供应商名称',
|
trigger: 'blur'
|
||||||
trigger: 'blur'
|
},
|
||||||
}, ],
|
],
|
||||||
},
|
},
|
||||||
supplierLevelOptions: [{
|
supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
|
||||||
"fullName": "一级",
|
|
||||||
"id": "1"
|
}
|
||||||
}, {
|
},
|
||||||
"fullName": "二级",
|
computed: {},
|
||||||
"id": "2"
|
watch: {},
|
||||||
}, {
|
created() {
|
||||||
"fullName": "三级",
|
},
|
||||||
"id": "3"
|
mounted() {},
|
||||||
}, {
|
methods: {
|
||||||
"fullName": "四级",
|
clearData(data){
|
||||||
"id": "4"
|
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.companyId = JSON.stringify(_data.companyId)
|
||||||
|
_data.status = parseInt(_data.status)
|
||||||
|
return _data;
|
||||||
|
},
|
||||||
|
dataInfo(dataAll){
|
||||||
|
let _dataAll =dataAll
|
||||||
|
_dataAll.companyId = JSON.parse( _dataAll.companyId)
|
||||||
|
_dataAll.status = parseInt( _dataAll.status)
|
||||||
|
this.dataForm = _dataAll
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
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>
|
</script>
|
||||||
|
@ -1,345 +1,285 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="JNPF-common-layout">
|
<div class="JNPF-common-layout">
|
||||||
|
|
||||||
<div class="JNPF-common-layout-center">
|
<div class="JNPF-common-layout-center">
|
||||||
<el-row class="JNPF-common-search-box" :gutter="16">
|
<el-row class="JNPF-common-search-box" :gutter="16">
|
||||||
<el-form @submit.native.prevent>
|
<el-form @submit.native.prevent>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="供应商编码">
|
<el-form-item label="供应商编码">
|
||||||
<el-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierCode" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="供应商名称">
|
<el-form-item label="供应商名称">
|
||||||
<el-input v-model="query.supplierName" placeholder="请输入" clearable> </el-input>
|
<el-input v-model="query.supplierName" placeholder="请输入" clearable> </el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||||
<div class="JNPF-common-head">
|
<div class="JNPF-common-head">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
<el-button type="primary" icon="el-icon-plus" @click="addOrUpdateHandle()">新增
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-download" @click="exportData()">导出
|
<el-button type="text" icon="el-icon-download" @click="exportData()" >导出
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()">批量删除
|
<el-button type="text" icon="el-icon-delete" @click="handleBatchRemoveDel()" >批量删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="JNPF-common-head-right">
|
<div class="JNPF-common-head-right">
|
||||||
<el-tooltip effect="dark" content="刷新" placement="top">
|
<el-tooltip effect="dark" content="刷新" placement="top">
|
||||||
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
|
||||||
@click="reset()" />
|
@click="reset()"/>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<screenfull isContainer />
|
<screenfull isContainer/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c
|
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange">
|
||||||
@selection-change="handleSelectionChange">
|
<el-table-column prop="supplierCode" label="供应商编码" width="0" align="left"
|
||||||
<el-table-column prop="supplierCode" label="供应商编码" width="0" align="left" sortable="custom" />
|
sortable="custom" />
|
||||||
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left" sortable="custom" />
|
<el-table-column prop="supplierName" label="供应商名称" width="0" align="left"
|
||||||
<el-table-column prop="supplierSiteId" label="地点ID" width="0" align="left" sortable="custom" />
|
sortable="custom" />
|
||||||
<el-table-column prop="supplierSiteCode" label="地点名称" width="0" align="left" sortable="custom" />
|
<el-table-column prop="supplierSiteId" label="供应商地点ID" width="0" align="left"
|
||||||
<el-table-column prop="companyId" label="所属公司编码" width="0" align="left" sortable="custom" />
|
sortable="custom" />
|
||||||
<el-table-column prop="companyName" label="所属公司名称" width="0" align="left" sortable="custom" />
|
<el-table-column prop="supplierSiteCode" label="供应商地点名称" width="0" align="left"
|
||||||
<el-table-column prop="contactName" label="联系人" width="0" align="left" sortable="custom" />
|
sortable="custom" />
|
||||||
<el-table-column prop="contactPhone" label="联系电话" width="0" align="left" sortable="custom" />
|
<el-table-column prop="companyId" label="公司名称" width="0" align="left"
|
||||||
<el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left" sortable="custom">
|
sortable="custom" />
|
||||||
<template slot-scope="scope">
|
<el-table-column prop="contactName" label="联系人" width="0" align="left"
|
||||||
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
|
sortable="custom" />
|
||||||
</template>
|
<el-table-column prop="contactPhone" label="联系电话" width="0" align="left"
|
||||||
</el-table-column>
|
sortable="custom" />
|
||||||
<el-table-column prop="address" label="地址" width="0" align="left" sortable="custom" />
|
<el-table-column label="供应商等级" width="0" prop="supplierLevel" algin="left"
|
||||||
<!-- <el-table-column prop="status" label="启用" width="0" align="left"
|
sortable="custom" >
|
||||||
sortable="custom" /> -->
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.supplierLevel | dynamicText(supplierLevelOptions) }}
|
||||||
<el-table-column prop="status" label="状态" width="0" align="left">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-tag type="success" disable-transitions v-if="scope.row.status == 1">启用
|
<el-table-column prop="address" label="地址" width="0" align="left"
|
||||||
</el-tag>
|
sortable="custom" />
|
||||||
<el-tag type="danger" disable-transitions v-else>禁用</el-tag>
|
<el-table-column prop="status" label="启用" width="0" align="left" sortable="custom" >
|
||||||
</template>
|
<template slot-scope="scope">
|
||||||
</el-table-column>
|
<el-tag type="success" disable-transitions v-if="scope.row.status == '1'">启用
|
||||||
|
</el-tag>
|
||||||
|
<el-tag type="danger" disable-transitions v-else>停用</el-tag>
|
||||||
<el-table-column label="操作" fixed="right" width="150">
|
</template>
|
||||||
<template slot-scope="scope">
|
</el-table-column>
|
||||||
<el-button type="text" @click="addOrUpdateHandle(scope.row.id)">编辑
|
<el-table-column label="操作" fixed="right"
|
||||||
</el-button>
|
width="150" >
|
||||||
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
<template slot-scope="scope">
|
||||||
</el-button>
|
<el-button type="text"
|
||||||
<el-button type="text" @click="goDetail(scope.row.id)">详情
|
@click="addOrUpdateHandle(scope.row.id)" >编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">删除
|
||||||
</el-table-column>
|
</el-button>
|
||||||
</JNPF-table>
|
<el-button type="text"
|
||||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
@click="goDetail(scope.row.id)">详情
|
||||||
@pagination="initData" />
|
</el-button>
|
||||||
</div>
|
</template>
|
||||||
</div>
|
</el-table-column>
|
||||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
</JNPF-table>
|
||||||
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
|
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
|
||||||
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false" />
|
</div>
|
||||||
</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>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import {
|
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
|
||||||
getDictionaryDataSelector
|
import JNPFForm from './Form'
|
||||||
} from '@/api/systemData/dictionary'
|
import ExportBox from './ExportBox'
|
||||||
import JNPFForm from './Form'
|
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
|
||||||
import ExportBox from './ExportBox'
|
import Detail from './Detail'
|
||||||
import {
|
|
||||||
getDataInterfaceRes
|
|
||||||
} from '@/api/systemData/dataInterface'
|
|
||||||
import Detail from './Detail'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {JNPFForm, ExportBox,Detail},
|
||||||
JNPFForm,
|
data() {
|
||||||
ExportBox,
|
return {
|
||||||
Detail
|
detailVisible: false,
|
||||||
},
|
query: {
|
||||||
data() {
|
supplierCode:undefined,
|
||||||
return {
|
supplierName:undefined,
|
||||||
detailVisible: false,
|
},
|
||||||
query: {
|
treeProps: {
|
||||||
supplierCode: undefined,
|
children: 'children',
|
||||||
supplierName: undefined,
|
label: 'fullName',
|
||||||
},
|
value: 'id'
|
||||||
treeProps: {
|
},
|
||||||
children: 'children',
|
list: [],
|
||||||
label: 'fullName',
|
listLoading: true,
|
||||||
value: 'id'
|
multipleSelection: [], total: 0,
|
||||||
},
|
listQuery: {
|
||||||
list: [],
|
currentPage: 1,
|
||||||
listLoading: true,
|
pageSize: 20,
|
||||||
multipleSelection: [],
|
sort: "desc",
|
||||||
total: 0,
|
sidx: "supplierCode",
|
||||||
listQuery: {
|
},
|
||||||
currentPage: 1,
|
formVisible: false,
|
||||||
pageSize: 20,
|
exportBoxVisible: false,
|
||||||
sort: "desc",
|
columnList: [
|
||||||
sidx: "supplierCode",
|
{prop: 'supplierCode', label: '供应商编码'},
|
||||||
},
|
{prop: 'supplierName', label: '供应商名称'},
|
||||||
formVisible: false,
|
{prop: 'supplierSiteId', label: '供应商地点ID'},
|
||||||
exportBoxVisible: false,
|
{prop: 'supplierSiteCode', label: '供应商地点名称'},
|
||||||
columnList: [{
|
{prop: 'companyId', label: '公司名称'},
|
||||||
prop: 'supplierCode',
|
{prop: 'contactName', label: '联系人'},
|
||||||
label: '供应商编码'
|
{prop: 'contactPhone', label: '联系电话'},
|
||||||
},
|
{prop: 'supplierLevel', label: '供应商等级'},
|
||||||
{
|
{prop: 'address', label: '地址'},
|
||||||
prop: 'supplierName',
|
{prop: 'status', label: '启用'},
|
||||||
label: '供应商名称'
|
],
|
||||||
},
|
supplierLevelOptions:[{"fullName":"一级","id":"1"},{"fullName":"二级","id":"2"},{"fullName":"三级","id":"3"},{"fullName":"四级","id":"4"}],
|
||||||
{
|
supplierLevelProps:{"label":"fullName","value":"id"},
|
||||||
prop: 'supplierSiteId',
|
}
|
||||||
label: '地点ID'
|
},
|
||||||
},
|
computed: {
|
||||||
{
|
menuId() {
|
||||||
prop: 'supplierSiteCode',
|
return this.$route.meta.modelId || ''
|
||||||
label: '地点名称'
|
}
|
||||||
},
|
},
|
||||||
{
|
created() {
|
||||||
prop: 'companyId',
|
this.initData()
|
||||||
label: '所属公司编码'
|
},
|
||||||
},
|
methods: {
|
||||||
{
|
goDetail(id){
|
||||||
prop: 'companyName',
|
this.detailVisible = true
|
||||||
label: '所属公司名称'
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.Detail.init(id)
|
||||||
{
|
})
|
||||||
prop: 'contactName',
|
},
|
||||||
label: '联系人'
|
sortChange({column, prop, order}) {
|
||||||
},
|
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
|
||||||
{
|
this.listQuery.sidx = !order ? '' : prop
|
||||||
prop: 'contactPhone',
|
this.initData()
|
||||||
label: '联系电话'
|
},
|
||||||
},
|
initData() {
|
||||||
{
|
this.listLoading = true;
|
||||||
prop: 'supplierLevel',
|
let _query = {
|
||||||
label: '供应商等级'
|
...this.listQuery,
|
||||||
},
|
...this.query,
|
||||||
{
|
menuId:this.menuId
|
||||||
prop: 'address',
|
};
|
||||||
label: '地址'
|
request({
|
||||||
},
|
url: `/api/supplier/Supplier/getList`,
|
||||||
{
|
method: 'post',
|
||||||
prop: 'status',
|
data: _query
|
||||||
label: '启用'
|
}).then(res => {
|
||||||
},
|
var _list =[];
|
||||||
],
|
for(let i=0;i<res.data.list.length;i++){
|
||||||
supplierLevelOptions: [{
|
let _data = res.data.list[i];
|
||||||
"fullName": "一级",
|
_list.push(_data)
|
||||||
"id": "1"
|
}
|
||||||
}, {
|
this.list = _list
|
||||||
"fullName": "二级",
|
this.total = res.data.pagination.total
|
||||||
"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
|
this.listLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleDel(id) {
|
handleDel(id) {
|
||||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
request({
|
request({
|
||||||
url: `/api/supplier/Supplier/${id}`,
|
url: `/api/supplier/Supplier/${id}`,
|
||||||
method: 'DELETE'
|
method: 'DELETE'
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
this.initData()
|
this.initData()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}).catch(() => {});
|
}).catch(() => {
|
||||||
},
|
});
|
||||||
handleSelectionChange(val) {
|
},
|
||||||
const res = val.map(item => item.id)
|
handleSelectionChange(val) {
|
||||||
this.multipleSelection = res
|
const res = val.map(item => item.id)
|
||||||
},
|
this.multipleSelection = res
|
||||||
handleBatchRemoveDel() {
|
},
|
||||||
if (!this.multipleSelection.length) {
|
handleBatchRemoveDel() {
|
||||||
this.$message({
|
if (!this.multipleSelection.length) {
|
||||||
type: 'error',
|
this.$message({
|
||||||
message: '请选择一条数据',
|
type: 'error',
|
||||||
duration: 1500,
|
message: '请选择一条数据',
|
||||||
})
|
duration: 1500,
|
||||||
return
|
})
|
||||||
}
|
return
|
||||||
const ids = this.multipleSelection.join()
|
}
|
||||||
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
const ids = this.multipleSelection.join()
|
||||||
type: 'warning'
|
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
|
||||||
}).then(() => {
|
type: 'warning'
|
||||||
request({
|
}).then(() => {
|
||||||
url: `/api/supplier/Supplier/batchRemove/${ids}`,
|
request({
|
||||||
method: 'DELETE'
|
url: `/api/supplier/Supplier/batchRemove/${ids}`,
|
||||||
}).then(res => {
|
method: 'DELETE'
|
||||||
this.$message({
|
}).then(res => {
|
||||||
type: 'success',
|
this.$message({
|
||||||
message: res.msg,
|
type: 'success',
|
||||||
onClose: () => {
|
message: res.msg,
|
||||||
this.initData()
|
onClose: () => {
|
||||||
}
|
this.initData()
|
||||||
});
|
}
|
||||||
})
|
});
|
||||||
}).catch(() => {})
|
})
|
||||||
},
|
}).catch(() => {
|
||||||
addOrUpdateHandle(id, isDetail) {
|
})
|
||||||
this.formVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
addOrUpdateHandle(id, isDetail) {
|
||||||
this.$refs.JNPFForm.init(id, isDetail)
|
this.formVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.JNPFForm.init(id, isDetail)
|
||||||
exportData() {
|
})
|
||||||
this.exportBoxVisible = true
|
},
|
||||||
this.$nextTick(() => {
|
exportData() {
|
||||||
this.$refs.ExportBox.init(this.columnList)
|
this.exportBoxVisible = true
|
||||||
})
|
this.$nextTick(() => {
|
||||||
},
|
this.$refs.ExportBox.init(this.columnList)
|
||||||
download(data) {
|
})
|
||||||
let query = {
|
},
|
||||||
...data,
|
download(data) {
|
||||||
...this.listQuery,
|
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
|
||||||
...this.query,
|
request({
|
||||||
menuId: this.menuId
|
url: `/api/supplier/Supplier/Actions/Export`,
|
||||||
}
|
method: 'GET',
|
||||||
request({
|
data: query
|
||||||
url: `/api/supplier/Supplier/Actions/Export`,
|
}).then(res => {
|
||||||
method: 'GET',
|
if (!res.data.url) return
|
||||||
data: query
|
this.jnpf.downloadFile(res.data.url)
|
||||||
}).then(res => {
|
this.$refs.ExportBox.visible = false
|
||||||
if (!res.data.url) return
|
this.exportBoxVisible = false
|
||||||
this.jnpf.downloadFile(res.data.url)
|
})
|
||||||
this.$refs.ExportBox.visible = false
|
},
|
||||||
this.exportBoxVisible = false
|
search() {
|
||||||
})
|
this.listQuery = {
|
||||||
},
|
currentPage: 1,
|
||||||
search() {
|
pageSize: 20,
|
||||||
this.listQuery = {
|
sort: "desc",
|
||||||
currentPage: 1,
|
sidx: "supplierCode",
|
||||||
pageSize: 20,
|
}
|
||||||
sort: "desc",
|
this.initData()
|
||||||
sidx: "supplierCode",
|
},
|
||||||
}
|
refresh(isrRefresh) {
|
||||||
this.initData()
|
this.formVisible = false
|
||||||
},
|
if (isrRefresh) this.reset()
|
||||||
refresh(isrRefresh) {
|
},
|
||||||
this.formVisible = false
|
reset() {
|
||||||
if (isrRefresh) this.reset()
|
for (let key in this.query) {
|
||||||
},
|
this.query[key] = undefined
|
||||||
reset() {
|
}
|
||||||
for (let key in this.query) {
|
this.search()
|
||||||
this.query[key] = undefined
|
}
|
||||||
}
|
}
|
||||||
this.search()
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in new issue