提交个必

This commit is contained in:
quyixiao 2020-09-29 17:34:33 +08:00
parent 8e3f550457
commit 1567ef9e12
2 changed files with 187 additions and 155 deletions

View File

@ -63,8 +63,9 @@
</div> </div>
</template> </template>
<script> <script>
import { apiGetNewPrintCodes, apiGetCodes, apiGetRePrintCode } from "@/api/api_equipment"; import {apiGetNewPrintCodes, apiGetCodes, apiGetRePrintCode} from '@/api/api_equipment'
import DeviceTypeDetail from './device-type-detail.vue' import DeviceTypeDetail from './device-type-detail.vue'
export default { export default {
components: { components: {
DeviceTypeDetail DeviceTypeDetail
@ -95,14 +96,14 @@ export default {
{value: 1, label: '已打印'}, {value: 1, label: '已打印'},
], ],
isShowDetail: false isShowDetail: false
}; }
}, },
created () { created () {
// this.handleGetImgCaptcha() // this.handleGetImgCaptcha()
}, },
mounted () { mounted () {
this.getData(); this.getData()
}, },
methods: { methods: {
printNewCodes () { printNewCodes () {
@ -111,108 +112,118 @@ export default {
return return
} }
apiGetNewPrintCodes({}, this.newCount).then((data) => { apiGetNewPrintCodes({}, this.newCount).then((data) => {
console.log(data); console.log(data)
if (data && data.code === 0) { if (data && data.code === 0) {
this.getData() this.getData()
this.$message("发送打印请求成功"); this.$message('发送打印请求成功')
} else { } else {
this.$message.error("发送打印请求失败!" + data.msg); this.$message.error('发送打印请求失败!' + data.msg)
} }
}); })
}, },
changeDepartment () { changeDepartment () {
this.specReq.page = 1; this.specReq.page = 1
this.getData() this.getData()
}, },
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.specReq.page = 1 this.specReq.page = 1
this.specReq.rows = val this.specReq.rows = val
this.getData(); this.getData()
}, },
currentChangeHandle (val) { currentChangeHandle (val) {
this.specReq.page = val this.specReq.page = val
this.getData(); this.getData()
}, },
getStatusStr (status) { getStatusStr (status) {
if (status < 2) { if (status < 2) {
return this.stateList[status + 1].label; return this.stateList[status + 1].label
} }
return status; return status
}, },
handlePrint (val) { handlePrint (val) {
apiGetRePrintCode({}, val.code).then((data) => { apiGetRePrintCode({}, val.code).then((data) => {
console.log(data); console.log(data)
if (data && data.code === 0) { if (data && data.code === 0) {
this.getData() this.getData()
this.$message("发送打印请求成功"); this.$message('发送打印请求成功')
} else { } else {
this.$message.error("发送打印请求失败!" + data.msg); this.$message.error('发送打印请求失败!' + data.msg)
} }
}); })
}, },
getData () { getData () {
console.log("获取数据") console.log('获取数据')
console.log(this.name) console.log(this.name)
console.log(this.categorys) console.log(this.categorys)
this.dataListLoading = true this.dataListLoading = true
apiGetCodes(this.specReq).then((data) => { apiGetCodes(this.specReq).then((data) => {
console.log(data); console.log(data)
if (data && data.code === 0) { if (data && data.code === 0) {
this.data = data.codes.list; this.data = data.codes.list
this.totalPage = data.codes.totalCount this.totalPage = data.codes.totalCount
} else { } else {
this.data = []; this.data = []
} }
this.dataListLoading = false; this.dataListLoading = false
}); })
}, },
btnSearch () { btnSearch () {
this.specReq.page = 1 this.specReq.page = 1
this.getData(); this.getData()
}, },
rowClick(row, event, column) {}, rowClick (row, event, column) {
}, },
}; },
}
</script> </script>
<style> <style>
.el-row { .el-row {
margin-bottom: 20px; margin-bottom: 20px;
} }
.el-col { .el-col {
border-radius: 10px; border-radius: 10px;
} }
.bg-purple-dark { .bg-purple-dark {
background: #99a9bf; background: #99a9bf;
} }
.bg-purple { .bg-purple {
background: #d3dce6; background: #d3dce6;
} }
.bg-purple-light { .bg-purple-light {
background: #e5f2f1; background: #e5f2f1;
} }
.grid-content { .grid-content {
border-radius: 4px; border-radius: 4px;
min-height: 36px; min-height: 36px;
} }
.row-bg { .row-bg {
padding: 10px 0; padding: 10px 0;
background-color: #f9fafc; background-color: #f9fafc;
} }
.div_height { .div_height {
height: 38px; height: 38px;
} }
.div_width { .div_width {
width: 100%; width: 100%;
} }
.width_100 { .width_100 {
width: 100px; width: 100px;
} }
.center { .center {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -221,6 +232,7 @@ export default {
padding: 1em; padding: 1em;
} }
.flex { .flex {
display: flex; display: flex;
align-items: center; align-items: center;
@ -229,6 +241,7 @@ export default {
height: 100%; height: 100%;
border: 1px solid; border: 1px solid;
} }
.flex_son { .flex_son {
width: 100%; width: 100%;
height: 100%; height: 100%;

View File

@ -1,9 +1,15 @@
<template> <template>
<div> <div>
<el-row> <el-row>
<el-col :span="20"><div class="grid-content flex"><el-input v-model="qr" placeholder="请输入编码"></el-input></div> <el-col :span="20">
<div class="grid-content flex">
<el-input v-model="qr" placeholder="请输入编码"></el-input>
</div>
</el-col> </el-col>
<el-col :span="4"><div class="grid-content bg-purple-light"><el-button type="success" class="div_width div_height" @click="goScan">扫码</el-button></div> <el-col :span="4">
<div class="grid-content bg-purple-light">
<el-button type="success" class="div_width div_height" @click="goScan">扫码</el-button>
</div>
</el-col> </el-col>
</el-row> </el-row>
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button> <el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
@ -11,6 +17,7 @@
</template>> </template>>
<script> <script>
import * as dd from 'dingtalk-jsapi' import * as dd from 'dingtalk-jsapi'
export default { export default {
data () { data () {
return { return {
@ -24,7 +31,6 @@ export default {
mounted () { mounted () {
this.qr = this.$cookie.get('devQr') this.qr = this.$cookie.get('devQr')
}, },
methods: { methods: {
@ -58,35 +64,45 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
.el-col { .el-col {
border-radius: 10px; border-radius: 10px;
} }
.bg-purple-dark { .bg-purple-dark {
background: #99a9bf; background: #99a9bf;
} }
.bg-purple { .bg-purple {
background: #d3dce6; background: #d3dce6;
} }
.bg-purple-light { .bg-purple-light {
background: #e5f2f1; background: #e5f2f1;
} }
.grid-content { .grid-content {
border-radius: 4px; border-radius: 4px;
min-height: 36px; min-height: 36px;
} }
.row-bg { .row-bg {
padding: 10px 0; padding: 10px 0;
background-color: #f9fafc; background-color: #f9fafc;
} }
.div_height { .div_height {
height: 38px; height: 38px;
} }
.div_width { .div_width {
width: 100%; width: 100%;
} }
.width_100 { .width_100 {
width: 100px; width: 100px;
} }
.center { .center {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -95,6 +111,7 @@ export default {
padding: 1em; padding: 1em;
} }
.flex { .flex {
display: flex; display: flex;
align-items: center; align-items: center;
@ -103,11 +120,13 @@ export default {
height: 100%; height: 100%;
border: 1px solid; border: 1px solid;
} }
.flex_son { .flex_son {
width: 100%; width: 100%;
height: 100%; height: 100%;
border: 0x solid; border: 0x solid;
} }
.zero_size { .zero_size {
width: 1px; width: 1px;
height: 1px; height: 1px;