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. 22
      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. 48
      src/views/get/deliverGoods.vue
  12. 216
      src/views/get/get.vue
  13. 92
      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. 552
      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 = { config = {
// API_URL: 'http://172.119.50.248:8081', // API_URL: 'http://fw.niulanshan.com.cn:8081',
// API_URL: 'http://61.135.192.50:8081', API_URL: 'http://121.36.65.171:9999',
API_URL: 'http://172.119.51.195:8081', // 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) { export function updateFetch(params) {
return request({ return request({

26
src/api/returnReceipt.js

@ -8,6 +8,32 @@ export function sentReceipt(params) {
data: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) { export function uploadReceipt(params) {
return request({ return request({

19
src/api/status.js

@ -34,3 +34,22 @@ export function printList(params) {
data: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
});
}

22
src/permission.js

@ -9,25 +9,13 @@ const whiteList = ['/login'] // 不重定向白名单
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
NProgress.start() NProgress.start()
if (getToken()) { if (getToken()) {
if (to.path === '/login') { // if (to.path === '/login') {
next({path: '/'}) // next({path: '/'})
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it // NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
} else { // } 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: '/' })
// })
// })
// } else {
// store.dispatch('changeActiveIndex', '/' + to.path.split("/")[1]).then();
next() next()
NProgress.done() NProgress.done()
// } // }
}
} else { } else {
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
next() next()

16
src/router/index.ts

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

2
src/utils/request.js

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

12
src/views/404.vue

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

5
src/views/get/addGet.vue

@ -11,7 +11,7 @@
</el-form> </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.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.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> <br><br>
</div> </div>
<el-form :model="paramsForm" ref="rForm" :rules="paramsForm.paramsRules"> <el-form :model="paramsForm" ref="rForm" :rules="paramsForm.paramsRules">
@ -19,7 +19,7 @@
:data="paramsForm.params" :data="paramsForm.params"
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
label="摘要" label="取码单备注"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-form-item <el-form-item
@ -103,7 +103,6 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log(this.$route.query);
this.getCompanyList() this.getCompanyList()
if(this.id != '') 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="summary" label="摘要"></el-table-column>
<el-table-column prop="discardId" 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="discardCount" label="废码数"></el-table-column>
<el-table-column prop="status" label="废码状态"> <el-table-column prop="status" label="废码状态" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 0" class="color-wait">待确认</span> <span v-if="scope.row.status == 0" class="color-wait">待确认</span>
<span v-else-if="scope.row.status == 1" class="color-error">已废弃</span> <span v-else-if="scope.row.status == 1" class="color-error">已废弃</span>

48
src/views/get/deliverGoods.vue

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

216
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-button type="danger" size="mini" icon="el-icon-circle-plus-outline" @click="addGetDialog()">创建取码单</el-button>
</el-form-item> </el-form-item>
</el-form> </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> </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="fetchId" label="取码单号"></el-table-column>
<el-table-column prop="fetchTime" 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="fetchCount" label="取码数"></el-table-column>
<el-table-column prop="status" label="取码单状态"> <el-table-column prop="status" label="取码单状态" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 0" class="color-wait">未生成</span> <span v-if="scope.row.status == 0" class="color-wait">未生成</span>
<span v-else-if="scope.row.status == 1" class="color-send">生成中</span> <span v-else-if="scope.row.status == 1" class="color-send">生成中</span>
@ -43,9 +46,10 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="250"> <el-table-column label="操作" width="250">
<template slot-scope="scope"> <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" v-if="scope.row.status == 0" @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="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" @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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -74,13 +78,40 @@
<el-button type="info" size="mini" @click="resetForm('form')">取消</el-button> <el-button type="info" size="mini" @click="resetForm('form')">取消</el-button>
</div> </div>
</el-dialog> </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> </div>
</template> </template>
<script> <script>
import { import {
getFetchList,generateFetch,sendMessage,getDownloadUrl,downFiles getFetchList,generateFetch,sendMessage,getDownloadUrl,downFiles,deleteFetchList,addFetchList,updateFetch,getFetchDetail
} from "@/api/get" } 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 { export default {
name: "getGet", name: "getGet",
data() { data() {
@ -101,6 +132,8 @@ export default {
telPhone:'', telPhone:'',
vCode:'' vCode:''
}, },
formAdd:{},
rules: { rules: {
telPhone: [ telPhone: [
{ required: true, message: '请输入手机号', trigger: 'blur' }, { required: true, message: '请输入手机号', trigger: 'blur' },
@ -110,20 +143,35 @@ export default {
{ required: true, message: '请输入短信验证码', trigger: 'blur' } { 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, // currentPage: 1, //
pageSize: 10, // pageSize: 10, //
total: 0, // total: 0, //
tableData: [], // tableData: [], //
formLabelWidth:'120px', formLabelWidth:'120px',
dialogDownloadVisible:false, dialogDownloadVisible:false,
dialogAddVisible:false,
sendStatus:false, sendStatus:false,
timer:60, timer:60,
fetchId:'', fetchId:'',
isAddBtn:true,
isEdit:false,
whiteList:[]
}; };
}, },
mounted() { mounted() {
this.initData() this.initData()
this.getSummaryData()
}, },
methods: { methods: {
// //
@ -133,7 +181,6 @@ export default {
}, },
// //
initData() { initData() {
const params = { const params = {
pageNo: this.currentPage, pageNo: this.currentPage,
pageSize: this.pageSize, pageSize: this.pageSize,
@ -141,9 +188,34 @@ export default {
startTime:this.formSearch.time?this.formSearch.time[0] : null, startTime:this.formSearch.time?this.formSearch.time[0] : null,
endTime:this.formSearch.time?this.formSearch.time[1] : null endTime:this.formSearch.time?this.formSearch.time[1] : null
} }
this.isAddBtn = true
getFetchList(params).then(res => { getFetchList(params).then(res => {
this.tableData = res.data.list 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){ downLoadFile(id){
@ -177,18 +249,91 @@ 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) { submitForm(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
const param ={ if(formName == 'form') {
fetch_id:this.fetchId, const param ={
phone:this.form.telPhone+'', fetch_id:this.fetchId,
verify_code:this.form.vCode+'' phone:this.form.telPhone+'',
verify_code:this.form.vCode+''
}
getDownloadUrl(param).then(res => {
window.location.href = this.BASE_URL + res.data
this.dialogDownloadVisible = false
})
} else if (formName == 'formAdd') {
if(this.isEdit)
{
this.upDateData()
} else {
this.addFetch()
}
} }
getDownloadUrl(param).then(res => {
window.location.href = this.BASE_URL + res.data
this.dialogDownloadVisible = false
})
} else { } else {
console.log('error submit!!'); console.log('error submit!!');
return false; return false;
@ -197,7 +342,12 @@ export default {
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
this.dialogDownloadVisible = false if(formName == 'form')
{
this.dialogDownloadVisible = false
} else if (formName == 'formAdd') {
this.dialogAddVisible = false
}
}, },
confirm(id){ confirm(id){
this.$confirm('此操作将生成防伪码印刷文件, 是否继续?', '提示', { this.$confirm('此操作将生成防伪码印刷文件, 是否继续?', '提示', {
@ -225,13 +375,39 @@ export default {
}); });
}); });
}, },
//
clickRowShowDetail(row, column, event){
this.showDetail(row.fetchId)
},
// //
showDetail(id) { showDetail(id) {
this.$router.push({name:'getGetDetail',query:{id:id}}) this.$router.push({name:'getGetDetail',query:{id:id}})
}, },
// //
addGetDialog(ids = null,times = null){ 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) { handleSizeChange(val) {

92
src/views/get/getDetail.vue

@ -5,19 +5,18 @@
<el-form-item label="取码单编号:"> <el-form-item label="取码单编号:">
{{id}} {{id}}
</el-form-item> </el-form-item>
<!-- <el-form-item label="时间:">
2021-05-01
</el-form-item> -->
</el-form> </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.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.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> <br><br>
</div> </div>
<label>取码详情</label> <label>取码详情</label>
<el-table :data="tableData" style="width: 100%" header-row-class-name=""> <el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="whitelistName" label="公司名称"></el-table-column> <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-column prop="fetch_count" label="取码数"></el-table-column>
</el-table> </el-table>
<br><br> <br><br>
@ -27,9 +26,17 @@
<el-table-column prop="receive_company" 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_time" label="送货时间"></el-table-column>
<el-table-column prop="sent_count" 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"> <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 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> </template>
</el-table-column> </el-table-column>
@ -44,6 +51,7 @@
</template> </template>
<script> <script>
import { getFetchDetail } from "@/api/get" import { getFetchDetail } from "@/api/get"
import {commitReceipt,deleteReceipt} from "@/api/returnReceipt"
import {summaryPortal} from '@/api/status'; import {summaryPortal} from '@/api/status';
export default { export default {
name: "getGetDetail", name: "getGetDetail",
@ -64,28 +72,80 @@ export default {
if(this.id != '') if(this.id != '')
{ {
this.initData() this.initData()
this.getSummaryData() // this.getSummaryData()
} }
}, },
methods: { methods: {
// //
initData() { initData() {
getFetchDetail({fetch_id:this.id}).then(res => { getFetchDetail({fetch_id:this.id}).then(res => {
console.log(res); this.AllData = res.data.summary
this.tableData = res.data.fetchDetail this.tableData = res.data.fetchDetail
this.tableData2 = res.data.receipt this.tableData2 = res.data.receipt
}) })
}, },
getSummaryData(){ // getSummaryData(){
summaryPortal().then(res =>{ // summaryPortal().then(res =>{
this.AllData = res.data // this.AllData = res.data
}) // })
}, // },
showPic(file){ showPic(file){
this.dialogPicVisible = true this.dialogPicVisible = true
this.imgPic = this.BASE_URL + file 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> </script>

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

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

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

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

2
src/views/send/cancel.vue

@ -26,7 +26,7 @@
<el-table-column prop="summary" label="摘要"></el-table-column> <el-table-column prop="summary" label="摘要"></el-table-column>
<el-table-column prop="discardId" 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="discardCount" label="废码数"></el-table-column>
<el-table-column prop="status" label="废码状态"> <el-table-column prop="status" label="废码状态" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.status == 0" class="color-wait">待确认</span> <span v-if="scope.row.status == 0" class="color-wait">待确认</span>
<span v-else-if="scope.row.status == 1" class="color-error">已废弃</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="结束日期"> end-placeholder="结束日期">
</el-date-picker> </el-date-picker>
</el-form-item> </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-form-item>
<el-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button> <el-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button>
</el-form-item> </el-form-item>
@ -28,16 +21,18 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </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.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.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.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> <br><br>
<el-table :data="tableData" style="width: 100%" header-row-class-name=""> <el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="sendTime" label="发码日期"></el-table-column> <el-table-column prop="sendTime" label="发码日期"></el-table-column>
<el-table-column prop="sendCount" 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="receivedCount" label="取码数"></el-table-column>
<el-table-column prop="status" label="发码状态"></el-table-column>
<!-- <el-table-column label="操作" width="200"> <!-- <el-table-column label="操作" width="200">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="showDetail(scope.row.id)"><i class="el-icon-edit"></i>查看</el-button> <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() { data() {
return { return {
formSearch: {// formSearch: {//
time: '', time: ''
status:null
}, },
AllData:{}, AllData:{},
currentPage: 1, // currentPage: 1, //
@ -153,7 +147,7 @@ export default {
} }
getSendList(params).then(res => { getSendList(params).then(res => {
this.tableData = res.data.list this.tableData = res.data.list
this.total = res.data.count this.total = res.data.total
}) })
}, },
getSummaryData(){ 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-button type="primary" size="mini" icon="el-icon-search" @click="search">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </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> </div>
<el-table :data="tableData" style="width: 100%" header-row-class-name=""> <el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column prop="fetchId" label="取码单号"></el-table-column> <el-table-column prop="fetchId" label="取码单号"></el-table-column>
@ -46,13 +53,14 @@
</template> </template>
<script> <script>
import { import {
printList printList,summaryPortal
} from "@/api/status" } from "@/api/status"
export default { export default {
name: "goodsCount", name: "goodsCount",
data() { data() {
return { return {
AllData:{},
formSearch: {// formSearch: {//
time: '', time: '',
}, },
@ -65,6 +73,7 @@ export default {
}, },
mounted() { mounted() {
this.initData() this.initData()
this.getSummaryData()
}, },
methods: { methods: {
// //
@ -85,6 +94,12 @@ export default {
this.total = res.data.count this.total = res.data.count
}) })
}, },
//
getSummaryData(){
summaryPortal().then(res =>{
this.AllData = res.data
})
},
// //
showDetail(id) { showDetail(id) {
this.$router.push({name:'getGoodsDetail',query:{id:id}}) this.$router.push({name:'getGoodsDetail',query:{id:id}})

552
src/views/status/sendStatus.vue

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

69
src/views/systemManage/whiteList.vue

@ -15,7 +15,7 @@
</div> </div>
<el-table :data="tableData" style="width: 100%" header-row-class-name=""> <el-table :data="tableData" style="width: 100%" header-row-class-name="">
<el-table-column type="selection" width="55"></el-table-column> <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="contactName" label="联系人"></el-table-column>
<el-table-column prop="phone" label="联系电话"></el-table-column> <el-table-column prop="phone" label="联系电话"></el-table-column>
<el-table-column prop="insertTime" 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-form-item label="联系人:" :label-width="formLabelWidth" prop="contact_name">
<el-input v-model="form.contact_name" autocomplete="off" placeholder="请输入姓名(必填)"></el-input> <el-input v-model="form.contact_name" autocomplete="off" placeholder="请输入姓名(必填)"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="联系电话:" :label-width="formLabelWidth" prop="phone"> <el-form-item label="联系电话1:" :label-width="formLabelWidth" prop="phone">
<el-input v-model="form.phone" autocomplete="off" minlength="11" maxlength="11" <el-input v-model="form.phone" autocomplete="off" minlength="11" maxlength="11" placeholder="请输入电话号码(必填)"></el-input>
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-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <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 { return {
isEdit: false, // or isEdit: false, // or
formSearch: {// formSearch: {//
@ -106,6 +121,12 @@ export default {
], ],
phone: [ phone: [
{required: true, validator: checkPhone, trigger: 'blur'} {required: true, validator: checkPhone, trigger: 'blur'}
],
phone2: [
{required: false, validator: checkPhone2, trigger: 'blur'}
],
phone3: [
{required: false, validator: checkPhone2, trigger: 'blur'}
] ]
}, },
tableData: [], // tableData: [], //
@ -136,12 +157,29 @@ export default {
//.dialog //.dialog
addUserDialog() { addUserDialog() {
this.isEdit = false this.isEdit = false
// this.form = {} this.form = {
company_name: '',
contact_name: '',
phone: ''
}
this.dialogAddUserVisible = true this.dialogAddUserVisible = true
}, },
// //
addWhiteListInfo() { 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({ this.$message({
message: res.msg, message: res.msg,
type: res.code == 200 ? 'success' : 'error' type: res.code == 200 ? 'success' : 'error'
@ -181,14 +219,27 @@ export default {
company_name: row.companyName, company_name: row.companyName,
contact_name: row.contactName, contact_name: row.contactName,
// insert_time: row.insertTime, // 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 wid:row.id
}, },
this.dialogAddUserVisible = true this.dialogAddUserVisible = true
}, },
// //
updateUserData() { 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({ this.$message({
message: res.msg, message: res.msg,
type: res.code == 200 ? 'success' : 'error' type: res.code == 200 ? 'success' : 'error'

Loading…
Cancel
Save