Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop

This commit is contained in:
caoqianming 2021-12-27 10:59:47 +08:00
commit 6ce9546c41
4 changed files with 401 additions and 301 deletions

View File

@ -1,12 +1,11 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-card> <el-card>
<div style="margin-top: 2px">
<div style="margin-top: 2px"> <el-button type="primary" icon="el-icon-plus" @click="handleCreate"
<el-button type="primary" icon="el-icon-plus" @click="handleCreate" >新增
>新增</el-button </el-button>
> </div>
</div>
</el-card> </el-card>
<el-card style="margin-top: 2px"> <el-card style="margin-top: 2px">
<el-table <el-table
@ -14,23 +13,23 @@
:data="customfieldList" :data="customfieldList"
style="width: 100%" style="width: 100%"
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50"/>
<el-table-column label="字段标识"> <el-table-column label="字段标识">
<template slot-scope="scope">{{ scope.row.field_key }}</template> <template slot-scope="scope">{{ scope.row.field_key }}</template>
</el-table-column> </el-table-column>
<el-table-column label="字段名称"> <el-table-column label="字段名称">
<template slot-scope="scope">{{ scope.row.field_name }}</template> <template slot-scope="scope">{{ scope.row.field_name }}</template>
</el-table-column> </el-table-column>
<el-table-column label="字段类型"> <el-table-column label="字段类型">
<template slot-scope="scope">{{ scope.row.field_type }}</template> <template slot-scope="scope">{{ scope.row.field_type }}</template>
</el-table-column> </el-table-column>
<el-table-column label="顺序ID"> <el-table-column label="顺序ID">
<template slot-scope="scope">{{ scope.row.sort }}</template> <template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column> </el-table-column>
<el-table-column label="字段描述"> <el-table-column label="字段描述">
<template slot-scope="scope">{{ scope.row.description }}</template> <template slot-scope="scope">{{ scope.row.description }}</template>
</el-table-column> </el-table-column>
<el-table-column label="创建时间"> <el-table-column label="创建时间">
<template slot-scope="scope">{{ scope.row.create_time }}</template> <template slot-scope="scope">{{ scope.row.create_time }}</template>
</el-table-column> </el-table-column>
@ -44,13 +43,15 @@
<el-link <el-link
v-if="checkPermission(['customfield_update'])" v-if="checkPermission(['customfield_update'])"
@click="handleEdit(scope)" @click="handleEdit(scope)"
>编辑</el-link >编辑
</el-link
> >
<el-link <el-link
v-if="checkPermission(['customfield_delete'])" v-if="checkPermission(['customfield_delete'])"
type="danger" type="danger"
@click="handleDeleteCustomfield(scope)" @click="handleDeleteCustomfield(scope)"
>删除</el-link >删除
</el-link
> >
</template> </template>
</el-table-column> </el-table-column>
@ -67,18 +68,18 @@
label-position="right" label-position="right"
:rules="rule1"> :rules="rule1">
<el-form-item label="字段标识" prop="field_key"> <el-form-item label="字段标识" prop="field_key">
<el-input v-model="customfield.field_key" placeholder="字段标识" /> <el-input v-model="customfield.field_key" placeholder="字段标识"/>
</el-form-item> </el-form-item>
<el-form-item label="字段名称" prop="field_name"> <el-form-item label="字段名称" prop="field_name">
<el-input v-model="customfield.field_name" placeholder="字段名称" /> <el-input v-model="customfield.field_name" placeholder="字段名称"/>
</el-form-item> </el-form-item>
<el-form-item label="字段描述" prop="description"> <el-form-item label="字段描述" prop="description">
<el-input v-model="customfield.description" placeholder="字段描述" /> <el-input v-model="customfield.description" placeholder="字段描述"/>
</el-form-item> </el-form-item>
<el-form-item label="占位符" prop="placeholder"> <el-form-item label="占位符" prop="placeholder">
<el-input v-model="customfield.placeholder" placeholder="占位符" /> <el-input v-model="customfield.placeholder" placeholder="占位符"/>
</el-form-item> </el-form-item>
<el-form-item label="字段类型" prop="field_type"> <el-form-item label="展示标签" prop="field_type">
<el-select style="width: 100%" v-model="customfield.field_type" placeholder="请选择"> <el-select style="width: 100%" v-model="customfield.field_type" placeholder="请选择">
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -88,28 +89,53 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="字段标签" v-show="customfield.field_type=='select'||customfield.field_type=='selects'">
<el-input v-model="customfield.label" placeholder="选项类型"/>
</el-form-item>
<el-form-item label="选项" v-show="customfield.field_type=='select'||customfield.field_type=='selects'"> <el-form-item label="选项" v-show="customfield.field_type=='select'||customfield.field_type=='selects'">
<el-button @click.prevent="addDomain" style="border: none;"> <el-button @click.prevent="addDomain" style="border: none;">
<i class="el-icon-circle-plus-outline"></i> <i class="el-icon-circle-plus-outline"></i>
<span style="font-size:14px;">添加</span> <span style="font-size:14px;">添加</span>
</el-button> </el-button>
<el-row v-for="(domain, $index) in choiceOption" :key=domain+$index style="margin-bottom: 10px"> <el-row v-for="(domain, $index) in choiceOption" :key='$index+1' style="margin-bottom: 10px">
<el-col :span="20"> <el-col :span="10">
<el-input v-model="choiceOption[$index]" auto-complete="off"></el-input> <template>
<el-form-item label="id">
<el-input type="number" v-model="choiceOption[$index].id" auto-complete="off" placeholder="id为整数"></el-input>
</el-form-item>
</template>
</el-col>
<el-col :span="10">
<template>
<el-form-item label="name">
<el-input v-model="choiceOption[$index].name" auto-complete="off"></el-input>
</el-form-item>
</template>
</el-col> </el-col>
<el-col :span="3" style="text-align: center" v-if="$index!==0"> <el-col :span="3" style="text-align: center" v-if="$index!==0">
<i class="el-icon-remove-outline" @click.prevent="removeDomain($index,'1')" style="color: red;font-size: 16px;"></i> <i
class="el-icon-remove-outline"
style="color: red;font-size: 16px;"
@click.prevent="removeDomain($index,'1')"
></i>
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item label="顺序ID" prop="sort"> <el-form-item label="顺序ID">
<el-input v-model="customfield.sort" type="number" placeholder="顺序" /> <el-input v-model="customfield.sort" type="number" placeholder="顺序"/>
</el-form-item> </el-form-item>
<el-form-item label="默认值" prop="default_value"> <el-form-item label="默认值">
<el-input v-model="customfield.default_value" placeholder="默认值" /> <el-input v-model="customfield.default_value" placeholder="默认值"/>
</el-form-item> </el-form-item>
<el-form-item label="模板" prop="field_template"> <el-form-item label="模板">
<el-input v-model="customfield.field_template" placeholder="你有一个待办工单:{title}" /> <el-input v-model="customfield.field_template" placeholder="你有一个待办工单:{title}"/>
</el-form-item>
<el-form-item label="是否隐藏">
<el-radio-group v-model="customfield.is_hidden">
<el-radio :label="false">显示</el-radio>
<el-radio :label="true">隐藏</el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div style="text-align: right"> <div style="text-align: right">
@ -120,39 +146,53 @@
</div> </div>
</template> </template>
<script> <script>
import { getWfCustomfieldList, createWfCustomfield,updateWfCustomfield,deleteWfCustomfield } from "@/api/workflow"; import {getWfCustomfieldList, createWfCustomfield, updateWfCustomfield, deleteWfCustomfield} from "@/api/workflow";
import checkPermission from "@/utils/permission"; import checkPermission from "@/utils/permission";
import vueJsonEditor from 'vue-json-editor' import vueJsonEditor from 'vue-json-editor'
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
const defaultcustomfield = { const defaultcustomfield = {
field_key: "", field_key: "",
field_name: "", field_name: "",
}; };
export default { export default {
components: { Pagination,vueJsonEditor }, components: {Pagination, vueJsonEditor},
name: "CTF", name: "CTF",
props: ["ID"], props: ["ID"],
data() { data() {
return { return {
customfield: { customfield: {
field_key:'', field_key: '',
field_name:'', field_name: '',
placeholder:'', placeholder: '',
field_type:'', field_type: '',
sort:'', sort: '',
default_value:'', label: 'name',
field_template:'', default_value: '',
field_choice:[] field_template: '',
}, field_choice: [],
view_permission_check:false, is_hidden:false,
hasJsonFlag:true, // json是否验证通过 },
hasJsonFlag1:true, // json是否验证通过 fieldHidden: true,
hasJsonFlag2:true, // json是否验证通过 fieldBlock: false,
// customfieldList: { view_permission_check: false,
// count:0 hasJsonFlag: true, // json是否验证通过
// }, hasJsonFlag1: true, // json是否验证通过
customfieldList:[], hasJsonFlag2: true, // json是否验证通过
options: [{ // customfieldList: {
// count:0
// },
customfieldList: [''],
labels:[{
label: '常规',
value: 'name'
},{
label: '名称|id',
value: 'name|id'
},{
label: '人员选择',
value: 'user'
}],
options: [{
value: 'string', value: 'string',
label: '文本' label: '文本'
}, { }, {
@ -167,172 +207,176 @@ export default {
}, { }, {
value: 'datetime', value: 'datetime',
label: '日期时间' label: '日期时间'
},{ }, {
value: 'select', value: 'select',
label: '单选' label: '单选'
},{ }, {
value: 'selects', value: 'selects',
label: '多选' label: '多选'
}, { }, {
value: 'textarea', value: 'textarea',
label: '文本域' label: '文本域'
}, { },{
value: 'file',
label: '附件'
}],
/*, {
value: 'selectuser', value: 'selectuser',
label: '用户名' label: '用户名'
}, { }, {
value: 'selectusers', value: 'selectusers',
label: '多选的用户名' label: '多选的用户名'
}, { }, */
value: 'file',
label: '附件'
}],
boolean_field_display:[], boolean_field_display: [],
choiceOption:[''], choiceOption: [{id:null,name:""}],
field_choice:[], field_choice: [],
dialogVisible: false, dialogVisible: false,
dialogType: "new", dialogType: "new",
rule1: { rule1: {
name: [{ required: true, message: "请输入", trigger: "blur" }], name: [{required: true, message: "请输入", trigger: "blur"}],
description: [{ required: true, message: "请输入", trigger: "blur" }] description: [{required: true, message: "请输入", trigger: "blur"}]
},
};
},
computed: {},
watch: {},
created() {
this.getList();
},
methods: {
//添加字段选项
addDomain() {
this.choiceOption.push({id:null,name:""})
}, },
}; //删除字段选项
}, removeDomain(index) {
computed: {}, this.choiceOption.splice(index, 1)
watch: {}, },
created() { checkPermission,
this.getList();
},
methods: {
//添加字段选项
addDomain() {
this.choiceOption.push('')
},
//删除字段选项
removeDomain(index){
this.choiceOption.splice(index, 1)
},
checkPermission,
getList() { getList() {
getWfCustomfieldList(this.ID).then((response) => {
if (response.data) {
this.customfieldList = response.data;
}
getWfCustomfieldList(this.ID).then((response) => {
if (response.data) {
this.customfieldList = response.data;
}
});
},
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.customfield = Object.assign({}, defaultcustomfield);
this.dialogType = "new";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handleEdit(scope) {
this.customfield = Object.assign({}, scope.row); // copy obj
this.choiceOption = scope.row.field_choice;
this.dialogType = "edit";
this.dialogVisible = true;
this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});
},
handlecfgt(scope)
{
this.$router.push({name:"configuration",params:{customfield:scope.row.id}})
}
,
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWorkflow(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
}); });
}, },
handleFilter() {
this.listQuery.page = 1;
this.getList();
},
resetFilter() {
this.listQuery = {
page: 1,
page_size: 20,
}
this.getList();
},
handleCreate() {
this.customfield = Object.assign({}, defaultcustomfield);
this.dialogType = "new";
this.dialogVisible = true;
/*this.$nextTick(() => {
// this.$refs["Form"].clearValidate();
this.customfield.label = 1;
});*/
},
handleEdit(scope) {
debugger;
this.customfield = Object.assign({}, scope.row); // copy obj
this.choiceOption = scope.row.field_choice;
this.dialogType = "edit";
this.dialogVisible = true;
/*this.$nextTick(() => {
this.$refs["Form"].clearValidate();
});*/
},
handlecfgt(scope) {
this.$router.push({name: "configuration", params: {customfield: scope.row.id}})
}
,
handleDelete(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await this.deleteWorkflow(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
async confirm(form) { async confirm(form) {
this.$refs[form].validate((valid) => { let that = this,choiceArr = [];
if (valid) { this.$refs[form].validate((valid) => {
const isEdit = this.dialogType === "edit"; if (valid) {
if (isEdit) { const isEdit = that.dialogType === "edit";
this.checkJson(); if(that.choiceOption[0]&&that.choiceOption[0].name!==''&&that.choiceOption[0].name!==null&&that.choiceOption[0].name!==undefined){
this.checkJson1(); that.choiceOption.forEach((item)=>{
this.checkJson2(); let obj = new Object();
this.customfield.field_choice = this.choiceOption; obj.id = parseInt(item.id);
updateWfCustomfield(this.customfield.id, this.customfield).then((res) => { obj.name = item.name;
if (res.code >= 200) { choiceArr.push(obj);
this.getList(); })
this.dialogVisible = false; }
this.$message.success("成功"); debugger;
} console.log(choiceArr);
}); that.customfield.field_choice = choiceArr;
console.log(that.customfield);
if (isEdit) {
updateWfCustomfield(this.customfield.id, this.customfield).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} else {
this.customfield.workflow = this.ID;
createWfCustomfield(this.customfield).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
}
} else { } else {
this.checkJson(); return false;
this.checkJson1();
this.checkJson2();
this.customfield.workflow=this.ID;
this.customfield.field_choice = this.choiceOption;
createWfCustomfield(this.customfield).then((res) => {
if (res.code >= 200) {
this.getList();
this.dialogVisible = false;
this.$message.success("成功");
}
});
} }
} else {
return false;
}
});
},
handleDeleteCustomfield(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWfCustomfield(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
}); });
}, },
handleDeleteCustomfield(scope) {
this.$confirm("确认删除?", "警告", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "error",
})
.then(async () => {
await deleteWfCustomfield(scope.row.id);
this.getList();
this.$message.success("成功");
})
.catch((err) => {
console.error(err);
});
},
onJsonChange (value) { /* onJsonChange(value) {
// console.log('更改value:', value); // console.log('更改value:', value);
// 实时保存 // 实时保存
this.onJsonSave(value) this.onJsonSave(value)
}, },
onJsonSave (value) { onJsonSave(value) {
// console.log('保存value:', value); // console.log('保存value:', value);
this.boolean_field_display = value this.boolean_field_display = value
this.hasJsonFlag = true this.hasJsonFlag = true
@ -343,61 +387,61 @@ export default {
}, },
// 检查json // 检查json
checkJson(){ checkJson() {
if (this.hasJsonFlag == false){ if (this.hasJsonFlag == false) {
alert("布尔显示定义json验证失败") // alert("布尔显示定义json验证失败")
return false return false
} else { } else {
alert("布尔显示定义json验证成功") // alert("布尔显示定义json验证成功")
return true return true
} }
}, },
onJsonChange1 (value) { onJsonChange1(value) {
// console.log('更改value:', value); // console.log('更改value:', value);
// 实时保存 // 实时保存
this.onJsonSave1(value) this.onJsonSave1(value)
}, },
onJsonSave1 (value) { onJsonSave1(value) {
this.field_choice = value this.field_choice = value
this.hasJsonFlag1 = true this.hasJsonFlag1 = true
}, },
onError1(value) { onError1(value) {
this.hasJsonFlag1 = false this.hasJsonFlag1 = false
}, },
// 检查json // 检查json
checkJson1(){ checkJson1() {
if (this.hasJsonFlag1 == false){ if (this.hasJsonFlag1 == false) {
alert("选项json验证失败") // alert("选项json验证失败")
return false return false
} else { } else {
alert("选项json1验证成功") // alert("选项json1验证成功")
return true return true
} }
}, },
onJsonChange2 (value) { onJsonChange2(value) {
// console.log('更改value:', value); // console.log('更改value:', value);
// 实时保存 // 实时保存
this.onJsonSave2(value) this.onJsonSave2(value)
}, },
onJsonSave2 (value) { onJsonSave2(value) {
this.field_choice = value this.field_choice = value
this.hasJsonFlag2 = true this.hasJsonFlag2 = true
}, },
onError2(value) { onError2(value) {
this.hasJsonFlag2 = false this.hasJsonFlag2 = false
}, },
// 检查json // 检查json
checkJson2(){ checkJson2() {
if (this.hasJsonFlag2 == false){ if (this.hasJsonFlag2 == false) {
alert("标签json验证失败") // alert("标签json验证失败")
return false return false
} else { } else {
alert("标签json1验证成功") // alert("标签json1验证成功")
return true return true
} }*/
}, // },
}, },
}; };
</script> </script>

View File

@ -187,6 +187,7 @@
<el-option label="只读" value="1"></el-option> <el-option label="只读" value="1"></el-option>
<el-option label="必填" value="2"></el-option> <el-option label="必填" value="2"></el-option>
<el-option label="可选" value="3"></el-option> <el-option label="可选" value="3"></el-option>
<el-option label="隐藏" value="4"></el-option>
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="2" style="text-align: center" v-if="$index!==0"> <el-col :span="2" style="text-align: center" v-if="$index!==0">

View File

@ -308,9 +308,9 @@
<el-select style="width: 100%" v-model="item.default_value" placeholder="请选择"> <el-select style="width: 100%" v-model="item.default_value" placeholder="请选择">
<el-option <el-option
v-for="item1 in item.field_choice" v-for="item1 in item.field_choice"
:key="item1" :key="item1.id"
:label="item1" :label="item1.name"
:value="item1" :value="item1.id"
> >
</el-option> </el-option>
</el-select> </el-select>
@ -319,9 +319,9 @@
<el-select style="width: 100%" multiple v-model="item.default_value" placeholder="请选择"> <el-select style="width: 100%" multiple v-model="item.default_value" placeholder="请选择">
<el-option <el-option
v-for="item1 in item.field_choice" v-for="item1 in item.field_choice"
:key="item1" :key="item1.id"
:label="item1" :label="item1.name"
:value="item1" :value="item1.id"
> >
</el-option> </el-option>
</el-select> </el-select>

View File

@ -508,98 +508,78 @@
</el-dialog> </el-dialog>
<!--不合格半成品重审--> <!--不合格半成品重审-->
<el-dialog title="不合格半成品重审" :close-on-click-modal="false" :visible.sync="limitedRetrial"> <el-dialog title="不合格半成品重审" :close-on-click-modal="false" :visible.sync="limitedRetrial">
<el-form label-width="80px" label-position="right"> <el-form label-width="130px" label-position="right">
<el-row v-for="(item, $index) in fieldList.record_data" :key="$index"> <el-form-item :label="item.field_name" v-for="item in customfieldList" :key="item.id" v-show="!item.is_hidden">
<el-form-item <template v-if="item.field_type=='string'">
v-if="item.field_type === 'string'" <el-input v-model="item.default_value" :placeholder="item.description" />
:label="item.field_name" </template>
> <template v-if="item.field_type==='int'">
<el-input placeholder="请输入" v-model="item.sort" /> <el-input v-model="item.default_value" type="number" :placeholder="item.description" oninput="value=value.replace(/[^\d]/g,'')" />
</el-form-item> </template>
<el-form-item <template v-if="item.field_type==='float'">
v-else-if="item.field_type === 'int'" <el-input v-model="item.default_value" type="number" :placeholder="item.description" />
:label="item.field_name" </template>
> <template v-if="item.field_type==='date'">
<el-input
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'float'"
:label="item.field_name"
>
<el-input
type="number"
placeholder="请输入"
v-model="item.sort"
/>
</el-form-item>
<el-form-item
v-else-if="item.field_type === 'date'"
:label="item.field_name"
>
<el-date-picker <el-date-picker
v-model="item.create_time" v-model="item.default_value"
type="date" type="date"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
style="width: 100%" style="width: 100%"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </template>
<el-form-item <template v-if="item.field_type==='datetime'">
v-else-if="item.field_type === 'datetime'"
:label="item.field_name"
>
<el-date-picker <el-date-picker
v-model="item.create_time" v-model="item.default_value"
type="datetime" type="datetime"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%" style="width: 100%"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </template>
<el-form-item <template v-if="item.field_type==='select'">
v-else-if="item.field_type === 'select'" <el-select style="width: 100%" v-model="item.default_value" placeholder="请选择">
:label="item.field_name"
>
<el-select
style="width: 100%"
v-model="item.sort"
placeholder="请选择"
>
<el-option <el-option
v-for="item1 in item.field_choice" v-for="item1 in item.field_choice"
:key="item1" :key="item1.id"
:label="item1" :label="item1.name"
:value="item1" :value="item1.id"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </template>
<el-form-item <template v-if="item.field_type==='selects'">
v-else-if="item.field_type === 'selects'" <el-select style="width: 100%" multiple v-model="item.default_value" placeholder="请选择">
:label="item.field_name"
>
<el-select
style="width: 100%"
v-model="optio"
multiple
placeholder="请选择"
>
<el-option <el-option
v-for="item1 in item.field_choice" v-for="item1 in item.field_choice"
:key="item1" :key="item1.id"
:label="item1" :label="item1.name"
:value="item1" :value="item1.id"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </template>
</el-row> <template v-if="item.field_type==='textarea'">
<el-input type="textarea" :rows="3" v-model="item.default_value" placeholder="内容" />
</template>
<template v-if="item.field_type==='file'">
<el-upload
ref="upload"
:action="upUrl"
:on-preview="handlePreview"
:on-success="handleUpSuccess"
:on-remove="handleRemove"
:headers="upHeaders"
:file-list="fileList"
:limit="1"
accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx"
>
<el-button size="small" type="primary">上传文件</el-button>
</el-upload>
</template>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="limitedRetrial = false"> </el-button> <el-button @click="limitedRetrial = false"> </el-button>
@ -609,12 +589,15 @@
</div> </div>
</template> </template>
<script> <script>
import { getOrgAll } from "@/api/org";
import { getUserList } from "@/api/user";
import {getWarehouseList} from "@/api/inm";
import checkPermission from "@/utils/permission";
import customForm from '@/components/customForm/index'; import customForm from '@/components/customForm/index';
import reviewForm from '@/components/customForm/review'; import reviewForm from '@/components/customForm/review';
import {getwproductList, wproductTest, wproductPutin, createputins,testInit,scrap,getRetrial} from "@/api/wpm"; import {getWfCustomfieldList,createTicket} from "@/api/workflow";
import checkPermission from "@/utils/permission";
import {getWarehouseList} from "@/api/inm";
import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm"; import {getMaterialList, getrecordformList, getrffieldList} from "@/api/mtm";
import {getwproductList, wproductTest, wproductPutin, createputins,testInit,scrap,getRetrial} from "@/api/wpm";
import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm"; import {getTestRecord,getTestRecordItem,putTestRecordItem,delTestRecordItem,subTestRecordItem} from "@/api/qm";
import {genTree} from "@/utils"; import {genTree} from "@/utils";
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
@ -704,7 +687,10 @@
originList: [], originList: [],
is_testok: "true", is_testok: "true",
field: [], field: [],
userList: [],//用户列表
orgList: [],//部门列表
recordformList: [], recordformList: [],
customfieldList: [],
recordform: null, recordform: null,
recordId: null, recordId: null,
fifo_detail: "", fifo_detail: "",
@ -728,6 +714,15 @@
dialogFormVisibles: false, dialogFormVisibles: false,
limitedCheckRecord: false, limitedCheckRecord: false,
testrecord: {}, testrecord: {},
retrialItem: {},//复检对象
retrialResponse: {},//复检对象
//复检表单
retrialForm: {
title:'',
transition:'',
workflow:'',
ticket_data:{},
},
WarehouseData: "", WarehouseData: "",
formName: '项目检查表', formName: '项目检查表',
}; };
@ -823,14 +818,64 @@
}, },
//不合格产品重审展示 //不合格产品重审展示
handleRetrial(scope){ handleRetrial(scope){
let that =this;
this.retrialItem = Object.assign({}, scope.row);
console.log(this.retrialItem);
getRetrial(scope.row.id).then(res=>{ getRetrial(scope.row.id).then(res=>{
debugger; that.retrialResponse = res.data;
console.log(res) getWfCustomfieldList(res.data.workflow).then((response) => {
if (response.data) {
that.customfieldList = response.data;
for (let i=0;i<that.customfieldList.length;i++) {
if(that.customfieldList[i].field_key==="wproduct"){
that.customfieldList[i].default_value = that.retrialResponse.exist_data.wproduct;
}
if(that.customfieldList[i].field_key==="wproduct_name"){
that.customfieldList[i].default_value = that.retrialResponse.exist_data.wproduct_name;
}
if(that.customfieldList[i].field_key==="wproduct_type"){
that.customfieldList[i].default_value = that.retrialResponse.exist_data.wproduct_specification;
}
if(that.customfieldList[i].field_key==="finder"){
that.customfieldList[i].default_value = that.retrialResponse.exist_data.finder;
}
if(that.customfieldList[i].field_key==="find_process"){
that.customfieldList[i].default_value = that.retrialResponse.exist_data.find_process;
}
if(that.customfieldList[i].label==="sys_user"){
that.customfieldList[i].field_choice = that.userList;
}
if(that.customfieldList[i].label==="deptSelect"){
that.customfieldList[i].field_choice = that.orgList;
}
}
}
});
that.limitedRetrial = true;
}) })
}, },
//不合格产品重审提交 //不合格产品重审提交
retrialSubmit(){ retrialSubmit(){
let that = this;
let fields = this.customfieldList;
let obj = new Object();
for(let i=0;i<fields.length;i++){
obj[fields[i].field_key] = fields[i].default_value
}
this.retrialForm.ticket_data = obj;
this.retrialForm.workflow = that.retrialResponse.workflow;
this.retrialForm.transition = 20;
this.retrialForm.title = that.retrialResponse.exist_data.wproduct_name+'的重审';
debugger;
console.log(this.retrialForm);
createTicket(this.retrialForm).then((res) => {
if (res.code >= 200) {
// this.getList();
this.limitedRetrial = false;
this.$message.success("成功");
}
});
}, },
//夹层半成品列表 //夹层半成品列表
getList3() { getList3() {
@ -1202,5 +1247,15 @@
this.reload() this.reload()
}, },
}, },
mounted() {
getUserList({page:0}).then(response => {
if (response.data) {
this.userList = response.data
}
});
getOrgAll().then((response) => {
this.orgList = response.data;
});
}
} }
</script> </script>