提交个必
This commit is contained in:
parent
8e3f550457
commit
1567ef9e12
@ -46,7 +46,7 @@
|
||||
@click="handlePrint(scope.row)"
|
||||
>重新打印
|
||||
</el-button>
|
||||
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -63,19 +63,20 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { apiGetNewPrintCodes, apiGetCodes, apiGetRePrintCode } from "@/api/api_equipment";
|
||||
import {apiGetNewPrintCodes, apiGetCodes, apiGetRePrintCode} from '@/api/api_equipment'
|
||||
import DeviceTypeDetail from './device-type-detail.vue'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DeviceTypeDetail
|
||||
},
|
||||
data() {
|
||||
|
||||
DeviceTypeDetail
|
||||
},
|
||||
data () {
|
||||
|
||||
return {
|
||||
isShowSearch: true,
|
||||
data: [],
|
||||
dataListLoading: false,
|
||||
newCount: null,
|
||||
newCount: null,
|
||||
showHeader: false,
|
||||
totalPage: 1,
|
||||
departmentReaderOnly: false,
|
||||
@ -89,130 +90,140 @@ export default {
|
||||
gmtModified: null,
|
||||
code: null,
|
||||
},
|
||||
stateList:[
|
||||
stateList: [
|
||||
{value: null, label: '全部'},
|
||||
{value: 0, label: '未打印'},
|
||||
{value: 1, label: '已打印'},
|
||||
],
|
||||
isShowDetail: false
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
created () {
|
||||
// this.handleGetImgCaptcha()
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.getData();
|
||||
|
||||
mounted () {
|
||||
this.getData()
|
||||
},
|
||||
methods: {
|
||||
printNewCodes(){
|
||||
if(!this.newCount || this.newCount == 0){
|
||||
printNewCodes () {
|
||||
if (!this.newCount || this.newCount == 0) {
|
||||
this.$message.error('请输入大于0的打印数量')
|
||||
return
|
||||
}
|
||||
apiGetNewPrintCodes({}, this.newCount).then((data) => {
|
||||
console.log(data);
|
||||
console.log(data)
|
||||
if (data && data.code === 0) {
|
||||
this.getData()
|
||||
this.$message("发送打印请求成功");
|
||||
|
||||
this.$message('发送打印请求成功')
|
||||
} else {
|
||||
this.$message.error("发送打印请求失败!" + data.msg);
|
||||
this.$message.error('发送打印请求失败!' + data.msg)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
changeDepartment(){
|
||||
this.specReq.page = 1;
|
||||
changeDepartment () {
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
},
|
||||
sizeChangeHandle(val) {
|
||||
sizeChangeHandle (val) {
|
||||
this.specReq.page = 1
|
||||
this.specReq.rows = val
|
||||
this.getData();
|
||||
this.getData()
|
||||
},
|
||||
currentChangeHandle(val) {
|
||||
currentChangeHandle (val) {
|
||||
this.specReq.page = val
|
||||
this.getData();
|
||||
this.getData()
|
||||
},
|
||||
getStatusStr(status) {
|
||||
getStatusStr (status) {
|
||||
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) => {
|
||||
console.log(data);
|
||||
console.log(data)
|
||||
if (data && data.code === 0) {
|
||||
this.getData()
|
||||
this.$message("发送打印请求成功");
|
||||
|
||||
this.$message('发送打印请求成功')
|
||||
|
||||
} else {
|
||||
this.$message.error("发送打印请求失败!" + data.msg);
|
||||
this.$message.error('发送打印请求失败!' + data.msg)
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
getData() {
|
||||
console.log("获取数据")
|
||||
|
||||
getData () {
|
||||
console.log('获取数据')
|
||||
console.log(this.name)
|
||||
console.log(this.categorys)
|
||||
this.dataListLoading = true
|
||||
apiGetCodes(this.specReq).then((data) => {
|
||||
console.log(data);
|
||||
console.log(data)
|
||||
if (data && data.code === 0) {
|
||||
this.data = data.codes.list;
|
||||
this.data = data.codes.list
|
||||
this.totalPage = data.codes.totalCount
|
||||
} else {
|
||||
this.data = [];
|
||||
this.data = []
|
||||
}
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
|
||||
btnSearch() {
|
||||
this.specReq.page = 1
|
||||
this.getData();
|
||||
this.dataListLoading = false
|
||||
})
|
||||
},
|
||||
|
||||
rowClick(row, event, column) {},
|
||||
btnSearch () {
|
||||
this.specReq.page = 1
|
||||
this.getData()
|
||||
},
|
||||
|
||||
rowClick (row, event, column) {
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-row {
|
||||
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%;
|
||||
@ -221,6 +232,7 @@ export default {
|
||||
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -229,9 +241,10 @@ export default {
|
||||
height: 100%;
|
||||
border: 1px solid;
|
||||
}
|
||||
|
||||
.flex_son {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0x solid;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@ -1,116 +1,135 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-col :span="20"><div class="grid-content flex"><el-input v-model="qr" placeholder="请输入编码"></el-input></div>
|
||||
</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>
|
||||
</el-row>
|
||||
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-row>
|
||||
<el-col :span="20">
|
||||
<div class="grid-content flex">
|
||||
<el-input v-model="qr" placeholder="请输入编码"></el-input>
|
||||
</div>
|
||||
</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>
|
||||
</el-row>
|
||||
<el-button type="primary" class="div_width" @click="btnSave">确定</el-button>
|
||||
</div>
|
||||
</template>>
|
||||
<script>
|
||||
import * as dd from 'dingtalk-jsapi'
|
||||
export default {
|
||||
data () {
|
||||
return{
|
||||
qr:''
|
||||
}
|
||||
|
||||
},
|
||||
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}})
|
||||
}
|
||||
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
qr: ''
|
||||
}
|
||||
|
||||
},
|
||||
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>
|
||||
|
||||
<style>
|
||||
.el-row {
|
||||
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;
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
|
||||
}
|
||||
.zero_size{
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
.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;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user