Browse Source

改版变更 v2.0

master
DESKTOP-00SUCB6\Administrator 4 years ago
parent
commit
0af24a5b0f
  1. 13
      public/config.js
  2. 9
      src/api/get.js
  3. 26
      src/api/returnReceipt.js
  4. 19
      src/api/status.js
  5. 18
      src/permission.js
  6. 16
      src/router/index.ts
  7. 2
      src/utils/request.js
  8. 12
      src/views/404.vue
  9. 5
      src/views/get/addGet.vue
  10. 2
      src/views/get/cancel.vue
  11. 30
      src/views/get/deliverGoods.vue
  12. 198
      src/views/get/get.vue
  13. 90
      src/views/get/getDetail.vue
  14. 9
      src/views/layout/components/AppMain.vue
  15. 2
      src/views/layout/components/Sidebar/index.vue
  16. 2
      src/views/send/cancel.vue
  17. 24
      src/views/send/send.vue
  18. 98
      src/views/status/getAllDetail.vue
  19. 17
      src/views/status/goodsCount.vue
  20. 500
      src/views/status/sendStatus.vue
  21. 69
      src/views/systemManage/whiteList.vue

13
public/config.js

@ -1,12 +1,7 @@
// config = {
// API_URL: 'http://www.fatoaniic.com/api',
// UPLOAD_URL: "http://www.fatoaniic.com/api/api-ftp/ftp/upload",
// DOWNLOAD_URL: "http://www.fatoaniic.com/api/api-ftp/ftp/download?filename=",
// SHOW_URL: "http://www.fatoaniic.com/ftpfile/",
// }
config = {
// API_URL: 'http://172.119.50.248:8081',
// API_URL: 'http://61.135.192.50:8081',
API_URL: 'http://172.119.51.195:8081',
// API_URL: 'http://fw.niulanshan.com.cn:8081',
API_URL: 'http://121.36.65.171:9999',
// API_URL: 'http://172.119.50.206:8081',
}

9
src/api/get.js

@ -16,7 +16,14 @@ export function addFetchList(params) {
});
}
//删除取码单
export function deleteFetchList(params) {
return request({
url: '/fetch/delete',
method: 'post',
data:params
});
}
// 编辑取码单
export function updateFetch(params) {
return request({

26
src/api/returnReceipt.js

@ -8,6 +8,32 @@ export function sentReceipt(params) {
data:params
});
}
//提交回执单
export function commitReceipt(params) {
return request({
url: '/receipt/commit',
method: 'post',
data:params
});
}
//删除回执单
export function deleteReceipt(params) {
return request({
url: '/receipt/delete',
method: 'post',
data:params
});
}
//添加送货 --保存并提交
export function savecommit(params) {
return request({
url: '/receipt/savecommit',
method: 'post',
data:params
});
}
//上传回执单
export function uploadReceipt(params) {
return request({

19
src/api/status.js

@ -34,3 +34,22 @@ export function printList(params) {
data:params
});
}
//总和的饼图
export function sumfetchpie(params) {
return request({
url: '/portal/sumfetchpie',
method: 'post',
data:params
});
}
//全部回执单列表
export function receiptAllList(params) {
return request({
url: '/receipt/list',
method: 'post',
data:params
});
}

18
src/permission.js

@ -9,25 +9,13 @@ const whiteList = ['/login'] // 不重定向白名单
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
if (to.path === '/login') {
next({path: '/'})
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
} else {
// if (store.getters.roles.length === 0) {
// store.dispatch('GetInfo').then(res => { // 拉取用户信息
// next()
// }).catch((err) => {
// store.dispatch('FedLogOut').then(() => {
// Message.error(err || 'Verification failed, please login again')
// next({ path: '/' })
// })
// })
// if (to.path === '/login') {
// next({path: '/'})
// NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
// } else {
// store.dispatch('changeActiveIndex', '/' + to.path.split("/")[1]).then();
next()
NProgress.done()
// }
}
} else {
if (whiteList.indexOf(to.path) !== -1) {
next()

16
src/router/index.ts

@ -40,20 +40,20 @@ const routes = [
component: AppMain,
name: 'antiFake',
redirect: 'noredirect',
meta: {title: '防伪码管理'},
meta: {title: '防伪服务'},
children: [
{
path: 'send',
component: () => import('@/views/send/send.vue'),
name: 'send',
meta: {title: '防伪码发码', icon: 'eye', noCache: true},
meta: {title: '发码管理', icon: 'eye', noCache: true},
},
{
path: 'cancel',
name: 'cancel',
component: () => import('@/views/send/cancel.vue'),
meta: {title: '防伪码废', icon: 'form', noCache: true},
meta: {title: '防伪码废', icon: 'form', noCache: true},
},
{
path: 'getDetail',
@ -153,7 +153,7 @@ const routes = [
path: '',
component: () => import('@/views/status/sendStatus.vue'),
name: 'sendStatus',
meta: {title: '防伪码发放情况', icon: 'form', noCache: true},
// meta: {title: '防伪码发放情况', icon: 'form', noCache: true},
},
{
path: 'cancelDetail',
@ -164,10 +164,10 @@ const routes = [
},
{
path: 'getDetail',
component: () => import('@/views/get/getDetail.vue'),
name: 'statusGetDetail',
component: () => import('@/views/status/getAllDetail.vue'),
name: 'getAllDetail',
hidden: true,
meta: {title: '取码详情', icon: 'form', noCache: true},
meta: {title: '取码详情', icon: 'form', noCache: true},
}
],
},
@ -183,7 +183,7 @@ const routes = [
path: '',
component: () => import('@/views/status/goodsCount.vue'),
name: 'goodsCount',
meta: {title: '印制成品码数据统计', icon: 'form', noCache: true},
// meta: {title: '印制成品码数据统计', icon: 'form', noCache: true},
},
{
path: 'getGoodsDetail',

2
src/utils/request.js

@ -61,7 +61,7 @@ service.interceptors.response.use(
if (res.code !== 200) {
// 511:失效的token;弹出弹框,返回登录页
if (res.code === 207) {
if (res.code === 209) {
if (isToken) {
isToken = false //防止下个一个token失效的请求在弹出第二个框
MessageBox.alert('你已被登出,请重新登录', '确定登出', {

12
src/views/404.vue

@ -2,20 +2,20 @@
<div class="wscn-http404-container">
<div class="wscn-http404">
<div class="pic-404">
<img class="pic-404__parent" :src="_getImage('404_images','building.png')" >
<img class="pic-404__child left" :src="_getImage('404_images','404_cloud.png')">
<img class="pic-404__child mid" :src="_getImage('404_images','404_cloud.png')">
<img class="pic-404__child right" :src="_getImage('404_images','404_cloud.png')">
<img class="pic-404__parent" src="../../public/template/001/img/404_images/building.png" >
<img class="pic-404__child left" src="../../public/template/001/img/404_images/404_cloud.png">
<img class="pic-404__child mid" src="../../public/template/001/img/404_images/404_cloud.png">
<img class="pic-404__child right" src="../../public/template/001/img/404_images/404_cloud.png">
</div>
<div class="bullshit">
<div class="bullshit__oops">OOPS!</div>
<div class="bullshit__info">版权所有
<a class="link-type" href="https://www.000860.com/sxkg/index.aspx" target="_blank">顺鑫农业</a>
<a class="link-type" target="_blank">顺鑫农业</a>
</div>
<div class="bullshit__headline">{{ message }}</div>
<!-- <div class="bullshit__info">请检查您输入的网址是否正确请点击以下按钮返回主页或者发送错误报告</div> -->
<br>
<a href="#/home" class="bullshit__return-home">返回首页</a>
<a href="#/login" class="bullshit__return-home">返回首页</a>
</div>
</div>
</div>

5
src/views/get/addGet.vue

@ -11,7 +11,7 @@
</el-form>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码总数{{AllData.totalSend}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码总数{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码剩余{{AllData.sendRemainder}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">余码量{{AllData.sendRemainder}}</span>
<br><br>
</div>
<el-form :model="paramsForm" ref="rForm" :rules="paramsForm.paramsRules">
@ -19,7 +19,7 @@
:data="paramsForm.params"
style="width: 100%">
<el-table-column
label="摘要"
label="取码单备注"
>
<template slot-scope="scope">
<el-form-item
@ -103,7 +103,6 @@ export default {
};
},
mounted() {
console.log(this.$route.query);
this.getCompanyList()
if(this.id != '')
{

2
src/views/get/cancel.vue

@ -29,7 +29,7 @@
<el-table-column prop="summary" label="摘要"></el-table-column>
<el-table-column prop="discardId" label="废码单号"></el-table-column>
<el-table-column prop="discardCount" label="废码数"></el-table-column>
<el-table-column prop="status" label="废码状态">
<el-table-column prop="status" label="废码状态" width="150">
<template slot-scope="scope">
<span v-if="scope.row.status == 0" class="color-wait">待确认</span>
<span v-else-if="scope.row.status == 1" class="color-error">已废弃</span>

30
src/views/get/deliverGoods.vue

@ -106,13 +106,14 @@
<br><br>
<div slot="footer" class="text-center">
<el-button type="primary" size="mini" @click="submitForm('rForm')">保存</el-button>
<el-button type="primary" size="mini" @click="submitForm('rForm',true)">保存并提交</el-button>
<el-button type="info" size="mini" @click="resetForm('rForm')">取消</el-button>
</div>
</div>
</template>
<script>
import {
sentReceipt,uploadReceipt
sentReceipt,savecommit
} from "@/api/returnReceipt"
import {getToken} from "@/utils/auth"
import { getWhitelist } from "@/api/user"
@ -150,7 +151,7 @@ export default {
{required: true,type:'number', message: '请输入送货数量', trigger: 'blur'}
],
receive_company:[
{required: true,type:'number', message: '请输入收货公司名称', trigger: 'blur'}
{required: true, message: '请输入收货公司名称', trigger: 'blur'}
],
receipt:[
{required: true, validator: checkPhotoOpe, trigger: "blur"}
@ -179,11 +180,24 @@ export default {
deleteData(index){
this.paramsForm.params.splice(index,1)
},
addReceipt(){
addReceipt(submitType){
if(this.paramsForm.params.length == 0) return
const params = {
fetch_id:this.QMD_id,
list:this.paramsForm.params
}
if(submitType)
{
savecommit(params).then(res => {
this.$message({
message: res.msg,
type: res.code == 200 ? 'success' : 'error'
});
this.$router.go(-1);
}).catch(err => {
console.log(err);
})
} else {
sentReceipt(params).then(res => {
this.$message({
message: res.msg,
@ -193,12 +207,13 @@ export default {
}).catch(err => {
console.log(err);
})
}
},
//form
submitForm(formName) {
submitForm(formName,submitType = false) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.addReceipt()
this.addReceipt(submitType)
} else {
console.log('error submit!!');
return false;
@ -245,4 +260,9 @@ export default {
.el-input {
width: 230px;
}
.el-upload__tip {
color: red;
font-weight: 500;
margin-top:0;
}
</style>

198
src/views/get/get.vue

@ -23,13 +23,16 @@
<el-button type="danger" size="mini" icon="el-icon-circle-plus-outline" @click="addGetDialog()">创建取码单</el-button>
</el-form-item>
</el-form>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">余码量{{AllData.sendRemainder}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码量{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">印刷量{{AllData.totalPrint}}</span>
<br><br>
</div>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table :data="tableData" style="width: 100%" >
<el-table-column prop="fetchId" label="取码单号"></el-table-column>
<el-table-column prop="fetchTime" label="日期"></el-table-column>
<!-- <el-table-column prop="summary" label="摘要"></el-table-column> -->
<el-table-column prop="fetchCount" label="取码数"></el-table-column>
<el-table-column prop="status" label="取码单状态">
<el-table-column prop="status" label="取码单状态" width="150">
<template slot-scope="scope">
<span v-if="scope.row.status == 0" class="color-wait">未生成</span>
<span v-else-if="scope.row.status == 1" class="color-send">生成中</span>
@ -43,9 +46,10 @@
</el-table-column>
<el-table-column label="操作" width="250">
<template slot-scope="scope">
<el-button type="text" size="small" @click="addGetDialog(scope.row.fetchId,scope.row.fetchTime)">编辑</el-button>
<el-button type="text" size="small" @click="confirm(scope.row.fetchId)">生成防伪码印刷文件</el-button>
<el-button type="text" size="small" v-if="scope.row.status == 0" @click="addGetDialog(scope.row.fetchId,scope.row.fetchTime)">编辑</el-button>
<el-button type="text" size="small" v-if="scope.row.status == 0" @click="confirm(scope.row.fetchId)">生成防伪码印刷文件</el-button>
<el-button type="text" size="small" @click="showDetail(scope.row.fetchId)">查看</el-button>
<el-button type="text" size="small" v-if="scope.row.status == 0" @click="del(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -74,13 +78,40 @@
<el-button type="info" size="mini" @click="resetForm('form')">取消</el-button>
</div>
</el-dialog>
<el-dialog title="创建取码单" :visible.sync="dialogAddVisible" width="500px" :close-on-click-modal='false'>
<el-form :model="formAdd" :rules="rulesAdd" ref="formAdd">
<el-form-item label="取码单编号:" :label-width="formLabelWidth">
<span>{{num}}</span>
</el-form-item>
<el-form-item label="发码时间:" :label-width="formLabelWidth">
<span>{{theGetTime}}</span>
</el-form-item>
<el-form-item label="印刷公司:" prop="whitelist_id" :label-width="formLabelWidth">
<el-select v-model="formAdd.whitelist_id" placeholder="请选择印刷公司" size="small">
<el-option v-for="(item,index) in whiteList" :key="index" :label="item.companyName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="取码数量:" prop="fetch_count" :label-width="formLabelWidth">
<el-input v-model.number="formAdd.fetch_count" size="small"></el-input>
</el-form-item>
<el-form-item label="取码单备注:" prop="summary" :label-width="formLabelWidth">
<el-input v-model="formAdd.summary" size="small"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="mini" @click="submitForm('formAdd')">保存</el-button>
<el-button type="info" size="mini" @click="resetForm('formAdd')">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getFetchList,generateFetch,sendMessage,getDownloadUrl,downFiles
getFetchList,generateFetch,sendMessage,getDownloadUrl,downFiles,deleteFetchList,addFetchList,updateFetch,getFetchDetail
} from "@/api/get"
import {validatePhone} from "@/utils/validate"
import { getWhitelist } from "@/api/user"
import {summaryPortal} from '@/api/status'
import {validatePhone,getDayTime,getDay2} from "@/utils/validate"
export default {
name: "getGet",
data() {
@ -101,6 +132,8 @@ export default {
telPhone:'',
vCode:''
},
formAdd:{},
rules: {
telPhone: [
{ required: true, message: '请输入手机号', trigger: 'blur' },
@ -110,20 +143,35 @@ export default {
{ required: true, message: '请输入短信验证码', trigger: 'blur' }
]
},
rulesAdd:{
whitelist_id:[
{required: true, message: '请选择公司', trigger: 'change'}
],
fetch_count:[
{required: true,type:'number', message: '请输入取码数量', trigger: 'blur'}
],
},
num:'',
theGetTime:'',
AllData:{},
currentPage: 1, //
pageSize: 10, //
total: 0, //
tableData: [], //
formLabelWidth:'120px',
dialogDownloadVisible:false,
dialogAddVisible:false,
sendStatus:false,
timer:60,
fetchId:'',
isAddBtn:true,
isEdit:false,
whiteList:[]
};
},
mounted() {
this.initData()
this.getSummaryData()
},
methods: {
//
@ -133,7 +181,6 @@ export default {
},
//
initData() {
const params = {
pageNo: this.currentPage,
pageSize: this.pageSize,
@ -141,9 +188,34 @@ export default {
startTime:this.formSearch.time?this.formSearch.time[0] : null,
endTime:this.formSearch.time?this.formSearch.time[1] : null
}
this.isAddBtn = true
getFetchList(params).then(res => {
this.tableData = res.data.list
this.total = res.data.count
this.total = res.data.total
for (let i = 0; i < this.tableData.length; i++) {
const element = this.tableData[i];
if(element.status != 2) {
this.isAddBtn = false
break
}
}
})
},
//
getSummaryData(){
summaryPortal().then(res =>{
this.AllData = res.data
})
},
//
getCompanyList(){
const params = {
pageNo: 1,
pageSize: 1000,
}
getWhitelist(params).then(res => {
this.whiteList = res.data.list
})
},
downLoadFile(id){
@ -177,9 +249,73 @@ export default {
});
},
del(row){
this.$confirm('此操作将删除‘'+row.fetchId+'’此取码单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteFetchList({fetch_id:row.fetchId}).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.initData()
}).catch(err => {
this.$message({
message: err.msg,
type: err.code == 200 ? 'success' : 'error'
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
});
});
},
//
addFetch(){
const params = {
fetch_time:this.theGetTime,
fetch_id:this.num,
list:[this.formAdd]
}
addFetchList(params).then(res => {
this.$message({
message: res.msg,
type: res.code == 200 ? 'success' : 'error'
});
this.resetForm('formAdd')
this.initData()
}).catch(err => {
console.log(err);
})
},
//
upDateData(){
const params = {
fetch_time:this.theGetTime,
fetch_id:this.num,
list:[this.formAdd]
}
updateFetch(params).then(res => {
this.$message({
message: res.msg,
type: res.code == 200 ? 'success' : 'error'
});
this.resetForm('formAdd')
this.initData()
}).catch(err => {
console.log(err);
})
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if(formName == 'form') {
const param ={
fetch_id:this.fetchId,
phone:this.form.telPhone+'',
@ -189,6 +325,15 @@ export default {
window.location.href = this.BASE_URL + res.data
this.dialogDownloadVisible = false
})
} else if (formName == 'formAdd') {
if(this.isEdit)
{
this.upDateData()
} else {
this.addFetch()
}
}
} else {
console.log('error submit!!');
return false;
@ -197,7 +342,12 @@ export default {
},
resetForm(formName) {
this.$refs[formName].resetFields();
if(formName == 'form')
{
this.dialogDownloadVisible = false
} else if (formName == 'formAdd') {
this.dialogAddVisible = false
}
},
confirm(id){
this.$confirm('此操作将生成防伪码印刷文件, 是否继续?', '提示', {
@ -225,13 +375,39 @@ export default {
});
});
},
//
clickRowShowDetail(row, column, event){
this.showDetail(row.fetchId)
},
//
showDetail(id) {
this.$router.push({name:'getGetDetail',query:{id:id}})
},
//
addGetDialog(ids = null,times = null){
this.$router.push({name:'addGet',query:{ids:ids,times:times}})
if( ids == null && times == null && this.isAddBtn == false)
{
this.$alert('当前存在尚未生成取码文件的取码单,请生成取码文件后在创建新的取码单!', '提示', {
confirmButtonText: '确定',
callback: action => {
}
});
return
}
this.getCompanyList()
if(ids == null && times == null) {
this.isEdit = false
} else {
this.isEdit = true
getFetchDetail({fetch_id:ids}).then(res => {
this.formAdd = res.data.fetchDetail[0]
})
}
this.dialogAddVisible = true
this.num = ids || 'QMD_'+getDay2()+'_'+Math.floor(Math.random()*10000)
this.theGetTime = times || getDayTime()
// this.$router.push({name:'addGet',query:{ids:ids,times:times}})
},
//
handleSizeChange(val) {

90
src/views/get/getDetail.vue

@ -5,19 +5,18 @@
<el-form-item label="取码单编号:">
{{id}}
</el-form-item>
<!-- <el-form-item label="时间:">
2021-05-01
</el-form-item> -->
</el-form>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码总数{{AllData.totalSend}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码总数{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码剩余{{AllData.sendRemainder}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码量{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">印刷量{{AllData.totalReceipt}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">未印制量{{AllData.totalUnPrint}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">废码量{{AllData.totalDiscard}}</span>
<br><br>
</div>
<label>取码详情</label>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="whitelistName" label="公司名称"></el-table-column>
<el-table-column prop="summary" label="摘要"></el-table-column>
<el-table-column prop="summary" label="取码单备注信息"></el-table-column>
<el-table-column prop="fetch_count" label="取码数"></el-table-column>
</el-table>
<br><br>
@ -27,9 +26,17 @@
<el-table-column prop="receive_company" label="收货公司"></el-table-column>
<el-table-column prop="sent_time" label="送货时间"></el-table-column>
<el-table-column prop="sent_count" label="送货数量(盘)"></el-table-column>
<el-table-column prop="receipt" label="送货回执单">
<el-table-column prop="status" label="状态" width="150">
<template slot-scope="scope">
<span class="color-send" v-if="scope.row.status == 1">已提交</span>
<span class="color-wait" v-else-if="scope.row.status == 0">待提交</span>
</template>
</el-table-column>
<el-table-column prop="receipt" label="送货回执单" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="showPic(scope.row.receipt)"><i class="el-icon-eye"></i>预览</el-button>
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="commit(scope.row)"><i class="el-icon-eye"></i>提交</el-button>
<el-button v-if="scope.row.status == 0" type="text" size="small" @click="del(scope.row)"><i class="el-icon-eye"></i>删除</el-button>
</template>
</el-table-column>
@ -44,6 +51,7 @@
</template>
<script>
import { getFetchDetail } from "@/api/get"
import {commitReceipt,deleteReceipt} from "@/api/returnReceipt"
import {summaryPortal} from '@/api/status';
export default {
name: "getGetDetail",
@ -64,28 +72,80 @@ export default {
if(this.id != '')
{
this.initData()
this.getSummaryData()
// this.getSummaryData()
}
},
methods: {
//
initData() {
getFetchDetail({fetch_id:this.id}).then(res => {
console.log(res);
this.AllData = res.data.summary
this.tableData = res.data.fetchDetail
this.tableData2 = res.data.receipt
})
},
getSummaryData(){
summaryPortal().then(res =>{
this.AllData = res.data
})
},
// getSummaryData(){
// summaryPortal().then(res =>{
// this.AllData = res.data
// })
// },
showPic(file){
this.dialogPicVisible = true
this.imgPic = this.BASE_URL + file
},
commit(row){
this.$confirm('提交完成后不可删除,请确认信息准确性, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
commitReceipt({id:row.id}).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.initData()
}).catch(err => {
this.$message({
message: err.msg,
type: err.code == 200 ? 'success' : 'error'
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
});
});
},
del(row){
this.$confirm('此操作将删除此回执单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteReceipt({id:row.id}).then(res => {
this.$message({
type: 'success',
message: '删除成功!'
});
this.initData()
}).catch(err => {
this.$message({
message: err.msg,
type: err.code == 200 ? 'success' : 'error'
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
});
});
}
}
};
</script>

9
src/views/layout/components/AppMain.vue

@ -16,6 +16,7 @@
<!-- </keep-alive> -->
</transition>
</section>
<p class="copyright">ICP备案证书号:京ICP备12027436号 京公网安备 11011302002117 牛栏山二锅头酒厂 技术支持福通互联 版本v1.0</p>
</div>
</div>
</template>
@ -72,4 +73,12 @@ import ResizeMixin from "../mixin/ResizeHandler";
padding: 20px;
}
.copyright {
position: absolute;
bottom: 5px;
text-align: center;
width: 100%;
color: gray;
font-size: 15px;
}
</style>

2
src/views/layout/components/Sidebar/index.vue

@ -34,7 +34,7 @@
// return this.$router.options.routes[2].children
// },
isCollapse() {
return !this.sidebar.opened;
return false || !this.sidebar.opened;
},
},
data(){

2
src/views/send/cancel.vue

@ -26,7 +26,7 @@
<el-table-column prop="summary" label="摘要"></el-table-column>
<el-table-column prop="discardId" label="废码单号"></el-table-column>
<el-table-column prop="discardCount" label="废码数"></el-table-column>
<el-table-column prop="status" label="废码状态">
<el-table-column prop="status" label="废码状态" width="150">
<template slot-scope="scope">
<span v-if="scope.row.status == 0" class="color-wait">待确认</span>
<span v-else-if="scope.row.status == 1" class="color-error">已废弃</span>

24
src/views/send/send.vue

@ -13,13 +13,6 @@
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="取码状态:">
<el-select v-model="formSearch.status" clearable size="mini" placeholder="请选择取码状态">
<el-option label="有剩余" :value="1"></el-option>
<el-option label="无剩余" :value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button>
</el-form-item>
@ -28,16 +21,18 @@
</el-form-item>
</el-form>
</div>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码总数{{AllData.totalSend}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码总数{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码剩余{{AllData.sendRemainder}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码量{{AllData.totalSend}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码量{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">印刷量{{AllData.totalPrint}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">余码量{{AllData.sendRemainder}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">废码量{{AllData.totalDiscard}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">未印制量{{AllData.totalUnPrint}}</span>
<br><br>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="sendTime" label="发码日期"></el-table-column>
<el-table-column prop="sendCount" label="发码数"></el-table-column>
<el-table-column prop="sendRemainder" label="发码剩余"></el-table-column>
<el-table-column prop="sendRemainder" label="余码量"></el-table-column>
<el-table-column prop="receivedCount" label="取码数"></el-table-column>
<el-table-column prop="status" label="发码状态"></el-table-column>
<!-- <el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="showDetail(scope.row.id)"><i class="el-icon-edit"></i>查看</el-button>
@ -104,8 +99,7 @@ export default {
data() {
return {
formSearch: {//
time: '',
status:null
time: ''
},
AllData:{},
currentPage: 1, //
@ -153,7 +147,7 @@ export default {
}
getSendList(params).then(res => {
this.tableData = res.data.list
this.total = res.data.count
this.total = res.data.total
})
},
getSummaryData(){

98
src/views/status/getAllDetail.vue

@ -0,0 +1,98 @@
<template>
<div class="app-container">
<label>送码详情</label>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="whitelistName" label="送货公司"></el-table-column>
<el-table-column prop="receive_company" label="收货公司"></el-table-column>
<el-table-column prop="sent_time" label="送货时间"></el-table-column>
<el-table-column prop="sent_count" label="送货数量(盘)"></el-table-column>
<el-table-column prop="status" label="状态" width="150">
<template slot-scope="scope">
<span class="color-success" v-if="scope.row.status == 1">已提交</span>
<span class="color-wait" v-else-if="scope.row.status == 0">待提交</span>
</template>
</el-table-column>
<el-table-column prop="receipt" label="送货回执单" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="showPic(scope.row.receipt)"><i class="el-icon-eye"></i>预览</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, prev, pager, next, sizes, jumper"
:total="total">
</el-pagination>
<el-dialog
title="回执单"
:visible.sync="dialogPicVisible"
width="700px">
<img :src="imgPic" style="width:100%;">
</el-dialog>
</div>
</template>
<script>
import {receiptAllList} from '@/api/status';
export default {
name: "getAllDetail",
data() {
return {
AllData:{},
BASE_URL:config.API_URL,
dialogPicVisible:false,
imgPic:'',
tableData: [],
currentPage: 1, //
pageSize: 10, //
total: 0, //
};
},
mounted() {
this.initData()
},
methods: {
//
initData() {
const params = {
pageNo: this.currentPage,
pageSize: this.pageSize
}
receiptAllList(params).then(res => {
this.tableData = res.data.list
this.total = res.data.total
})
},
showPic(file){
this.dialogPicVisible = true
this.imgPic = this.BASE_URL + file
},
//
handleSizeChange(val) {
this.pageSize = val
this.initData()
},
//
handleCurrentChange(val) {
this.currentPage = val
this.initData()
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.input-with-select {
float: left;
top: 10px;
}
.el-input {
width: 230px;
}
</style>

17
src/views/status/goodsCount.vue

@ -17,6 +17,13 @@
<el-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button>
</el-form-item>
</el-form>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">发码量{{AllData.totalSend}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">取码量{{AllData.totalFetch}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">余码量{{AllData.sendRemainder}}</span><br>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">印刷量{{AllData.totalPrint}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">废码量{{AllData.totalDiscard}}</span>
<span class="font-size-16 line-height-2em color-error" style="margin-right:20px;">未印制量{{AllData.totalUnPrint}}</span>
<br><br>
</div>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="fetchId" label="取码单号"></el-table-column>
@ -46,13 +53,14 @@
</template>
<script>
import {
printList
printList,summaryPortal
} from "@/api/status"
export default {
name: "goodsCount",
data() {
return {
AllData:{},
formSearch: {//
time: '',
},
@ -65,6 +73,7 @@ export default {
},
mounted() {
this.initData()
this.getSummaryData()
},
methods: {
//
@ -85,6 +94,12 @@ export default {
this.total = res.data.count
})
},
//
getSummaryData(){
summaryPortal().then(res =>{
this.AllData = res.data
})
},
//
showDetail(id) {
this.$router.push({name:'getGoodsDetail',query:{id:id}})

500
src/views/status/sendStatus.vue

@ -1,35 +1,26 @@
<template>
<div class="app-container">
<!-- <div id="ehcarts_1" class="myEcharts"></div> -->
<div id="ehcarts_1" class="myEcharts"></div>
<div>
<el-form :inline="true" :model="formSearch" ref="ruleForm" class="demo-form-inline">
<el-form-item label="时间:">
<el-date-picker
v-model="formSearch.time"
size="mini"
value-format="yyyy-MM-dd HH:mm:ss"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="time" label="日期"></el-table-column>
<el-table-column prop="send_count" label="发码数"></el-table-column>
<el-table-column prop="fetch_count" label="领码数"></el-table-column>
<el-table-column prop="discard_count" label="废码数"></el-table-column>
<el-table-column prop="send_remainder" label="发码剩余"></el-table-column>
<el-table-column label="操作" width="200">
<div id="ehcarts_2" class="myEcharts"></div>
<!-- <div class="fetch-block">
<label>取码单编号</label>
<p v-for="(item,index) in fetchList" :key="item.fetchId" @click="checkFetch(item,index)">
<span :class="{ 'color-send': index == fetchIndex}">{{item.fetchId}}</span>
</p>
</div> -->
<div v-show="isShowSend">
<el-table :data="sendList" style="width: 100%" header-row-class-name="">
<el-table-column prop="sendTime" label="发码日期"></el-table-column>
<el-table-column prop="sendCount" label="发码数"></el-table-column>
<el-table-column prop="sendRemainder" label="余码量"></el-table-column>
<el-table-column prop="receivedCount" label="取码数"></el-table-column>
<!-- <el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" v-if="scope.row.type != 1" @click="showDetail(scope.row.real_id,scope.row.type)">查看</el-button>
<el-button type="text" size="small" @click="showDetail(scope.row.id)"><i class="el-icon-edit"></i>查看</el-button>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<el-pagination
background
@ -39,43 +30,36 @@
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, prev, pager, next, sizes, jumper"
:total="total">
:total="sendTotal">
</el-pagination>
<el-dialog title="查看" :visible.sync="dialogDetailVisible" width="750px">
<el-row class="font-size-16 line-height-2em">
<el-col :span="12">
<p>发码时间{{sendDetail.sendTime}}</p>
<p>发码数量:{{sendDetail.sendTotal}}</p>
</el-col>
<el-col :span="12">
<p>取码总数:{{sendDetail.getTotal}}</p>
</el-col>
</el-row>
<br>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="a" label="取码单号"></el-table-column>
<el-table-column prop="b" label="取码数"></el-table-column>
</div>
<div v-show="isShowFetch">
<el-table :data="[fetchData]" style="width: 100%" header-row-class-name="">
<!-- <el-table-column prop="fetchId" label="取码单编号"></el-table-column> -->
<el-table-column prop="fetchCount" label="取码数"></el-table-column>
<el-table-column prop="printCount" label="印制数"></el-table-column>
<el-table-column prop="unPrintCount" label="未印制数"></el-table-column>
<el-table-column prop="discardCount" label="废码数"></el-table-column>
<el-table-column label="操作" width="200">
<template slot-scope="scope">
<el-button type="text" size="small" @click="showGetDetail(scope.row.id)"><i class="el-icon-edit"></i>查看</el-button>
<el-button type="text" size="small" @click="showGetDetail(scope.row.fetchId)"><i class="el-icon-edit"></i>查看去向</el-button>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="info" size="mini" @click="dialogDetailVisible = false">取消</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
columnPortal,tablePortal
columnPortal,tablePortal,summaryPortal,sumfetchpie
} from "@/api/status"
import {
getSendList
} from "@/api/send"
import * as echarts from 'echarts';
export default {
name: "sendStatus",
data() {
return {
formSearch: {//
time: ''
@ -87,163 +71,360 @@ export default {
},
dialogDetailVisible:false,
ehcarts_1:null,
ehcarts_2:null,
currentPage: 1, //
pageSize: 10, //
total: 0, //
sendTotal: 0, //
tableData: [
], //
], //,
totalData:{},
isShowSend:false,
sendList:[],
fetchData:[],
// fetchList:[],
fetchTable:[],
// fetchIndex:0,
isShowFetch:false
};
},
mounted() {
this.initData()
// this.initData()
this.initEchartsData()
// this.setEcharts()
this.initSendList()
},
methods: {
//
search() {
this.currentPage = 1
this.initData()
},
//
initData() {
initSendList(){
const params = {
pageNo: this.currentPage,
pageSize: this.pageSize,
startTime:this.formSearch.time?this.formSearch.time[0] : null,
endTime:this.formSearch.time?this.formSearch.time[1] : null
fetchStatus : 0,
}
tablePortal(params).then(res => {
this.tableData = res.data.list
this.total = res.data.count
getSendList(params).then(res => {
this.sendList = res.data.list
this.sendTotal = res.data.total
})
},
initEchartsData(){
let myDate = new Date()
var nowTime = myDate.toLocaleDateString()
var nowTime = nowTime.split('/')[0] + (nowTime.split('/')[1].length > 1 ? nowTime.split('/')[1] : '0'+nowTime.split('/')[1])
var beforeTime = new Date(myDate.setMonth(myDate.getMonth() - 11)).toLocaleDateString()
var beforeTime = beforeTime.split('/')[0] + (beforeTime.split('/')[1].length > 1 ?beforeTime.split('/')[1] : '0'+beforeTime.split('/')[1])
const params2 = {
start_month:beforeTime,
end_month:nowTime
//
summaryPortal().then(res => {
if(res.data) {
this.totalData = res.data
this.setEcharts1(this.totalData)
this.ehcarts_1.on("click", param => {
if(param.data)
{
this.isShowFetch = false
this.isShowSend = true
}
columnPortal(params2).then(res => {
let data = res.data
var xData = []
var yData1 = []
var yData2 = []
var yData3 = []
for (let i = 0; i < data.length; i++) {
const element = data[i];
xData.push(element.month)
yData1.push(element.send_count)
yData2.push(element.fetch_count)
yData3.push(element.discard_count)
});
}
})
//
sumfetchpie().then(res => {
if(res.data)
{
this.fetchData = res.data
// this.fetchIndex = 0
// this.fetchList = res.data
this.setEcharts2()
this.ehcarts_2.on("click", param => {
if(param.data)
{
this.isShowSend = false
this.isShowFetch = true
// this.fetchTable = []
// this.fetchIndex = 0
// this.fetchTable = this.fetchList.slice(1)
}
});
}
this.setEcharts(xData,yData1,yData2,yData3)
})
},
//
showDetail(id,type) {
// this.dialogDetailVisible = true
if(type == 2) {
this.$router.push({name:'statusGetDetail',query:{id:id}})
} else if (type == 3) {
this.$router.push({name:'statusCancelDetail',query:{FMD_id:id}})
//
showGetDetail(id){
this.$router.push({name:'getAllDetail'})
},
//
checkFetch(item,index){
this.isShowSend = false
this.isShowFetch = true
this.fetchTable = []
this.fetchIndex = index
if(index == 0)
{
this.fetchTable = this.fetchList.slice(1)
} else {
this.fetchTable.push(item)
}
},
//
showGetDetail(){
this.$router.push({name:'getDetail'})
setEcharts1(data){
let politicsFenBu_data = [
{
value: data.totalFetch,
name: '取码量',//
},
setEcharts(xData,yData1,yData2,yData3){
{
value: data.sendRemainder,
name: '余码量',//
}
];
this.ehcarts_1 = echarts.init(document.getElementById("ehcarts_1"));
let option = {
grid: {
left:70,
bottom: 30,
right: 15
color: ['#ffda25', '#886eff', '#0cd2e6'],
title: {
itemGap: 10,
text: '发码总数',
subtext: data.totalSend,
left: '21%',
top: '30%',
textAlign: 'center',
textStyle: {
fontFamily: 'Arial',
fontWeight: '400',
fontSize: 18,
color: '#3e347b',
backgroundColor:'#ff3300',
},
subtextStyle: {
fontWeight: '400',
// fontSize: 18,
color: '#3e347b',
fontSize: '20',
fontWeight: 'bold',
backgroundColor: 'rgba(56,89,255,0.2)',
borderColor: 'rgba(255,255,255,1)',
borderWidth: 10,
padding: [6, 6, 6, 6],
shadowColor: 'rgba(56,211,255,1)',
shadowBlur: 3,
borderRadius: 3,
},
color:['rgb(84 112 198)','rgb(145 204 117)','rgb(238 102 102)'],
legend: {
data: ['发码', '取码', '作废']
},
tooltip: {
trigger: "item",
formatter: "{a} <br/>{b}: {c}"
},
xAxis: {
type: "category",
data: xData,
axisLabel: {
interval: 1
// rotate:45
}
trigger: 'item',
formatter: '{a} <br/>{b} : {c}',
backgroundColor: 'rgba(0,0,0,0.6)',
borderColor: 'rgba(0,0,0,0)',
padding: 10,
textStyle: {
color: '#fff',
fontSize: 14,
fontWeight: '300',
},
},
legend: {
itemGap: 10,
icon: 'circle',
type: 'scroll',
orient: 'vertical',
left: 60,
top: '50%',
textStyle: {
color: '#77899c',
rich: {
a: {
color: '#999',
width: 100,
},
b: {
color: '#23c3ff',
width: 60,
align: 'right',
},
c: {
color: '#777777',
width: 100,
align: 'left',
},
},
yAxis: {
type: "value",
splitLine: {
show: false
},
formatter: function (name) {
let target;
for (let i = 0; i < politicsFenBu_data.length; i++) {
if (politicsFenBu_data[i].name == name) {
target = politicsFenBu_data[i].value;
}
}
return `{a|${name}(占比)}{b|${((target / data.totalSend) * 100).toFixed(2) + '%'}}`;
},
},
series: [
{
name: "发码",
type: "bar",
itemStyle: {
borderWidth: 2, //border
borderColor: 'rgba(0,0,0,0.2)',
},
smooth: true,
center: ['62%', '50%'],
name: '',
type: 'pie',
radius: ['10%', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: true,
fontSize: 14,
fontWeight: "bold",
position: "top"
}
formatter: '{b} : {c}',
position: 'top',
},
data: yData1
},
{
name: "取码",
type: "bar",
emphasis: {
label: {
normal: {
formatter: '',
show: true,
fontSize: '40',
fontWeight: 'bold',
},
},
data: politicsFenBu_data,
},
],
};
this.ehcarts_1.setOption(option);
},
setEcharts2(){
let data = this.fetchData
let politicsFenBu_data = [
{
value: data.printCount,
name: '印刷量',//
},
{
value: data.unPrintCount,
name: '未印制量',//
},
{
value: data.discardCount,
name: '废码量',//
}
];
this.ehcarts_2 = echarts.init(document.getElementById("ehcarts_2"));
let option = {
color: ['#ffda25', '#886eff', '#0cd2e6'],
title: {
itemGap: 10,
text: '取码数',
subtext: data.fetchCount,
left: '21%',
top: '30%',
textAlign: 'center',
textStyle: {
fontFamily: 'Arial',
fontWeight: '400',
fontSize: 18,
color: '#3e347b',
backgroundColor:'#ff3300',
},
subtextStyle: {
fontWeight: '400',
fontSize: 18,
color: '#3e347b',
fontSize: '20',
fontWeight: 'bold',
backgroundColor: 'rgba(56,89,255,0.2)',
borderColor: 'rgba(255,255,255,1)',
borderWidth: 10,
padding: [6, 6, 6, 6],
shadowColor: 'rgba(56,211,255,1)',
shadowBlur: 3,
borderRadius: 3,
},
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c}元',
backgroundColor: 'rgba(0,0,0,0.6)',
borderColor: 'rgba(0,0,0,0)',
padding: 10,
textStyle: {
color: '#fff',
fontSize: 14,
fontWeight: "bold",
position: "top"
fontWeight: '300',
},
},
legend: {
itemGap: 10,
icon: 'circle',
type: 'scroll',
orient: 'vertical',
left: 60,
top: '50%',
textStyle: {
color: '#77899c',
rich: {
a: {
color: '#999',
width: 100,
},
b: {
color: '#23c3ff',
width: 60,
align: 'right',
},
c: {
color: '#777777',
width: 100,
align: 'left',
},
},
},
formatter: function (name) {
let target;
for (let i = 0; i < politicsFenBu_data.length; i++) {
if (politicsFenBu_data[i].name == name) {
target = politicsFenBu_data[i].value;
}
}
return `{a|${name}(占比)}{b|${((target / data.fetchCount) * 100).toFixed(2) + '%'}}`;
},
data: yData2
},
series: [
{
name: "作废",
type: "bar",
itemStyle: {
borderWidth: 2, //border
borderColor: 'rgba(0,0,0,0.2)',
},
smooth: true,
center: ['62%', '50%'],
name: '',
type: 'pie',
radius: ['10%', '50%'],
avoidLabelOverlap: false,
label: {
normal: {
show: true,
fontSize: 14,
fontWeight: "bold",
position: "top"
}
formatter: '{b} : {c}',
position: 'top',
},
data: yData3
}
]
}
this.ehcarts_1.setOption(option);
emphasis: {
label: {
formatter: '',
show: true,
fontSize: '40',
fontWeight: 'bold',
},
},
data: politicsFenBu_data,
},
],
};
this.ehcarts_2.setOption(option);
},
//
handleSizeChange(val) {
this.pageSize = val
this.initData()
this.initSendList()
},
//
handleCurrentChange(val) {
this.currentPage = val
this.initData()
this.initSendList()
}
}
};
</script>
@ -258,8 +439,27 @@ export default {
}
.myEcharts {
position: relative;
display: inline-block;
height: 300px;
width: calc(100% - 100px);
margin: 50px;
width: 50%;
// margin: 20px;
}
.fetch-block {
position: relative;
display: inline-block;
width: 200px;
height: 300px;
overflow: hidden;
padding: 20px 0;
p {
line-height: 25px;
color: darkgray;
font-size: 15px;
font-weight: 400;
cursor: pointer;
&:hover {
color: #4395ff;
}
}
}
</style>

69
src/views/systemManage/whiteList.vue

@ -15,7 +15,7 @@
</div>
<el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="companyName" label="企业名称"></el-table-column>
<el-table-column prop="companyName" label="企业名称" width="400"></el-table-column>
<el-table-column prop="contactName" label="联系人"></el-table-column>
<el-table-column prop="phone" label="联系电话"></el-table-column>
<el-table-column prop="insertTime" label="操作时间"></el-table-column>
@ -46,9 +46,14 @@
<el-form-item label="联系人:" :label-width="formLabelWidth" prop="contact_name">
<el-input v-model="form.contact_name" autocomplete="off" placeholder="请输入姓名(必填)"></el-input>
</el-form-item>
<el-form-item label="联系电话:" :label-width="formLabelWidth" prop="phone">
<el-input v-model="form.phone" autocomplete="off" minlength="11" maxlength="11"
placeholder="请输入电话号码(必填)"></el-input>
<el-form-item label="联系电话1:" :label-width="formLabelWidth" prop="phone">
<el-input v-model="form.phone" autocomplete="off" minlength="11" maxlength="11" placeholder="请输入电话号码(必填)"></el-input>
</el-form-item>
<el-form-item label="联系电话2:" :label-width="formLabelWidth" prop="phone2">
<el-input v-model="form.phone2" autocomplete="off" minlength="11" maxlength="11" placeholder="请输入电话号码(选填)"></el-input>
</el-form-item>
<el-form-item label="联系电话3:" :label-width="formLabelWidth" prop="phone3">
<el-input v-model="form.phone3" autocomplete="off" minlength="11" maxlength="11" placeholder="请输入电话号码(选填)"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@ -78,7 +83,17 @@ export default {
}
}
}
const checkPhone2 = (rule, value, callback) => {
if (!value) {
return callback();
} else {
if (validatePhone(value)) {
callback();
} else {
return callback(new Error('请输入正确的手机号'));
}
}
}
return {
isEdit: false, // or
formSearch: {//
@ -106,6 +121,12 @@ export default {
],
phone: [
{required: true, validator: checkPhone, trigger: 'blur'}
],
phone2: [
{required: false, validator: checkPhone2, trigger: 'blur'}
],
phone3: [
{required: false, validator: checkPhone2, trigger: 'blur'}
]
},
tableData: [], //
@ -136,12 +157,29 @@ export default {
//.dialog
addUserDialog() {
this.isEdit = false
// this.form = {}
this.form = {
company_name: '',
contact_name: '',
phone: ''
}
this.dialogAddUserVisible = true
},
//
addWhiteListInfo() {
addWhiteList(this.form).then(res => {
let param = {
company_name: this.form.company_name,
contact_name: this.form.contact_name,
phone: this.form.phone
}
if(this.form.phone2 && this.form.phone2.trim() != '')
{
param.phone += ','+this.form.phone2
}
if(this.form.phone3 && this.form.phone3.trim() != '')
{
param.phone += ','+this.form.phone3
}
addWhiteList(param).then(res => {
this.$message({
message: res.msg,
type: res.code == 200 ? 'success' : 'error'
@ -181,14 +219,27 @@ export default {
company_name: row.companyName,
contact_name: row.contactName,
// insert_time: row.insertTime,
phone: row.phone,
phone: row.phone.split(',')[0],
phone2: row.phone.split(',')[1],
phone3: row.phone.split(',')[2],
wid:row.id
},
this.dialogAddUserVisible = true
},
//
updateUserData() {
updateWhiteList(this.form).then(res => {
let param = JSON.parse(JSON.stringify(this.form))
if(this.form.phone2 && this.form.phone2.trim() != '')
{
param.phone += ','+this.form.phone2
delete param.phone2
}
if(this.form.phone3 && this.form.phone3.trim() != '')
{
param.phone += ','+this.form.phone3
delete param.phone3
}
updateWhiteList(param).then(res => {
this.$message({
message: res.msg,
type: res.code == 200 ? 'success' : 'error'

Loading…
Cancel
Save