槽液信息模块内容修改

dev-scheduling
jinna 1 month ago
parent 9d3d68148e
commit b85b12209d
  1. 8
      src/api/basicData/calculationFormula.js
  2. 76
      src/api/basicData/ruleMaintenance.js
  3. 8
      src/api/tankSolutionSystem/info.js
  4. 10
      src/api/tankSolutionSystem/resultsCon.js
  5. 159
      src/utils/tankclac.js
  6. 85
      src/views/basicData/calculationFormula/components/addEditDosing.vue
  7. 1
      src/views/basicData/calculationFormula/tankDosing.vue
  8. 1
      src/views/basicData/calculationFormula/theoreticalValue.vue
  9. 352
      src/views/basicData/components/addRuleDialog.vue
  10. 352
      src/views/basicData/ruleMaintenance.vue
  11. 49
      src/views/productionSchedulingPlan/basic/qualityGrade.vue
  12. 24
      src/views/qualityManagement/tankSolutionSystem/components/addEditInfoDialog.vue
  13. 56
      src/views/qualityManagement/tankSolutionSystem/components/batchDialog.vue
  14. 6
      src/views/qualityManagement/tankSolutionSystem/components/disposeDialog.vue
  15. 32
      src/views/qualityManagement/tankSolutionSystem/info.vue
  16. 31
      src/views/qualityManagement/tankSolutionSystem/inspectionReport.vue
  17. 8
      src/views/qualityManagement/tankSolutionSystem/workTankLine.vue
  18. 4
      src/views/qualityManagement/tankSolutionSystem/workTankManagement.vue

@ -32,3 +32,11 @@ export const deleteFormula = params =>
method: 'post',
params
})
// 获取分析项目下拉
export const getSelectFormula = (params) =>
request({
url: '/api/blade-desk/QA/LiquidTank/listForSelectDistinct',
method: 'get',
params
})

@ -0,0 +1,76 @@
import request from '@/axios';
// 工艺能力下拉
export const getCapability = () =>{
return request({
url:'/api/blade-desk/BA/craftAbility/findList',
method:'get'
})
}
// 生产标识下拉
export const getProduction = () =>{
return request({
url:'/api/blade-scheduling/qualityGrade/getGrades',
method:'get'
})
}
// 外协厂商下拉
export const getOutsourcing = () =>{
return request({
url:'/api/blade-desk/BA/Oem/listForSelect',
method:'get'
})
}
// 作业中心下拉
export const getWorkCenter = () =>{
return request({
url:'/api/blade-desk/BA/WorkCenter/listForSelect',
method:'get'
})
}
// 分派规则列表
export const getList = (params) => {
return request({
url: '/api/blade-desk/bsAssign/page',
method: 'get',
params
});
};
// 获取指定类型字典
export const getPointRule = () => {
return request({
url: '/api/blade-system/dict/dictionary?code=AssignPoint',
method: 'get',
});
};
// 获取限制类型字典
export const getLimitRule = () => {
return request({
url: '/api/blade-system/dict/dictionary?code=AssignLimit',
method: 'get',
});
};
// 保存分派规则
export const saveRules = (data) => {
return request({
url: '/api/blade-desk/bsAssign/saveBat',
method: 'post',
data,
});
};
// 删除分派规则
export const deleteRules = (params) => {
return request({
url: '/api/blade-desk/bsAssign/remove',
method: 'post',
params,
});
};

@ -112,3 +112,11 @@ export const issueInfo = (params) =>{
params
})
}
// 获取物料下拉
export const getSelectMaterial = (params) =>
request({
url: '/api/blade-wms/stGoodsNew/listForStGoods',
method: 'get',
params
})

@ -80,3 +80,13 @@ export const getLineList = (params) =>{
params
})
}
// 检验报告导出
export const exportReport = (params) =>{
return request({
url:'/api/blade-desk/QA/LiquidTankTaskCopy/exportData',
method:'get',
params,
responseType: 'blob',
})
}

@ -0,0 +1,159 @@
export function calcTank(data,row,equation){
// 1. 获取最后一条
const lastItem = row;
const tankId = lastItem.workTankId;
// 2. 构建同 tankId 的药剂映射
const chemMap = {};
data.forEach(item => {
if (item.workTankId === tankId) {
chemMap[item.testElement] = {
actualAddValue: item.actualAddValue || 0,
fillingLocation: item.fillingLocation || 0,
firstTestValue:item.firstTestValue || 0
};
}
});
// 3. 本条自身值
const self = {
'实际添加量': row.actualAddValue || 0,
'体积': row.volume || 0,
'测量值': row.firstTestValue || 0,
'添加点': row.fillingLocation || 0
};
// 4. 替换公式
let formula = equation
// 替换 <药剂名>实际添加量 和 <药剂名>添加点,找不到则为 0
formula = formula.replace(/([^\s+*/\-(){}[\]]+?)(实际添加量|添加点|测量值)/g, (match, name, suffix) => {
const chem = chemMap[name];
console.log('name--------',name)
console.log('chem--------',chem)
if(name != ''){
if (chem) {
if (suffix === '实际添加量') {
return String(chem.actualAddValue);
} else if (suffix === '添加点') {
return String(chem.fillingLocation);
}else if (suffix === '测量值') {
return String(chem.firstTestValue);
}
// return String(suffix === '实际添加量' ? chem.actualValue : chem.addPoint);
}else{
return '0'
}
}else{
return '0'
}
// return '0'; // 未找到,替换为 0
});
// 替换通用字段
const globalReplacements = {
'实际添加量': self['实际添加量'],
'体积': self['体积'],
'测量值': self['测量值'],
'添加点': self['添加点'],
};
for (const [key, value] of Object.entries(globalReplacements)) {
const escapedKey = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
formula = formula.replace(new RegExp(escapedKey, 'g'), String(value));
}
// 5. 转为合法 JS 表达式
let expr = formula
.replace(/{/g, '(')
.replace(/}/g, ')')
.replace(/\s+/g, '');
console.log('expo--------',expr)
return expr;
// const tankId = row.workTankId;
// // 2. 构建同 tankId 下 name -> { actualAddValue, fillingLocation }
// const chemMap = {};
// data.forEach(item => {
// if (item.workTankId === tankId) {
// chemMap[item.testElement] = {
// actualAddValue: item.actualAddValue || 0,
// fillingLocation: item.fillingLocation || 0,
// firstTestValue:item.firstTestValue || 0
// };
// }
// });
// // 3. 本条自身值
// const self = {
// '实际添加量': row.actualAddValue || 0,
// '体积': row.volume || 0,
// '测量值': row.firstTestValue || 0,
// '添加点': row.fillingLocation || 0
// };
// // 4. 复制公式
// let formula = equation;
// // 5. 先处理 "<药剂名>实际添加量" 和 "<药剂名>添加点"
// // 使用正则匹配:连续非运算符字符 + "实际添加量" 或 "添加点"
// formula = formula.replace(/([^\s+*/\-(){}[\]]+?)(实际添加量|添加点|添加量|测量值)/g, (match, name, suffix) => {
// const chem = chemMap[name];
// console.log('chem---------',chem)
// // if (chem) {
// // return String(suffix === '实际添加量' ? chem.actualValue : chem.addPoint);
// // } else {
// // // 未找到对应药剂,替换为 0
// // return '0';
// // }
// if (chem) {
// if (suffix === '实际添加量') {
// return String(chem.actualAddValue);
// } else if (suffix === '添加点') {
// return String(chem.fillingLocation);
// }else if (suffix === '添加量') {
// return String(chem.actualAddValue);
// }else if (suffix === '测量值') {
// return String(chem.firstTestValue);
// }
// }
// // 如果找不到,保留原样(避免破坏公式)
// return match;
// });
// // 6. 再替换通用字段(注意顺序:先长后短,但这里无包含关系)
// const globalReplacements = {
// '实际添加量': self['实际添加量'],
// '体积': self['体积'],
// '测量值': self['测量值'],
// '添加点': self['添加点'],
// };
// for (const [key, value] of Object.entries(globalReplacements)) {
// // 转义特殊字符(虽然中文一般不需要,但安全起见)
// const escapedKey = key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// const regex = new RegExp(escapedKey, 'g');
// formula = formula.replace(regex, String(value));
// }
// let jsExpr = formula
// .replace(/{/g, '(')
// .replace(/}/g, ')')
// .replace(/\s+/g, ''); // 去掉空格(可选,但更安全)
// return jsExpr;
}
export function safeEval(expr) {
// 只允许数字、括号、+ - * / . 等安全字符
if (!/^[\d+\-*/().]+$/.test(expr)) {
throw new Error("公式包含非法字符");
}
try {
// 使用 Function 而非 eval 更安全(无作用域访问)
return new Function('return (' + expr + ')')();
} catch (e) {
throw new Error("公式计算失败: " + e.message);
}
}

@ -33,6 +33,11 @@
<el-option v-for="item in othersOptions2" :key="item.label" :label="item.label" :value="item.label" />
</el-select>
</el-form-item>
<el-form-item label="其他成分添加点:">
<el-select v-model="value3" placeholder="请选择" style="width: 240px" @change="othersChange3">
<el-option v-for="item in othersOptions3" :key="item.label" :label="item.label" :value="item.label" />
</el-select>
</el-form-item>
</div>
</div>
<template #footer>
@ -44,7 +49,7 @@
</el-dialog>
</template>
<script>
import {addFormula,updateFormula} from "@/api/basicData/calculationFormula"
import {addFormula,updateFormula,getSelectFormula} from "@/api/basicData/calculationFormula"
export default {
props: {
showDialog: {
@ -78,52 +83,10 @@ export default {
},
value1: '',
value2: '',
othersOptions1: [
{
value: '1',
label: '焦磷酸铜'
},
{
value: '2',
label: '焦磷酸钾'
},
{
value: '3',
label: '氰化钠'
},
{
value: '4',
label: 'Ag'
},
{
value: '5',
label: '硫酸'
},
],
othersOptions2: [
{
value: '1',
label: '焦磷酸铜'
},
{
value: '2',
label: '焦磷酸钾'
},
{
value: '3',
label: '氰化钠'
},
{
value: '4',
label: 'Ag'
},
{
value: '5',
label: '硫酸'
},
],
value3: '',
othersOptions1: [],
othersOptions2: [],
othersOptions3:[],
calculationFormula: ['+', '-', '*', '/', '(', ')', '.'],
computerOthersList: [
{
@ -157,6 +120,7 @@ export default {
},
mounted() {
this.openShow = this.showDialog
this.getAllElement()
if(JSON.stringify(this.checkRow) != '{}'){
this.numberForm = {
...this.checkRow,
@ -166,9 +130,25 @@ export default {
}
},
methods: {
getAllElement(){
getSelectFormula().then(res =>{
console.log('res-----------',res)
const data = res.data.data.map(item =>{
return {
label:item,
value:item
}
})
this.othersOptions1 = data
this.othersOptions2 = data
this.othersOptions3 = data
})
},
//
handleInput(status, value) {
const { blurIndex } = this;
console.log('blurIndex------------',blurIndex)
const index = this.numberForm.formula.length
let newStr = "";
// params , ${ },formula
if (status == "params") {
@ -177,15 +157,18 @@ export default {
newStr = "" + value + "添加量";
} else if (status == "others2") {
newStr = "" + value + "测量值";
}else if (status == "others3") {
newStr = "" + value + "添加点";
} else {
newStr = value;
}
this.numberForm.formula = this.insertStr(
this.numberForm.formula,
blurIndex,
index,
newStr
);
this.blurIndex = this.blurIndex + newStr.length;
console.log('blurIndex-----------',this.blurIndex)
},
othersChange1() {
this.handleInput('others1', this.value1)
@ -193,8 +176,14 @@ export default {
othersChange2() {
this.handleInput('others2', this.value2)
},
othersChange3(){
this.handleInput('others3', this.value3)
},
//
insertStr(source, start, newStr) {
console.log('source----------',source)
console.log('start----------',start)
console.log('newStr----------',newStr)
return source.slice(0, start) + newStr + source.slice(start);
},

@ -154,6 +154,7 @@ export default {
},
methods: {
addEdit() {
this.checkRow = {};
this.isOpen = true;
},
editFn(row) {

@ -144,6 +144,7 @@ export default {
},
methods: {
addEdit() {
this.checkRow = {}
this.isOpen = true
},
editFn(row) {

@ -0,0 +1,352 @@
<template>
<el-dialog title="新增" append-to-body :modelValue="openShow" fullscreen @close="closeDialog">
<div style="margin-bottom: 12px" v-if="moldAddMore">
<el-button type="primary" @click="addTable">插入一行</el-button>
<el-button type="danger" @click="delTable">删除选中行</el-button>
</div>
<!-- 单个 Form 包裹整个表格 -->
<el-form
ref="tableForm"
:model="form"
:rules="formRules"
label-width="0px"
>
<!-- 全局错误提示 -->
<div v-if="formError" class="error-message" style="color: #f56c6c; margin-bottom: 10px;">
{{ formError }}
</div>
<el-table :data="form.tableData" @select="selectChange" border>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column align="center" label="工艺能力" prop="craftAbilityId">
<template #header>
<span><i style="color: red">*</i>工艺能力</span>
</template>
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].craftAbilityId`" :rules="formRules.craftAbilityId">
<el-select
v-model="scope.row.craftAbilityId"
placeholder="请选择"
style="width: 100%"
>
<el-option
v-for="item in capabilityData"
:key="item.id"
:value="item.id"
:label="item.caName"
></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="零件号" prop="partCode">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].partCode`" :rules="formRules.partCode">
<el-input v-model="scope.row.partCode" placeholder="请输入零件号"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="生产标识" prop="prodMarkId">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].prodMarkId`" :rules="formRules.prodMarkId">
<el-select
multiple
v-model="scope.row.prodMarkId"
placeholder="请选择生产标识"
style="width: 100%"
>
<el-option
v-for="item in identificationData"
:key="item.id"
:value="item.id"
:label="item.qualityGrade"
></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="单件面积上限(dm²)" prop="upArea">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].upArea`" :rules="formRules.upArea">
<el-input v-model="scope.row.upArea" placeholder="请输入单件面积上限"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="单件面积下限(dm²)" prop="lowArea">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].lowArea`" :rules="formRules.lowArea">
<el-input v-model="scope.row.lowArea" placeholder="请输入单件面积下限"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="单批面积上限(dm²)" prop="singleUpArea">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].singleUpArea`" :rules="formRules.singleUpArea">
<el-input v-model="scope.row.singleUpArea" placeholder="请输入单批面积上限"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="单批面积下限(dm²)" prop="singleDownArea">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].singleDownArea`" :rules="formRules.singleDownArea">
<el-input v-model="scope.row.singleDownArea" placeholder="请输入单批面积下限"></el-input>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="限制类型" prop="limitType">
<template #header>
<span><i style="color: red">*</i>限制类型</span>
</template>
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].limitType`" :rules="formRules.limitType">
<el-select
v-model="scope.row.limitType"
placeholder="请选择限制类型"
style="width: 100%"
>
<el-option v-for="item in limitRule" :key="item.id" :value="item.dictKey" :label="item.dictValue"></el-option>
<!-- <el-option label="必须" :value="1"></el-option> -->
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="指定类型" prop="pointType">
<template #header>
<span><i style="color: red">*</i>指定类型</span>
</template>
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].pointType`" :rules="formRules.pointType">
<el-select
v-model="scope.row.pointType"
placeholder="请选择指定类型"
style="width: 100%"
>
<el-option v-for="item in pointRule" :key="item.id" :value="item.dictKey" :label="item.dictValue"></el-option>
<!-- <el-option label="厂内" value="1"></el-option>
<el-option label="外协" value="2"></el-option> -->
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="外协厂商" prop="oemId">
<!-- <template #header v-if="showOem">
<span><i style="color: red">*</i>外协厂商</span>
</template> -->
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].oemId`" :rules="formRules.oemId">
<el-select
v-model="scope.row.oemId"
placeholder="请选择外协厂商"
style="width: 100%"
>
<el-option v-for="item in companyData" :label="item.ocName" :key="item.id" :value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="作业中心" prop="centerId">
<!-- <template #header v-if="showCenter">
<span><i style="color: red">*</i>作业中心</span>
</template> -->
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].centerId`" :rules="formRules.centerId">
<el-select
v-model="scope.row.centerId"
placeholder="请选择作业中心"
style="width: 100%"
>
<el-option v-for="item in workCenterData" :label="item.wcName" :key="item.id" :value="item.id"></el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="备注" prop="remark">
<template #default="scope">
<el-form-item :prop="`tableData[${scope.$index}].remark`" :rules="formRules.remark">
<el-input v-model="scope.row.remark" placeholder="请输入备注"></el-input>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</template>
</el-dialog>
</template>
<script>
import {getCapability,getProduction,getOutsourcing,getWorkCenter,getLimitRule,
getPointRule,saveRules} from "@/api/basicData/ruleMaintenance"
export default {
props:{
isOpen:{
type:Boolean,
default:false
},
moldAddMore:{
type:Boolean,
default:false
},
row:{
type:Object,
default:{}
}
},
data(){
return{
openShow:false,
formError:'',
showOem:false,
showCenter:false,
form:{
tableData:[]
},
formRules:{
craftAbilityId:[
{ required: true, message: '请选择工艺能力', trigger: ['change', 'submit'] }
],
limitType:[
{ required: true, message: '请选择限制类型', trigger: ['change', 'submit'] }
],
pointType:[
{ required: true, message: '请选择指定类型', trigger: ['change', 'submit'] }
],
},
capabilityData:[],
identificationData:[],
companyData:[],
workCenterData:[],
pointRule:[],
limitRule:[]
}
},
async mounted(){
// this.getCapability();
// this.getProduction();
// this.getOutsourcing();
// this.getWorkCenter();
// this.getPointRule()
// this.getLimitRule()
const pointData = await getPointRule()
this.pointRule = pointData.data.data
const limitData = await getLimitRule()
this.limitRule = limitData.data.data
const capaRes = await getCapability()
this.capabilityData = capaRes.data.data
const companyRes = await getOutsourcing()
this.companyData = companyRes.data.data
const idenRes = await getProduction()
this.identificationData = idenRes.data.data
const worlRes = await getWorkCenter()
this.workCenterData = worlRes.data.data
if(JSON.stringify(this.row) != '{}'){
this.row.craftAbilityId = this.row.craftAbilityId + ''
this.row.centerId = this.row.centerId == -1 ? '' : this.row.centerId + ''
this.row.oemId = this.row.oemId == -1 ? '' : this.row.oemId + ''
this.form.tableData[0] = this.row
}
console.log('this.row', this.row)
this.openShow = this.isOpen;
},
methods:{
getPointRule(){
getPointRule().then(res =>{
this.pointRule = res.data.data
})
},
getLimitRule(){
getLimitRule().then(res =>{
this.limitRule = res.data.data
})
},
getCapability(){
getCapability().then(res =>{
this.capabilityData = res.data.data;
})
},
getProduction(){
getProduction().then(res =>{
this.identificationData = res.data.data;
})
},
getOutsourcing(){
getOutsourcing().then(res =>{
this.companyData = res.data.data;
})
},
getWorkCenter(){
getWorkCenter().then(res =>{
this.workCenterData = res.data.data;
})
},
selectChange(list, row) {
row._select = !row._select;
},
//
delTable() {
this.form.tableData = this.form.tableData.filter(row => !row._select);
},
addTable(){
this.form.tableData.push({
_select:false
})
},
submit(){
this.formError = '';
// Form
this.$refs.tableForm.validate((isValid, invalidFields) => {
if (!isValid) {
//
this.formError = '存在未完善的字段,请检查表格中的红色提示';
this.$nextTick(() => {
//
const firstError = document.querySelector('.el-form-item.is-error');
if (firstError) {
firstError.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
});
return;
}
this.form.tableData.map(item =>{
if(item.pointType == 1 && (!item.oemId || item.oemId == '')){
this.formError = '指定类型为外协时,请选择外协厂商';
return
}
if(item.pointType == 0 && (!item.centerId || item.centerId == '')){
this.formError = '指定类型为厂内时,请选择作业中心';
return
}
})
console.log('form----------',this.form.tableData)
//
const submitData = this.form.tableData.map(row => {
row.prodMarkId = row.prodMarkId && row.prodMarkId.length != 0 && row.prodMarkId.join(',')
const { _select, ...validData } = row; //
return validData;
});
saveRules(submitData).then(res =>{
if(res.data.code == 200){
this.$message.success('保存成功');
this.closeDialog(true);
}
})
})
},
closeDialog(val){
this.openShow = false;
this.$emit('closeDialog',val);
}
}
}
</script>
<style lang="scss" scoped>
::v-deep .el-form-item{
margin-top: 15px !important;
}
</style>

@ -0,0 +1,352 @@
<template>
<basic-container>
<avue-crud
:option="option"
:table-loading="loading"
:data="data"
v-model="form"
v-model:page="page"
ref="crud"
@search-change="searchChange"
@search-reset="searchReset"
@selection-change="selectionChange"
@current-change="currentChange"
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
>
<template #singleArea="{row}">
{{row.lowArea + '~' + row.upArea }}
</template>
<template #batchArea="{row}">
{{row.singleDownArea + '~' + row.singleUpArea }}
</template>
<template #menu-left>
<el-button type="primary" @click="handleAdd">新增</el-button>
<el-button type="danger" @click="handleDelete">删除</el-button>
</template>
<template #menu="scope">
<el-button type="text" @click="editRow(scope.row)">编辑</el-button>
<el-button type="text" @click="rowDel(scope.row)">删除</el-button>
</template>
</avue-crud>
<add-rule-dialog v-if="showDialog" :isOpen="showDialog" :row="checkRow" :moldAddMore="moldAddMore" @closeDialog="closeDialog"></add-rule-dialog>
</basic-container>
</template>
<script>
import addRuleDialog from './components/addRuleDialog.vue'
import {getList,deleteRules} from "@/api/basicData/ruleMaintenance"
export default {
components: { addRuleDialog },
data() {
return {
moldAddMore:false,
loading: false,
showDialog:false,
page: {
total: 0,
currentPage: 1,
pageSize: 10,
},
data: [],
form: {},
selectionList:[],
option: {
height: "auto",
calcHeight: 32,
tip: false,
size: "medium",
simplePage: true,
searchShow: true,
searchMenuSpan: 6,
searchIcon: true,
searchIndex: 3,
tree: false,
border: true,
index: true,
selection: true,
viewBtn: false,
delBtn: false,
editBtn: false,
addBtn: false,
editBtnText: "修改",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
viewBtnText: "详情",
labelWidth: 120,
menuWidth: 120,
dialogWidth: 1040,
dialogClickModal: false,
searchEnter: true,
excelBtn: false,
filterBtn: true,
searchShowBtn: false,
columnSort: true,
excelBtn: true,
columnSort: true,
index: false,
showOverflowTooltip: true,
searchLabelPosition: "left",
searchLabelPosition: "left",
searchGutter: 24,
searchSpan: 6,
menuAlign: "center",
gridBtn: false,
searchMenuPosition: "right",
addBtnIcon: " ",
viewBtnIcon: " ",
delBtnIcon: " ",
editBtnIcon: " ",
align: "center",
column: [
{
label: "工艺能力",
prop: "craftAbilityId",
type:"select",
sortable: false,
filter: true,
span: 12,
search: true,
dicUrl:"/blade-desk/BA/craftAbility/findList",
props:{
label:"caName",
value:"id"
},
width:200,
},
{
label: "零件号",
prop: "partCode",
sortable: false,
filter: true,
span: 12,
width:150,
search: true,
},
{
label: "生产标识",
prop: "prodMark",
// type:"select",
sortable: false,
filter: true,
span: 12,
width:150,
search: false,
multiple: true,
// dicUrl:"/blade-scheduling/qualityGrade/getGrades",
// props:{
// label:"qualityGrade",
// value:"id"
// }
},
{
label: "单件面积上下限(dm²)",
prop: "singleArea",
sortable: false,
filter: true,
span: 12,
width:200,
search: false,
multiple: true,
},
{
label: "单批面积上下限(dm²)",
prop: "batchArea",
sortable: false,
filter: true,
width:200,
span: 12,
search: false,
multiple: true,
},
{
label: "限制类型",
prop: "limitType",
type:"select",
sortable: false,
filter: true,
span: 12,
search: true,
width:200,
dicUrl:'/api/blade-system/dict/dictionary?code=AssignLimit',
props:{
label:"dictValue",
value:"dictKey"
}
// dicData:[
// {label:"",value:1}
// ]
},
{
label: "指定类型",
prop: "pointType",
type:"select",
sortable: false,
filter: true,
span: 12,
search: true,
width:200,
dicUrl:'/api/blade-system/dict/dictionary?code=AssignPoint',
props:{
label:"dictValue",
value:"dictKey"
}
// dicData:[
// {label:"",value:1},
// {label:"",value:2},
// ]
},
{
label: "外协厂商",
prop: "oemId",
type:'select',
sortable: false,
filter: true,
span: 12,
search: true,
width:200,
dicUrl:"/api/blade-desk/BA/Oem/listForSelect",
props:{
label:"ocName",
value:"id"
}
},
{
label: "作业中心",
prop: "centerId",
type:'select',
sortable: false,
filter: true,
span: 12,
search: true,
width:200,
dicUrl:"/api/blade-desk/BA/WorkCenter/listForSelect",
props:{
label:"wcName",
value:"id"
}
},
{
label: "备注",
prop: "remark",
sortable: false,
filter: true,
width:150,
span: 12,
search: false,
},
{
label: "维护人",
prop: "createUserName",
sortable: false,
filter: true,
width:150,
span: 12,
search: false,
},
{
label: "维护时间",
prop: "createTime",
sortable: false,
width:200,
filter: true,
span: 12,
search: false,
},
]
},
checkRow:{}
}
},
mounted() {
},
methods:{
handleAdd(){
this.checkRow = {}
this.moldAddMore = true
this.showDialog = true
},
selectionChange(list){
this.selectionList = list
},
handleDelete(){
if(this.selectionList.length == 0){
this.$message.error('请至少选择一条数据')
return
}
this.$confirm('确定删除数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
deleteRules({
ids:this.selectionList.map(item => item.id).join(',')
}).then(res =>{
this.$message.success('删除成功')
this.onLoad()
})
})
},
editRow(row){
this.moldAddMore = false
this.checkRow = row
this.showDialog = true
},
rowDel(row){
this.$confirm('确定删除数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(() => {
deleteRules({
ids:row.id
}).then(res =>{
this.$message.success('删除成功')
this.onLoad()
})
})
},
closeDialog(val){
this.showDialog = false
if(val){
this.onLoad()
}
},
searchChange(params, done){
this.query = params;
this.page.currentPage = 1
this.onLoad()
done()
},
searchReset(){
this.query = {}
this.onLoad()
},
currentChange(currentPage){
this.page.currentPage = currentPage
},
sizeChange( pageSize){
this.page.pageSize = pageSize
},
refreshChange(){
this.onLoad()
},
onLoad(){
getList({
current:this.page.currentPage,
size:this.page.pageSize,
...this.query
}).then(res =>{
this.data = res.data.data.records
this.page.total = res.data.data.total
})
}
}
}
</script>
<style>
</style>

@ -55,7 +55,7 @@ export default {
calcHeight: 32,
simplePage: false,
searchShow: true,
searchMenuSpan: 6,
searchMenuSpan: 18,
searchIcon: true,
searchIndex: 3,
tree: false,
@ -108,6 +108,38 @@ export default {
label: '类型',
prop: 'type',
search: true,
hide:true,
display:false,
sortable: true,
span: 12,
type:'select',
rules: [
{
required: true,
message: '请选择',
trigger: 'blur',
},
],
dicData:[
{
label:'军品',
value:'1'
},
{
label:'商飞',
value:'2'
},
{
label:'宇航',
value:'3'
}
]
},
{
label: '类型',
prop: 'type',
search: false,
multiple: true,
sortable: true,
span: 12,
type:'select',
@ -148,7 +180,12 @@ export default {
done();
},
rowSave(row, done, loading) {
addGualityGrade(row).then(
console.log(row);
let params = {
qualityGrade:row.qualityGrade,
types:row.type
}
addGualityGrade(params).then(
() => {
this.onLoad(this.page);
this.$message({
@ -164,7 +201,13 @@ export default {
);
},
rowUpdate(row, index, done, loading) {
updateGualityGrade(row).then(
// row.types = row.type
let params = {
id:row.id,
qualityGrade:row.qualityGrade,
types:row.type.split(',')
}
updateGualityGrade(params).then(
() => {
this.onLoad(this.page);
this.$message({

@ -134,15 +134,14 @@
</el-col>
<el-col :span="8">
<el-form-item label="药品物料号:" prop="drugMaterialId">
<el-select v-model="form.drugMaterialId" :disabled="type == 'view'" placeholder="请选择">
<el-option label="物料一" value="1" />
<el-option label="物料2" value="2" />
<el-select v-model="form.drugMaterialId" :disabled="type == 'view'" placeholder="请选择" @change="changeGoods">
<el-option v-for="item in drugMaterialOptions" :key="item.id" :label="item.goodsCode" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="药品物料名称:" prop="drugMaterialName">
<el-input v-model="form.drugMaterialName" :disabled="type == 'view'" placeholder="请输入" disabled />
<el-input v-model="form.drugMaterialName" placeholder="请输入" disabled />
</el-form-item>
</el-col>
@ -263,7 +262,7 @@
</el-dialog>
</template>
<script>
import {getFormula,getTank,getWorkCenter,getPerson,getManager,getTeam,addInfo,getDetail,editInfo} from '@/api/tankSolutionSystem/info'
import {getFormula,getTank,getWorkCenter,getPerson,getManager,getTeam,addInfo,getDetail,editInfo,getSelectMaterial} from '@/api/tankSolutionSystem/info'
export default {
props: {
showDialog: {
@ -296,6 +295,7 @@ export default {
return {
openShow: false,
form: {},
drugMaterialOptions:[],
rules: {
workCenterId: [
{ required: true, message: '请选择作业中心', trigger: 'blur' },
@ -369,18 +369,30 @@ export default {
this.getPersonList()
this.getManagerList()
this.getTeamList()
this.getGoods()
if(this.rowId){
this.getInfoDetail()
}
},
methods: {
getGoods(){
getSelectMaterial().then(res =>{
this.drugMaterialOptions = res.data.data
})
},
changeGoods(val){
let tmp = this.drugMaterialOptions.find(item => item.id == val)
this.form.drugMaterialName = tmp.goodsName
},
//
getInfoDetail(){
getDetail({id:this.rowId}).then(res =>{
this.form = {
...res.data.data,
isPutOff:res.data.data.isPutOff == 1 ? true : false,
teamId:res.data.data.teamId + ''
teamId:res.data.data.teamId + '',
drugMaterialId:res.data.data.drugMaterialId + '',
workCenterId:res.data.data.workCenterId + '',
}
if(this.form.jobType == 1){
this.form = {

@ -41,7 +41,10 @@
</template>
<!-- 测量值 -->
<template #firstTestValue="scope">
<div class="inpu-text"><el-input @blur="() => testBlur(scope.row,scope.$index)" @input="val => scope.row.firstTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8" v-model="scope.row.firstTestValue" /><i>({{scope.row.liquidTank.testUnit}})</i></div>
<div class="inpu-text" >
<el-input style="margin-top:9px;" @blur="() => testBlur(scope.row,scope.$index)" @input="val => scope.row.firstTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8" v-model="scope.row.firstTestValue" />
<i>({{scope.row.liquidTank.testUnit}})</i>
</div>
</template>
<template #conductivityFirstTestValue="scope">
<div class="inpu-text"><el-input @input="val => scope.row.conductivityFirstTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8" v-model="scope.row.conductivityFirstTestValue" /></div>
@ -61,7 +64,8 @@
</template>
<!-- 复测电导率 -->
<template #conductivityRepeatTestValue="scope">
<div class="inpu-text"><el-input @input="val => scope.row.conductivityRepeatTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 2 || scope.row.status == 4" v-model="scope.row.conductivityRepeatTestValue" /></div>
<div class="inpu-text">
<el-input @input="val => scope.row.conductivityRepeatTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 2 || scope.row.status == 4" v-model="scope.row.conductivityRepeatTestValue" /></div>
</template>
<template #firstTestDate="scope">
<div class="inpu-text">
@ -76,14 +80,23 @@
</div>
</template>
<template #needAddValue="scope">
<div class="inpu-text"><el-input @input="val => scope.row.needAddValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8 || scope.row.status == 2 || scope.row.status == 4" v-model="scope.row.needAddValue" /><i>({{scope.row.liquidTank.addUnit}})</i></div>
<div class="inpu-text">
<el-input style="margin-top:9px;" @input="val => scope.row.needAddValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8 || scope.row.status == 2 || scope.row.status == 4" v-model="scope.row.needAddValue" />
<i>({{scope.row.liquidTank.addUnit}})</i>
</div>
</template>
<template #actualAddValue="scope">
<div class="inpu-text"><el-input @input="val => scope.row.actualAddValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8" v-model="scope.row.actualAddValue" /><i>({{scope.row.liquidTank.addUnit}})</i></div>
<div class="inpu-text">
<el-input style="margin-top:9px;" @blur="() => changeActualValue(scope.row,scope.$index)" @input="val => scope.row.actualAddValue = formatDecimal(val, 5)" :disabled="scope.row.status == 8" v-model="scope.row.actualAddValue" />
<i>({{scope.row.liquidTank.addUnit}})</i>
</div>
</template>
<!-- 复测测量值 -->
<template #repeatTestValue="scope">
<div class="inpu-text"><el-input @input="val => scope.row.repeatTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 2 || scope.row.status == 4" v-model="scope.row.repeatTestValue" /><i>({{scope.row.liquidTank.testUnit}})</i></div>
<div class="inpu-text">
<el-input style="margin-top:9px;" @input="val => scope.row.repeatTestValue = formatDecimal(val, 5)" :disabled="scope.row.status == 2 || scope.row.status == 4" v-model="scope.row.repeatTestValue" />
<i>({{scope.row.liquidTank.testUnit}})</i>
</div>
</template>
</avue-crud>
<template #footer>
@ -95,6 +108,7 @@
</el-dialog>
</template>
<script>
import {calcTank,safeEval} from "@/utils/tankclac"
import {firstBat,fillBat,editDrugBat} from "@/api/tankSolutionSystem/tankSolutionTaskAssignment"
export default {
props: {
@ -393,7 +407,7 @@ export default {
filter: true,
span: 24,
search: false,
width: 170,
width: 200,
cell: true,
type: 'datetime',
@ -478,12 +492,13 @@ export default {
}
}
}
console.log('filterVal-------------',filterVal)
return filterVal;
},
testBlur(row,index){
console.log('row-------------',row)
console.log('index-------------',index)
// console.log('row-----------',row)
// console.log('formula-----------',formula)
// console.log('theoryFormula-----------',theoryFormula)
//
const testValue = parseFloat(row.firstTestValue);
const min = parseFloat(row.targetValueMin);
@ -501,8 +516,25 @@ export default {
row.actualAddValue = 0
row.afterAddTheoryValue = testValue
}
this.data.map(item =>{
let formula = calcTank(this.data,item,item.addFormulaContent)
let theoryFormula = calcTank(this.data,item,item.afterFormulaContent)
item.needAddValue = parseFloat(safeEval(formula).toFixed(5))
item.afterAddTheoryValue = parseFloat(safeEval(theoryFormula).toFixed(5))
})
console.log('data------------',this.data)
},
changeActualValue(row,index){
let formula = calcTank(this.data,row,row.addFormulaContent)
let theoryFormula = calcTank(this.data,row,row.afterFormulaContent)
console.log('row',row)
console.log('formula',formula)
console.log('theoryFormula',theoryFormula)
row.needAddValue = parseFloat(safeEval(formula).toFixed(5))
row.afterAddTheoryValue = parseFloat(safeEval(theoryFormula).toFixed(5))
},
submit(){
if(this.data[0].status == 2){
const requiredFields = [
@ -802,7 +834,11 @@ export default {
.el-input {
height: 32px;
margin-top: 9px;
// margin-top: 9px;
}
.el-date-editor.el-input, .el-date-editor.el-input__wrapper {
height: var(--el-input-height,var(--el-component-size)) !important;
}
i {

@ -41,10 +41,10 @@
<span>药物名称</span><span>{{ detailForm.drugName }}</span>
</el-col>
<el-col :span="6">
<span>药品物料号</span><span>{{ detailForm.drugMaterialName }}</span>
<span>药品物料号</span><span>{{ detailForm.drugMaterialCode }}</span>
</el-col>
<el-col :span="6">
<span>药品物料名称</span><span>{{ detailForm.drugMatterName }}</span>
<span>药品物料名称</span><span>{{ detailForm.drugMaterialName }}</span>
</el-col>
</el-row>
<el-row class="item_item" :gutter="20">
@ -273,7 +273,7 @@
<span>化验人</span><span>{{ detailForm.repeatTestUserId }}</span>
</el-col>
<el-col :span="6">
<span>化验时间</span><span>{{ detailForm.repeatTestDate }}</span>
<span>化验时间</span><span>{{ detailForm.repeatFillDate }}</span>
</el-col>
</el-row>
<el-row class="item_item" :gutter="20">

@ -39,7 +39,7 @@
</template>
</avue-crud>
<el-dialog title="导入" append-to-body v-model="excelBox" width="555px">
<!-- <el-dialog title="导入" append-to-body v-model="excelBox" width="555px">
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
<template #excelTemplate>
<el-button type="primary" @click="handleTemplate">
@ -47,7 +47,7 @@
</el-button>
</template>
</avue-form>
</el-dialog>
</el-dialog> -->
<el-dialog title="批量设置" append-to-body v-model="setBox" width="555px">
<el-form v-model="settingForm" label-width="80px">
<el-form-item label="主管工艺">
@ -79,15 +79,25 @@
<!-- 新增 编辑 -->
<addEditInfoDialog v-if="isInfoOpen" :type="infoType" :row-id="rowId" :show-dialog="isInfoOpen" @closeDialog="closeDialog"></addEditInfoDialog>
<!-- 导入 -->
<basic-import v-if="isShowImport" title="导入" :isShow="isShowImport"
templateUrl="/blade-desk/QA/LiquidTank/downloadExcelTemplate"
templateName="槽液信息模板.xlsx"
importUrl="/blade-desk/QA/LiquidTank/importExcel"
@closeDialog="closeDialog">
</basic-import>
</basic-container>
</template>
<script>
import dispatcherDialog from './components/dispatcherDialog.vue'
import addEditInfoDialog from './components/addEditInfoDialog.vue'
import basicImport from '@/components/basic-import/main.vue'
// import calculateNeedValuesByFormula fro/m '@/utils/calculateNeedValuesByFormula'
import {getList,getDetail,deleteInfo,getManager,getPerson,getTeam,setBatch} from '@/api/tankSolutionSystem/info'
export default {
components: { dispatcherDialog, addEditInfoDialog },
components: { dispatcherDialog, addEditInfoDialog,basicImport },
data() {
return {
months: [
@ -98,6 +108,7 @@ export default {
'1', '2', '3', '4', '5', '6',
'7', '8', '9', '10', '11', '12', , '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'
],
isShowImport:false,
excelBox: false,
loading: false,
setBox: false,
@ -131,7 +142,7 @@ export default {
editBtnIcon: ' ',
viewBtnText: '详情',
labelWidth: 140,
menuWidth: 220,
menuWidth: 180,
dialogWidth: 1200,
dialogClickModal: false,
searchEnter: true,
@ -147,7 +158,7 @@ export default {
searchLabelPosition: 'left',
searchGutter: 24,
searchSpan: 6,
menuAlign: 'left',
menuAlign: 'center',
gridBtn: false,
searchMenuPosition: 'right',
align: 'center',
@ -681,7 +692,12 @@ export default {
managerList:[],
teamList:[],
personList:[]
personList:[],
// data1:[
// {addPoint:1,testValue:15,volume:10,name:"CUCN",actualValue:20,needValue:30},
// {addPoint:3,testValue:2,volume:5,name:"",actualValue:10,needValue:''},
// ]
}
},
mounted() {
@ -710,11 +726,13 @@ export default {
},
addInfo(){
this.infoType = 'add'
this.rowId = null
this.isInfoOpen = true
},
closeDialog(val) {
this.isOpen = false
this.isInfoOpen = false
this.isShowImport = false
if(val){
this.onLoad()
}
@ -723,7 +741,7 @@ export default {
return val == 1 ? '周一' : val == 2 ? '周二' : val == 3 ? '周三' : val == 4 ? '周四' : val == 5 ? '周五' : val == 6 ? '周六' : '周日'
},
handleImport() {
this.excelBox = true;
this.isShowImport = true;
},
//
submitSeeting(){

@ -13,10 +13,11 @@
<template #menu="scope">
<el-button type="text" @click="handleView(scope.row)">详情</el-button>
<el-button type="text" @click="rowDel(scope.row)">删除</el-button>
<el-button type="text" @click="exportRow(scope.row)">导出</el-button>
</template>
</avue-crud>
<el-dialog title="检验报告" append-to-body v-model="lineBox" fullscreen width="95%">
<el-form :inline="true" v-model="lineForm" label-width="80px" v-if="viewType == 'report'">
<el-form :inline="true" ref="linesForm" :model="lineForm" :rules="lineRules" label-width="90px" v-if="viewType == 'report'">
<el-row :gutter="24">
<el-col :span="5">
<el-form-item label="作业中心:" prop="workCenterId">
@ -28,7 +29,7 @@
<el-col :span="5">
<el-form-item label="槽号:" prop="workTankId">
<el-select v-model="lineForm.workTankId" placeholder="请选择" style="width: 220px;">
<el-option v-for="item in tankList" :key="item.id" :label="item.name" :value="item.id" />
<el-option v-for="item in tankList" :key="item.id" :label="item.workTankCode" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
@ -103,9 +104,9 @@
<script>
import { detail } from '@/api/flow/flow'
import {getReportList,generateReport,createReport,getReportDetail,deleteReport} from '@/api/tankSolutionSystem/resultsCon'
import {getReportList,generateReport,createReport,getReportDetail,deleteReport,exportReport} from '@/api/tankSolutionSystem/resultsCon'
import {getWorkCenter,getTank,getPerson,getManager,getTeam,addInfo,getDetail,editInfo} from '@/api/tankSolutionSystem/info'
import { format } from 'echarts'
import { downloadXls } from '@/utils/util';
export default {
data() {
return {
@ -113,6 +114,11 @@ export default {
form: {},
query: {},
lineForm: {},
lineRules:{
workCenterId:[{required: true, message: '请选择作业中心', trigger: 'blur'}],
// workTankId:[{required: true, message: '', trigger: 'blur'}],
// testElement:[{required: true, message: '', trigger: 'blur'}],
},
nameForm: {},
detailBox: false,
detailForm: {},
@ -160,7 +166,7 @@ export default {
addBtnIcon: ' ',
viewBtnIcon: ' ',
delBtnIcon: ' ',
menuWidth:100,
menuWidth:130,
editBtnIcon: ' ',
index: false,
showOverflowTooltip: true,
@ -596,6 +602,9 @@ export default {
createLine() {
// workCenterId workTankId liquidTankId testElement createTimeStart createTimeEnd
console.log('lineForm--------',this.lineForm)
this.$refs.linesForm.validate(valid =>{
console.log('valid---------',valid)
if(valid){
let params = {
workCenterId:this.lineForm.workCenterId,
workTankId:this.lineForm.workTankId,
@ -614,6 +623,9 @@ export default {
})
console.log('this.reportData===============',this.reportData)
})
}
})
// this.data = [
@ -863,6 +875,15 @@ export default {
})
})
},
exportRow(row){
exportReport({id:row.id}).then(res =>{
console.log('res-----------',res)
downloadXls(res.data, row.name)
// if(res.data.code == 200){
// this.$message.success('')
// }
})
},
handleDelete() {
if (this.selectionList.length === 0) {
this.$message.warning('请选择至少一条数据');

@ -412,7 +412,13 @@ export default {
},
submit(){
generateLine(this.lineData).then(res =>{
const submitParams = this.lineData.map(item =>{
item.workCenterId = item.wcId
const {wcId,...submitData} = item
return submitData
})
console.log('submitParams---------',submitParams)
generateLine(submitParams).then(res =>{
if(res.data.code == 200){
this.$message.success('生成曲线成功')
this.lineBox = false

@ -294,6 +294,8 @@ export default {
this.onLoad()
done()
}
}).catch(err =>{
loading()
})
},
rowSave(row, done, loading) {
@ -305,6 +307,8 @@ export default {
this.onLoad()
done()
}
}).catch(err =>{
loading(false)
})
},
searchReset() {

Loading…
Cancel
Save