This commit is contained in:
2022-06-27 10:21:54 +08:00
commit 571e582eca
257 changed files with 41968 additions and 0 deletions

View File

@@ -0,0 +1,183 @@
<template>
<section>
<nav-bar title="设备查询"></nav-bar>
<section class="content mgt186" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
<div class="filter-wraper">
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">设备</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="编码、名称" v-model="val1">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">工序</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option"
:active="active"
:open="open"
@toggleItem="toggleItem"
@dropdownMenu="dropdownMenu">
</dropdown-menu>
</div>
</div>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th><button class="iconfont check_icon check_icon--squa" :class="{'check_icon--checked': allcheckActive}" @click="allCheck"></button></th>
<th>设备编码</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)">
<td><button class="iconfont check_icon check_icon--squa" :class="{'check_icon--checked': e.checked}"></button></td>
<td>{{e.device_code}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>设备名称</th>
<th>规格</th>
<th>型号</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)">
<td>{{e.device_name}}</td>
<td>{{e.device_specification}}</td>
<td>{{e.device_model}}</td>
</tr>
</table>
</div>
</div>
<div class="loading-tips">{{desc}}</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" @click="_queryDevice">查询</button>
<button class="btn submit-button">保存</button>
<button class="btn submit-button">关闭</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {queryWorkProducedure, queryDevice} from '@config/getData2.js'
export default {
name: 'EquipSearchCheckbox',
components: {
NavBar,
DropdownMenu
},
data () {
return {
val1: '',
dataList: [],
option: [],
active: '',
open: false,
page: 1,
size: '10',
busy: false,
desc: '',
checkArr: [],
allcheckActive: false
}
},
created () {
this._queryWorkProducedure()
},
methods: {
toggleItem () {
if (!this.open) {
this.open = true
} else {
this.open = false
}
},
dropdownMenu (i) {
this.active = i + ''
this.open = false
},
async _queryWorkProducedure () {
let res = await queryWorkProducedure()
if (res.code === '1') {
this.option = res.results
this.option.map(el => {
this.$set(el, 'value', el.workprocedure_code)
this.$set(el, 'label', el.workprocedure_name)
})
} else {
this.Dialog(res.desc)
}
},
async _queryDevice () {
let code = ''
if (this.active) {
code = this.option[this.active].workprocedure_code
}
this.page = 1
this.busy = false
this.desc = ''
let res = await queryDevice(this.val1, code, this.page + '', this.size)
if (res.code === '1') {
this.dataList = []
this.checkArr = []
this.allcheckActive = false
res.rows.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.rows]
if (res.rows.length < 10) {
this.busy = true
this.desc = '已加载全部数据'
}
} else {
this.Dialog(res.desc)
this.desc = res.desc
}
},
async loadMore () {
this.busy = true
this.page++
let code = ''
if (this.active) {
code = this.option[this.active].workprocedure_code
}
let res = await queryDevice(this.val1, code, this.page + '', this.size)
if (res.code === '1') {
res.rows.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...this.dataList, ...res.rows]
if (res.rows.length < 10) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
} else {
this.Dialog(res.desc)
this.desc = res.desc
}
},
allCheck () {
this.allcheckActive = this.checkArr.length !== this.dataList.length
this.dataList.map(el => { el.checked = this.allcheckActive })
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
this.allcheckActive = this.checkArr.length === this.dataList.length
}
}
}
</script>
<style lang="stylus" scoped>
>>>.content
height calc(100% - 1.96rem)
overflow-y auto
</style>

View File

@@ -0,0 +1,197 @@
<template>
<section>
<nav-bar :inner="true" title="设备查询"></nav-bar>
<section class="content mgt186" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
<div class="filter-wraper">
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">设备</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" placeholder="编码、名称" v-model="val1">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">工序</div>
<div class="fxcol mgl20 visible" >
<dropdown-menu
:option="option"
:active="active"
:open="open"
@toggleItem="toggleItem"
@dropdownMenu="dropdownMenu">
</dropdown-menu>
</div>
</div>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>设备编码</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.device_id === pkId}">
<td>{{e.device_code}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>设备名称</th>
<th>规格</th>
<th>型号</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.device_id === pkId}">
<td>{{e.device_name}}</td>
<td>{{e.device_specification}}</td>
<td>{{e.device_model}}</td>
</tr>
</table>
</div>
</div>
<div class="loading-tips">{{desc}}</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" @click="_queryDevice">查询</button>
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toKeep">保存</button>
<button class="btn submit-button" @click="$router.back()">关闭</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import DropdownMenu from '@components/DropdownMenu.vue'
import {queryWorkProducedure, queryDevice} from '@config/getData2.js'
export default {
name: 'EquipSearchRadio',
components: {
NavBar,
DropdownMenu
},
data () {
return {
val1: '',
dataList: [],
option: [],
active: '',
open: false,
page: 1,
size: '10',
busy: false,
desc: '',
pkId: '',
pkObj: {},
fromPath: ''
}
},
beforeRouteEnter (to, from, next) {
next((vm) => {
vm.fromPath = from.path
})
},
created () {
this._queryWorkProducedure()
},
methods: {
toggleItem () {
if (!this.open) {
this.open = true
} else {
this.open = false
}
},
dropdownMenu (i) {
this.active = i + ''
this.open = false
},
async _queryWorkProducedure () {
let res = await queryWorkProducedure()
if (res.code === '1') {
this.option = res.results
this.option.map(el => {
this.$set(el, 'value', el.workprocedure_code)
this.$set(el, 'label', el.workprocedure_name)
})
} else {
this.Dialog(res.desc)
}
},
async _queryDevice () {
let code = ''
if (this.active) {
code = this.option[this.active].workprocedure_code
}
this.page = 1
this.busy = false
this.desc = ''
let res = await queryDevice(this.val1, code, this.page + '', this.size)
if (res.code === '1') {
this.dataList = []
this.checkArr = []
this.allcheckActive = false
res.rows.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...res.rows]
if (res.rows.length < 10) {
this.busy = true
this.desc = '已加载全部数据'
}
} else {
this.Dialog(res.desc)
this.desc = res.desc
}
},
async loadMore () {
this.busy = true
this.page++
let code = ''
if (this.active) {
code = this.option[this.active].workprocedure_code
}
let res = await queryDevice(this.val1, code, this.page + '', this.size)
if (res.code === '1') {
res.rows.map(el => {
this.$set(el, 'checked', false)
})
this.dataList = [...this.dataList, ...res.rows]
if (res.rows.length < 10) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
} else {
this.Dialog(res.desc)
this.desc = res.desc
}
},
toCheck (e) {
this.pkId = this.pkId !== e.device_id ? e.device_id : ''
this.pkObj = this.pkId === e.device_id ? e : {}
},
toKeep () {
if (this.pkId) {
if (this.$route.query.url === 'ResultEntry') {
this.$router.push({
path: '/ResultEntry',
query: {
ename: this.pkObj.device_name,
eid: this.pkObj.device_id
}
})
} else {
this.$store.dispatch('materObj', this.pkObj)
this.$router.back()
}
}
}
}
}
</script>
<style lang="stylus" scoped>
>>>.content
height calc(100% - 1.96rem)
overflow-y auto
</style>

View File

@@ -0,0 +1,79 @@
<template>
<section>
<nav-bar :inner="true" title="物料查询"></nav-bar>
<section class="content mgt186 mgb70">
<div class="filter-wraper">
<div class="bottom-filter-tip relative">
<div class="filter-label txtjustify">物料编码</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" ref="scaninput1" v-model="val1">
<a class="icon-scan filter-scan" @click="handleFocus1"></a>
</div>
</div>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th><button class="iconfont check_icon check_icon--squa" :class="{'check_icon--checked': allcheckActive}" @click="allCheck"></button></th>
<th>物料编码</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}">
<td><button class="iconfont check_icon check_icon--squa" :class="{'check_icon--checked': e.checked}"></button></td>
<td>{{e.task_no}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>物料名称</th>
<th>物料类别</th>
</tr>
<tr v-for="(e, i) in dataList" :key="i" @click="toCheck(e)" :class="{'checked': e.task_uuid === pkId}">
<td>{{e.start_devicecode}}</td>
<td>{{e.next_devicecode}}</td>
</tr>
</table>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button">确认</button>
<button class="btn submit-button">取消</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
export default {
name: 'MaterInfoSearchCheckBox',
components: {
NavBar
},
data () {
return {
val1: '',
dataList: [],
checkArr: [],
allcheckActive: false
}
},
methods: {
handleFocus1 () {
this.$refs.scaninput1.focus()
},
allCheck () {
this.allcheckActive = this.checkArr.length !== this.dataList.length
this.dataList.map(el => { el.checked = this.allcheckActive })
this.checkArr = this.dataList.filter(i => { return i.checked === true })
},
toCheck (e) {
e.checked = !e.checked
this.checkArr = this.dataList.filter(i => { return i.checked === true })
this.allcheckActive = this.checkArr.length === this.dataList.length
}
}
}
</script>

View File

@@ -0,0 +1,177 @@
<template>
<section>
<nav-bar :inner="true" title="物料查询"></nav-bar>
<section class="content mgt186" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="0" infinite-scroll-immediate-check="false">
<div class="filter-wraper">
<div class="bottom-filter-tip relative">
<div class="filter-label txtjustify">物料编码</div>
<div class="fxcol mgl20">
<input type="text" class="filter-input filter-scan-input" v-model="val1">
</div>
<div class="mgl20">
<button class="btn" @click="searchList">查询</button>
</div>
</div>
</div>
<div class="grid-wraper">
<div class="left_fixed">
<table class="layout-t left_layout_t">
<tr>
<th>物料编码</th>
</tr>
<tr v-for="e in dataList" :key="e.material_id" @click="toCheck(e)" :class="{'checked': e.material_id === pkId}">
<td>{{e.material_code}}</td>
</tr>
</table>
</div>
<div class="slide">
<table class="layout-t">
<tr>
<th>物料名称</th>
<th>规格</th>
<th>物料类别</th>
</tr>
<tr v-for="e in dataList" :key="e.material_id" @click="toCheck(e)" :class="{'checked': e.material_id === pkId}">
<td>{{e.material_name}}</td>
<td>{{e.material_spec}}</td>
<td>{{e.material_dtl_scode_name}}</td>
</tr>
</table>
</div>
</div>
<div class="loading-tips">{{desc}}</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': pkId === ''}" @click="toSure">确认</button>
<button class="btn submit-button" @click="$router.back()">取消</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import { queryMaterialList } from '@config/getData2.js'
export default {
name: 'MaterInfoSearchRadio',
components: {
NavBar
},
data () {
return {
val1: '',
dataList: [],
pkId: '',
pkObj: {},
fromPath: '',
page: 1,
size: '10',
busy: false,
desc: ''
}
},
beforeRouteEnter (to, from, next) {
next((vm) => {
vm.fromPath = from.path
})
},
methods: {
async searchList () {
this.dataList = []
this.pkId = ''
this.pkObj = {}
this.page = 1
this.size = '10'
this.busy = false
this.desc = ''
let type = ''
// 标签打印 物料查询规则( 1 是pg粉 2 是软废 3 合金球)
// 1 袋标签打印查pg粉传1
// 2 软废组桶物料查只查软废传2
// 3 返工料 只查pg粉传1
// 4 产成品 只查合金球传3
// 5 成品只查pg粉传1
if (this.fromPath === '/SoftWasteBagPrint' || this.fromPath === '/ReworkBarrelPrint' || this.fromPath === '/ChengPinBarrelPrint') {
type = '1'
} else if (this.fromPath === '/SoftWasteBarrelPrint' || this.fromPath === '/CleaningGroupBarrel') {
type = '2'
} else if (this.fromPath === '/FinishProdBarrelPrint') {
type = '3'
} else if (this.$route.query.url === 'ResultEntry') {
type = '1'
} else {
type = ''
}
let res = await queryMaterialList(this.val1, type, this.page + '', this.size)
if (res.code === '1') {
this.dataList = [...res.rows]
if (res.rows.length < 10) {
this.busy = true
this.desc = '已加载全部数据'
}
} else {
this.Dialog(res.desc)
this.desc = res.desc
}
},
async loadMore () {
this.busy = true
this.page++
let type = ''
if (this.fromPath === '/SoftWasteBagPrint' || this.fromPath === '/ReworkBarrelPrint' || this.fromPath === '/ChengPinBarrelPrint') {
type = '1'
} else if (this.fromPath === '/SoftWasteBarrelPrint' || this.fromPath === '/CleaningGroupBarrel') {
type = '2'
} else if (this.fromPath === '/FinishProdBarrelPrint') {
type = '3'
} else if (this.$route.query.url === 'ResultEntry') {
type = '1'
} else {
type = ''
}
let res = await queryMaterialList(this.val1, type, this.page + '', this.size)
if (res.code === '1') {
this.dataList = [...this.dataList, ...res.rows]
if (res.rows.length < 10) {
this.busy = true
this.desc = '已加载全部数据'
} else {
this.busy = false
}
} else {
this.Dialog(res.desc)
this.desc = res.desc
}
},
toCheck (e) {
this.pkId = this.pkId === e.material_id ? '' : e.material_id
this.pkObj = this.pkId === e.material_id ? e : {}
},
toSure () {
if (this.pkId !== '') {
// if (this.$route.query.url === 'ResultEntry') {
// this.$router.push({
// path: '/ResultEntry',
// query: {
// id: this.pkObj.material_id,
// name: this.pkObj.material_name
// }
// })
// } else {
// this.$store.dispatch('materObj', this.pkObj)
// this.$router.back()
// }
this.$store.dispatch('materObj', this.pkObj)
this.$router.back()
} else {
this.toast('请选择一行')
}
}
}
}
</script>
<style lang="stylus" scoped>
>>>.content
height calc(100% - 1.96rem)
overflow-y auto
</style>

View File

@@ -0,0 +1,130 @@
<template>
<section>
<nav-bar title="修改密码"></nav-bar>
<section class="content mgt186">
<div class="filter-wraper">
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">当前密码</div>
<div class="fxcol mgl20">
<input type="password" class="filter-input filter-scan-input" v-model="val1">
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">新密码</div>
<div class="fxcol mgl20 relative">
<input type="password" class="filter-input filter-scan-input" v-model="val2" @blur="handleBlur1">
<div v-show="error1 === true" class="error">密码长度必须为6-20个字符</div>
</div>
</div>
<div class="bottom-filter-tip">
<div class="filter-label txtjustify">确认新密码</div>
<div class="fxcol mgl20 relative">
<input type="password" class="filter-input filter-scan-input" v-model="val3" @blur="handleBlur2">
<div v-show="error2 === true" class="error">两次输入的密码不一致</div>
</div>
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :disabled="disabled" :class="{'btn-disabled': btnDisabled === false}" @click="toSure">确认</button>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import { updatePass } from '@config/getData2.js'
import {encrypt} from '../../../main.js'
export default {
name: 'Password',
components: {
NavBar
},
data () {
return {
val1: '',
val2: '',
val3: '',
error1: false,
error2: false,
disabled: false
}
},
computed: {
btnDisabled () {
let flag = false
if (this.val1 !== '' && this.val2.length >= 6 && this.val2.length <= 20 && this.val2 === this.val3) {
flag = true
}
return flag
}
},
methods: {
handleBlur1 () {
if (this.val2.length < 6 || this.val2.length > 20) {
this.error1 = true
} else {
this.error1 = false
}
if (this.val2 === this.val3) this.error2 = false
},
handleBlur2 () {
if (this.val2 !== this.val3) {
this.error2 = true
} else {
this.error2 = false
}
},
toSure () {
this.disabled = true
if (this.val1 === '') {
this.disabled = false
return
}
if (this.val2.length < 6 || this.val2.length > 20) {
this.error1 = true
this.disabled = false
return
}
if (this.val2 !== this.val3) {
this.error2 = true
this.disabled = false
return
}
if (this.val2.length >= 6 && this.val2.length <= 20) this.error1 = false
if (this.val2 === this.val3) this.error2 = false
this._updatePass()
},
async _updatePass () {
try {
let res = await updatePass(encrypt(this.val1), encrypt(this.val2))
if (res.code === '1') {
this.toast(res.desc)
this.$store.dispatch('setSignOut')
this.$router.push('/login')
} else {
this.Dialog(res.desc)
this.disabled = false
}
} catch (e) {
this.disabled = false
}
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
.filter-label
width 1.6rem
.relative
overflow visible
.error
position absolute
left 0
top 1rem
_font(.2rem, .2rem, $red)
.bottom-filter-tip
padding 0.5rem 0 0 0
</style>

View File

@@ -0,0 +1,130 @@
<template>
<section>
<nav-bar :inner="true" title="拍照"></nav-bar>
<section class="content mgt186">
<div class="image_wraper">
<div class="image_wraper_i">
<img v-show="unimgsrc === ''" src="../../../images/xinrui/nopict.svg">
<img v-show="unimgsrc !== ''" id="imgshow">
</div>
</div>
</section>
<section class="submit-bar">
<button class="btn submit-button" :class="{'btn-disabled': formData === ''}" :disabled="disabled" @click="_uploadPict">确认</button>
<button class="btn submit-button" @click="handleDelImg">取消</button>
<div class="btn submit-button relative">
上传
<input
type='file'
id='H5moreUp'
ref='H5moreUp'
accept='image/*'
@change="loadImg"
/>
</div>
</section>
</section>
</template>
<script>
import NavBar from '@components/NavBar.vue'
import {uploadPict, rawmaterialSava} from '@config/getData2.js'
export default {
name: 'UploadPict',
components: {
NavBar
},
data () {
return {
upImgUrl: '',
unimgsrc: '',
formData: '',
disabled: false,
result: {}
}
},
methods: {
loadImg () {
// 获取文件
let file = document.getElementById('H5moreUp').files[0]
// 创建读取文件的对象
let reader = new FileReader()
// 创建文件读取相关的变量
let imgFile
// 为文件读取成功设置事件
reader.onload = (e) => {
imgFile = e.target.result
document.getElementById('imgshow').setAttribute('src', imgFile)
this.unimgsrc = imgFile
}
// 正式读取文件
reader.readAsDataURL(file)
this.formData = new FormData()
this.formData.append('file', file)
},
async _uploadPict () {
this.disabled = true
if (this.formData === '') {
this.disabled = false
return
}
// let uploadUrl = this.$store.getters.imgip + '/api/localStorage/pictures/'
let data = {
'formData': this.formData,
'flag': true
}
let res = await uploadPict(data)
if (res.code === '1') {
// this.upImgUrl = uploadUrl + res.result.path
this.toast(res.desc)
this.result = res.result
this.formData = ''
this._rawmaterialSava()
} else {
this.Dialog(res.desc)
}
},
async _rawmaterialSava () {
let obj = this.$store.getters.materObj !== '' ? Object.assign({}, this.$store.getters.materObj, this.result, {business_type: '01'}) : Object.assign({}, this.result, {business_type: '01'})
let res = await rawmaterialSava(obj)
if (res.code === '1') {
this.$router.back()
} else {
this.Dialog(res.desc)
}
},
handleDelImg () {
this.unimgsrc = ''
this.formData = ''
this.$refs.H5moreUp.value = ''
document.getElementById('imgshow').removeAttribute('src')
}
}
}
</script>
<style lang="stylus" scoped>
@import '~@style/mixin'
>>>.content
height calc(100% - 2rem)
.image_wraper
_wh(90%, 100%)
margin 0 auto
padding-top 1rem
.image_wraper_i
position relative
_wh(100%, 100%)
overflow-y auto
z-index 99
img
_wh(100%, auto)
z-index 99
border-radius .1rem
#H5moreUp
position absolute
top 0
left 0
_wh(100%, 100%)
opacity 0
z-index 100
</style>