|
@@ -6,7 +6,7 @@
|
|
|
<el-button type="primary" @click="save" :loading="loading" v-if="type != 'detail'">保存</el-button>
|
|
<el-button type="primary" @click="save" :loading="loading" v-if="type != 'detail'">保存</el-button>
|
|
|
<el-button type="primary" @click="handleReporting" :loading="loading" v-if="type != 'detail'">报工完成</el-button>
|
|
<el-button type="primary" @click="handleReporting" :loading="loading" v-if="type != 'detail'">报工完成</el-button>
|
|
|
</header-title>
|
|
</header-title>
|
|
|
- <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type" :qualityType="qualityType"></base-info>
|
|
|
|
|
|
|
+ <base-info ref="baseInfoRefs" v-if="form" :form="form" :btnType="type" :qualityType1="qualityType"></base-info>
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<header-title title="质检内容">
|
|
<header-title title="质检内容">
|
|
|
<el-button type="primary" :loading="loading" v-if="type != 'detail'"
|
|
<el-button type="primary" :loading="loading" v-if="type != 'detail'"
|
|
@@ -132,7 +132,7 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
|
|
|
|
|
- <sampleListDialog ref="detailRef" @handleConfirm="handleConfirm"></sampleListDialog>
|
|
|
|
|
|
|
+ <sampleListDialog ref="detailRef" @handleConfirm="handleConfirm" @handleDispose="handleDispose"></sampleListDialog>
|
|
|
<sampleDisposeDialog ref="disposeRef" @handleDisposeConfirm="handleDisposeConfirm"></sampleDisposeDialog>
|
|
<sampleDisposeDialog ref="disposeRef" @handleDisposeConfirm="handleDisposeConfirm"></sampleDisposeDialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -163,7 +163,7 @@ export default {
|
|
|
const defaultForm = function () {
|
|
const defaultForm = function () {
|
|
|
return {
|
|
return {
|
|
|
code: '',
|
|
code: '',
|
|
|
- qualityType: '',
|
|
|
|
|
|
|
+ qualityType: null,
|
|
|
qualityModeproduceRoutingId: '',
|
|
qualityModeproduceRoutingId: '',
|
|
|
produceRoutingName: '',
|
|
produceRoutingName: '',
|
|
|
produceTaskId: '',
|
|
produceTaskId: '',
|
|
@@ -188,6 +188,8 @@ export default {
|
|
|
totalWeight: '',
|
|
totalWeight: '',
|
|
|
sampleNumber: '',
|
|
sampleNumber: '',
|
|
|
imgUrl: [],
|
|
imgUrl: [],
|
|
|
|
|
+ qualityTimeStart: '',
|
|
|
|
|
+ qualityTimeEnd: ''
|
|
|
};
|
|
};
|
|
|
};
|
|
};
|
|
|
return {
|
|
return {
|
|
@@ -199,7 +201,6 @@ export default {
|
|
|
// 表单验证规则
|
|
// 表单验证规则
|
|
|
categoryParamList: [],
|
|
categoryParamList: [],
|
|
|
type: '',
|
|
type: '',
|
|
|
- qualityType: null,
|
|
|
|
|
title: '',
|
|
title: '',
|
|
|
loading: false,
|
|
loading: false,
|
|
|
|
|
|
|
@@ -234,7 +235,7 @@ export default {
|
|
|
{ label: '批次号', prop: 'batchNo', align: 'center' },
|
|
{ label: '批次号', prop: 'batchNo', align: 'center' },
|
|
|
{ label: '发货条码', prop: 'barcodes', align: 'center' },
|
|
{ label: '发货条码', prop: 'barcodes', align: 'center' },
|
|
|
{ label: '包装编码', prop: 'packageNo', align: 'center' },
|
|
{ label: '包装编码', prop: 'packageNo', align: 'center' },
|
|
|
- { label: '包装数量', prop: 'packingQuantity', align: 'center' },
|
|
|
|
|
|
|
+ // { label: '包装数量', prop: 'packingQuantity', align: 'center' },
|
|
|
{ label: '包装单位', prop: 'packingUnit', align: 'center' },
|
|
{ label: '包装单位', prop: 'packingUnit', align: 'center' },
|
|
|
{ label: '计量数量', prop: 'measureQuantity', align: 'center' },
|
|
{ label: '计量数量', prop: 'measureQuantity', align: 'center' },
|
|
|
{ label: '计量单位', prop: 'measureUnit', align: 'center' },
|
|
{ label: '计量单位', prop: 'measureUnit', align: 'center' },
|
|
@@ -273,6 +274,7 @@ export default {
|
|
|
isValid: true,
|
|
isValid: true,
|
|
|
isStatus: true,
|
|
isStatus: true,
|
|
|
SampleListbyReportList: [],
|
|
SampleListbyReportList: [],
|
|
|
|
|
+ qualityTimeStart: ''
|
|
|
|
|
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
@@ -317,20 +319,47 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
|
|
+ getNowDate() {
|
|
|
|
|
+ let date = new Date(),
|
|
|
|
|
+ obj = {
|
|
|
|
|
+ year: date.getFullYear(), //获取当前月份(0-11,0代表1月)
|
|
|
|
|
+ month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
|
|
|
|
|
+ strDate: date.getDate(), // 获取当前日(1-31)
|
|
|
|
|
+ hour: date.getHours(), //获取当前小时(0 ~ 23)
|
|
|
|
|
+ minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
|
|
|
|
|
+ second: date.getSeconds() //获取当前秒数(0 ~ 59)
|
|
|
|
|
+ };
|
|
|
|
|
+ Object.keys(obj).forEach((key) => {
|
|
|
|
|
+ if (obj[key] < 10) obj[key] = `0${obj[key]}`;
|
|
|
|
|
+ });
|
|
|
|
|
+ return obj;
|
|
|
|
|
+ },
|
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
|
console.log(val, '选中数据')
|
|
console.log(val, '选中数据')
|
|
|
},
|
|
},
|
|
|
- async open(type) {
|
|
|
|
|
|
|
+ async open() {
|
|
|
this.type = this.$route.query.type;
|
|
this.type = this.$route.query.type;
|
|
|
this.qualityType = this.$route.query.qualityType;
|
|
this.qualityType = this.$route.query.qualityType;
|
|
|
- this.title = this.type == 'add' ? '新增' : type == 'edit' ? '报工' : '详情';
|
|
|
|
|
|
|
+ this.title = this.type == 'add' ? '新增' : this.type == 'edit' ? '报工' : '详情';
|
|
|
|
|
|
|
|
if (this.type == 'add') {
|
|
if (this.type == 'add') {
|
|
|
const code = await getCode('quality_work_order_code');
|
|
const code = await getCode('quality_work_order_code');
|
|
|
this.form.code = code;
|
|
this.form.code = code;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (this.$route.query.qualityTimeStart != '' || this.$route.query.qualityTimeStart != null || this.$route.query.qualityTimeStart != undefined) {
|
|
|
|
|
+ this.qualityTimeStart = this.getNowTime();
|
|
|
|
|
+ console.log(this.qualityTimeStart, '开始报工时间')
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ getNowTime() {
|
|
|
|
|
+ const nowDate = this.getNowDate()
|
|
|
|
|
+ return nowDate.year + '-' + nowDate.month + '-' + nowDate.strDate + ' ' + nowDate.hour + ':' + nowDate.minute + ':' + nowDate.second
|
|
|
|
|
+ },
|
|
|
|
|
+ getNowTimes() {
|
|
|
|
|
+ const nowDate = this.getNowDate()
|
|
|
|
|
+ return nowDate.year + '-' + nowDate.month + '-' + nowDate.strDate
|
|
|
|
|
+ },
|
|
|
async getDetail() {
|
|
async getDetail() {
|
|
|
|
|
|
|
|
getById(this.$route.query.id).then((res) => {
|
|
getById(this.$route.query.id).then((res) => {
|
|
@@ -365,6 +394,8 @@ export default {
|
|
|
const res = await queryQualitySamplContent({ qualityWorkerId: this.$route.query.id })
|
|
const res = await queryQualitySamplContent({ qualityWorkerId: this.$route.query.id })
|
|
|
let addStatus = res.map((item) => {
|
|
let addStatus = res.map((item) => {
|
|
|
item.isValid = true;
|
|
item.isValid = true;
|
|
|
|
|
+ item.disposeTime = item.disposeTime ? item.disposeTime.split(' ')[0] : null;
|
|
|
|
|
+ item.sampleDate = item.sampleDate ? item.sampleDate.split(' ')[0] : null;
|
|
|
return {
|
|
return {
|
|
|
...item
|
|
...item
|
|
|
}
|
|
}
|
|
@@ -458,26 +489,21 @@ export default {
|
|
|
}
|
|
}
|
|
|
const selectedData = [];
|
|
const selectedData = [];
|
|
|
selectedData.push(this.sampleList[index])
|
|
selectedData.push(this.sampleList[index])
|
|
|
- console.log(index, row, type, selectedData, 'index, row, type, mergedData')
|
|
|
|
|
|
|
+
|
|
|
this.$refs.detailRef.openDia(index, row, type, selectedData, null);
|
|
this.$refs.detailRef.openDia(index, row, type, selectedData, null);
|
|
|
},
|
|
},
|
|
|
handleDispose(index, row, type) {
|
|
handleDispose(index, row, type) {
|
|
|
if (!this.sampleList[index]) {
|
|
if (!this.sampleList[index]) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- // const selectedData = [];
|
|
|
|
|
- // selectedData.push(this.sampleList[index])
|
|
|
|
|
- // console.log(index, row, type, selectedData, 'index, row, type, mergedData')
|
|
|
|
|
- this.sampleList[index].sampleDate = this.formatCurrentDate();
|
|
|
|
|
- this.sampleList[index].disposeTime = this.formatCurrentDate();
|
|
|
|
|
- this.$refs.disposeRef.openDispose(index, row, type, null, null, this.form.qualityType);
|
|
|
|
|
- },
|
|
|
|
|
- formatCurrentDate() {
|
|
|
|
|
- const date = new Date();
|
|
|
|
|
- const year = date.getFullYear();
|
|
|
|
|
- const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
|
|
|
- const day = String(date.getDate()).padStart(2, '0');
|
|
|
|
|
- return `${year}-${month}-${day}`;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ this.sampleList[index].sampleDate = this.getNowTimes();
|
|
|
|
|
+
|
|
|
|
|
+ this.sampleList[index].disposeTime = this.getNowTimes();
|
|
|
|
|
+
|
|
|
|
|
+ console.log(index, row, type, this.qualityType)
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs.disposeRef.openDispose(index, row, type, this.qualityType);
|
|
|
},
|
|
},
|
|
|
// 报工
|
|
// 报工
|
|
|
handleReporting(index, row) {
|
|
handleReporting(index, row) {
|
|
@@ -485,6 +511,13 @@ export default {
|
|
|
if (!valid) {
|
|
if (!valid) {
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
|
|
+ // let form = {
|
|
|
|
|
+ // qualityTimeEnd: this.getNowTime(),
|
|
|
|
|
+ // qualityTimeStart: this.qualityTimeStart,
|
|
|
|
|
+ // ...this.form,
|
|
|
|
|
+ // }
|
|
|
|
|
+ this.form.qualityTimeEnd = new Date(this.getNowTime())
|
|
|
|
|
+ this.form.qualityTimeStart = new Date(this.qualityTimeStart)
|
|
|
let params = {
|
|
let params = {
|
|
|
...this.form,
|
|
...this.form,
|
|
|
sampleList: this.sampleList,
|
|
sampleList: this.sampleList,
|
|
@@ -492,7 +525,6 @@ export default {
|
|
|
qualityInventoryList: this.packingList
|
|
qualityInventoryList: this.packingList
|
|
|
}
|
|
}
|
|
|
console.log(params, 'params')
|
|
console.log(params, 'params')
|
|
|
- // return;
|
|
|
|
|
exeReportWork(params)
|
|
exeReportWork(params)
|
|
|
.then((msg) => {
|
|
.then((msg) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -506,11 +538,9 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
// 处理确认事件
|
|
// 处理确认事件
|
|
|
- handleDisposeConfirm(list, index) {
|
|
|
|
|
- if (index != null) {
|
|
|
|
|
- this.$set(this.sampleList, index, list[0]);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$set(this.sampleList, null, list);
|
|
|
|
|
|
|
+ handleDisposeConfirm(row, index) {
|
|
|
|
|
+ if (index > -1) {
|
|
|
|
|
+ this.$set(this.sampleList, index, row)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
//确认报工
|
|
//确认报工
|