|
@@ -21,26 +21,22 @@
|
|
|
<h2 class="bg-left titleup">实时监控</h2>
|
|
|
<div class="bottom">
|
|
|
<div v-if="!monitorUrl1" class="video1">
|
|
|
- <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" >
|
|
|
- <div >监控视频未连接</div>
|
|
|
-
|
|
|
+ <img src="../../../public/img/quesheng@2x.png" alt="" class="img1">
|
|
|
+ <div>监控视频未连接</div>
|
|
|
+
|
|
|
</div>
|
|
|
<div v-else class="video1">
|
|
|
- <iframe :src="monitorUrl1" width="440" height="360" allowfullscreen ="true"
|
|
|
- webkitallowfullscreen="true"
|
|
|
- mozallowfullscreen="true"
|
|
|
- allow="autoplay; fullscreen; microphone;"></iframe>
|
|
|
+ <iframe :src="monitorUrl1" width="440" height="360" allowfullscreen="true" webkitallowfullscreen="true"
|
|
|
+ mozallowfullscreen="true" allow="autoplay; fullscreen; microphone;"></iframe>
|
|
|
</div>
|
|
|
<div v-if="!monitorUrl2" class="video1">
|
|
|
- <img src="../../../public/img/quesheng@2x.png" alt="" class="img1" >
|
|
|
- <div >监控视频未连接</div>
|
|
|
-
|
|
|
+ <img src="../../../public/img/quesheng@2x.png" alt="" class="img1">
|
|
|
+ <div>监控视频未连接</div>
|
|
|
+
|
|
|
</div>
|
|
|
<div v-else class="video2">
|
|
|
- <iframe :src="monitorUrl2" width="440" height="360" allowfullscreen="true"
|
|
|
- webkitallowfullscreen="true"
|
|
|
- mozallowfullscreen="true"
|
|
|
- allow="autoplay; fullscreen; microphone;"></iframe>
|
|
|
+ <iframe :src="monitorUrl2" width="440" height="360" allowfullscreen="true" webkitallowfullscreen="true"
|
|
|
+ mozallowfullscreen="true" allow="autoplay; fullscreen; microphone;"></iframe>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -74,26 +70,28 @@
|
|
|
<ws-input v-model="weighingList.goodsName" placeholder="请输入货名" maxlength="100" size="small" disabled />
|
|
|
</ws-form-item>
|
|
|
<ws-form-item label="毛重(公斤)" span="1" prop="grossWeight">
|
|
|
- <ws-input type="number" @mousewheel.native.prevent v-if="this.index == 0" v-model="weighingList.grossWeight" @input="calculation"
|
|
|
- placeholder="未获取到毛重" maxlength="100" size="small" :disabled="disabled" />
|
|
|
- <ws-input type="number" @mousewheel.native.prevent v-else v-model="weighingList.grossWeight" @input="calculation" placeholder="未获取到毛重"
|
|
|
- maxlength="100" size="small" disabled />
|
|
|
+ <ws-input type="number" @mousewheel.native.prevent v-if="this.index == 0"
|
|
|
+ v-model="weighingList.grossWeight" @input="calculation" placeholder="未获取到毛重" maxlength="100"
|
|
|
+ size="small" :disabled="disabled" />
|
|
|
+ <ws-input type="number" @mousewheel.native.prevent v-else v-model="weighingList.grossWeight"
|
|
|
+ @input="calculation" placeholder="未获取到毛重" maxlength="100" size="small" disabled />
|
|
|
</ws-form-item>
|
|
|
<el-button type="primary" :class="index ==0 ? '' : 'butCss'" @click="openPort">重新获取</el-button>
|
|
|
<ws-form-item label="皮重(公斤)" span="1" prop="tare" v-if="information == '皮重'">
|
|
|
- <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.tare" @input="calculation" placeholder="未获取到皮重" maxlength="100"
|
|
|
- size="small" :disabled="disabled" />
|
|
|
+ <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.tare" @input="calculation"
|
|
|
+ placeholder="未获取到皮重" maxlength="100" size="small" :disabled="disabled" />
|
|
|
</ws-form-item>
|
|
|
<el-button type="primary" v-if="index != 0" @click="openPort">重新获取</el-button>
|
|
|
<div class="formItem">
|
|
|
- <ws-form-item label="扣重(公斤)" span="1" prop="buckleWeightRatio" v-if="information == '皮重' && paramType == '2'">
|
|
|
- <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.buckleMiscellaneous" @input="calculation" placeholder="请输入扣重"
|
|
|
- maxlength="100" size="small" />
|
|
|
+ <ws-form-item label="扣重(公斤)" span="1" prop="buckleWeightRatio"
|
|
|
+ v-if="information == '皮重' && paramType == '2'">
|
|
|
+ <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.buckleMiscellaneous"
|
|
|
+ @input="calculation" placeholder="请输入扣重" maxlength="100" size="small" />
|
|
|
</ws-form-item>
|
|
|
|
|
|
<ws-form-item label="净重(公斤)" span="1" prop="netWeight" v-if="information == '皮重'">
|
|
|
- <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.netWeight" placeholder="请输入净重" maxlength="100" size="small"
|
|
|
- disabled />
|
|
|
+ <ws-input type="number" @mousewheel.native.prevent v-model="weighingList.netWeight"
|
|
|
+ placeholder="请输入净重" maxlength="100" size="small" disabled />
|
|
|
</ws-form-item>
|
|
|
</div>
|
|
|
</ws-info-table>
|
|
@@ -142,7 +140,8 @@
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
- <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单" @close="closeDialog" :close-on-click-modal="false">
|
|
|
+ <el-dialog width="70%" class="table-content" center :visible.sync="isShowPrint" title="粮食检斤单" @close="closeDialog"
|
|
|
+ :close-on-click-modal="false">
|
|
|
<weightCheckPrint :tableData="inspect" ref="saveImg"></weightCheckPrint>
|
|
|
<div style="text-align:center">
|
|
|
<el-button type="primary" @click="closePrint">关闭</el-button>
|
|
@@ -168,15 +167,15 @@
|
|
|
components: {
|
|
|
weightCheckPrint,
|
|
|
},
|
|
|
- watch:{
|
|
|
- weighingList:{//深度监听,可监听到对象、数组的变化
|
|
|
- handler(val, oldVal){
|
|
|
- if(val.tare){
|
|
|
- this.weighingList.netWeight = this.weighingList.grossWeight - val.tare
|
|
|
- }
|
|
|
- },
|
|
|
- deep:true //true 深度监听
|
|
|
- }
|
|
|
+ watch: {
|
|
|
+ weighingList: { //深度监听,可监听到对象、数组的变化
|
|
|
+ handler(val, oldVal) {
|
|
|
+ if (val.tare) {
|
|
|
+ this.weighingList.netWeight = this.weighingList.grossWeight - val.tare
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true //true 深度监听
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -215,9 +214,9 @@
|
|
|
param: 9600,
|
|
|
monitorUrl1: '',
|
|
|
monitorUrl2: '',
|
|
|
- cangid:'',
|
|
|
- paramType:'1',
|
|
|
- warehouseName:''
|
|
|
+ cangid: '',
|
|
|
+ paramType: '1',
|
|
|
+ warehouseName: ''
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
@@ -240,8 +239,7 @@
|
|
|
this.warehouseId = this.$route.query.warehouseId
|
|
|
if (!this.$route.query.grossWeight) {
|
|
|
this.$route.query.grossWeight = 0
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
this.weighingList.grossWeight = this.$route.query.grossWeight
|
|
|
}
|
|
|
// this.purchasePriceList = this.$route.query.purchasePriceList
|
|
@@ -291,7 +289,8 @@
|
|
|
.then((response) => {
|
|
|
for (let i = 0; i < response.records.length; i++) {
|
|
|
if (response.records[i].paymentManagement) {
|
|
|
- if (response.records[i].paymentManagement.status == '待结算' && !response.records[i].paymentManagement.approveStatus) {
|
|
|
+ if (response.records[i].paymentManagement.status == '待结算' && !response.records[i].paymentManagement
|
|
|
+ .approveStatus) {
|
|
|
response.records[i].allow = 1
|
|
|
} else {
|
|
|
response.records[i].allow = 2
|
|
@@ -315,13 +314,13 @@
|
|
|
console.log(this.common.commonWeighingList, 'commonWeighingList')
|
|
|
let _list = this.common.commonWeighingList
|
|
|
for (let i = 0; i < _list.length; i++) {
|
|
|
- if(_list[i].allow == 2){
|
|
|
+ if (_list[i].allow == 2) {
|
|
|
continue
|
|
|
}
|
|
|
if (_list[i].status == '已质检' || _list[i].status == '已称毛重') {
|
|
|
this.mList.push(_list[i])
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if ((_list[i].status == '已称皮重' || _list[i].status == '已称毛重')) {
|
|
|
this.pList.push(_list[i])
|
|
|
}
|
|
@@ -330,42 +329,66 @@
|
|
|
this.index = 0
|
|
|
this.carList = this.mList
|
|
|
if (this.mList.length != 0) {
|
|
|
- let _item = this.mList.filter(function(val){
|
|
|
- console.log(that.$route.query.id)
|
|
|
- if(val.id==that.$route.query.id){
|
|
|
- return val
|
|
|
- }
|
|
|
+ let _item = this.mList.filter(function(val) {
|
|
|
+ console.log(that.$route.query.id)
|
|
|
+ if (val.id == that.$route.query.id) {
|
|
|
+ return val
|
|
|
+ }
|
|
|
})
|
|
|
+ if (_item.length != 0) {
|
|
|
+ this.setCurrent(_item[0])
|
|
|
+
|
|
|
+ this.weighingList = _item[0]
|
|
|
+ this.carWeightInfo = {
|
|
|
+ carNumber: _item[0].carNumber,
|
|
|
+ type: this.information,
|
|
|
+ weight: this.weighingList.grossWeight
|
|
|
+ }
|
|
|
|
|
|
- this.setCurrent(_item[0])
|
|
|
+ this.weighingList = _item[0]
|
|
|
+ } else {
|
|
|
+ this.setCurrent(this.mList[0])
|
|
|
|
|
|
- this.carWeightInfo = {
|
|
|
- carNumber: _item[0].carNumber,
|
|
|
- type: this.information,
|
|
|
- weight: this.weighingList.grossWeight
|
|
|
+ this.weighingList = this.mList[0]
|
|
|
+ this.carWeightInfo = {
|
|
|
+ carNumber: this.mList[0].carNumber,
|
|
|
+ type: this.information,
|
|
|
+ weight: this.weighingList.grossWeight
|
|
|
+ }
|
|
|
}
|
|
|
- this.deptBudgetTotal = this.mList.length
|
|
|
+ this.deptBudgetTotal = this.mList.length
|
|
|
}
|
|
|
- this.weighingList = _item[0]
|
|
|
+
|
|
|
} else {
|
|
|
this.index = 1
|
|
|
this.carList = this.pList
|
|
|
if (this.pList.length != 0) {
|
|
|
- let _item = this.pList.filter(function(val1){
|
|
|
- if(val1.id==that.$route.query.id){
|
|
|
- return val1
|
|
|
- }
|
|
|
+ let _item = this.pList.filter(function(val1) {
|
|
|
+ if (val1.id == that.$route.query.id) {
|
|
|
+ return val1
|
|
|
+ }
|
|
|
})
|
|
|
- this.setCurrent(_item[0])
|
|
|
-
|
|
|
- this.carWeightInfo = {
|
|
|
- carNumber: _item[0].carNumber,
|
|
|
- type: this.information,
|
|
|
- weight: this.weighingList.tare
|
|
|
+ if (_item.length != 0) {
|
|
|
+ this.setCurrent(_item[0])
|
|
|
+ this.weighingList = _item[0]
|
|
|
+ this.carWeightInfo = {
|
|
|
+ carNumber: _item[0].carNumber,
|
|
|
+ type: this.information,
|
|
|
+ weight: this.weighingList.tare
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.setCurrent(this.pList[0])
|
|
|
+
|
|
|
+ this.weighingList = this.pList[0]
|
|
|
+ this.carWeightInfo = {
|
|
|
+ carNumber: this.pList[0].carNumber,
|
|
|
+ type: this.information,
|
|
|
+ weight: this.weighingList.tare
|
|
|
+ }
|
|
|
}
|
|
|
- this.deptBudgetTotal = this.pList.length
|
|
|
+
|
|
|
+ this.deptBudgetTotal = this.pList.length
|
|
|
}
|
|
|
- this.weighingList = _item[0]
|
|
|
}
|
|
|
},
|
|
|
tabClick(val) {
|
|
@@ -409,7 +432,7 @@
|
|
|
baudRate: this.param
|
|
|
}); // set baud rate
|
|
|
this.reader = port.readable.getReader();
|
|
|
-
|
|
|
+
|
|
|
// 监听来自串行设备的数据
|
|
|
while (true) {
|
|
|
const {
|
|
@@ -427,7 +450,7 @@
|
|
|
// var receData = HexConvert.ByteToString(value);
|
|
|
// console.log("receData",receData);
|
|
|
var flag = false;
|
|
|
- if(this.warehouseName&&this.warehouseName == '山东诸城迈饶库'){
|
|
|
+ if (this.warehouseName && this.warehouseName == '山东诸城迈饶库') {
|
|
|
for (var i = 0; i < value.length; i++) {
|
|
|
var tmp = String.fromCharCode(value[i])
|
|
|
if (tmp == '+') {
|
|
@@ -438,22 +461,21 @@
|
|
|
}
|
|
|
}
|
|
|
if (this.tpyeNo != 2) {
|
|
|
- if(parseInt(result)|| parseInt(result) == 0){
|
|
|
+ if (parseInt(result) || parseInt(result) == 0) {
|
|
|
this.weighingList.grossWeight = parseInt(result)
|
|
|
}
|
|
|
} else {
|
|
|
- if(parseInt(result)|| parseInt(result) == 0){
|
|
|
+ if (parseInt(result) || parseInt(result) == 0) {
|
|
|
this.weighingList.tare = parseInt(result)
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- else{
|
|
|
- for(var i=0;i<value.length;i++){
|
|
|
+ } else {
|
|
|
+ for (var i = 0; i < value.length; i++) {
|
|
|
var tmp = String.fromCharCode(value[i])
|
|
|
- if(value[0] != 49 && value[0] != 2){
|
|
|
+ if (value[0] != 49 && value[0] != 2) {
|
|
|
break
|
|
|
}
|
|
|
- if (tmp == String.fromCharCode(32) ) {
|
|
|
+ if (tmp == String.fromCharCode(32)) {
|
|
|
flag = true
|
|
|
}
|
|
|
if (flag && result.length < 7 && tmp != String.fromCharCode(32)) {
|
|
@@ -467,16 +489,16 @@
|
|
|
}
|
|
|
}
|
|
|
if (this.tpyeNo != 2) {
|
|
|
- if(parseInt(result)|| parseInt(result) == 0){
|
|
|
- this.weighingList.grossWeight = parseInt(result)*100
|
|
|
+ if (parseInt(result) || parseInt(result) == 0) {
|
|
|
+ this.weighingList.grossWeight = parseInt(result) * 100
|
|
|
}
|
|
|
} else {
|
|
|
- if(parseInt(result)|| parseInt(result) == 0){
|
|
|
- this.weighingList.tare = parseInt(result)*100
|
|
|
+ if (parseInt(result) || parseInt(result) == 0) {
|
|
|
+ this.weighingList.tare = parseInt(result) * 100
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
setTimeout(1000)
|
|
|
// value 是一个 Uint8Array
|
|
|
}
|
|
@@ -662,7 +684,7 @@
|
|
|
//累计售粮没有超上限完成毛检保存
|
|
|
this.weighingList.relationId = this.relationId;
|
|
|
this.weighingList.secretaryWeigher = sessionStorage.getItem('ws-pf_staffName'),
|
|
|
- grossWeight(this.weighingList)
|
|
|
+ grossWeight(this.weighingList)
|
|
|
.toPromise()
|
|
|
.then((response) => {
|
|
|
this.$notify.success({
|
|
@@ -800,10 +822,12 @@
|
|
|
padding: 20px;
|
|
|
border-radius: 10px;
|
|
|
margin: 0 20px 20px 20px;
|
|
|
- .car-type{
|
|
|
+
|
|
|
+ .car-type {
|
|
|
text-align: left;
|
|
|
}
|
|
|
- .kg-style{
|
|
|
+
|
|
|
+ .kg-style {
|
|
|
font-size: 30px;
|
|
|
}
|
|
|
}
|
|
@@ -929,7 +953,8 @@
|
|
|
padding: 10px 0 !important;
|
|
|
height: auto !important;
|
|
|
}
|
|
|
- .weight{
|
|
|
+
|
|
|
+ .weight {
|
|
|
font-size: 68px;
|
|
|
}
|
|
|
</style>
|