|
|
|
|
@ -3,7 +3,7 @@
|
|
|
|
|
<u-navbar :is-back="false" title="资产扫码" title-color="#fff" :background="{'background':'#107fc9'}"></u-navbar>
|
|
|
|
|
|
|
|
|
|
<view class="content">
|
|
|
|
|
<u-swiper :list="list"></u-swiper>
|
|
|
|
|
<u-swiper :list="list" :border-radius="0"></u-swiper>
|
|
|
|
|
|
|
|
|
|
<u-button :ripple="true" :type="flag ? 'error' : 'primary'" :custom-style="{'margin':'20rpx 30rpx 0 30rpx'}"
|
|
|
|
|
@click="scanClick">{{ flag ? "停止扫描" : "开始扫描" }}</u-button>
|
|
|
|
|
@ -43,7 +43,7 @@
|
|
|
|
|
</view>
|
|
|
|
|
<view class="info">
|
|
|
|
|
<view class="info__name">资产状态:</view>
|
|
|
|
|
<view class="info__value">{{activeStatusFormat(fund.active_status) || " "}}</view>
|
|
|
|
|
<view class="info__value">{{activeStatusFormat(fund.assets_status) || " "}}</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<u-button type="primary" :ripple="true" :custom-style="btnStyle" @click="isShowPop = true">
|
|
|
|
|
@ -58,7 +58,7 @@
|
|
|
|
|
<!-- 此处没有自定义左边的内容,会默认显示一个点 -->
|
|
|
|
|
<template v-slot:content>
|
|
|
|
|
<view>
|
|
|
|
|
<view class="u-order-desc" @click="fund = item">{{ item.remark }}</view>
|
|
|
|
|
<view class="u-order-desc">{{ item.remark }}</view>
|
|
|
|
|
<view class="u-order-time">
|
|
|
|
|
{{$moment(item.created_at).format('YYYY-MM-DD HH:mm:SS')}}
|
|
|
|
|
</view>
|
|
|
|
|
@ -81,16 +81,16 @@
|
|
|
|
|
</u-input>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="资产状态">
|
|
|
|
|
<u-input :value="activeStatusFormat(fund.active_status)" type="select"
|
|
|
|
|
<u-input :value="activeStatusFormat(fund.assets_status)" type="select"
|
|
|
|
|
@click="isShowSelect = true" placeholder="请选择资产状态"></u-input>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="备注">
|
|
|
|
|
<u-input v-model="fund.remark" type="textarea" :auto-height="true" placeholder="请输入备注">
|
|
|
|
|
<u-input v-model="fund.content" type="textarea" :auto-height="true" placeholder="请输入备注">
|
|
|
|
|
</u-input>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-form-item label="图片上传">
|
|
|
|
|
<u-upload :show-progress="false" :auto-upload="false" :max-count="1" ref="uUpload"
|
|
|
|
|
:file-list="fund.files ? [{url:fund.files}] : []">
|
|
|
|
|
:file-list="fund.photo ? [{url:fund.photo}] : []">
|
|
|
|
|
</u-upload>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
|
|
|
|
@ -103,7 +103,7 @@
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
|
|
|
|
<u-select :list="statusList" v-model="isShowSelect" @confirm="e => fund.active_status = e[0].value"></u-select>
|
|
|
|
|
<u-select :list="statusList" v-model="isShowSelect" @confirm="e => fund.assets_status = e[0].value"></u-select>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
@ -138,44 +138,41 @@
|
|
|
|
|
isShowSelect: false,
|
|
|
|
|
action: `${ROOTPATH}/index.php?s=/Home/Worker/upload.html`,
|
|
|
|
|
statusList: [{
|
|
|
|
|
value: 0,
|
|
|
|
|
label: "正常未领用"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: 1,
|
|
|
|
|
label: "已领用"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: -1,
|
|
|
|
|
label: "报废"
|
|
|
|
|
label: "正常"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: -2,
|
|
|
|
|
label: "维修停用"
|
|
|
|
|
value: 2,
|
|
|
|
|
label: "维修"
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
btnStyle: {
|
|
|
|
|
'margin': '60rpx 30rpx 0 30rpx'
|
|
|
|
|
},
|
|
|
|
|
list: [{
|
|
|
|
|
image: '/static/pic1.jpeg'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
image: '/static/pic2.jpeg'
|
|
|
|
|
}
|
|
|
|
|
list: [{
|
|
|
|
|
image: '/static/1.jpg'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
image: '/static/2.jpg'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
image: '/static/3.jpg'
|
|
|
|
|
},{
|
|
|
|
|
image: '/static/4.jpg'
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
flag: 0, //当前扫码状态0未开始,1进行中
|
|
|
|
|
fund: {
|
|
|
|
|
id: 0,
|
|
|
|
|
name: '',
|
|
|
|
|
serial: '',
|
|
|
|
|
position: '',
|
|
|
|
|
worker_name: '',
|
|
|
|
|
active_status: '',
|
|
|
|
|
files: '',
|
|
|
|
|
remark: ''
|
|
|
|
|
assets_id: 0,
|
|
|
|
|
name: '',
|
|
|
|
|
serial: '',
|
|
|
|
|
position: '',
|
|
|
|
|
worker_name: '',
|
|
|
|
|
assets_status: '',
|
|
|
|
|
photo: '',
|
|
|
|
|
content: ''
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
qrIdList: [],
|
|
|
|
|
@ -187,14 +184,14 @@
|
|
|
|
|
clear() {
|
|
|
|
|
this.info = []
|
|
|
|
|
this.fund = {
|
|
|
|
|
id: 0,
|
|
|
|
|
assets_id: 0,
|
|
|
|
|
name: '',
|
|
|
|
|
serial: '',
|
|
|
|
|
position: '',
|
|
|
|
|
worker_name: '',
|
|
|
|
|
active_status: '',
|
|
|
|
|
files: '',
|
|
|
|
|
remark: ''
|
|
|
|
|
assets_status: '',
|
|
|
|
|
photo: '',
|
|
|
|
|
content: ''
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
@ -206,7 +203,7 @@
|
|
|
|
|
|
|
|
|
|
async confirm() {
|
|
|
|
|
|
|
|
|
|
if (!this.fund.active_status && this.fund.active_status !== 0) {
|
|
|
|
|
if (!this.fund.assets_status) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请选择资产状态"
|
|
|
|
|
@ -219,10 +216,10 @@
|
|
|
|
|
tempFilePath: this.$refs.uUpload.lists[0]?.url
|
|
|
|
|
})
|
|
|
|
|
console.log(filePath);
|
|
|
|
|
this.fund.files = filePath[1]?.savedFilePath
|
|
|
|
|
this.fund.photo = filePath[1]?.savedFilePath
|
|
|
|
|
}
|
|
|
|
|
await executeSql(`
|
|
|
|
|
update property set active_status = "${this.fund.active_status}",remark = "${this.fund.remark}",is_check = 1${this.fund.files ? ',files = "' + this.fund.files + '"' : '' } where id = ${this.fund.id};
|
|
|
|
|
update property set assets_status = "${this.fund.assets_status}",content = "${this.fund.content}",is_check = 1${this.fund.photo ? ',photo = "' + this.fund.photo + '"' : '' } where assets_id = ${this.fund.assets_id};
|
|
|
|
|
`)
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'success',
|
|
|
|
|
@ -320,7 +317,7 @@
|
|
|
|
|
}
|
|
|
|
|
try {
|
|
|
|
|
let propertys = await selectFromTable(`
|
|
|
|
|
select * from property where id in (${getSqlIn()});
|
|
|
|
|
select * from property where assets_id in (${getSqlIn()});
|
|
|
|
|
`)
|
|
|
|
|
androidModule.showToast(`扫描到:${propertys.length}件资产`)
|
|
|
|
|
this.info = propertys
|
|
|
|
|
@ -336,10 +333,8 @@
|
|
|
|
|
computed: {
|
|
|
|
|
activeStatusFormat() {
|
|
|
|
|
let map = new Map([
|
|
|
|
|
[0, '正常未领用'],
|
|
|
|
|
[1, '已领用'],
|
|
|
|
|
[-1, '报废'],
|
|
|
|
|
[-2, '维修停用']
|
|
|
|
|
[1, '正常'],
|
|
|
|
|
[2, '维修'],
|
|
|
|
|
])
|
|
|
|
|
return function(status) {
|
|
|
|
|
return map.get(status)
|
|
|
|
|
|