|
|
|
@ -36,7 +36,7 @@
|
|
|
|
|
<view class="list-reson"> |
|
|
|
|
<view class="left">不良原因</view> |
|
|
|
|
<view class="right"> |
|
|
|
|
<text>{{ reason[item.reason_no_id].title }}</text> |
|
|
|
|
<text>{{ reason[item.reason_no_id]?reason[item.reason_no_id].title:'' }}</text> |
|
|
|
|
<image src="../../static/next.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -49,13 +49,13 @@
|
|
|
|
|
<view class="left">不良品处置</view> |
|
|
|
|
<view class="right"><input v-model="item.remake" placeholder="请输入" /></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn-jian" @tap="froms.splice(index, 1)" v-if="index > 0"> |
|
|
|
|
<view class="btn-jian" @tap="froms.splice(index, 1)" v-if="index > 0&&ifEdit!=0"> |
|
|
|
|
<image src="../../static/jian.png"></image> |
|
|
|
|
<text>删除</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn-jia" @tap="add"> |
|
|
|
|
<view class="btn-jia" @tap="add" v-if="ifEdit!=0"> |
|
|
|
|
<image src="../../static/jia.png"></image> |
|
|
|
|
<text>添加</text> |
|
|
|
|
</view> |
|
|
|
@ -65,6 +65,7 @@
|
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { reasonNo, badReasons } from '../../api/index.js'; |
|
|
|
|
import {noDetail} from "../../api/user.js"; |
|
|
|
|
export default { |
|
|
|
|
onLoad(e) { |
|
|
|
|
this.planInfo = JSON.parse(decodeURIComponent(e.badProduct)); |
|
|
|
@ -72,10 +73,12 @@ export default {
|
|
|
|
|
reasonNo({ status: 1 }).then(res => { |
|
|
|
|
this.reason = res; |
|
|
|
|
}); |
|
|
|
|
this.getInfo() |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
planInfo: {}, |
|
|
|
|
ifEdit:0, |
|
|
|
|
frequency: ['白班', '夜班'], |
|
|
|
|
reason: [], |
|
|
|
|
froms: [ |
|
|
|
@ -117,12 +120,28 @@ export default {
|
|
|
|
|
frequency: 0 |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getInfo(){ |
|
|
|
|
noDetail({plan_id:this.planInfo.plan_id}).then(res=>{ |
|
|
|
|
if(res){ |
|
|
|
|
this.froms=res |
|
|
|
|
this.ifEdit=1 |
|
|
|
|
this.froms.map(items=>{ |
|
|
|
|
console.log("不良品详情id",items.id) |
|
|
|
|
res.map(its=>{ |
|
|
|
|
items.id=its.id |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
console.log("不良品详情",this.froms) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
submit() { |
|
|
|
|
let params = JSON.parse(JSON.stringify(this.froms)); |
|
|
|
|
params = params.map(item => { |
|
|
|
|
item.reason_no_id = this.reason[item.reason_no_id].id; |
|
|
|
|
return item; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.buttonState = false; |
|
|
|
|
this.$functions.confirm("是否进行此操作?").then(()=>{ |
|
|
|
|
badReasons({data: params}).then(res => { |
|
|
|
|