+
@@ -43,50 +43,57 @@
-
-
+
+
\ No newline at end of file
diff --git a/src/views/qm/productCheck.vue b/src/views/qm/productCheck.vue
index ede58402..d53e076b 100644
--- a/src/views/qm/productCheck.vue
+++ b/src/views/qm/productCheck.vue
@@ -3,59 +3,175 @@
- {{ mioObj.test_date }}
- {{ mioObj.number }}
- {{ mioObj.count }}
+ {{ workObj.test_date }}
+ {{ workObj.batch }}
+ {{ workObj.count }}
-
-
- 新增
-
-
-
-
-
-
+
+
+
+
-
- {{ item.testitem_description }}
-
+ {{scope.row.test_numer}}
+
-
-
-
- {{ item.test_val }}
-
+
+
+
+
+
+
+
+
-
+
-
- 合格
-
-
- 不合格
-
+
+
+
+
-
-
-
-
+
- 编辑
-
-
- 删除
-
+
+
+
-
+
+
+ 保存
+ 编辑
+ 删除
+
+
+
+
+
+
+
+ {{scope.row.test_numer}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 编辑
+ 删除
+
+
+
@@ -75,75 +191,113 @@ export default {
},
data() {
return {
+ addTemplate:{
+ ftestitems:[
+ {test_val:'',check_val:'',testitem:''},
+ {test_val:'',check_val:'',testitem:''},
+ {test_val:'',check_val:'',testitem:''},
+ {test_val:'',check_val:'',testitem:''},
+ ],
+ test_date:'',//work获取
+ test_numer:'',
+ is_ok:true,
+ test_user:'',
+ ftest_work:'',//work获取
+ isEdit:true,
+ },
+ ftestitems:[],
dialog: {
check:false,
save: false,
},
apiObj: null,
params: {},
- mioId: '',
- mioObj: {},
- selection: [],
- stateDict: {
- 10: '创建中',
- 20: '已提交'
- },
- typeDict: {
- 'do_out': '生产领料',
- 'sale_out': '销售发货',
- 'pur_in': '采购入库',
- 'do_in': '生产入库',
- 'other_in': '其他入库',
- 'other_out': '其他出库',
- },
-mioitemId:'',
+ formTableData: null,
+ ftestWork:'',
type:'',
- cate:'',
- objitem:{},
+ userList:[],
+ workObj:{},
};
},
+ watch: {
+ formTableData(newValue, oldValue) {
+ console.log('值发生了变化:', newValue);
+ this.testNumberChange();
+ }
+ },
mounted() {
- this.type = this.$route.query.type;
- this.cate = this.$route.query.cate;
- this.mioId = this.$route.query.mio;
- this.params.mio = this.$route.query.mio;
- this.apiObj = this.$API.inm.mioitem.list;
- this.getMio();
+ let that = this;
+ that.type = that.$route.query.type;
+ that.ftestWork = that.$route.query.ftestWork;
+ that.addTemplate.ftest_work = that.ftestWork;
+ that.$API.qm.ftestwork.item.req(that.ftestWork).then((res) => {
+ that.workObj = res;
+ that.addTemplate.test_date = res.test_date;
+ that.addTemplate.test_numer = res.batch+'_1';
+ that.getCheckList();
+ })
+ let tag = that.type == 'bang'?'prod_bang':'prod_guan';
+ that.getTestItem(tag,that.ftestWork);
+ that.getUserList(that.ftestWork);
},
methods: {
- getMio() {
- this.$API.inm.mio.item.req(this.mioId).then((res) => {
- this.mioObj = res;
- this.belongDeptId = res.belong_dept
+ //获取检验项目
+ getTestItem(tag,ftestWork){
+ let that = this;
+ that.$API.qm.getTestItem.get({tag:tag,page:0,ftest_work:ftestWork}).then(res=>{
+ // console.log(res)
+ let arr = res;
+ that.ftestitems = res;
+ let ftestitems = [];
+ arr.forEach(item => {
+ let obj = {};
+ obj.test_val = 0;
+ obj.testitem = item.id;
+ ftestitems.push(obj);
+ });
+ that.addTemplate.ftestitems = ftestitems;
})
},
- //添加
- table_add() {
- this.dialog.save = true;
- this.$nextTick(() => {
- this.$refs.saveDialog.open("add", this.mioObj.type);
+ //获取员工
+ getUserList(){
+ let that = this;
+ this.$API.system.user.list.req({page:0}).then(res=>{
+ that.userList = res;
});
},
- //编辑
- table_edit(row) {
- this.dialog.save = true;
- this.$nextTick(() => {
- this.$refs.saveDialog.open("edit").setData(row);
- });
+ //表格数据
+ getCheckList(ftestwork){
+ let that = this;
+ that.formTableData = [];
+ this.$API.qm.ftest.list.req({page:0,type:'prod',ftest_work:ftestwork}).then(res=>{
+ if(res.length>0){
+ that.addTemplate.test_numer = that.workObj.batch+'_'+(res.length+1);
+ console.log('that.addTemplate.test_numer',that.addTemplate.test_numer)
+ res.forEach(item=>{
+ let obj = {};
+ obj = item;
+ obj.isEdit = false;
+ that.formTableData.push(obj);
+ })
+ }
+ })
},
- //查看
- table_show(row) {
- this.dialog.save = true;
- this.$nextTick(() => {
- this.$refs.saveDialog.open("show").setData(row);
- });
+ testNumberChange(){
+ this.addTemplate.test_numer = this.workObj.batch+'_'+(this.formTableData.length+1);
+ },
+ editCheck(row){
+ this.formTableData.forEach((item,index)=>{
+ if(item.id == row.id){
+ this.formTableData[index].isEdit = true;
+ }
+ })
},
//删除
table_del(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
- this.$API.inm.mioitem.delete.req(row.id).then((res) => {
+ this.$API.qm.ftest.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
this.$refs.table.refresh();
return res;
@@ -152,29 +306,17 @@ mioitemId:'',
});
}).catch(() => { });
},
- table_check(row){
- this.mioitemId = row.id;
- this.objitem = row;
- this.dialog.check = true;
- this.$nextTick(() => {
- this.$refs.checkDialog.open("add");
- });
- },
- check_Show(row){
- this.mioitemId = row.id;
- this.objitem = row;
- this.dialog.check = true;
- this.$nextTick(() => {
- this.$refs.checkDialog.open("show").setData(row);
+ saveCheck(row){
+ this.$API.qm.ftest.create.req(row).then((res) => {
+ this.$message.success("操作成功");
+ this.$refs.table.refresh();
+ }).catch((err) => {
+ return err;
});
},
//本地更新数据
handleSaveSuccess(data, mode) {
- if (mode == "add") {
- this.$refs.table.refresh();
- } else if (mode == "edit") {
- this.$refs.table.refresh();
- }
+ this.$refs.table.refresh();
},
handleCheckSuccess(){
this.$refs.table.refresh();
diff --git a/src/views/qm/product_check.vue b/src/views/qm/product_check.vue
index 83bd8ddf..78c2bd19 100644
--- a/src/views/qm/product_check.vue
+++ b/src/views/qm/product_check.vue
@@ -15,33 +15,224 @@
label-width="100px"
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{scope.row.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
+
+
+
+
+ {{scope.row.name}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
+
diff --git a/src/views/qm/product_form.vue b/src/views/qm/product_form.vue
index 48737085..bcd8d319 100644
--- a/src/views/qm/product_form.vue
+++ b/src/views/qm/product_form.vue
@@ -99,6 +99,7 @@ export default {
that.options.forEach(item => {
if(item.id==val){
that.form.count = item.count;
+ that.form.batch = item.batch;
that.form.material = item.material;
}
});
@@ -110,14 +111,21 @@ export default {
this.isSaveing = true;
try {
if (this.mode == "add") {
- res = await this.$API.qm.ftestwork.create.req(this.form);
+ this.$API.qm.ftestwork.create.req(this.form).then(res => {
+ this.isSaveing = false;
+ this.visible = false;
+ this.$emit("success");
+ this.$message.success("操作成功");
+ });
} else if (this.mode == "edit") {
- res = await this.$API.qm.ftestwork.update.req(this.form.id,this.form);
+ this.$API.qm.ftestwork.update.req(this.form.id,this.form).then(res => {
+ this.isSaveing = false;
+ this.visible = false;
+ this.$emit("success");
+ this.$message.success("操作成功");
+ });
}
- this.isSaveing = false;
- this.$emit("success", this.form, this.mode);
- this.visible = false;
- this.$message.success("操作成功");
+
} catch (err) {
//可以处理校验错误
this.isSaveing = false;
diff --git a/src/views/wpm/worktask_form.vue b/src/views/wpm/worktask_form.vue
index f646bc40..20dcccc3 100644
--- a/src/views/wpm/worktask_form.vue
+++ b/src/views/wpm/worktask_form.vue
@@ -1217,7 +1217,7 @@ export default {
let equipment_number = number.substring(number.length - 1);
this.equipment_number = equipment_number;
let index= this.form.index
- if(index!==undefined&&index!==''&&index!==null){
+ if(index==undefined||index==''||index==null){
index=''
}
this.form.batch=this.material_model+'-'+equipment_number+'-'+this.dateNow+'-'+index;