Merge remote-tracking branch 'origin/master'

master
wws 1 year ago
commit 16b3870cd1

@ -68,4 +68,64 @@ export function getQcListUser(query) {
method: 'get',
params: query
});
}
}
//状态修改
export function changeIncomeStatus(recordId, status) {
const data = {
recordId,
status
}
return request({
url: '/quality/qcIncome/changeIncomeStatus',
method: 'put',
data: data
})
}
// 查询检测项列表
export function getCkeckProjectList(query) {
return request({
url: '/quality/qcIncome/getCkeckProjectList',
method: 'get',
params: query
});
}
//合格不合格
export function changeCheckDetailStatus(recordId, status) {
const data = {
recordId,
status
}
return request({
url: '/quality/qcIncome/changeCheckDetailStatus',
method: 'put',
data: data
})
}
//测量值提交
export function commitActualValue(recordId, actualValues) {
const data = {
recordId,
actualValues
}
return request({
url: '/quality/qcIncome/commitActualValue',
method: 'put',
data: data
})
}
//审核结果提交
export function commitCheckResult(recordId) {
const data = {
recordId
}
return request({
url: '/quality/qcIncome/commitCheckResult',
method: 'put',
data: data
})
}

@ -449,6 +449,7 @@
clearable
v-model="form.workPlanTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划维修时间"
>
</el-date-picker>
@ -460,6 +461,7 @@
clearable
v-model="form.workPlanDownTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择计划停机时间"
>
</el-date-picker>

@ -42,20 +42,26 @@
/>
</el-form-item>
<el-form-item label="是否委外" prop="workOutsource">
<el-input
v-model="queryParams.workOutsource"
placeholder="请输入是否委外"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select
v-model="queryParams.workOutsource"
placeholder="请选择是否委外"
@change="$forceUpdate()"
clearable
style="width:220px"
@keyup.enter.native="handleQuery">
<el-option v-for="item in workOutsourceOption" :key="item.workOutsource" :label="item.label" :value="item.workOutsource"></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否停机维修" prop="workDownMachine">
<el-input
v-model="queryParams.workDownMachine"
placeholder="请输入是否停机维修"
clearable
@keyup.enter.native="handleQuery"
/>
<el-select
v-model="queryParams.workDownMachine"
placeholder="请选择是否停机"
@change="$forceUpdate()"
clearable
style="width:220px"
@keyup.enter.native="handleQuery">
<el-option v-for="item in workDownMachineOption" :key="item.workDownMachine" :label="item.label" :value="item.workDownMachine"></el-option>
</el-select>
</el-form-item>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
@ -78,6 +84,7 @@
v-model="queryParams.factoryCode"
placeholder="请输入工厂编码"
clearable
style="width:220px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -142,7 +149,11 @@
<span>{{ parseTime(scope.row.workPlanTime) }}</span>
</template>
</el-table-column>
<el-table-column label="是否停机维修" align="center" prop="workDownMachine" width="180"/>
<el-table-column label="是否停机维修" align="center" prop="workDownMachine" width="180">
<template slot-scope="scope">
{{ scope.row.workDownMachine == "1" ? "停机" : "不停机" }}
</template>
</el-table-column>
<el-table-column label="计划停机时间" align="center" prop="workPlanDownTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.workPlanDownTime) }}</span>
@ -150,9 +161,12 @@
</el-table-column>
<el-table-column label="维修人员" align="center" prop="workPerson" />
<el-table-column label="维修组" align="center" prop="workTeam" />
<el-table-column label="是否委外" align="center" prop="workOutsource" />
<el-table-column label="是否委外" align="center" prop="workOutsource" >
<template slot-scope="scope">
{{ scope.row.workOutsource == "1" ? "委外" : "不委外" }}
</template>
</el-table-column>
<el-table-column label="委外工单编码" align="center" prop="outWorkCode" width="180"/>
<el-table-column label="原因分析" align="center" prop="workReason" />
<el-table-column label="故障描述" align="center" prop="workFaultDesc" />
<el-table-column label="维修用时" align="center" prop="workCostTime" width="180">
@ -162,7 +176,7 @@
</el-table-column>
<el-table-column label="维修费用" align="center" prop="workCost" />
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
<template slot-scope="scope">
<el-button
size="mini"
@ -334,6 +348,20 @@ export default {
attr3: null,
factoryCode: null
},
workOutsourceOption: [{
workOutsource: "1",
label: '委外'
}, {
workOutsource: "0",
label: '不委外'
}],
workDownMachineOption: [{
workDownMachine: "1",
label: '停机'
}, {
workDownMachine: "0",
label: '不停机'
}],
//
form: {},
//

@ -0,0 +1,230 @@
<template>
<div>
<el-dialog title="检验项目"
v-if="showFlag"
:visible.sync="showFlag"
:modal= false
width="1000px"
>
<el-row :gutter="20">
<el-col :span="24" :xs="24">
<el-table v-loading="loading" :data="itemList" ref="myTable" >
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column label="检测规则Id" align="left" prop="recordId" :show-overflow-tooltip="true" v-if="false"/>
<el-table-column label="检测规则编码" align="left" prop="projectNo" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="检验规则名称" align="left" prop="ruleName" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="检验规则属性" align="left" prop="propertyCode" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="检验方式" align="left" prop="checkMode" :show-overflow-tooltip="true" />
<el-table-column label="检验工具" align="left" prop="checkTool" :show-overflow-tooltip="true" />
<el-table-column label="检验标准" align="left" prop="checkStandard" :show-overflow-tooltip="true" />
<el-table-column label="单位" align="left" prop="unitCode" :show-overflow-tooltip="true" width="80"/>
<el-table-column label="检测结果" key="status" align="center" prop="status" width="90">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="Y"
inactive-value="N"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="测量值" align="left" prop="actualValue" :show-overflow-tooltip="true" width="120"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleShowValue(scope.row)"
v-hasPermi="['quality:qcIncome:edit']"
>检测值</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBomForm"> </el-button>
<el-button @click="showFlag=false"> </el-button>
</div>
</el-dialog>
<!--测量值弹窗-->
<el-dialog title="测量值" :visible.sync="valueOpen" width="600px" append-to-body>
<el-form :model="dynamicValidateForm" ref="dynamicValidateForm" label-width="100px" class="demo-dynamic">
<el-form-item
v-for="(domain, index) in dynamicValidateForm.domains"
:label="'测量值' + index"
:key="domain.key"
:prop="'domains.' + index + '.value'"
:rules="{
required: true, message: '测量值不能为空', trigger: 'blur'
}"
>
<el-input v-model="domain.value" style="width: 70%;"></el-input>
<el-button @click.prevent="removeDomain(domain)" style="margin-left:30px">删除</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('dynamicValidateForm')"></el-button>
<el-button @click="addDomain"></el-button>
<el-button @click="resetForm('dynamicValidateForm')"></el-button>
</el-form-item>
</el-form>
</el-dialog>
</div>
</template>
<script>
import { getCkeckProjectList,changeCheckDetailStatus,commitActualValue,commitCheckResult } from "@/api/quality/income";
export default {
name: "itemSelectUser",
dicts: ["check_result"],
data() {
return {
showFlag:false,
//
selectedRows: {},
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// BOM
itemList: null,
//
bomCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
pageSize: 10,
belongTo:''
//,userCode: '',
//userName : ''
},
data:{},
dynamicValidateForm: {
domains: [{
value: ''
}]
},
//
valueOpen: false,
//id
recordId:'',
};
},
created() {
//this.getList();
},
methods: {
init(rowdata){
this.data=rowdata
this.queryParams.belongTo = this.data.recordId;
this.getList();
},
/** 查询表格列表*/
getList() {
this.loading = true;
getCkeckProjectList(this.queryParams).then(response => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
}
);
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
submitBomForm() {
commitCheckResult(this.queryParams.belongTo).then(response => {
this.$modal.msgSuccess("检测完成");
this.$emit('saveCheck');
this.showFlag = false;
});
},
// /YN
handleStatusChange(row) {
let text = row.status === "N" ? "不合格" : "合格";
this.$modal.confirm('确认' + '"' + row.checkNo + '"'+text+'吗?').then(function() {
return changeCheckDetailStatus(row.recordId, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "操作成功");
}).catch(function() {
row.status = row.status === "N" ? "Y" : "N";
});
},
//
/** 检测结果钮操作 */
handleShowValue(row) {
this.valueOpen = true;
this.recordId = row.recordId;
},
submitForm(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
let values = this.dynamicValidateForm.domains;
var actualValues = values.map(item => item.value);
commitActualValue(this.recordId, actualValues).then(response => {
this.dynamicValidateForm.domains = [{ value: ''}];
this.$modal.msgSuccess("提交成功");
this.valueOpen = false;
this.getList();
});
} else {
console.log('error submit!!');
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
removeDomain(item) {
var index = this.dynamicValidateForm.domains.indexOf(item)
if (index !== -1) {
this.dynamicValidateForm.domains.splice(index, 1)
}
},
addDomain() {
this.dynamicValidateForm.domains.push({
value: '',
key: Date.now()
});
}
}
};
</script>

@ -25,14 +25,17 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="来料时间" prop="incomeTime">
<el-date-picker clearable
v-model="queryParams.incomeTime"
type="date"
value-format="yyyy-MM-dd "
placeholder="请选择来料时间">
<el-form-item label="来料时间" prop="incomeTimeArray">
<el-date-picker
v-model="queryParams.incomeTimeArray"
format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<!--
<el-form-item label="检测地点" prop="checkLoc">
<el-input
v-model="queryParams.checkLoc"
@ -40,13 +43,15 @@
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检验时间" prop="checkTime">
<el-date-picker clearable
v-model="queryParams.checkTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择检验时间">
</el-form-item>-->
<el-form-item label="检验时间" prop="checkTimeArray">
<el-date-picker
v-model="queryParams.checkTimeArray"
format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item>
@ -66,6 +71,7 @@
v-hasPermi="['quality:qcIncome:add']"
>新增</el-button>
</el-col>
<!--
<el-col :span="1.5">
<el-button
type="success"
@ -87,7 +93,7 @@
@click="handleDelete"
v-hasPermi="['quality:qcIncome:remove']"
>删除</el-button>
</el-col>
</el-col>-->
<el-col :span="1.5">
<el-button
type="warning"
@ -103,41 +109,59 @@
<el-table v-loading="loading" :data="incomeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="recordId" v-if="false"/>
<el-table-column label="检验任务编号" align="center" prop="checkNo" />
<el-table-column label="来料批次号" align="center" prop="incomeBatchNo" />
<el-table-column label="订单号" align="center" prop="orderNo" />
<el-table-column label="物料号" align="center" prop="materialCode" />
<el-table-column label="物料名称" align="center" prop="materialName" />
<el-table-column label="recordId" align="center" prop="recordId" v-if="false"/>
<el-table-column label="检验任务编号" align="center" prop="checkNo" width="120"/>
<el-table-column label="来料批次号" align="center" prop="incomeBatchNo" width="120"/>
<el-table-column label="订单号" align="center" prop="orderNo" width="120"/>
<el-table-column label="物料号" align="center" prop="materialCode" width="170"/>
<el-table-column label="物料名称" align="center" prop="materialName" width="150"/>
<el-table-column label="收货数量" align="center" prop="quality" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="供应商编码" align="center" prop="supplierCode" />
<el-table-column label="供应商名称" align="center" prop="supplierName" />
<el-table-column label="供应商编码" align="center" prop="supplierCode" width="120"/>
<el-table-column label="供应商名称" align="center" prop="supplierName" width="240"/>
<el-table-column label="来料时间" align="center" prop="incomeTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.incomeTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="检测地点" align="center" prop="checkLoc" />
<el-table-column label="检测状态" align="center" prop="checkStatus" />
<el-table-column label="检测人工号" align="center" prop="checkManCode" />
<el-table-column label="检测人姓名" align="center" prop="checkManName" />
<el-table-column label="检测地点" align="center" prop="checkLoc" width="120"/>
<el-table-column label="检测状态" align="center" prop="checkStatus" >
<template slot-scope="scope">
<dict-tag
:options="dict.type.check_status"
:value="scope.row.checkStatus"
/>
</template>
</el-table-column>
<el-table-column label="检测人工号" align="center" prop="checkManCode" width="100"/>
<el-table-column label="检测人姓名" align="center" prop="checkManName" width="100"/>
<el-table-column label="检验时间" align="center" prop="checkTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.checkTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="检验结果" align="center" prop="checkResult" />
<el-table-column label="是否启用" align="center" prop="status" />
<el-table-column label="是否启用" align="center" width="100">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
active-value="1"
inactive-value="0"
@change="handleStatusChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
@click="handleCheckProject(scope.row)"
v-hasPermi="['quality:qcIncome:edit']"
>修改</el-button>
>检验</el-button>
<!--
<el-button
size="mini"
type="text"
@ -145,6 +169,7 @@
@click="handleDelete(scope.row)"
v-hasPermi="['quality:qcIncome:remove']"
>删除</el-button>
-->
</template>
</el-table-column>
</el-table>
@ -275,18 +300,25 @@
ref="itemSelectUser"
@onSelected="onSelectUser"
></ItemSelectUser>
<!--检验项目弹窗-->
<ItemSelectProject
ref="itemSelectProject"
@saveCheck="saveCheck"
></ItemSelectProject>
</div>
</template>
<script>
import { listIncome, getIncome, delIncome, addIncome, updateIncome } from "@/api/quality/income";
import { listIncome, getIncome, delIncome, addIncome, updateIncome ,changeIncomeStatus} from "@/api/quality/income";
import ItemSelectMaterial from "./selectMaterial.vue";
import ItemSelectSupplier from "./selectSupplier.vue";
import ItemSelectUser from "./selectUser.vue";
import ItemSelectProject from "./checkProjectType.vue";
import moment from 'moment';
export default {
name: "Income",
components: { ItemSelectMaterial,ItemSelectSupplier,ItemSelectUser },
dicts: ["unit"],
components: { ItemSelectMaterial,ItemSelectSupplier,ItemSelectUser,ItemSelectProject},
dicts: ["unit","check_status"],
data() {
return {
//
@ -309,6 +341,8 @@ export default {
open: false,
//
queryParams: {
incomeTimeArray: [],
checkTimeArray: [],
pageNum: 1,
pageSize: 10,
checkNo: null,
@ -338,19 +372,72 @@ export default {
form: {},
//
rules: {
factoryCode: [
{ required: true, message: "工厂编码不能为空", trigger: "blur" }
incomeBatchNo: [
{ required: true, message: "来料批次号不能为空", trigger: "blur" }
],
orderNo: [
{ required: true, message: "订单号不能为空", trigger: "blur" }
],
materialName: [
{ required: true, message: "物料号不能为空", trigger: "blur" }
],
quality: [
{ required: true, message: "数量不能为空", trigger: "blur" }
],
unit: [
{ required: true, message: "单位不能为空", trigger: "blur" }
],
supplierName: [
{ required: true, message: "供应商不能为空", trigger: "blur" }
],
incomeTime: [
{ required: true, message: "来料时间不能为空", trigger: "blur" }
],
checkManName: [
{ required: true, message: "检测人不能为空", trigger: "blur" }
],
checkLoc: [
{ required: true, message: "检测地点不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getDate();
this.getList();
},
methods: {
/**获取默认查询时间段**/
getDate() {
let start = this.Fungetdate (0)
let end = this.Fungetdate (1)
this.queryParams.incomeTimeArray.push(start,end)
this.queryParams.checkTimeArray.push(start,end)
},
Fungetdate (num) {
var dd = new Date();
dd.setDate(dd.getDate() + num);
var y = dd.getFullYear();
var m = dd.getMonth() + 1;//
var d = dd.getDate();
return y + "-" + m + "-" + d+" 00:00:00";
},
/** 查询来料检验列表 */
getList() {
this.loading = true;
if(this.queryParams.incomeTimeArray!=null){
this.queryParams.incomeTimeStart = moment(this.queryParams.incomeTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
this.queryParams.incomeTimeEnd = moment(this.queryParams.incomeTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
}
if(this.queryParams.checkTimeArray!=null){
this.queryParams.checkTimeStart = moment(this.queryParams.checkTimeArray[0]).format('YYYY-MM-DD HH:mm:ss');
this.queryParams.checkTimeEnd = moment(this.queryParams.checkTimeArray[1]).format('YYYY-MM-DD HH:mm:ss');
}
listIncome(this.queryParams).then(response => {
this.incomeList = response.rows;
this.total = response.total;
@ -460,10 +547,23 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
this.download('qcIncome/income/export', {
this.download('quality/qcIncome/export', {
...this.queryParams
}, `income_${new Date().getTime()}.xlsx`)
},
//
handleStatusChange(row) {
let text = row.status === "0" ? "停用" : "启用";
this.$modal.confirm('确认要"' + text + '""' + row.checkNo + '"吗?').then(function() {
return changeIncomeStatus(row.recordId, row.status);
}).then(() => {
this.$modal.msgSuccess(text + "成功");
}).catch(function() {
row.status = row.status === "0" ? "1" : "0";
});
},
/**物料选择弹出框**/
handleSelectMaterial() {
this.$refs.itemSelectMaterial.showFlag = true;
@ -492,6 +592,15 @@ export default {
onSelectUser(obj) {
this.form.checkManCode = obj.code;
this.form.checkManName = obj.name;
},
//
handleCheckProject(row){
this.$refs.itemSelectProject.showFlag = true;
this.$refs.itemSelectProject.init(row);
},
//
saveCheck(){
this.getList();
}
}
};

@ -36,8 +36,7 @@
<el-table-column width="50" align="center" type="selection">
</el-table-column>
<!-- 序号 -->
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号"></el-table-column>
<el-table-column label="员工姓名" align="left" key="userId" prop="userId" :show-overflow-tooltip="true" />
<el-table-column label="员工ID" align="left" key="userId" prop="userId" :show-overflow-tooltip="true" />
<el-table-column label="员工工号" align="left" key="userCode" prop="userCode" :show-overflow-tooltip="true" />
<el-table-column label="员工姓名" align="left" key="userName" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="手机号" align="left" key="phonenumber" prop="phonenumber" :show-overflow-tooltip="true" />

Loading…
Cancel
Save