提交个必
This commit is contained in:
parent
8e3f550457
commit
1567ef9e12
@ -46,7 +46,7 @@
|
|||||||
@click="handlePrint(scope.row)"
|
@click="handlePrint(scope.row)"
|
||||||
>重新打印
|
>重新打印
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@ -63,19 +63,20 @@
|
|||||||
</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
|
||||||
},
|
},
|
||||||
data() {
|
data () {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isShowSearch: true,
|
isShowSearch: true,
|
||||||
data: [],
|
data: [],
|
||||||
dataListLoading: false,
|
dataListLoading: false,
|
||||||
newCount: null,
|
newCount: null,
|
||||||
showHeader: false,
|
showHeader: false,
|
||||||
totalPage: 1,
|
totalPage: 1,
|
||||||
departmentReaderOnly: false,
|
departmentReaderOnly: false,
|
||||||
@ -89,130 +90,140 @@ export default {
|
|||||||
gmtModified: null,
|
gmtModified: null,
|
||||||
code: null,
|
code: null,
|
||||||
},
|
},
|
||||||
stateList:[
|
stateList: [
|
||||||
{value: null, label: '全部'},
|
{value: null, label: '全部'},
|
||||||
{value: 0, label: '未打印'},
|
{value: 0, label: '未打印'},
|
||||||
{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 () {
|
||||||
if(!this.newCount || this.newCount == 0){
|
if (!this.newCount || this.newCount == 0) {
|
||||||
this.$message.error('请输入大于0的打印数量')
|
this.$message.error('请输入大于0的打印数量')
|
||||||
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() {
|
|
||||||
this.specReq.page = 1
|
|
||||||
this.getData();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
rowClick(row, event, column) {},
|
btnSearch () {
|
||||||
|
this.specReq.page = 1
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
|
||||||
|
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,9 +241,10 @@ 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;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,116 +1,135 @@
|
|||||||
<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">
|
||||||
</el-col>
|
<div class="grid-content flex">
|
||||||
<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-input v-model="qr" placeholder="请输入编码"></el-input>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
</el-col>
|
||||||
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
|
<el-col :span="4">
|
||||||
</div>
|
<div class="grid-content bg-purple-light">
|
||||||
|
<el-button type="success" class="div_width div_height" @click="goScan">扫码</el-button>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
|
||||||
|
</div>
|
||||||
</template>>
|
</template>>
|
||||||
<script>
|
<script>
|
||||||
import * as dd from 'dingtalk-jsapi'
|
import * as dd from 'dingtalk-jsapi'
|
||||||
export default {
|
|
||||||
data () {
|
|
||||||
return{
|
|
||||||
qr:''
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
export default {
|
||||||
created () {
|
data () {
|
||||||
// this.handleGetImgCaptcha()
|
return {
|
||||||
},
|
qr: ''
|
||||||
mounted () {
|
|
||||||
this.qr = this.$cookie.get('devQr')
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
goScan () {
|
|
||||||
this.scan()
|
|
||||||
},
|
|
||||||
scan () {
|
|
||||||
dd.biz.util.scan({
|
|
||||||
type: String , // type 为 all、qrCode、barCode,默认是all。
|
|
||||||
onSuccess: function(data) {
|
|
||||||
console.log(2)
|
|
||||||
console.log(data)
|
|
||||||
this.qr = data.text
|
|
||||||
}.bind(this),
|
|
||||||
onFail : function(err) {
|
|
||||||
}.bind(this)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
btnSave(){
|
|
||||||
this.$cookie.set('devQr', this.qr)
|
|
||||||
this.$router.replace({name: 'devicedetail', query:{type: 1}})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
// this.handleGetImgCaptcha()
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
this.qr = this.$cookie.get('devQr')
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
goScan () {
|
||||||
|
this.scan()
|
||||||
|
},
|
||||||
|
scan () {
|
||||||
|
dd.biz.util.scan({
|
||||||
|
type: String, // type 为 all、qrCode、barCode,默认是all。
|
||||||
|
onSuccess: function (data) {
|
||||||
|
console.log(2)
|
||||||
|
console.log(data)
|
||||||
|
this.qr = data.text
|
||||||
|
}.bind(this),
|
||||||
|
onFail: function (err) {
|
||||||
|
}.bind(this)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
btnSave () {
|
||||||
|
this.$cookie.set('devQr', this.qr)
|
||||||
|
this.$router.replace({name: 'devicedetail', query: {type: 1}})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.el-row {
|
.el-row {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
}
|
|
||||||
.el-col {
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.bg-purple-dark {
|
|
||||||
background: #99a9bf;
|
|
||||||
}
|
|
||||||
.bg-purple {
|
|
||||||
background: #d3dce6;
|
|
||||||
}
|
|
||||||
.bg-purple-light {
|
|
||||||
background: #e5f2f1;
|
|
||||||
}
|
|
||||||
.grid-content {
|
|
||||||
border-radius: 4px;
|
|
||||||
min-height: 36px;
|
|
||||||
}
|
|
||||||
.row-bg {
|
|
||||||
padding: 10px 0;
|
|
||||||
background-color: #f9fafc;
|
|
||||||
}
|
|
||||||
.div_height{
|
|
||||||
height: 38px;
|
|
||||||
}
|
|
||||||
.div_width{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.width_100{
|
|
||||||
width: 100px;
|
|
||||||
}
|
|
||||||
.center{
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
|
|
||||||
padding: 1em;
|
|
||||||
}
|
|
||||||
.flex{
|
|
||||||
display:flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content:center;
|
|
||||||
width:100%;
|
|
||||||
height:100%;
|
|
||||||
border:1px solid;
|
|
||||||
}
|
|
||||||
.flex_son{
|
|
||||||
width:100%;
|
|
||||||
height:100%;
|
|
||||||
border:0x solid;
|
|
||||||
}
|
}
|
||||||
.zero_size{
|
|
||||||
width: 1px;
|
.el-col {
|
||||||
height: 1px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
.bg-purple-dark {
|
||||||
|
background: #99a9bf;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-purple {
|
||||||
|
background: #d3dce6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bg-purple-light {
|
||||||
|
background: #e5f2f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-content {
|
||||||
|
border-radius: 4px;
|
||||||
|
min-height: 36px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row-bg {
|
||||||
|
padding: 10px 0;
|
||||||
|
background-color: #f9fafc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div_height {
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div_width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width_100 {
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
|
||||||
|
padding: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 1px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flex_son {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
border: 0x solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.zero_size {
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user