Merge branch 'develop' of https://e.coding.net/ctcdevteam/hberp/hberp into develop
This commit is contained in:
commit
6ce9546c41
|
@ -1,12 +1,11 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card>
|
||||
|
||||
<div style="margin-top: 2px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||
>新增</el-button
|
||||
>
|
||||
</div>
|
||||
<div style="margin-top: 2px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleCreate"
|
||||
>新增
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-top: 2px">
|
||||
<el-table
|
||||
|
@ -14,23 +13,23 @@
|
|||
:data="customfieldList"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column type="index" width="50"/>
|
||||
<el-table-column label="字段标识">
|
||||
<template slot-scope="scope">{{ scope.row.field_key }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字段名称">
|
||||
<template slot-scope="scope">{{ scope.row.field_name }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字段类型">
|
||||
<el-table-column label="字段类型">
|
||||
<template slot-scope="scope">{{ scope.row.field_type }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="顺序ID">
|
||||
<el-table-column label="顺序ID">
|
||||
<template slot-scope="scope">{{ scope.row.sort }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字段描述">
|
||||
<el-table-column label="字段描述">
|
||||
<template slot-scope="scope">{{ scope.row.description }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间">
|
||||
<el-table-column label="创建时间">
|
||||
<template slot-scope="scope">{{ scope.row.create_time }}</template>
|
||||
</el-table-column>
|
||||
|
||||
|
@ -44,13 +43,15 @@
|
|||
<el-link
|
||||
v-if="checkPermission(['customfield_update'])"
|
||||
@click="handleEdit(scope)"
|
||||
>编辑</el-link
|
||||
>编辑
|
||||
</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="checkPermission(['customfield_delete'])"
|
||||
type="danger"
|
||||
@click="handleDeleteCustomfield(scope)"
|
||||
>删除</el-link
|
||||
>删除
|
||||
</el-link
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -67,18 +68,18 @@
|
|||
label-position="right"
|
||||
:rules="rule1">
|
||||
<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 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 label="字段描述" prop="description">
|
||||
<el-input v-model="customfield.description" placeholder="字段描述" />
|
||||
<el-input v-model="customfield.description" placeholder="字段描述"/>
|
||||
</el-form-item>
|
||||
<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 label="字段类型" prop="field_type">
|
||||
<el-form-item label="展示标签" prop="field_type">
|
||||
<el-select style="width: 100%" v-model="customfield.field_type" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
|
@ -88,28 +89,53 @@
|
|||
</el-option>
|
||||
</el-select>
|
||||
</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-button @click.prevent="addDomain" style="border: none;">
|
||||
<i class="el-icon-circle-plus-outline"></i>
|
||||
<span style="font-size:14px;">添加</span>
|
||||
</el-button>
|
||||
<el-row v-for="(domain, $index) in choiceOption" :key=domain+$index style="margin-bottom: 10px">
|
||||
<el-col :span="20">
|
||||
<el-input v-model="choiceOption[$index]" auto-complete="off"></el-input>
|
||||
<el-row v-for="(domain, $index) in choiceOption" :key='$index+1' style="margin-bottom: 10px">
|
||||
<el-col :span="10">
|
||||
<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 :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-row>
|
||||
</el-form-item>
|
||||
<el-form-item label="顺序ID" prop="sort">
|
||||
<el-input v-model="customfield.sort" type="number" placeholder="顺序" />
|
||||
<el-form-item label="顺序ID">
|
||||
<el-input v-model="customfield.sort" type="number" placeholder="顺序"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="默认值" prop="default_value">
|
||||
<el-input v-model="customfield.default_value" placeholder="默认值" />
|
||||
<el-form-item label="默认值">
|
||||
<el-input v-model="customfield.default_value" placeholder="默认值"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模板" prop="field_template">
|
||||
<el-input v-model="customfield.field_template" placeholder="你有一个待办工单:{title}" />
|
||||
<el-form-item label="模板">
|
||||
<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>
|
||||
<div style="text-align: right">
|
||||
|
@ -120,39 +146,53 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getWfCustomfieldList, createWfCustomfield,updateWfCustomfield,deleteWfCustomfield } from "@/api/workflow";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import vueJsonEditor from 'vue-json-editor'
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultcustomfield = {
|
||||
field_key: "",
|
||||
field_name: "",
|
||||
};
|
||||
export default {
|
||||
components: { Pagination,vueJsonEditor },
|
||||
name: "CTF",
|
||||
props: ["ID"],
|
||||
data() {
|
||||
return {
|
||||
customfield: {
|
||||
field_key:'',
|
||||
field_name:'',
|
||||
placeholder:'',
|
||||
field_type:'',
|
||||
sort:'',
|
||||
default_value:'',
|
||||
field_template:'',
|
||||
field_choice:[]
|
||||
},
|
||||
view_permission_check:false,
|
||||
hasJsonFlag:true, // json是否验证通过
|
||||
hasJsonFlag1:true, // json是否验证通过
|
||||
hasJsonFlag2:true, // json是否验证通过
|
||||
// customfieldList: {
|
||||
// count:0
|
||||
// },
|
||||
customfieldList:[],
|
||||
options: [{
|
||||
import {getWfCustomfieldList, createWfCustomfield, updateWfCustomfield, deleteWfCustomfield} from "@/api/workflow";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import vueJsonEditor from 'vue-json-editor'
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultcustomfield = {
|
||||
field_key: "",
|
||||
field_name: "",
|
||||
};
|
||||
export default {
|
||||
components: {Pagination, vueJsonEditor},
|
||||
name: "CTF",
|
||||
props: ["ID"],
|
||||
data() {
|
||||
return {
|
||||
customfield: {
|
||||
field_key: '',
|
||||
field_name: '',
|
||||
placeholder: '',
|
||||
field_type: '',
|
||||
sort: '',
|
||||
label: 'name',
|
||||
default_value: '',
|
||||
field_template: '',
|
||||
field_choice: [],
|
||||
is_hidden:false,
|
||||
},
|
||||
fieldHidden: true,
|
||||
fieldBlock: false,
|
||||
view_permission_check: false,
|
||||
hasJsonFlag: true, // json是否验证通过
|
||||
hasJsonFlag1: true, // json是否验证通过
|
||||
hasJsonFlag2: true, // json是否验证通过
|
||||
// customfieldList: {
|
||||
// count:0
|
||||
// },
|
||||
customfieldList: [''],
|
||||
labels:[{
|
||||
label: '常规',
|
||||
value: 'name'
|
||||
},{
|
||||
label: '名称|id',
|
||||
value: 'name|id'
|
||||
},{
|
||||
label: '人员选择',
|
||||
value: 'user'
|
||||
}],
|
||||
options: [{
|
||||
value: 'string',
|
||||
label: '文本'
|
||||
}, {
|
||||
|
@ -167,172 +207,176 @@ export default {
|
|||
}, {
|
||||
value: 'datetime',
|
||||
label: '日期时间'
|
||||
},{
|
||||
}, {
|
||||
value: 'select',
|
||||
label: '单选'
|
||||
},{
|
||||
}, {
|
||||
value: 'selects',
|
||||
label: '多选'
|
||||
}, {
|
||||
value: 'textarea',
|
||||
label: '文本域'
|
||||
}, {
|
||||
},{
|
||||
value: 'file',
|
||||
label: '附件'
|
||||
}],
|
||||
/*, {
|
||||
value: 'selectuser',
|
||||
label: '用户名'
|
||||
}, {
|
||||
value: 'selectusers',
|
||||
label: '多选的用户名'
|
||||
}, {
|
||||
value: 'file',
|
||||
label: '附件'
|
||||
}],
|
||||
}, */
|
||||
|
||||
|
||||
boolean_field_display:[],
|
||||
choiceOption:[''],
|
||||
field_choice:[],
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
rule1: {
|
||||
name: [{ required: true, message: "请输入", trigger: "blur" }],
|
||||
description: [{ required: true, message: "请输入", trigger: "blur" }]
|
||||
boolean_field_display: [],
|
||||
choiceOption: [{id:null,name:""}],
|
||||
field_choice: [],
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
rule1: {
|
||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||
description: [{required: true, message: "请输入", trigger: "blur"}]
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//添加字段选项
|
||||
addDomain() {
|
||||
this.choiceOption.push({id:null,name:""})
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//添加字段选项
|
||||
addDomain() {
|
||||
this.choiceOption.push('')
|
||||
},
|
||||
//删除字段选项
|
||||
removeDomain(index){
|
||||
this.choiceOption.splice(index, 1)
|
||||
},
|
||||
checkPermission,
|
||||
//删除字段选项
|
||||
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) {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogType === "edit";
|
||||
if (isEdit) {
|
||||
this.checkJson();
|
||||
this.checkJson1();
|
||||
this.checkJson2();
|
||||
this.customfield.field_choice = this.choiceOption;
|
||||
updateWfCustomfield(this.customfield.id, this.customfield).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
this.$message.success("成功");
|
||||
}
|
||||
});
|
||||
let that = this,choiceArr = [];
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const isEdit = that.dialogType === "edit";
|
||||
if(that.choiceOption[0]&&that.choiceOption[0].name!==''&&that.choiceOption[0].name!==null&&that.choiceOption[0].name!==undefined){
|
||||
that.choiceOption.forEach((item)=>{
|
||||
let obj = new Object();
|
||||
obj.id = parseInt(item.id);
|
||||
obj.name = item.name;
|
||||
choiceArr.push(obj);
|
||||
})
|
||||
}
|
||||
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 {
|
||||
this.checkJson();
|
||||
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("成功");
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} 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);
|
||||
// 实时保存
|
||||
this.onJsonSave(value)
|
||||
},
|
||||
onJsonSave (value) {
|
||||
onJsonSave(value) {
|
||||
// console.log('保存value:', value);
|
||||
this.boolean_field_display = value
|
||||
this.hasJsonFlag = true
|
||||
|
@ -343,61 +387,61 @@ export default {
|
|||
},
|
||||
|
||||
// 检查json
|
||||
checkJson(){
|
||||
if (this.hasJsonFlag == false){
|
||||
alert("布尔显示定义json验证失败")
|
||||
checkJson() {
|
||||
if (this.hasJsonFlag == false) {
|
||||
// alert("布尔显示定义json验证失败")
|
||||
return false
|
||||
} else {
|
||||
alert("布尔显示定义json验证成功")
|
||||
// alert("布尔显示定义json验证成功")
|
||||
return true
|
||||
}
|
||||
},
|
||||
onJsonChange1 (value) {
|
||||
onJsonChange1(value) {
|
||||
// console.log('更改value:', value);
|
||||
// 实时保存
|
||||
this.onJsonSave1(value)
|
||||
},
|
||||
onJsonSave1 (value) {
|
||||
onJsonSave1(value) {
|
||||
this.field_choice = value
|
||||
this.hasJsonFlag1 = true
|
||||
},
|
||||
onError1(value) {
|
||||
this.hasJsonFlag1 = false
|
||||
},
|
||||
// 检查json
|
||||
checkJson1(){
|
||||
if (this.hasJsonFlag1 == false){
|
||||
alert("选项json验证失败")
|
||||
// 检查json
|
||||
checkJson1() {
|
||||
if (this.hasJsonFlag1 == false) {
|
||||
// alert("选项json验证失败")
|
||||
return false
|
||||
} else {
|
||||
alert("选项json1验证成功")
|
||||
// alert("选项json1验证成功")
|
||||
return true
|
||||
}
|
||||
},
|
||||
onJsonChange2 (value) {
|
||||
onJsonChange2(value) {
|
||||
// console.log('更改value:', value);
|
||||
// 实时保存
|
||||
this.onJsonSave2(value)
|
||||
},
|
||||
onJsonSave2 (value) {
|
||||
onJsonSave2(value) {
|
||||
this.field_choice = value
|
||||
this.hasJsonFlag2 = true
|
||||
},
|
||||
onError2(value) {
|
||||
this.hasJsonFlag2 = false
|
||||
},
|
||||
// 检查json
|
||||
checkJson2(){
|
||||
if (this.hasJsonFlag2 == false){
|
||||
alert("标签json验证失败")
|
||||
// 检查json
|
||||
checkJson2() {
|
||||
if (this.hasJsonFlag2 == false) {
|
||||
// alert("标签json验证失败")
|
||||
return false
|
||||
} else {
|
||||
alert("标签json1验证成功")
|
||||
// alert("标签json1验证成功")
|
||||
return true
|
||||
}
|
||||
},
|
||||
}*/
|
||||
// },
|
||||
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -187,6 +187,7 @@
|
|||
<el-option label="只读" value="1"></el-option>
|
||||
<el-option label="必填" value="2"></el-option>
|
||||
<el-option label="可选" value="3"></el-option>
|
||||
<el-option label="隐藏" value="4"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="2" style="text-align: center" v-if="$index!==0">
|
||||
|
|
|
@ -308,9 +308,9 @@
|
|||
<el-select style="width: 100%" v-model="item.default_value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
:key="item1.id"
|
||||
:label="item1.name"
|
||||
:value="item1.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
@ -319,9 +319,9 @@
|
|||
<el-select style="width: 100%" multiple v-model="item.default_value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
:key="item1.id"
|
||||
:label="item1.name"
|
||||
:value="item1.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
|
|
@ -508,98 +508,78 @@
|
|||
</el-dialog>
|
||||
<!--不合格半成品重审-->
|
||||
<el-dialog title="不合格半成品重审" :close-on-click-modal="false" :visible.sync="limitedRetrial">
|
||||
<el-form label-width="80px" label-position="right">
|
||||
<el-row v-for="(item, $index) in fieldList.record_data" :key="$index">
|
||||
<el-form-item
|
||||
v-if="item.field_type === 'string'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-input placeholder="请输入" v-model="item.sort" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'int'"
|
||||
: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 === '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-form label-width="130px" label-position="right">
|
||||
<el-form-item :label="item.field_name" v-for="item in customfieldList" :key="item.id" v-show="!item.is_hidden">
|
||||
<template v-if="item.field_type=='string'">
|
||||
<el-input v-model="item.default_value" :placeholder="item.description" />
|
||||
</template>
|
||||
<template v-if="item.field_type==='int'">
|
||||
<el-input v-model="item.default_value" type="number" :placeholder="item.description" oninput="value=value.replace(/[^\d]/g,'')" />
|
||||
</template>
|
||||
<template v-if="item.field_type==='float'">
|
||||
<el-input v-model="item.default_value" type="number" :placeholder="item.description" />
|
||||
</template>
|
||||
<template v-if="item.field_type==='date'">
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
v-model="item.default_value"
|
||||
type="date"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'datetime'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
</template>
|
||||
<template v-if="item.field_type==='datetime'">
|
||||
<el-date-picker
|
||||
v-model="item.create_time"
|
||||
v-model="item.default_value"
|
||||
type="datetime"
|
||||
placeholder="选择日期"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
style="width: 100%"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'select'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="item.sort"
|
||||
placeholder="请选择"
|
||||
>
|
||||
</template>
|
||||
<template v-if="item.field_type==='select'">
|
||||
<el-select style="width: 100%" v-model="item.default_value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
:key="item1.id"
|
||||
:label="item1.name"
|
||||
:value="item1.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-else-if="item.field_type === 'selects'"
|
||||
:label="item.field_name"
|
||||
>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="optio"
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
</template>
|
||||
<template v-if="item.field_type==='selects'">
|
||||
<el-select style="width: 100%" multiple v-model="item.default_value" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item1 in item.field_choice"
|
||||
:key="item1"
|
||||
:label="item1"
|
||||
:value="item1"
|
||||
:key="item1.id"
|
||||
:label="item1.name"
|
||||
:value="item1.id"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</template>
|
||||
<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>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="limitedRetrial = false">取 消</el-button>
|
||||
|
@ -609,12 +589,15 @@
|
|||
</div>
|
||||
</template>
|
||||
<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 reviewForm from '@/components/customForm/review';
|
||||
import {getwproductList, wproductTest, wproductPutin, createputins,testInit,scrap,getRetrial} from "@/api/wpm";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import {getWarehouseList} from "@/api/inm";
|
||||
import {getWfCustomfieldList,createTicket} from "@/api/workflow";
|
||||
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 {genTree} from "@/utils";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
|
@ -704,7 +687,10 @@
|
|||
originList: [],
|
||||
is_testok: "true",
|
||||
field: [],
|
||||
userList: [],//用户列表
|
||||
orgList: [],//部门列表
|
||||
recordformList: [],
|
||||
customfieldList: [],
|
||||
recordform: null,
|
||||
recordId: null,
|
||||
fifo_detail: "",
|
||||
|
@ -728,6 +714,15 @@
|
|||
dialogFormVisibles: false,
|
||||
limitedCheckRecord: false,
|
||||
testrecord: {},
|
||||
retrialItem: {},//复检对象
|
||||
retrialResponse: {},//复检对象
|
||||
//复检表单
|
||||
retrialForm: {
|
||||
title:'',
|
||||
transition:'',
|
||||
workflow:'',
|
||||
ticket_data:{},
|
||||
},
|
||||
WarehouseData: "",
|
||||
formName: '项目检查表',
|
||||
};
|
||||
|
@ -823,14 +818,64 @@
|
|||
},
|
||||
//不合格产品重审展示
|
||||
handleRetrial(scope){
|
||||
let that =this;
|
||||
this.retrialItem = Object.assign({}, scope.row);
|
||||
console.log(this.retrialItem);
|
||||
getRetrial(scope.row.id).then(res=>{
|
||||
debugger;
|
||||
console.log(res)
|
||||
that.retrialResponse = res.data;
|
||||
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(){
|
||||
|
||||
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() {
|
||||
|
@ -1202,5 +1247,15 @@
|
|||
this.reload()
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
getUserList({page:0}).then(response => {
|
||||
if (response.data) {
|
||||
this.userList = response.data
|
||||
}
|
||||
});
|
||||
getOrgAll().then((response) => {
|
||||
this.orgList = response.data;
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue