Commit 279467e5 by wangweidong

整体优化

parent d2faa442
......@@ -22,6 +22,9 @@ export default {
http
.post('meter/v1/item/bath_write_value/' + data.itemIds, data)
.then(res => res),
_handJudge: data =>
http.post('meter/v1/item/hand_judge/' + data.ids, data).then(res => res),
testEnd: data =>
http
.post(
......
......@@ -5,16 +5,15 @@
<div>
<Form ref="formObj" :model="formObj" :rules="ruleValidate" :label-width="90">
<Form-item label="判定结果:" prop="type">
<RadioGroup v-model="formObj.type">
<Radio :label="1">合格</Radio>
<Radio :label="2">不合格</Radio>
<Radio :label="3">不判定</Radio>
<RadioGroup v-model="formObj.singleJudge">
<Radio :label="'PASS'">合格</Radio>
<Radio :label="'FAIL'">不合格</Radio>
</RadioGroup>
</Form-item>
</Form>
</div>
<div slot="footer">
<ModalFooter ref="footerModal" @on-result-change="_footerResult" :footer="footerList"></ModalFooter>
<ModalFooter ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></ModalFooter>
</div>
</Modal>
</div>
......@@ -24,6 +23,7 @@
* 判定
*/
import ModalFooter from '../../../components/base/modalFooter'
import { meterItem } from '../../../api'
export default {
components: {
......@@ -35,13 +35,12 @@ export default {
modalTitle: '判定',
showBackModal: false,
formObj: {
type: 1
singleJudge: 'PASS'
},
path: '',
ruleValidate: {
type: [
singleJudge: [
{
type: 'number',
required: true,
message: '判定结果不能为空',
trigger: 'blur'
......@@ -80,20 +79,20 @@ export default {
if (valid) {
const data = {}
data.ids = this.ids.join(',')
this.$extend(data, { type: this.formObj.type })
console.log('要传的数据', data)
this.showBackModal = false
// this.$store.dispatch('FoodItem/judge', data).then(() => {
// if (this.$store.state.FoodItem.success) {
// this.$Message.success('判定成功')
// this.showBackModal = false
// this.$emit('on-result-change')
// }
// })
this.$extend(data, { singleJudge: this.formObj.singleJudge })
this._handJudge(data)
} else {
this.$Message.error('表单验证失败!')
}
})
},
_handJudge: async function(data) {
const result = await meterItem._handJudge(data)
if (result) {
this.$Message.success('判定成功!')
this.showBackModal = false
this.$emit('on-result-change')
}
}
}
}
......
......@@ -67,8 +67,8 @@
<modal-footer ref="footerModal" :footer="footerList" @on-result-change="_footerResult"></modal-footer>
</div>
</Modal>
<fillout ref="fillout"></fillout>
<decide ref="decide"></decide>
<fillout ref="fillout" @on-result-change="_page"></fillout>
<decide ref="decide" @on-result-change="_page"></decide>
</div>
</template>
<script>
......
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