Merge branch 'dy' of git.picaiba.com:mt-fe-group/xc-pad into dy
This commit is contained in:
commit
292b795bd1
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-01-09 13:48:42
|
||||
* @LastEditTime: 2024-01-29 17:17:14
|
||||
* @LastEditTime: 2024-01-30 08:55:04
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@ -123,16 +123,6 @@ export default {
|
||||
} else {
|
||||
this.lineArray = []
|
||||
}
|
||||
// if (res && res.data.data.length > 0) {
|
||||
// this.lineArray = res.data.data.map(item => {
|
||||
// return {
|
||||
// text: item.name,
|
||||
// value: item.id
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.lineArray = []
|
||||
// }
|
||||
})
|
||||
},
|
||||
getSection (value) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-01-09 13:49:03
|
||||
* @LastEditTime: 2024-01-29 17:57:45
|
||||
* @LastEditTime: 2024-01-30 08:56:57
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
@ -59,7 +59,7 @@
|
||||
<el-col :span="12">
|
||||
<div class="whiteForm">
|
||||
<el-form-item label="产线" prop="lineId">
|
||||
<el-select v-model="ruleForm.lineId" filterable clearable placeholder="请选择产线" @focus="focusInput1($event)" style="width: 100%; display: block" @change="getSection()">
|
||||
<el-select v-model="ruleForm.lineId" filterable clearable placeholder="请选择产线" @focus="focusInput1($event)" style="width: 100%; display: block" @change="getSection">
|
||||
<el-option v-for="(item, index) in lineArray" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -95,7 +95,7 @@
|
||||
<el-row>
|
||||
<el-form-item>
|
||||
<!-- <el-button @click="resetForm('ruleForm')">取消</el-button> -->
|
||||
<el-button class="subButton" type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
||||
<el-button class="subButton" :disabled="disabled" type="primary" @click="submitForm('ruleForm')">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -147,8 +147,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { workOrderList, scrapDetList, lineList, createScrap, workshopSectionListByLine } from '@/api/quality'
|
||||
import { workOrderList, scrapDetList, createScrap, authList } from '@/api/quality'
|
||||
import SimpleKeyboard from './components/simpleKeyboard.vue'
|
||||
import { getUserId } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
components: { SimpleKeyboard },
|
||||
@ -179,19 +180,32 @@ export default {
|
||||
lineArray: [],
|
||||
scrapList: [],
|
||||
sectionArray: [],
|
||||
disabled: true,
|
||||
rules: {
|
||||
workOrderId: [
|
||||
{ required: true, message: '请选择工单', trigger: 'change' }
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: '请输入报废数量', trigger: 'blur' }
|
||||
],
|
||||
detName: [
|
||||
{ required: true, message: '请选择报废原因', trigger: 'blur' }
|
||||
]
|
||||
// workOrderId: [
|
||||
// { required: true, message: '请选择工单', trigger: 'change' }
|
||||
// ],
|
||||
// num: [
|
||||
// { required: true, message: '请输入报废数量', trigger: 'blur' }
|
||||
// ],
|
||||
// detName: [
|
||||
// { required: true, message: '请选择报废原因', trigger: 'change' }
|
||||
// ]
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
ruleForm: {
|
||||
handler (val) {
|
||||
console.log('场次', val)
|
||||
if (val.workOrderId && val.num && val.detName.length > 0) {
|
||||
this.disabled = false
|
||||
}
|
||||
},
|
||||
deep: true
|
||||
// immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
inputValue: {
|
||||
get () {
|
||||
@ -241,10 +255,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSection () {
|
||||
workshopSectionListByLine({ id: this.ruleForm.lineId }).then(res => {
|
||||
this.sectionArray = res.data.data
|
||||
getSection (value) {
|
||||
const temp = this.lineArray.filter(item => {
|
||||
return item.id === value
|
||||
})
|
||||
this.sectionArray = temp[0].children
|
||||
// workshopSectionListByLine({ id: this.ruleForm.lineId }).then(res => {
|
||||
// this.sectionArray = res.data.data
|
||||
// })
|
||||
},
|
||||
inputFun () {
|
||||
this.$emit('input')
|
||||
@ -339,13 +357,21 @@ export default {
|
||||
async getDict () {
|
||||
const workRes = await workOrderList()
|
||||
this.workOrderList = workRes?.data?.data
|
||||
await lineList().then(res => {
|
||||
this.lineArray = res?.data?.data.map(item => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: item.id
|
||||
}
|
||||
})
|
||||
// await lineList().then(res => {
|
||||
// this.lineArray = res?.data?.data.map(item => {
|
||||
// return {
|
||||
// name: item.name,
|
||||
// id: item.id
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
await authList({ userId: getUserId() }).then(res => {
|
||||
console.log('res', res.data.data)
|
||||
if (res && res.data.data.datas.length > 0) {
|
||||
this.lineArray = res.data.data.datas
|
||||
} else {
|
||||
this.lineArray = []
|
||||
}
|
||||
})
|
||||
const scrapRes = await scrapDetList()
|
||||
this.scrapList = scrapRes?.data?.data
|
||||
|
@ -139,7 +139,8 @@ export default {
|
||||
@deep: ~'>>>';
|
||||
.hg-theme-default {
|
||||
width: 100%;
|
||||
margin-top: 50px;
|
||||
margin-top: -10px;
|
||||
z-index: 1;
|
||||
// position: absolute;
|
||||
// bottom: 0;
|
||||
// left: 0;
|
||||
|
Loading…
Reference in New Issue
Block a user