|
|
|
@ -76,6 +76,16 @@
|
|
|
|
|
v-hasPermi="['quality:inventoryReport:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="success"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-printer"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="showPrintX"
|
|
|
|
|
v-hasPermi="['quality:inventoryReport:export']"
|
|
|
|
|
>巡检记录</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
@ -242,11 +252,66 @@
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<!-- 打印预览弹出层 -->
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="仓库质量巡查记录"
|
|
|
|
|
:visible.sync="printDialogVisible"
|
|
|
|
|
width="871px"
|
|
|
|
|
>
|
|
|
|
|
<div id="printFrom" class="my-print-box">
|
|
|
|
|
|
|
|
|
|
<el-form :model="form">
|
|
|
|
|
<!-- 主数据 -->
|
|
|
|
|
<div v-for="(item,index) in printData.workTable" :key="index">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="7">
|
|
|
|
|
<img src="@/assets/logo/lanjv.png" class="report-logo"/>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" class="center-text">
|
|
|
|
|
<h1>中山榄菊日化实业有限公司</h1>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 表头- -->
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :offset="8" :span="8" class="center-text">
|
|
|
|
|
<h2>仓库质量巡查记录</h2>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<!-- 导航栏 -->
|
|
|
|
|
<el-row class="my-print-nav">
|
|
|
|
|
<el-col :span="6">巡检日期:{{printData.incomeTime}}</el-col>
|
|
|
|
|
<el-col :span="6">条数:{{printData.pageNo}}</el-col>
|
|
|
|
|
<el-col :span="6">编码:{{printData.fileNo}}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table v-if="refreshNewWorkerTable" v-loading="newWorkerLoading" class="my-print-table"
|
|
|
|
|
:data="item" border style="width: 100%;padding-bottom: 1px;">
|
|
|
|
|
<el-table-column label="序号" prop="xh" width="55"></el-table-column>
|
|
|
|
|
<el-table-column prop="materialName" label="产品/物料名称" width="120"></el-table-column>
|
|
|
|
|
<el-table-column prop="modelType" width="80" label="型号规格"></el-table-column>
|
|
|
|
|
<!--<el-table-column prop="workorderCode" width="105" label="生产订单" :formatter="orderCodeFormate"></el-table-column>-->
|
|
|
|
|
<el-table-column prop="incomeBatchNo" width="225" label="生产批号(日期)"></el-table-column>
|
|
|
|
|
<el-table-column prop="checkResult" label="质量状况(包括堆放是否合理)" width="190"></el-table-column>
|
|
|
|
|
<el-table-column prop="routeCode" width="140" label="处理方式"></el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<!-- 底部 -->
|
|
|
|
|
<el-row class="my-print-foot">
|
|
|
|
|
<el-col :offset="1" :span="6">审核:</el-col>
|
|
|
|
|
<el-col :offset="1" :span="6">品管员:{{printData.checkManName}}</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<div class="fy" v-if="index!=printData.workTable.length-1"></div>
|
|
|
|
|
</div>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="handlePrint(printData)">打 印</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listInventory, getInventory, delInventory, addInventory, updateInventory,getCkeckProjectList} from "@/api/quality/inventoryReport";
|
|
|
|
|
import { listInventory, getInventory, delInventory, addInventory, updateInventory,getCkeckProjectList,printXJRecordList} from "@/api/quality/inventoryReport";
|
|
|
|
|
import { getCheckTypes } from "@/api/quality/qcProduce";
|
|
|
|
|
import { getDefectTypeListByDefectType } from "@/api/quality/defectType.js";
|
|
|
|
|
import moment from 'moment';
|
|
|
|
@ -344,7 +409,12 @@ export default {
|
|
|
|
|
/* incomeBatchNo: [
|
|
|
|
|
{ required: true, message: "库存批次号不能为空", trigger: "blur" }
|
|
|
|
|
], */
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
fenyeNumber:5,
|
|
|
|
|
fenyeNumberTwo:5,
|
|
|
|
|
shengchan:true,
|
|
|
|
|
newWorkerLoading: false,
|
|
|
|
|
refreshNewWorkerTable:true
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
@ -518,7 +588,6 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 打印预览-浏览器打印
|
|
|
|
|
handlePrint(params) {
|
|
|
|
|
console.log(this.form);
|
|
|
|
|
printJS({
|
|
|
|
|
printable: params.printable, // 'printFrom', // 标签元素id
|
|
|
|
|
type: params.type || 'html',
|
|
|
|
@ -541,6 +610,54 @@ export default {
|
|
|
|
|
const foundDefect = this.defectList.find(defect => defect.defectCode === defectCode);
|
|
|
|
|
return foundDefect.defectSubclass;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 打印巡检记录
|
|
|
|
|
showPrintX() {
|
|
|
|
|
var startQuery = moment(this.queryParams.checkTimeArray[0]).format('YYYY-MM-DD');
|
|
|
|
|
var endQuery = moment(this.queryParams.checkTimeArray[1]).format('YYYY-MM-DD');
|
|
|
|
|
if(this.queryParams.checkTimeArray.length<0){
|
|
|
|
|
this.$modal.msgError("检验时间筛选条件不能为空")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if(startQuery != endQuery){
|
|
|
|
|
this.$modal.msgError("检验时间筛选条件必须是同一天")
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.printData.workCenter = "暂无数据";
|
|
|
|
|
this.printData.printDate = null;
|
|
|
|
|
this.printData.workTable = [];
|
|
|
|
|
this.printData.factory = null;
|
|
|
|
|
this.printData.productDate = null;
|
|
|
|
|
this.printData.pageNo =0 ;
|
|
|
|
|
// 打开工单信息对话框
|
|
|
|
|
this.printDialogVisible = true;
|
|
|
|
|
this.newWorkerLoading = true // 设置加载状态为true,表示正在加载
|
|
|
|
|
this.refreshNewWorkerTable = false // 先将refreshProTable设置为false,隐藏表格
|
|
|
|
|
printXJRecordList(this.queryParams).then(response => {
|
|
|
|
|
this.showWorkorderCode = false;
|
|
|
|
|
this.printData.incomeTime = startQuery;
|
|
|
|
|
this.printData.fileNo = response[0].fileNo;
|
|
|
|
|
this.printData.checkManName = response[0].checkManName;
|
|
|
|
|
//this.printData.printDate = moment(new Date()).format('YYYY-MM-DD')
|
|
|
|
|
this.printData.workTable = response
|
|
|
|
|
this.printData.pageNo = response.length;
|
|
|
|
|
let chunkedArray = [];
|
|
|
|
|
|
|
|
|
|
// 遍历this.printData.workTable
|
|
|
|
|
for (let i = 0; i < this.printData.workTable.length; i += (i==0?this.fenyeNumber:this.fenyeNumberTwo)) {
|
|
|
|
|
|
|
|
|
|
// 使用slice方法从当前索引i开始切割,切割长度为10(如果剩余元素少于10,则切割剩余所有元素)
|
|
|
|
|
let chunk = this.printData.workTable.slice(i, i + (i==0?this.fenyeNumber:this.fenyeNumberTwo));
|
|
|
|
|
// 将切割后的数组添加到chunkedArray中
|
|
|
|
|
chunkedArray.push(chunk);
|
|
|
|
|
}
|
|
|
|
|
this.printData.workTable = chunkedArray;
|
|
|
|
|
this.refreshNewWorkerTable = true // 立即将refreshProTable设置为true,显示表格
|
|
|
|
|
this.newWorkerLoading = false // 设置加载状态为false,表示加载完成
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 1. 若是objectSpanMethod不返回任何东西,表格不会变化
|
|
|
|
|
* 2. 最外层的判断一般是,先从第几列开始合并
|
|
|
|
@ -587,7 +704,7 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style scoped>
|
|
|
|
@ -617,4 +734,9 @@ export default {
|
|
|
|
|
border: 1px solid #d3dce6; /* 边框颜色可以根据需要自定义 */
|
|
|
|
|
text-align:center;
|
|
|
|
|
}
|
|
|
|
|
.my-print-head {
|
|
|
|
|
margin-top: 5px;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|