|
|
|
|
@ -2,8 +2,15 @@ |
|
|
|
|
<ifrm ref="ifrm"> |
|
|
|
|
<!-- 安全点检 --> |
|
|
|
|
<uni-forms ref="form" err-show-type="toast"> |
|
|
|
|
<uni-forms-item><input type="text" v-model="facilityValue" @confirm="facilityConfirm" |
|
|
|
|
class="uni-input-border" placeholder="设备编码" /></uni-forms-item> |
|
|
|
|
<uni-forms-item> |
|
|
|
|
<input |
|
|
|
|
type="text" |
|
|
|
|
v-model="facilityValue" |
|
|
|
|
@confirm="facilityConfirm" |
|
|
|
|
class="uni-input-border" |
|
|
|
|
placeholder="设备编码" |
|
|
|
|
/> |
|
|
|
|
</uni-forms-item> |
|
|
|
|
</uni-forms> |
|
|
|
|
<checkbox-group @change="checkboxChange"> |
|
|
|
|
<uni-table border stripe emptyText="暂无更多数据" class="table"> |
|
|
|
|
@ -21,41 +28,58 @@ |
|
|
|
|
<uni-td align="center">{{ item.checkItem }}</uni-td> |
|
|
|
|
<uni-td align="center">{{ item.checkCon }}</uni-td> |
|
|
|
|
<uni-td align="center" class="tableRequired"> |
|
|
|
|
<picker @change="bindPickerChange($event, index)" :value="item.facilityIndex" :range="array"> |
|
|
|
|
<picker |
|
|
|
|
@change="bindPickerChange($event, index)" |
|
|
|
|
:value="item.facilityIndex" |
|
|
|
|
:range="array" |
|
|
|
|
> |
|
|
|
|
<view class="uni-input">{{ array[item.facilityIndex] }}</view> |
|
|
|
|
</picker> |
|
|
|
|
</uni-td> |
|
|
|
|
<uni-td align="center" width="200"><textarea style="width: 260rpx;" auto-height |
|
|
|
|
v-model="item.describe" /></uni-td> |
|
|
|
|
<uni-td align="center" width="200"> |
|
|
|
|
<textarea |
|
|
|
|
style="width: 260rpx" |
|
|
|
|
auto-height |
|
|
|
|
v-model="item.describe" |
|
|
|
|
/> |
|
|
|
|
</uni-td> |
|
|
|
|
</uni-tr> |
|
|
|
|
</uni-table> |
|
|
|
|
</checkbox-group> |
|
|
|
|
<view class="buttonBox"><button class="button" type="primary" :disabled="!(facilitySeceteArr.length > 0)" |
|
|
|
|
@click="submitClick">提交</button></view> |
|
|
|
|
<view class="buttonBox"> |
|
|
|
|
<button |
|
|
|
|
class="button" |
|
|
|
|
type="primary" |
|
|
|
|
:disabled="!(facilitySeceteArr.length > 0)" |
|
|
|
|
@click="submitClick" |
|
|
|
|
> |
|
|
|
|
提交 |
|
|
|
|
</button> |
|
|
|
|
</view> |
|
|
|
|
</ifrm> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import ifrm from '@/pages/index/ifrm'; |
|
|
|
|
import scan from '../../mixin/scan.js'; |
|
|
|
|
export default { |
|
|
|
|
import ifrm from "@/pages/index/ifrm"; |
|
|
|
|
import scan from "../../mixin/scan.js"; |
|
|
|
|
export default { |
|
|
|
|
mixins: [scan], |
|
|
|
|
components: { |
|
|
|
|
ifrm |
|
|
|
|
ifrm, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
facilityValue: '', |
|
|
|
|
array: ['正常', '关机', '异常'], |
|
|
|
|
facilityValue: "", |
|
|
|
|
array: ["正常", "关机", "异常"], |
|
|
|
|
facilityData: [], |
|
|
|
|
facilitySeceteArr: [] |
|
|
|
|
facilitySeceteArr: [], |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
checkboxChange(e) { |
|
|
|
|
this.facilitySeceteArr = e.detail.value; |
|
|
|
|
}, |
|
|
|
|
bindPickerChange: function(e, index) { |
|
|
|
|
bindPickerChange: function (e, index) { |
|
|
|
|
this.facilityData[index].facilityIndex = e.target.value; |
|
|
|
|
}, |
|
|
|
|
getBarCode(code) { |
|
|
|
|
@ -67,54 +91,47 @@ |
|
|
|
|
getData(code) { |
|
|
|
|
if (!code) return; |
|
|
|
|
this.facilityValue = code; |
|
|
|
|
this.$ajax.request({ |
|
|
|
|
url: 'pdaLoad/getSpotCheckByEcCode/' + code, |
|
|
|
|
method: 'GET', |
|
|
|
|
success: data => { |
|
|
|
|
this.facilityValue = ''; |
|
|
|
|
this.$u.api.getSpotCheckByCode(code).then((data) => { |
|
|
|
|
this.facilityValue = ""; |
|
|
|
|
this.facilityData = []; |
|
|
|
|
data.forEach(item => { |
|
|
|
|
data.forEach((item) => { |
|
|
|
|
this.facilityData.push({ |
|
|
|
|
...item, |
|
|
|
|
facilityIndex: 0 |
|
|
|
|
facilityIndex: 0, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '数据获取成功' |
|
|
|
|
title: "数据获取成功", |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
submitClick() { |
|
|
|
|
let arr = []; |
|
|
|
|
this.facilitySeceteArr.forEach(item => { |
|
|
|
|
this.facilitySeceteArr.forEach((item) => { |
|
|
|
|
arr.push({ |
|
|
|
|
sscId: item.sscId, |
|
|
|
|
checkResult: item.facilityIndex, |
|
|
|
|
describe: item.describe |
|
|
|
|
describe: item.describe, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
this.$ajax.request({ |
|
|
|
|
url: 'pdaSave/saveBySpotCheck', |
|
|
|
|
method: 'POST', |
|
|
|
|
data: { |
|
|
|
|
sscList: arr |
|
|
|
|
}, |
|
|
|
|
success: data => { |
|
|
|
|
this.$u.api |
|
|
|
|
.saveSpotCheck({ |
|
|
|
|
sscList: arr, |
|
|
|
|
}) |
|
|
|
|
.then((data) => { |
|
|
|
|
uni.showToast({ |
|
|
|
|
title: '点检成功' |
|
|
|
|
title: "点检成功", |
|
|
|
|
}); |
|
|
|
|
this.facilityValue = ''; |
|
|
|
|
this.facilityValue = ""; |
|
|
|
|
this.facilityData = []; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
onNavigationBarButtonTap(btn) { |
|
|
|
|
this.$refs.ifrm.topMenuClick(btn); |
|
|
|
|
}, |
|
|
|
|
onShow() {} |
|
|
|
|
}; |
|
|
|
|
onShow() {}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped></style> |