This commit is contained in:
tczjx58520 2020-04-17 09:59:39 +08:00
commit 28dd09ded1
9 changed files with 187 additions and 10 deletions

View file

@ -127,6 +127,7 @@
<detail-report :reportcontrol.sync="reportcontrol" :reportdata.sync="reportdata" @report="report"/>
<detail-report2 :reportcontrol2.sync="reportcontrol2" :reportdata2.sync="reportdata2" @report2="report2"/>
<detail-report3 :reportcontrol3.sync="reportcontrol3" :reportdata3.sync="reportdata3" @report3="report3"/>
<detail-report4 :reportcontrol4.sync="reportcontrol4" :reportdata4.sync="reportdata4" @report4="report4"/>
</el-form-item>
</el-col>
<el-col :span="6">
@ -273,11 +274,12 @@ import MyEmp2 from './components/MyEmp2'
import DetailReport from './components/DetailReport'
import DetailReport2 from './components/DetailReport2'
import DetailReport3 from './components/DetailReport3'
import DetailReport4 from './components/DetailReport4'
import OutSource from './components/OutSource'
var _that
export default {
name: 'AddCheckReport',
components: { OutSource, DetailReport3, DetailReport2, DetailReport, MyEmp2, MyMater, MyQuality, MyAccept, ProduceTask, MyArrival, MyCenter, MyDelivery, MySupplier, MyDetail, MyEmp },
components: { DetailReport4, OutSource, DetailReport3, DetailReport2, DetailReport, MyEmp2, MyMater, MyQuality, MyAccept, ProduceTask, MyArrival, MyCenter, MyDelivery, MySupplier, MyDetail, MyEmp },
data() {
const validatePass = (rule, value, callback) => {
// console.log(value)
@ -351,8 +353,10 @@ export default {
IsProduceManagerId: false,
//
reportdata3: [],
reportdata4: [],
//
reportcontrol3: false,
reportcontrol4: false,
//
reportdata2: [],
//
@ -511,16 +515,49 @@ export default {
_that = this
},
methods: {
outSourceDetail(val) {
console.log(val)
this.$refs.editable.clear()
for (let i = 0; i < val.length; i++) {
this.$refs.editable.insert(val[i])
report4(val) {
console.log('val', val)
this.sourceSerialNumber = val.id
this.personalForm.sourceSerialNumber = val.id
this.personalForm.productCode = val.productCode
this.personalForm.productName = val.productName
this.personalForm.unit = val.unit
this.personalForm.typeId = val.type
this.typeId = val.typeName
this.judgequilty = (val.quantity).toFixed(2)
this.personalForm.checkQuantity = (val.quantity).toFixed(2)
if (Number(this.personalForm.checkQuantity) <= 100) {
this.personalForm.sampleQuantity = 5
}
if (Number(this.personalForm.checkQuantity) >= 101) {
this.personalForm.sampleQuantity = Math.round(Number(this.personalForm.checkQuantity) * 0.05)
}
//
this.adddetail(val.productCode)
},
outSourceDetail(val) {
},
outSource(val) {
console.log(val)
this.personalForm.sourceNumber = val.number
console.log(123)
this.$refs.editable.clear()
this.$refs.personalForm2.clearValidate()
this.$refs.personalForm2.resetFields()
this.$refs.personalForm3.clearValidate()
this.$refs.personalForm3.resetFields()
this.personalForm.productName = ''
this.personalForm.unit = ''
this.personalForm.typeId = ''
this.personalForm.failedQuantity = ''
this.personalForm.passRate = ''
this.reportdata4 = val.outsourcingEnterDetailVos
this.personalForm.inspectionDeptId = val.produceDeptId
if (val.handlePersonId !== '' && val.handlePersonId !== null && val.handlePersonId !== undefined) {
this.personalForm.produceManagerId = val.handlePersonId
this.produceManagerId = val.handlePersonName
this.IsProduceManagerId = true
}
},
getdatatime() { //
var date = new Date()
@ -629,7 +666,7 @@ export default {
} else if (this.personalForm.sourceType === '3') {
this.reportcontrol3 = true
} else if (this.personalForm.sourceType === '4') {
// this.outsourcecontrol = true
this.reportcontrol4 = true
}
},
adddetail(val) {

View file

@ -206,7 +206,7 @@ export default {
1: _that.$t('updates.zjsqd'),
2: _that.$t('updates.cgdhd'),
3: _that.$t('updates.zscrw'),
4: _that.$t('Hmodule.Nosource')
4: '外包单'
}
return statusMap[status]
},

View file

@ -288,7 +288,10 @@ export default {
},
sourceTypeFilter(status) {
const statusMap = {
1: _that.$t('updates.zjsqd')
1: _that.$t('updates.zjsqd'),
2: _that.$t('updates.cgdhd'),
3: _that.$t('updates.zscrw'),
4: '外包单'
}
return statusMap[status]
},

View file

@ -0,0 +1,115 @@
<template>
<el-dialog :visible.sync="editVisible" :reportcontrol4="reportcontrol4" :reportdata4="reportdata4" :close-on-press-escape="false" top="10px" title="外包单明细" append-to-body @close="$emit('update:reportcontrol4', false)">
<!-- 列表开始 -->
<el-table
:key="tableKey"
:data.sync="list"
border
fit
highlight-current-row
style="width: 100%;margin-top: 50px"
@current-change="handleCurrentChange">
<el-table-column :resizable="false" :label="$t('Hmodule.wpbh')" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productCode }}</span>
</template>
</el-table-column>
<el-table-column :resizable="false" :label="$t('Hmodule.wpmc')" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
</el-table-column>
<el-table-column :resizable="false" :label="$t('Hmodule.dw')" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.unit }}</span>
</template>
</el-table-column>
<el-table-column :resizable="false" :label="$t('tongyo.quantity')" align="center" min-width="150">
<template slot-scope="scope">
<span>{{ scope.row.quantity }}</span>
</template>
</el-table-column>
</el-table>
<!-- 列表结束 -->
<span slot="footer" class="dialog-footer">
<el-button type="success" style="text-align: center;" @click="handleAddTo">{{ $t('Hmodule.sure') }}</el-button>
</span>
</el-dialog>
</template>
<script>
var _that
export default {
props: {
reportcontrol4: {
type: Boolean,
default: false
},
reportdata4: {
type: Array,
default: null
}
},
data() {
return {
//
choosedata: [],
//
editVisible: this.reportcontrol4,
//
staffcontrol: false,
//
checkPersonname: '',
//
list: this.reportdata4,
//
total: 0,
//
tableKey: 0
}
},
watch: {
reportcontrol4() {
this.editVisible = this.reportcontrol4
},
reportdata4() {
this.list = this.reportdata4
}
},
beforeCreate() {
_that = this
},
methods: {
handleCurrentChange(val) {
console.log(val)
this.choosedata = val
},
//
handleAddTo() {
this.editVisible = false
console.log(this.choosedata)
this.$emit('report4', this.choosedata)
}
}
}
</script>
<style scoped>
.ERP-container {
margin: 50px 30px;
}
.filter-item{
width: 150px;
margin-left: 20px;
}
.form-name{
font-size: 18px;
color: #373e4f;
margin-bottom: -20px;
margin-top: 30px;
}
.container{
margin-top: 2%;
border: 1px solid #eceff6;
}
</style>

View file

@ -17,6 +17,7 @@
<el-option value="1" label="质检申请单" />
<el-option value="2" label="采购到货单" />
<el-option value="3" label="生产任务单" />
<el-option value="4" label="外包单" />
</el-select>
</el-form-item>
</el-col>

View file

@ -335,8 +335,20 @@ export default {
outSourceDetail(val) {
console.log(val)
this.$refs.editable.clear()
let flag = 0
for (let i = 0; i < val.length; i++) {
this.$refs.editable.insert(val[i])
if (val[i].qualifyQuantity > 0) {
flag++
this.$refs.editable.insert(val[i])
}
}
if (flag === 0) {
this.$notify.error({
title: 'wrong',
message: '请先质检再入库',
offset: 100
})
return false
}
},
outSource(val) {

View file

@ -316,6 +316,7 @@ export default {
const outSourceDetail = outsourcingDetailVos.map(function(item) {
return {
actualEnterQuantity: item.quantity,
qualifyQuantity: item.qualifyQuantity,
productCode: item.productCode,
productName: item.productName,
categoryName: item.productCategoryName,

View file

@ -474,6 +474,10 @@ export default {
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
elem.reportCheckingQuantity = 0
elem.actualCheckingQuantity = 0
elem.qualifyQuantity = 0
elem.unqualifyQuantity = 0
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}

View file

@ -482,6 +482,10 @@ export default {
EnterDetail.map(function(elem) {
return elem
}).forEach(function(elem) {
elem.reportCheckingQuantity = 0
elem.actualCheckingQuantity = 0
elem.qualifyQuantity = 0
elem.unqualifyQuantity = 0
if (elem.productCode === null || elem.productCode === '' || elem.productCode === undefined) {
delete elem.productCode
}