|
@@ -3,51 +3,80 @@
|
|
|
<view>
|
|
|
<u-navbar :title="navTitle" autoBack placeholder @leftClick="leftClick"></u-navbar>
|
|
|
<view class="card_order_details">
|
|
|
- <view class="details_title">高频编码 <span class="line_title">*</span></view>
|
|
|
- <view class="card_search">
|
|
|
+ <view style="display: flex;align-items: center;margin-bottom: 20rpx;" v-if="storeFlag">
|
|
|
+ <image class="mine_image" src="../../static/portrait.png" mode=""></image>
|
|
|
+ <view class="card_user_title">
|
|
|
+ <view class="mine_phone">{{storeData[2]}}
|
|
|
+ </view>
|
|
|
+ <view class="mine_phone">{{storeData[4]}}
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="details_title">钢瓶编号 <span class="line_title">*</span></view>
|
|
|
+ <view style="display: flex;align-items: center;" v-if="selectiveType != 'inspect'">
|
|
|
+ <u-input border="surround" placeholder="点击输入" v-model="frequencyCoding"></u-input>
|
|
|
+ <view class="btn_add_card">
|
|
|
+ <u-button type="primary" text="添加" @click="addCode"></u-button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="card_search" v-else-if="selectiveType == 'inspect'">
|
|
|
<view class="card_sweep" @click="sweep">
|
|
|
<u-icon name="scan" size="36"></u-icon>
|
|
|
<view class="scan_title">扫一扫</view>
|
|
|
</view>
|
|
|
<view class="card_input">
|
|
|
- <u-input border="surround" v-model="frequencyCoding"></u-input>
|
|
|
+ <u-input border="surround" v-model="frequencyCoding" @blur="inputBlur"></u-input>
|
|
|
</view>
|
|
|
<view class="deleteCurrent" @click="removeWaybill(frequencyCoding)">
|
|
|
<u-icon class="icon_current" name="backspace" height="10" size="20"></u-icon>
|
|
|
<view class="title_nape">删除</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="selectiveType != '99' && selectiveType != '100'">
|
|
|
- <view class="card_frequency" v-if="selectiveType != 'inspect'">
|
|
|
- <view class="card_high space_between">
|
|
|
- <view class="card_frequency_title">高频编码列表</view>
|
|
|
- <view class="card_bottle">已扫<span>{{list.length}}</span>瓶</view>
|
|
|
- </view>
|
|
|
- <view style="width: 100%;" v-if="list.length > 0">
|
|
|
- <view class="item_coding" v-for="(item,index) in list" :key="index">
|
|
|
- <view class="title_coding">{{item}}</view>
|
|
|
- <u-icon name="close-circle-fill" color="#c0c4cc" size="20"
|
|
|
- @click="removeWaybill(item)"></u-icon>
|
|
|
+ <view class="card_frequency" v-if="selectiveType != 'inspect'">
|
|
|
+ <view class="scan_card_code">
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ <view style="display: flex;align-items: center;" @click="addLine">
|
|
|
+ <u-icon name="scan" size="26"></u-icon>
|
|
|
+ <view class="title_subhead">增加一条</view>
|
|
|
+ </view>
|
|
|
+ <view style="display: flex;align-items: center;margin-left: 30rpx;" @click="continuousAddition">
|
|
|
+ <u-icon name="scan" size="26"></u-icon>
|
|
|
+ <view class="title_subhead">连续扫码增加</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="card_empty" v-else>
|
|
|
- <u-empty mode="list"></u-empty>
|
|
|
- </view>
|
|
|
+ <view class="card_bottle">已扫<span>{{list.length}}</span>瓶</view>
|
|
|
</view>
|
|
|
- <view class="card_examine" v-else>
|
|
|
- <view class="card_examine_item space_between" v-for="(item,index) in checkEntry" :key="index">
|
|
|
- <view class="title_entry">{{item.label}}</view>
|
|
|
- <view style="height: 40rpx;" v-if="item.type == 'radio'">
|
|
|
- <u-radio-group v-model="ruleForm.state" placement="row">
|
|
|
- <u-radio shape="circle" :customStyle="{width:'140rpx'}"
|
|
|
- v-for="(item, index) in item.options" :key="index" :label="item.label"
|
|
|
- :name="item.value"></u-radio>
|
|
|
- </u-radio-group>
|
|
|
- </view>
|
|
|
- <view class="center_row" v-if="item.type == 'input'">
|
|
|
- <u-input class="input_item" border="surround" v-model="ruleForm[`${item.field}`]"></u-input>
|
|
|
- <view style="margin-left: 15rpx;width: 90rpx;">{{item.unit}}</view>
|
|
|
+ <view style="width: 100%;" v-if="list.length > 0">
|
|
|
+ <view class="item_coding" v-for="(item,index) in list" :key="index">
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ <view class="item_current">{{index + 1}}</view>
|
|
|
+ <view class="title_codingewtw">{{item}}</view>
|
|
|
</view>
|
|
|
+ <view class="item_title1 title_red" @click="removeWaybill(item)">删除</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="card_empty" v-else>
|
|
|
+ <u-empty mode="list" text="请先扫描添加钢瓶编号"></u-empty>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="card_examine" v-else>
|
|
|
+ <view class="card_examine_item space_between" v-for="(item,index) in checkEntry" :key="index">
|
|
|
+ <view class="title_entry">{{item.label}}</view>
|
|
|
+ <view style="height: 40rpx;" v-if="item.type == 'radio'">
|
|
|
+ <u-radio-group v-model="ruleForm[`${item.field}`]" placement="row">
|
|
|
+ <u-radio shape="circle" :customStyle="{width:'140rpx'}"
|
|
|
+ v-for="(item, index) in item.options" :key="index" :label="item.label"
|
|
|
+ :name="item.value"></u-radio>
|
|
|
+ </u-radio-group>
|
|
|
+ </view>
|
|
|
+ <view class="center_row" v-if="item.type == 'input'">
|
|
|
+ <u-input class="input_item" border="surround" v-model="ruleForm[`${item.field}`]"></u-input>
|
|
|
+ <view style="margin-left: 15rpx;width: 90rpx;">{{item.unit}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="center_row" v-if="item.type == 'numinput'">
|
|
|
+ <u-input class="input_item" type="digit" border="surround"
|
|
|
+ v-model="ruleForm[`${item.field}`]"></u-input>
|
|
|
+ <view style="margin-left: 15rpx;width: 90rpx;">{{item.unit}}</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -56,6 +85,17 @@
|
|
|
<u-button style="margin-bottom: 20rpx;" type="primary" @click="submit">提交</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <u-popup :show="show" :round="10" :closeOnClickOverlay="false" mode="center" @close="close">
|
|
|
+ <view class="card_coding_scan">
|
|
|
+ <view class="title_coding">钢瓶编号</view>
|
|
|
+ <view class="coding_title1">{{scanCoding}}</view>
|
|
|
+ <view style="display: flex;align-items: center;">
|
|
|
+ <u-icon color="#19be6b" size="30" name="checkmark-circle-fill"></u-icon>
|
|
|
+ <view class="success_title">扫描成功</view>
|
|
|
+ </view>
|
|
|
+ <view class="title_coding">3秒后再次扫描</view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -72,11 +112,44 @@
|
|
|
cmpCode: '',
|
|
|
list: [],
|
|
|
checkEntry: formRules(),
|
|
|
- ruleForm: {},
|
|
|
+ ruleForm: {
|
|
|
+ deadWeight: '',
|
|
|
+ color: '',
|
|
|
+ pipePressure: '',
|
|
|
+ fillWeight: '',
|
|
|
+ repeatWeight: '',
|
|
|
+ corrosion: 0,
|
|
|
+ crackle: 0,
|
|
|
+ deform: 0,
|
|
|
+ damage: 0,
|
|
|
+ safeAnnex: 0,
|
|
|
+ gasPressure: 0,
|
|
|
+ bodyDeform: 0,
|
|
|
+ fillingLeak: 0,
|
|
|
+ bodyTemperature: 0,
|
|
|
+ filledLeak: 0,
|
|
|
+ warnSign: 0,
|
|
|
+ fillLabel: 0,
|
|
|
+ seal: 0,
|
|
|
+ },
|
|
|
orderId: '',
|
|
|
+ scanType: 1,
|
|
|
+ show: false,
|
|
|
+ scanCoding: '',
|
|
|
+ storeFlag: false,
|
|
|
+ storeData: []
|
|
|
}
|
|
|
},
|
|
|
+ onUnload() {
|
|
|
+ console.log('页面销毁了!');
|
|
|
+ this.$cache.removeCache('storeInformation')
|
|
|
+ },
|
|
|
onLoad(receive) {
|
|
|
+ var storeList = this.$cache.getCache('storeInformation')
|
|
|
+ if (storeList) {
|
|
|
+ this.storeFlag = true
|
|
|
+ this.storeData = storeList
|
|
|
+ }
|
|
|
this.navTitle = receive.title
|
|
|
this.selectiveType = receive.id
|
|
|
this.cmpCode = receive.cmpCode
|
|
@@ -87,33 +160,72 @@
|
|
|
uni.$emit('refresh');
|
|
|
},
|
|
|
submit() {
|
|
|
+ // 99订单扫码确定送达、100订单扫码确定取消
|
|
|
if (this.selectiveType == '99' || this.selectiveType == '100') {
|
|
|
// 修改订单状态
|
|
|
- if (this.frequencyCoding) {
|
|
|
+ if (this.list.length > 0) {
|
|
|
const param = {
|
|
|
id: Number(this.orderId),
|
|
|
state: null,
|
|
|
- chipUid: this.frequencyCoding,
|
|
|
+ chipUid: this.list,
|
|
|
}
|
|
|
if (this.selectiveType == '99') {
|
|
|
param.state = 3
|
|
|
} else if (this.selectiveType == '100') {
|
|
|
param.state = 4
|
|
|
}
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ });
|
|
|
this.$api.put('/api/order/state', param).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.frequencyCoding = ''
|
|
|
+ this.list = []
|
|
|
uni.$u.toast('操作成功')
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.$emit('refresh');
|
|
|
+ uni.navigateBack({
|
|
|
+ delta: 1
|
|
|
+ });
|
|
|
+ }, 1000)
|
|
|
} else {
|
|
|
uni.$u.toast(res.data.msg)
|
|
|
}
|
|
|
+ uni.hideLoading();
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.$u.toast('请先扫钢瓶编号')
|
|
|
+ }
|
|
|
+ } else if (this.selectiveType == 'inspect') {
|
|
|
+ if (this.frequencyCoding) {
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ });
|
|
|
+ let params = JSON.parse(JSON.stringify(this.ruleForm))
|
|
|
+ params.repeatWeight = Number(this.ruleForm.repeatWeight)
|
|
|
+ params.fillWeight = Number(this.ruleForm.fillWeight)
|
|
|
+ params.deadWeight = Number(this.ruleForm.deadWeight)
|
|
|
+ params.pipePressure = Number(this.ruleForm.pipePressure)
|
|
|
+ this.$api.post('/api/fill-check', {
|
|
|
+ innerCode: this.frequencyCoding,
|
|
|
+ ...params,
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.frequencyCoding = ''
|
|
|
+ uni.$u.toast('操作成功')
|
|
|
+ }
|
|
|
+ uni.hideLoading();
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
})
|
|
|
} else {
|
|
|
- uni.$u.toast('请先扫高频编码')
|
|
|
+ uni.$u.toast('请先扫钢瓶编号')
|
|
|
}
|
|
|
} else {
|
|
|
if (this.list.length > 0) {
|
|
|
- // 操作记录
|
|
|
+ // 操作记录、流转步骤接口
|
|
|
const param = {
|
|
|
chipUidList: this.list,
|
|
|
currentEnterprise: this.cmpCode,
|
|
@@ -122,6 +234,9 @@
|
|
|
if (!param.currentEnterprise) {
|
|
|
delete param.currentEnterprise
|
|
|
}
|
|
|
+ uni.showLoading({
|
|
|
+ mask: true,
|
|
|
+ });
|
|
|
this.$api.post('/api/operation-log', param).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
this.list = []
|
|
@@ -130,12 +245,38 @@
|
|
|
} else {
|
|
|
uni.$u.toast(res.data.msg)
|
|
|
}
|
|
|
+ uni.hideLoading();
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
})
|
|
|
} else {
|
|
|
- uni.$u.toast('请先扫高频编码')
|
|
|
+ uni.$u.toast('请先扫钢瓶编号')
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ // 输入值
|
|
|
+ inputBlur(value) {
|
|
|
+ this.list.push(value)
|
|
|
+ this.list = Array.from(new Set(this.list));
|
|
|
+ },
|
|
|
+ // 输入钢瓶编号添加
|
|
|
+ addCode() {
|
|
|
+ if (this.frequencyCoding) {
|
|
|
+ this.list.push(this.frequencyCoding)
|
|
|
+ this.list = Array.from(new Set(this.list));
|
|
|
+ this.frequencyCoding = ''
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 添加一条
|
|
|
+ addLine() {
|
|
|
+ this.scanType = 1
|
|
|
+ this.sweep()
|
|
|
+ },
|
|
|
+ // 连续添加
|
|
|
+ continuousAddition() {
|
|
|
+ this.scanType = 2
|
|
|
+ this.sweep()
|
|
|
+ },
|
|
|
// 扫一扫
|
|
|
sweep() {
|
|
|
// 允许从相机和相册扫码
|
|
@@ -175,14 +316,26 @@
|
|
|
success: (res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
var arr = res.data.data
|
|
|
- this.frequencyCoding = arr.inner_code
|
|
|
if (this.selectiveType != '99' || this.selectiveType != '100') {
|
|
|
- this.list.push(arr.inner_code)
|
|
|
-
|
|
|
- function methods1(arr) {
|
|
|
- return Array.from(new Set(arr));
|
|
|
+ if (this.selectiveType == 'inspect') {
|
|
|
+ this.frequencyCoding = arr.inner_code
|
|
|
+ }
|
|
|
+ if (this.scanType == 1) {
|
|
|
+ this.list.push(arr.inner_code)
|
|
|
+ this.list = Array.from(new Set(this.list));
|
|
|
+ } else {
|
|
|
+ this.show = true
|
|
|
+ this.list.push(arr.inner_code)
|
|
|
+ this.list = Array.from(new Set(this.list));
|
|
|
+ this.scanCoding = arr.inner_code
|
|
|
+ // 扫码间隔两秒
|
|
|
+ setTimeout(() => {
|
|
|
+ this.sweep()
|
|
|
+ this.show = false
|
|
|
+ }, 3000)
|
|
|
}
|
|
|
- this.list = methods1(this.list)
|
|
|
+ } else {
|
|
|
+ this.frequencyCoding = arr.inner_code
|
|
|
}
|
|
|
uni.hideLoading();
|
|
|
}
|
|
@@ -201,13 +354,34 @@
|
|
|
return arr.filter((item) => item !== key);
|
|
|
}
|
|
|
},
|
|
|
+ // 弹窗关闭
|
|
|
+ close() {
|
|
|
+ this.show = false
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.card_order_details {
|
|
|
- margin: 25rpx;
|
|
|
+ margin: 0rpx 25rpx 25rpx 25rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mine_image {
|
|
|
+ width: 100rpx;
|
|
|
+ height: 100rpx;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .card_user_title {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: flex-start;
|
|
|
+ }
|
|
|
+
|
|
|
+ .mine_phone {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ font-size: 30rpx;
|
|
|
}
|
|
|
|
|
|
.details_title {
|
|
@@ -217,6 +391,10 @@
|
|
|
margin-bottom: 10rpx;
|
|
|
}
|
|
|
|
|
|
+ .btn_add_card {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ }
|
|
|
+
|
|
|
.card_search {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
@@ -239,12 +417,31 @@
|
|
|
margin-left: 30rpx;
|
|
|
}
|
|
|
|
|
|
- .line_title {
|
|
|
- color: red;
|
|
|
+ .deleteCurrent {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ border: 1px solid #e5e5e5;
|
|
|
+ padding: 5rpx 0rpx 5rpx 5rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ height: 66rpx;
|
|
|
+
|
|
|
+ .icon_current {
|
|
|
+ height: 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_nape {
|
|
|
+ margin: 0rpx 10rpx;
|
|
|
+ display: flex;
|
|
|
+ font-size: 20rpx;
|
|
|
+ width: 40rpx;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- .card_high {
|
|
|
- margin-top: 30rpx;
|
|
|
+ .line_title {
|
|
|
+ color: red;
|
|
|
}
|
|
|
|
|
|
.card_frequency {
|
|
@@ -252,14 +449,21 @@
|
|
|
flex-wrap: wrap;
|
|
|
}
|
|
|
|
|
|
- .card_frequency_title {
|
|
|
- font-size: 32rpx;
|
|
|
+ .scan_card_code {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 30rpx;
|
|
|
+ padding-bottom: 30rpx;
|
|
|
+ border-bottom: 1rpx solid #d7d7d7;
|
|
|
}
|
|
|
|
|
|
.card_bottle {
|
|
|
font-size: 30rpx;
|
|
|
|
|
|
span {
|
|
|
+ margin: 0rpx 5rpx;
|
|
|
color: red;
|
|
|
}
|
|
|
}
|
|
@@ -274,10 +478,24 @@
|
|
|
border-bottom: 2rpx solid #dfdfdf;
|
|
|
}
|
|
|
|
|
|
- .title_coding {
|
|
|
+ .item_current {
|
|
|
+ width: 40rpx;
|
|
|
+ color: #82848a;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_codingewtw {
|
|
|
+ margin-left: 10rpx;
|
|
|
font-size: 30rpx;
|
|
|
}
|
|
|
|
|
|
+ .item_title1 {
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .title_red {
|
|
|
+ color: #fa3534;
|
|
|
+ }
|
|
|
+
|
|
|
.card_empty {
|
|
|
width: 100%;
|
|
|
margin-top: 50rpx;
|
|
@@ -306,6 +524,7 @@
|
|
|
.card_examine_item {
|
|
|
display: flex;
|
|
|
margin-bottom: 20rpx;
|
|
|
+ height: 72rpx;
|
|
|
}
|
|
|
|
|
|
.title_entry {
|
|
@@ -322,26 +541,27 @@
|
|
|
width: 240rpx;
|
|
|
}
|
|
|
|
|
|
- .deleteCurrent {
|
|
|
+ .card_coding_scan {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-direction: column;
|
|
|
- justify-content: center;
|
|
|
- border: 1px solid #e5e5e5;
|
|
|
- padding: 5rpx 0rpx 5rpx 5rpx;
|
|
|
- margin-left: 10rpx;
|
|
|
- border-radius: 8rpx;
|
|
|
- height: 66rpx;
|
|
|
+ width: 400rpx;
|
|
|
+ padding: 30rpx;
|
|
|
+ }
|
|
|
|
|
|
- .icon_current {
|
|
|
- height: 15px;
|
|
|
- }
|
|
|
+ .title_coding {
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin: 20rpx;
|
|
|
+ }
|
|
|
|
|
|
- .title_nape {
|
|
|
- margin: 0rpx 10rpx;
|
|
|
- display: flex;
|
|
|
- font-size: 20rpx;
|
|
|
- width: 40rpx;
|
|
|
- }
|
|
|
+ .success_title {
|
|
|
+ font-size: 40rpx;
|
|
|
+ margin-left: 10rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .coding_title1 {
|
|
|
+ font-size: 60rpx;
|
|
|
+ margin-bottom: 20rpx;
|
|
|
+ font-weight: 600;
|
|
|
}
|
|
|
</style>
|