Commit ea96d2ee authored by 高宇's avatar 高宇

拍照 和扫码

parent 9554d707
......@@ -14,6 +14,7 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
},
"dependencies": {
"dsbridge": "^3.1.4",
"@riophae/vue-treeselect": "^0.4.0",
"axios": "0.18.1",
"bpmn-js": "^6.1.1",
......
......@@ -36,6 +36,8 @@ import Pagination from '@/components/Pagination'
import { uploadPublic } from '@/api/fileUploadPublic'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
// 安卓h5交互
import { WebView } from '@/utils/WebViewContact'
Vue.use(Viewer)
Viewer.setDefaults({
Options: {
......@@ -47,6 +49,7 @@ Viewer.setDefaults({
})
// 全局方法挂载
Vue.prototype.$WebView = WebView
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
......
const DS_BRIDGE = require('dsbridge')
// 拍照
export const openCamera = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openCamera', params, res => {
resolve(res)
})
})
}
// 扫码
export const openScan = (params) => {
return new Promise(resolve => {
DS_BRIDGE.call('openScan', params, res => {
resolve(res)
})
})
}
export const WebView = {
openCamera,
openScan
}
......@@ -74,7 +74,11 @@
<div class="inspectionStandards">
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准1:" label-width="80">
<el-input v-model="inspectJbAl2o3List.standardOne" class="inspectionStandardsInput" @blur="getInspect" />
<el-input
v-model="inspectJbAl2o3List.standardOne"
class="inspectionStandardsInput"
@blur="getInspect"
/>
</el-form-item>
</el-form>
</div>
......@@ -134,7 +138,11 @@
<div class="inspectionStandards">
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准2:" label-width="80">
<el-input v-model="inspectJbAl2o3List.standardTwo" class="inspectionStandardsInput" @blur="getInspect" />
<el-input
v-model="inspectJbAl2o3List.standardTwo"
class="inspectionStandardsInput"
@blur="getInspect"
/>
</el-form-item>
</el-form>
</div>
......@@ -181,12 +189,20 @@
<div class="inspectionStandards">
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准1:" label-width="80">
<el-input v-model="inspectJbAl2o3List.limitOne" class="inspectionStandardsInput" @blur="getInspectNext" />
<el-input
v-model="inspectJbAl2o3List.limitOne"
class="inspectionStandardsInput"
@blur="getInspectNext"
/>
</el-form-item>
</el-form>
<el-form :model="inspectJbAl2o3List">
<el-form-item label="检验标准2:" label-width="80">
<el-input v-model="inspectJbAl2o3List.limitTwo" class="inspectionStandardsInput" @blur="getInspectNext" />
<el-input
v-model="inspectJbAl2o3List.limitTwo"
class="inspectionStandardsInput"
@blur="getInspectNext"
/>
</el-form-item>
</el-form>
</div>
......@@ -314,7 +330,7 @@
<div class="uploadLabel">附件:</div>
<div class="uploadImg">
<div class="peviewImg">
<div id="imageOne" class="OneImg">
<div v-if="showImgViewer" id="imageOne" class="OneImg">
<el-image
class="OneElImg"
:src="url"
......@@ -323,83 +339,14 @@
@click.stop="handleClickStop('imageOne')"
/>
</div>
<el-upload
class="oneUploadButton"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-remove="handleRemoveImg"
:on-success="uploadSuccess"
:file-list="imgFileList"
>
<div class="uploadIcon">
<i class="el-icon-plus" />
<div class="uploadButton" @click="handleTakePhotos">
<div class="uploadContent">
<div class="imgContainer">
<img class="img" src="@/assets/image/shangchuan.png">
</div>
<div class="imgText">点击下载</div>
</div>
</el-upload>
<!-- <div id="imageTwo" class="twoImg">-->
<!-- <el-image-->
<!-- class="twoElImg"-->
<!-- :src="url1"-->
<!-- fit="full"-->
<!-- :preview-src-list="srcList1"-->
<!-- @click.stop="handleClickStop('imageTwo')"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="uploadButton">-->
<!-- <div class="uploadContent">-->
<!-- <div class="imgContainer">-->
<!-- <img class="img" src="@/assets/image/shangchuan.png">-->
<!-- </div>-->
<!-- <div class="imgText">点击下载</div>-->
<!-- </div>-->
<!-- </div>-->
<!-- -->
<!-- <div v-if="showImgViewer" id="imageOne" class="OneImg">-->
<!-- <el-image-->
<!-- class="OneElImg"-->
<!-- :src="url"-->
<!-- fit="full"-->
<!-- :preview-src-list="srcList"-->
<!-- @click.stop="handleClickStop('imageOne')"-->
<!-- />-->
<!-- </div>-->
<!-- <el-upload-->
<!-- :show-file-list="false"-->
<!-- :action="upload.url + '?updateSupport=' + upload.updateSupport"-->
<!-- list-type="picture-card"-->
<!-- :on-preview="handlePictureCardPreview"-->
<!-- :on-remove="handleRemoveImg"-->
<!-- :on-success="uploadSuccess"-->
<!-- :file-list="imgFileList"-->
<!-- >-->
<!-- </el-upload>-->
<!-- <div id="imageOne" class="OneImg">-->
<!-- <el-image-->
<!-- class="OneElImg"-->
<!-- :src="url"-->
<!-- fit="full"-->
<!-- :preview-src-list="srcList"-->
<!-- @click.stop="handleClickStop('imageOne')"-->
<!-- />-->
<!-- </div>-->
<!-- <div id="imageTwo" class="twoImg">-->
<!-- <el-image-->
<!-- class="twoElImg"-->
<!-- :src="url1"-->
<!-- fit="full"-->
<!-- :preview-src-list="srcList1"-->
<!-- @click.stop="handleClickStop('imageTwo')"-->
<!-- />-->
<!-- </div>-->
<!-- <div class="uploadButton">-->
<!-- <div class="uploadContent">-->
<!-- <div class="imgContainer">-->
<!-- <img class="img" src="@/assets/image/shangchuan.png">-->
<!-- </div>-->
<!-- <div class="imgText">点击下载</div>-->
<!-- </div>-->
<!-- </div>-->
</div>
</div>
</div>
</div>
......@@ -476,10 +423,12 @@ import { getToken } from '@/utils/auth'
import { addIncomeInspectInfo } from '@/api/oneTbale'
import { parseTime } from '@/utils'
import { getInfo } from '@/api/login'
export default {
name: 'CheckList',
data() {
return {
imgUrlForm: {},
activeName: 'first',
initialImgPreviewIndex: 0, // 预览打开看到的图片下标
showImgViewer: false,
......@@ -500,16 +449,16 @@ export default {
updateSupport: 0,
// 设置上传的请求头部
headers: {
Authorization: 'Bearer ' + getToken() },
Authorization: 'Bearer ' + getToken()
},
// 上传的地址
url: process.env.VUE_APP_BASE_API + '/system/user/importExcel'
},
dialogVisible: false,
url: require('@/assets/image/cadone.png'),
url: '',
url1: require('@/assets/image/cadTwo.png'),
// url: '',
srcList: [
require('@/assets/image/cadone.png')
],
// srcList: [],
srcList1: [
......@@ -575,7 +524,8 @@ export default {
wgCq: undefined,
wgFf: undefined,
wgTf: undefined,
limitData: undefined
limitData: undefined,
ossId: undefined
},
// 检查记录1
recode1: [],
......@@ -591,6 +541,17 @@ export default {
methods: {
parseTime,
// 获取检验时间和检验人
// 拍照上传
handleTakePhotos() {
console.log('调用前', getToken())
const params = {
flag: 'openCamera',
tokenMsg: getToken()
}
this.$WebView.openCamera(params).then(res => {
this.inspectInfoList.jcCode = res
})
},
getInspect() {
const time = parseTime(new Date(), '{y}-{m}-{d} {h}:{i}:{s}')
this.inspectJbAl2o3List.oneJcDate = time
......@@ -896,7 +857,7 @@ export default {
console.log('obj', obj)
addIncomeInspectInfo(obj).then(response => {
console.log('re', response)
if (response.code == 200) {
if (response.code === 200) {
this.msgSuccess('保存成功')
}
})
......@@ -913,7 +874,7 @@ export default {
console.log('obj', obj)
addIncomeInspectInfo(obj).then(response => {
console.log('re', response)
if (response.code == 200) {
if (response.code === 200) {
this.msgSuccess('提交成功')
this.resetInspectInfo()
this.reaetinspectJbAl2o3List()
......@@ -942,25 +903,24 @@ export default {
* @return:
**/
processCode(list) {
console.log('list', list.length)
switch (list.length) {
case 1:
this.oneForm.jcCj = list[0]
this.inspectInfoList.jcLot = list[0]
break
case 2:
this.oneForm.jcCj = list[0]
this.oneForm.jcCode = list[1]
this.inspectInfoList.jcLot = list[0]
this.inspectInfoList.jcCj = list[1]
break
case 3:
this.oneForm.jcCj = list[0]
this.oneForm.jcCode = list[1]
this.oneForm.jcLot = list[2]
this.inspectInfoList.jcLot = list[0]
this.inspectInfoList.jcCj = list[1]
this.inspectInfoList.jcPn = list[2]
break
case 4:
this.oneForm.jcCj = list[0]
this.oneForm.jcCode = list[1]
this.oneForm.jcLot = list[2]
this.oneForm.quantity = list[3]
this.inspectInfoList.jcLot = list[0]
this.inspectInfoList.jcCj = list[1]
this.inspectInfoList.jcPn = list[2]
this.inspectInfoList.jcNum = list[3]
break
}
},
......@@ -971,13 +931,22 @@ export default {
* @return:
**/
scanCodes() {
var s = 'a,b,c,d'
let list = []
list = s.split(',')
if (list && list.length > 0) {
console.log('list', list)
this.processCode(list)
console.log('扫码', 11)
const params = {
flag: 'openScan'
}
var selt = this
this.$WebView.openScan(params).then(res => {
console.log('提交后结果', res)
let list = []
list = res.split(':')
if (list && list.length > 0) {
console.log('list', list)
selt.processCode(list)
}
})
// 调用扫码接口
// var s = 'a,b,c,d'
},
handleClick(tab, event) {
console.log(tab, event)
......@@ -1058,10 +1027,12 @@ export default {
.el-dialog__wrapper {
background-color: rgba(0, 0, 0, 0.5);
}
::v-deep .el-tabs__nav-wrap::after{
::v-deep .el-tabs__nav-wrap::after {
background-color: unset;
}
::v-deep .el-tabs__header{
::v-deep .el-tabs__header {
width: 80% !important;
margin-left: 13% !important;
margin-bottom: 20px !important;
......@@ -1090,33 +1061,39 @@ export default {
width: 70%;
//width: 176px;
}
.tableInput{
.tableInput {
border: 1px solid #d9d9d9;
border-radius: 4px;
}
.scanInput{
.scanInput {
width: 67%;
height: 32px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 4px;
}
.scanCode {
margin-left: 1%;
width: 30%;
background: #0057ff;
border-radius: 4px;
}
.topInput{
.topInput {
width: 50%;
height: 32px;
background: #ffffff;
border: 1px solid #d9d9d9;
border-radius: 4px;
}
.topContain{
.topContain {
text-align: right;
}
.normalInput {
//width: 496px;
height: 32px;
......@@ -1135,8 +1112,8 @@ export default {
justify-content: center;
align-items: center;
.scanCode{
width:42px;
.scanCode {
width: 42px;
height: 22px;
}
......@@ -1151,12 +1128,14 @@ export default {
}
}
}
.textDiv{
.textDiv {
margin-top: 20px;
width: 87%;
height: 40px;
text-align: right;
.fontSp{
.fontSp {
font-family: Microsoft YaHei, Microsoft YaHei-400;
margin-right: 5px;
font-weight: 400;
......@@ -1164,13 +1143,16 @@ export default {
}
}
.oneForm {
//margin-top: 50px;
margin-left: 10%;
width: 80%;
::v-deep .el-form-item__content {
margin-left: 45px !important;
}
.formLabel {
width: 100%;
//width: 80px;
......@@ -1260,7 +1242,8 @@ export default {
margin-top: 12px;
margin-top: 12px;
}
.OneTable{
.OneTable {
.twoCheck {
display: flex;
width: 100%;
......@@ -1281,6 +1264,7 @@ export default {
//display: flex;
//justify-content: center;
}
.recordTwoTitle {
margin-top: 5%;
width: 84px;
......@@ -1292,13 +1276,15 @@ export default {
color: #606266;
line-height: 22px;
}
.recordFourTitle{
.recordFourTitle {
width: 74%;
height: auto;
display: flex;
margin-left: 12%;
justify-content: space-around;
}
.recordOneContainer {
margin-top: 16px;
width: 200%;
......@@ -1306,15 +1292,18 @@ export default {
height: auto;
background: rgba(0, 87, 255, 0.05);
border-radius: 4px;
.inspectionStandards{
.inspectionStandards {
width: 80%;
margin-left: 12%;
padding-top: 20px;
.inspectionStandardsInput{
.inspectionStandardsInput {
width: 50%;
}
}
.recordOneTitle{
.recordOneTitle {
width: 100%;
height: 40px;
margin-top: 20px;
......@@ -1323,22 +1312,26 @@ export default {
margin-left: 12%;
align-items: center;
justify-content: space-evenly;
.input{
.input {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
}
.different{
.different {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
}
.average{
.average {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
}
.compare{
.compare {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
......@@ -1351,11 +1344,12 @@ export default {
margin-left: 15%;
//padding-top: 30px;
//padding-left: 90px;
.oneContent{
.oneContent {
display: flex;
margin-top: 16px;
padding-bottom: 16px;
.compareValue{
.compareValue {
margin-left: 29.7%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -1364,7 +1358,8 @@ export default {
display: flex;
align-items: center;
}
.number{
.number {
width: 9px;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -1373,10 +1368,12 @@ export default {
display: flex;
align-items: center;
}
.recordData{
.recordData {
margin-left: 3%;
}
}
.Content {
display: flex;
margin-top: 16px;
......@@ -1417,7 +1414,8 @@ export default {
margin-top: -3%;
}
}
.averageValue{
.averageValue {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
font-size: 14px;
......@@ -1427,7 +1425,8 @@ export default {
margin-top: -3%;
}
.compareValue{
.compareValue {
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
......@@ -1439,17 +1438,19 @@ export default {
}
}
.recordThreeContent {
width: 80%;
margin-left: 15%;
//padding-top: 30px;
//padding-left: 90px;
.oneContent{
.oneContent {
display: flex;
margin-top: 16px;
padding-bottom: 16px;
margin-left: 10%;
.compareValue{
.compareValue {
margin-left: 29.7%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -1458,7 +1459,8 @@ export default {
display: flex;
align-items: center;
}
.number{
.number {
width: 9px;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -1467,10 +1469,12 @@ export default {
display: flex;
align-items: center;
}
.recordData{
.recordData {
margin-left: 3%;
}
}
.Content {
display: flex;
margin-top: 16px;
......@@ -1512,7 +1516,8 @@ export default {
margin-top: -3%;
}
}
.averageValue{
.averageValue {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
font-size: 14px;
......@@ -1522,7 +1527,8 @@ export default {
margin-top: -2%;
}
.compareValue{
.compareValue {
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
......@@ -1598,6 +1604,7 @@ export default {
}
}
}
.twoCheckNext {
display: flex;
width: 100%;
......@@ -1618,6 +1625,7 @@ export default {
//display: flex;
//justify-content: center;
}
.recordTwoTitle {
margin-top: 5%;
width: 84px;
......@@ -1629,7 +1637,8 @@ export default {
color: #606266;
line-height: 22px;
}
.recordThreeTitle{
.recordThreeTitle {
width: 84px;
height: 22px;
font-size: 16px;
......@@ -1649,16 +1658,19 @@ export default {
height: auto;
background: rgba(0, 87, 255, 0.05);
border-radius: 4px;
.inspectionStandards{
.inspectionStandards {
width: 80%;
height: 40px;
margin-left: 12%;
padding-top: 20px;
.inspectionStandardsInput{
.inspectionStandardsInput {
width: 50%;
}
}
.recordOneTitle{
.recordOneTitle {
width: 100%;
height: 40px;
margin-top: 20px;
......@@ -1667,22 +1679,26 @@ export default {
margin-left: 12%;
align-items: center;
justify-content: space-evenly;
.input{
.input {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
}
.different{
.different {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
}
.average{
.average {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
}
.compare{
.compare {
font-family: Microsoft YaHei, Microsoft YaHei-700;
font-weight: 700;
color: #606266;
......@@ -1695,11 +1711,12 @@ export default {
margin-left: 15%;
//padding-top: 30px;
//padding-left: 90px;
.oneContent{
.oneContent {
display: flex;
margin-top: 16px;
padding-bottom: 16px;
.compareValue{
.compareValue {
margin-left: 29.7%;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -1708,7 +1725,8 @@ export default {
display: flex;
align-items: center;
}
.number{
.number {
width: 9px;
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
......@@ -1717,10 +1735,12 @@ export default {
display: flex;
align-items: center;
}
.recordData{
.recordData {
margin-left: 3%;
}
}
.Content {
display: flex;
margin-top: 16px;
......@@ -1761,7 +1781,8 @@ export default {
margin-top: -3%;
}
}
.averageValue{
.averageValue {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
font-size: 14px;
......@@ -1771,7 +1792,8 @@ export default {
margin-top: -4%;
}
.compareValue{
.compareValue {
font-size: 14px;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
......@@ -1852,23 +1874,26 @@ export default {
height: auto;
display: flex;
margin-left: 13%;
margin-top:30px ;
margin-top: 30px;
justify-content: space-between;
.inspectDate{
.inspectDate {
display: flex;
justify-content: space-between;
width: 50%;
width: 26%;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
.inspectTime{
.inspectTime {
display: flex;
justify-content: space-between;
width: 19%;
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
.inspectPerson{
.inspectPerson {
display: flex;
justify-content: space-between;
width: 13%;
......@@ -1933,51 +1958,61 @@ export default {
}
}
}
.twoTable{
.twoTable {
margin-left: 10%;
width: 77%;
.oneRegion{
.oneRegion {
display: flex;
justify-content: space-between;
.leftRegion{
.leftRegion {
width: 47%;
//height: 100%;
//border: 1px solid #d9d9d9;
//border-radius: 4px;
}
.rightRegion{
.rightRegion {
width: 47%;
//height: 100%;
//border: 1px solid #d9d9d9;
//border-radius: 4px;
}
}
.twoRegion{
.twoRegion {
display: flex;
justify-content: space-between;
.leftRegion{
.leftRegion {
width: 44.5%;
//height: 100%;
//border: 1px solid #d9d9d9;
//border-radius: 4px;
}
.rightRegion{
.rightRegion {
width: 44.5%;
//height: 100%;
//border: 1px solid #d9d9d9;
//border-radius: 4px;
}
}
.threeRegion{
.threeRegion {
display: flex;
justify-content: space-between;
.leftRegion{
.leftRegion {
width: 44.5%;
//height: 100%;
//border: 1px solid #d9d9d9;
//border-radius: 4px;
}
.rightRegion{
.rightRegion {
width: 44.5%;
//height: 100%;
//border: 1px solid #d9d9d9;
......@@ -2019,21 +2054,23 @@ export default {
border-radius: 4px;
}
}
.oneUploadButton{
::v-deep .el-upload--picture-card{
margin-left: 16px;
width: 112px;
line-height: unset;
height: 112px;
background: #ffffff;
border: 1px dashed #d9d9d9;
border-radius: 4px;
justify-content: center;
align-items: center;
display: flex;
}
.uploadIcon{
.imgText{
.oneUploadButton {
::v-deep .el-upload--picture-card {
margin-left: 16px;
width: 112px;
line-height: unset;
height: 112px;
background: #ffffff;
border: 1px dashed #d9d9d9;
border-radius: 4px;
justify-content: center;
align-items: center;
display: flex;
}
.uploadIcon {
.imgText {
margin-top: 8px;
width: 72px;
height: 16px;
......@@ -2105,24 +2142,29 @@ export default {
line-height: 16px;
}
}
.inspectionResults{
.inspectionResults {
width: 31%;
margin-top: 40px;
margin-left: 10%;
}
.partIv{
.partIv {
.auditor {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
.auditTime{
.auditTime {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
.auditStatus{
.auditStatus {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
display: flex;
width: 31%;
height: auto;
......@@ -2130,15 +2172,18 @@ export default {
margin-left: 10%;
justify-content: space-between;
}
.auditOpinion{
::v-deep .el-form-item__label{
.auditOpinion {
::v-deep .el-form-item__label {
font-family: Microsoft YaHei, Microsoft YaHei-400;
font-weight: 400;
}
width: 31%;
margin-left: 10%;
margin-top: 20px;
}
.submitButton {
margin-top: 50px;
margin-left: 30%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment