8 changed files with 1870 additions and 8 deletions
-
3src/api/sampleManagement/technicalSpecificationList.js
-
2src/main.js
-
32src/views/common/yzz.vue
-
52src/views/demo/demo.vue
-
6src/views/modules/project/projectInfo/projectInfo.vue
-
481src/views/modules/sampleManagement/demoZuJian.vue
-
696src/views/modules/sampleManagement/technicalSpecificationList/com_technical-add-or-update.vue
-
606src/views/modules/sampleManagement/technicalSpecificationList/technicalSpecificationList.vue
@ -0,0 +1,3 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
export const technicalSpecificationListSearch = data => createAPI(`/technicalSpecification/technicalSpecificationListSearch`,'post',data) |
|||
@ -0,0 +1,32 @@ |
|||
<template> |
|||
<div class="tag"> |
|||
<span class="tag-label">大傻逼</span> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
name: 'yzz', |
|||
props: { |
|||
label: { |
|||
type: String, |
|||
required: true |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
.tag { |
|||
display: inline-block; |
|||
background-color: #007bff; |
|||
color: #fff; |
|||
border-radius: 4px; |
|||
padding: 4px 8px; |
|||
margin-right: 8px; |
|||
} |
|||
|
|||
.tag-label { |
|||
font-size: 14px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,481 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|||
<el-form :inline="true" label-position="top" style="margin-top: 0px"> |
|||
<el-button type="primary" @click="addModal()">新增</el-button> |
|||
</el-form> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
height="240" |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%; "> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" |
|||
style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
width="150" |
|||
fixed="right" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="updateModel(scope.row)">修改</a> |
|||
<a type="text" size="small" @click="deleteData(scope.row)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-dialog |
|||
width="600px" |
|||
:title="!dataForm.id ? '添加' :'编辑'" |
|||
:close-on-click-modal="false" |
|||
:visible.sync="visible"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole"> |
|||
<el-form-item :label="'项目料号'"> |
|||
<el-input v-model="dataForm.testPartNo" style="width: 130px" disabled></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="partTypeDesc" :rules="dataRole.partTypeDesc"> |
|||
<span slot="label" style="" @click="getBaseList(1013,1)"><a herf="#">物料类型</a></span> |
|||
<el-input v-model="dataForm.partTypeDesc" style="width: 130px" readonly @focus="getBaseList(1013,1)" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole"> |
|||
<el-form-item :label="'物料名称'" prop="partName" :rules="dataRole.partName"> |
|||
<el-input v-model="dataForm.partName" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'物料描述'"> |
|||
<el-input v-model="dataForm.partDesc" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'物料描述'"> |
|||
<el-input v-model="dataForm.partSpec" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'物料图号'"> |
|||
<el-input v-model="dataForm.materialNumber" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'备注'"> |
|||
<el-input v-model="dataForm.remark" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="saveData()">{{'确定'}}</el-button> |
|||
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
getProjectInfoPartList, |
|||
saveProjectPart, |
|||
deleteProjectPartWithId, |
|||
} from "@/api/project/project.js" |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
export default { |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data() { |
|||
return { |
|||
dataList: [], |
|||
searchData: { |
|||
site: '', |
|||
username: this.$store.state.user.name, |
|||
projectId: '', |
|||
}, |
|||
visible:false, |
|||
dataListLoading: false, |
|||
currentRow:'', |
|||
columnList:[ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4TestPartNo', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "testPartNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4PartType', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "partType", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料分类", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 60 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4PartTypeDesc', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "partTypeDesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料分类名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4PartName', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "partName", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4PartDesc', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "partDesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料描述", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4PartSpec', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "partSpec", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "规格型号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4MaterialNumber', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "materialNumber", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料图号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4Remark', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "remark", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "备注", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4CreateDate', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "createDate", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "创建时间", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 160 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4CreateBy', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "createBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "创建人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4UpdateDate', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "updateDate", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "上次修改日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 160 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 101002003, |
|||
serialNumber: '101002003Table4UpdateBy', |
|||
tableId: "101002003Table4", |
|||
tableName: "项目物料", |
|||
columnProp: "updateBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "修改人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
], |
|||
dataForm:{ |
|||
id:'', |
|||
site: '', |
|||
projectId: '', |
|||
testPartNo:'', |
|||
partType:'', |
|||
partTypeDesc:'', |
|||
partName:'', |
|||
partDesc:'', |
|||
partSpec:'', |
|||
remark:'', |
|||
materialNumber:'', |
|||
username:'', |
|||
}, |
|||
dataRole: { |
|||
partTypeDesc: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
partName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.tagNo1 = type |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 1013) { |
|||
if(type==1) { |
|||
strVal = this.dataForm.partType |
|||
} |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 1013) { |
|||
if(this.tagNo1==1) { |
|||
this.dataForm.partType = val.Base_id |
|||
this.dataForm.partTypeDesc = val.Base_desc |
|||
} |
|||
} |
|||
}, |
|||
//初始化组件的参数 |
|||
init(inData) { |
|||
//初始化参数 |
|||
this.searchData = JSON.parse(JSON.stringify(inData)); |
|||
//刷新表格 |
|||
this.searchTable(); |
|||
|
|||
}, |
|||
searchTable(){ |
|||
getProjectInfoPartList(this.searchData).then(({data}) => { |
|||
//区分请求成功和失败的状况 |
|||
if (data && data.code == 0) { |
|||
this.dataList = data.rows; |
|||
} else { |
|||
this.dataList = []; |
|||
} |
|||
}); |
|||
}, |
|||
addModal(){ |
|||
if(this.searchData.projectId==""||this.searchData.projectId==null){ |
|||
this.$alert('请选择项目!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
this.dataForm={ |
|||
id:0, |
|||
site: this.searchData.site, |
|||
projectId: this.searchData.projectId, |
|||
testPartNo:'', |
|||
partType:'', |
|||
partTypeDesc:'', |
|||
partName:'', |
|||
partDesc:'', |
|||
partSpec:'', |
|||
remark:'', |
|||
materialNumber:'', |
|||
username:this.$store.state.user.name, |
|||
} |
|||
this.visible=true; |
|||
}, |
|||
updateModel(row){ |
|||
this.dataForm={ |
|||
id:row.id, |
|||
site: row.site, |
|||
projectId: row.projectId, |
|||
testPartNo:row.testPartNo, |
|||
partType:row.partType, |
|||
partTypeDesc:row.partTypeDesc, |
|||
partName:row.partName, |
|||
partDesc:row.partDesc, |
|||
partSpec:row.partSpec, |
|||
remark:row.remark, |
|||
materialNumber:row.materialNumber, |
|||
username:this.$store.state.user.name, |
|||
} |
|||
this.visible=true; |
|||
}, |
|||
saveData(){ |
|||
if(this.dataForm.partType==''||this.dataForm.partType==null){ |
|||
this.$alert('请选择物料类别!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.partName==''||this.dataForm.partName==null){ |
|||
this.$alert('请输入物料名称!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
saveProjectPart(this.dataForm).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success( '操作成功') |
|||
this.visible = false |
|||
this.searchTable(); |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}, |
|||
deleteData(){ |
|||
this.$confirm('确定要删除这条数据?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
deleteProjectPartWithId(this.dataForm).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success( '操作成功') |
|||
this.searchTable(); |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
|
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,696 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-dialog |
|||
width="600px" |
|||
:title="!dataForm.id ? '添加' :'编辑'" |
|||
:close-on-click-modal="false" |
|||
:visible.sync="visible"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="projectRole"> |
|||
<el-form-item :label="'项目层级'" prop="projectLevel" :rules="projectRole.projectLevel"> |
|||
<el-select v-model="dataForm.projectLevel" style="width: 130px"> |
|||
<el-option label="一级" value=1></el-option> |
|||
<el-option label="二级" value=2></el-option> |
|||
<el-option label="三级" value=3></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
|
|||
<el-form-item :label="'项目号'"> |
|||
<el-input v-model="dataForm.projectId" style="width: 130px" disabled></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="projectType" :rules="projectRole.projectType"> |
|||
<span slot="label" style="" @click="getBaseList(1010,1)"><a herf="#">项目类型</a></span> |
|||
<el-input v-model="dataForm.projectType" style="width: 130px" readonly @focus="getBaseList(1010,1)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item prop="customerName" :rules="projectRole.customerName"> |
|||
<span slot="label" style="" @click="getBaseList(102,1)"><a herf="#">所属客户</a></span> |
|||
<el-input v-model="dataForm.customerName" style="width: 130px" readonly @focus="getBaseList(102,1)"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="projectRole"> |
|||
<el-form-item :label="'项目名称'" prop="projectName" :rules="projectRole.projectName"> |
|||
<el-input v-model="dataForm.projectName" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'项目描述'" > |
|||
<el-input v-model="dataForm.projectDesc" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="projectRole"> |
|||
<el-form-item prop="projectSourceDesc" :rules="projectRole.projectSourceDesc"> |
|||
<span slot="label" style="" @click="getBaseList(1011,1)"><a herf="#">项目来源</a></span> |
|||
<el-input v-model="dataForm.projectSourceDesc" style="width: 130px" readonly @focus="getBaseList(1011,1)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item prop="priorityDesc" :rules="projectRole.priorityDesc"> |
|||
<span slot="label" style="" @click="getBaseList(1012,1)"><a herf="#">优先级</a></span> |
|||
<el-input v-model="dataForm.priorityDesc" style="width: 130px" readonly @focus="getBaseList(1012,1)"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'要求日期:'" prop="needDate" :rules="projectRole.needDate"> |
|||
<el-date-picker |
|||
style="width: 130px" |
|||
v-model="dataForm.needDate" |
|||
type="date" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期"> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="projectRole"> |
|||
<el-form-item prop="projectManagerName" :rules="projectRole.projectManagerName"> |
|||
<span slot="label" style="" @click="managerChooseModal()"><a herf="#">项目经理</a></span> |
|||
<el-input v-model="dataForm.projectManagerName" readonly style="width: 274px" @focus="managerChooseModal()"></el-input> |
|||
</el-form-item> |
|||
<el-form-item prop="projectOwnerName" :rules="projectRole.projectOwnerName"> |
|||
<span slot="label" style="" @click="ownerChooseModal()"><a herf="#">项目负责人</a></span> |
|||
<el-input v-model="dataForm.projectOwnerName" readonly style="width: 274px" @focus="ownerChooseModal()"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'客户应用/要求'"> |
|||
<el-input v-model="dataForm.customerRemark" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'其他要求'"> |
|||
<el-input v-model="dataForm.remark" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="projectRole"> |
|||
<el-form-item prop="userRoleName" :rules="projectRole.userRoleName"> |
|||
<span slot="label" style="" @click="userRollModal()"><a herf="#">项目权限</a></span> |
|||
<el-input v-model="dataForm.userRoleName" style="width: 562px" @focus="userRollModal()"></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="dataFormSubmit()">{{'确定'}}</el-button> |
|||
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<el-dialog |
|||
width="530px" |
|||
title="项目经理" |
|||
:close-on-click-modal="false" |
|||
:visible.sync="managerFlag"> |
|||
<el-transfer v-model="projectManagerList" :props="{ |
|||
key: 'operatorId', |
|||
label: 'operatorName' |
|||
}" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<div style="margin-top: 5px"> |
|||
<el-button type="primary" @click="saveManagerList()">确定</el-button> |
|||
<el-button @click="managerFlag = false" type="primary">取消</el-button> |
|||
</div> |
|||
</span> |
|||
</el-dialog> |
|||
|
|||
<el-dialog |
|||
width="530px" |
|||
title="项目负责人" |
|||
:close-on-click-modal="false" |
|||
:visible.sync="ownerFlag"> |
|||
<el-transfer v-model="projectOwnerList" :props="{ |
|||
key: 'operatorId', |
|||
label: 'operatorName' |
|||
}" :data="operatorList" :titles="['未选择', '已选择']"></el-transfer> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<div style="margin-top: 5px"> |
|||
<el-button type="primary" @click="saveOwnerList()">确定</el-button> |
|||
<el-button @click="ownerFlag = false" type="primary">取消</el-button> |
|||
</div> |
|||
</span> |
|||
</el-dialog> |
|||
|
|||
<el-dialog |
|||
width="530px" |
|||
title="权限" |
|||
:close-on-click-modal="false" |
|||
:visible.sync="userRoleFlag"> |
|||
<el-table |
|||
:data="userRoleList" |
|||
border |
|||
:height="300" |
|||
v-loading="false" |
|||
style="width: 100%;"> |
|||
<el-table-column |
|||
prop="username" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="35" |
|||
label="账号"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="userDisplay" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="35" |
|||
label="姓名"> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="30" |
|||
label=""> |
|||
<template slot-scope="scope"> |
|||
<!-- 如果数据为Y,显示勾选框,否则不勾选 --> |
|||
<el-checkbox v-model="scope.row.checkAll" @change="changeAll(scope.row)"></el-checkbox> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="30" |
|||
label="查询"> |
|||
<template slot-scope="scope"> |
|||
<!-- 如果数据为Y,显示勾选框,否则不勾选 --> |
|||
<el-checkbox v-model="scope.row.searchCheck" @change="changeCheck(scope.row,1)"></el-checkbox> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="30" |
|||
label="修改"> |
|||
<template slot-scope="scope"> |
|||
<!-- 如果数据为Y,显示勾选框,否则不勾选 --> |
|||
<el-checkbox v-model="scope.row.updateCheck" @change="changeCheck(scope.row,2)"></el-checkbox> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="30" |
|||
label="下载"> |
|||
<template slot-scope="scope"> |
|||
<!-- 如果数据为Y,显示勾选框,否则不勾选 --> |
|||
<el-checkbox v-model="scope.row.downCheck" @change="changeCheck(scope.row,3)"></el-checkbox> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
prop="" |
|||
header-align="center" |
|||
align="center" |
|||
min-width="30" |
|||
label="删除"> |
|||
<template slot-scope="scope"> |
|||
<!-- 如果数据为Y,显示勾选框,否则不勾选 --> |
|||
<el-checkbox v-model="scope.row.deleteCheck" @change="changeCheck(scope.row,4)"></el-checkbox> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<span slot="footer" class="dialog-footer"> |
|||
<div style="margin-top: 5px"> |
|||
<el-button type="primary" @click="saveUserList()">确定</el-button> |
|||
<el-button @click="userRoleFlag = false" type="primary">取消</el-button> |
|||
</div> |
|||
</span> |
|||
</el-dialog> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {projectInfoSearch, |
|||
searchOperatorWithSite, |
|||
searchProjectTeamStr, |
|||
searchUserRoll, |
|||
saveProjectInfo, |
|||
} from "@/api/project/project.js" |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
export default { |
|||
components: { |
|||
Chooselist |
|||
}, |
|||
data () { |
|||
return { |
|||
tagNo:'', |
|||
tagNo1:'', |
|||
visible: false, |
|||
treeVisible: false, |
|||
managerFlag:false, |
|||
userRoleFlag:false, |
|||
ownerFlag:false, |
|||
operatorList:[], |
|||
dataForm: { |
|||
id: 0, |
|||
site:this.$store.state.user.site, |
|||
projectLevel:1, |
|||
projectId:'', |
|||
projectTypeDb:'', |
|||
projectType:'', |
|||
customerName:'', |
|||
customerId:'', |
|||
projectName:'', |
|||
projectDesc:'', |
|||
needDate:'', |
|||
priority:'', |
|||
projectSource:'', |
|||
priorityDesc:'', |
|||
projectSourceDesc:'', |
|||
projectManagerName:'', |
|||
projectOwnerName:'', |
|||
customerRemark:'', |
|||
remark:'', |
|||
userRoleName:'', |
|||
projectManagerList:[], |
|||
projectOwnerList:[], |
|||
userRoleList:[], |
|||
}, |
|||
projectManagerList:[], |
|||
projectOwnerList:[], |
|||
userRoleList:[], |
|||
projectRole: { |
|||
projectLevel: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
projectType: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
customerName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
projectName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
projectSourceDesc: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
priorityDesc: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
needDate: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
projectManagerName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
projectOwnerName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
userRoleName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
} |
|||
} |
|||
}, |
|||
created () { |
|||
|
|||
}, |
|||
methods: { |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.tagNo1 = type |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 1010) { |
|||
if(type==1) { |
|||
strVal = this.dataForm.projectTypeDb |
|||
} |
|||
} |
|||
if (val === 102) { |
|||
if(type==1) { |
|||
strVal = this.dataForm.customerId |
|||
} |
|||
} |
|||
if (val === 1011) { |
|||
if(type==1) { |
|||
strVal = this.dataForm.projectSource |
|||
} |
|||
} |
|||
if (val === 1012) { |
|||
if(type==1) { |
|||
strVal = this.dataForm.priority |
|||
} |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 1010) { |
|||
if(this.tagNo1==1) { |
|||
this.dataForm.projectTypeDb = val.Base_id |
|||
this.dataForm.projectType = val.Base_desc |
|||
} |
|||
} |
|||
if (this.tagNo === 102) { |
|||
if(this.tagNo1==1) { |
|||
this.dataForm.customerId = val.Customer_no |
|||
this.dataForm.customerName = val.Customer_desc |
|||
} |
|||
} |
|||
if (this.tagNo === 1011) { |
|||
if(this.tagNo1==1) { |
|||
this.dataForm.projectSource = val.Base_id |
|||
this.dataForm.projectSourceDesc = val.Base_desc |
|||
} |
|||
} |
|||
if (this.tagNo === 1012) { |
|||
if(this.tagNo1==1) { |
|||
this.dataForm.priority = val.Base_id |
|||
this.dataForm.priorityDesc = val.Base_desc |
|||
} |
|||
} |
|||
}, |
|||
init (id) { |
|||
this.dataForm.id = id || 0 |
|||
if(this.dataForm.id!=0){ |
|||
let inData={ |
|||
page: 1, |
|||
limit: 10, |
|||
id:id |
|||
} |
|||
projectInfoSearch(inData).then(({data}) => { |
|||
if(data.page.list.length>0){ |
|||
this.dataForm= data.page.list[0]; |
|||
let inData={ |
|||
site:this.dataForm.site, |
|||
projectId:this.dataForm.projectId, |
|||
type:'manager', |
|||
} |
|||
searchProjectTeamStr(inData).then(({data}) => { |
|||
this.dataForm.projectManagerList=data.rows |
|||
}) |
|||
let inData2={ |
|||
site:this.dataForm.site, |
|||
projectId:this.dataForm.projectId, |
|||
type:'owner', |
|||
} |
|||
searchProjectTeamStr(inData2).then(({data}) => { |
|||
this.dataForm.projectOwnerList=data.rows |
|||
}) |
|||
let inData3={ |
|||
site:this.dataForm.site, |
|||
projectId:this.dataForm.projectId, |
|||
} |
|||
searchUserRoll(inData3).then(({data}) => { |
|||
this.dataForm.userRoleList=data.rows |
|||
}) |
|||
} |
|||
}) |
|||
}else { |
|||
this.dataForm={ |
|||
id: 0, |
|||
site:this.$store.state.user.site, |
|||
projectLevel:1, |
|||
projectId:'', |
|||
projectTypeDb:'', |
|||
projectType:'', |
|||
customerName:'', |
|||
customerId:'', |
|||
projectName:'', |
|||
projectDesc:'', |
|||
needDate:'', |
|||
priority:'', |
|||
projectSource:'', |
|||
priorityDesc:'', |
|||
projectSourceDesc:'', |
|||
projectManagerName:'', |
|||
projectOwnerName:'', |
|||
customerRemark:'', |
|||
remark:'', |
|||
userRoleName:'', |
|||
projectManagerList:[], |
|||
projectOwnerList:[], |
|||
} |
|||
let inData={ |
|||
site:this.dataForm.site, |
|||
projectId:this.dataForm.projectId, |
|||
} |
|||
searchUserRoll(inData).then(({data}) => { |
|||
this.dataForm.userRoleList=data.rows |
|||
}) |
|||
} |
|||
this.visible = true |
|||
}, |
|||
|
|||
managerChooseModal(){ |
|||
let inData={ |
|||
site:this.dataForm.site, |
|||
projectId:this.dataForm.projectId, |
|||
} |
|||
searchOperatorWithSite(inData).then(({data}) => { |
|||
this.operatorList=data.rows |
|||
}) |
|||
this.projectManagerList = JSON.parse(JSON.stringify(this.dataForm.projectManagerList)); |
|||
this.managerFlag=true |
|||
}, |
|||
saveManagerList(){ |
|||
let projectManagerName=''; |
|||
for (let i = 0; i < this.projectManagerList.length; i++) { |
|||
let select= this.operatorList.filter(item => item.operatorId === this.projectManagerList[i]) |
|||
if(select.length>0){ |
|||
projectManagerName+=select[0].operatorName+';' |
|||
} |
|||
} |
|||
this.dataForm.projectManagerName=projectManagerName |
|||
this.dataForm.projectManagerList=JSON.parse(JSON.stringify(this.projectManagerList)); |
|||
this.managerFlag=false |
|||
}, |
|||
ownerChooseModal(){ |
|||
let inData={ |
|||
site:this.dataForm.site, |
|||
projectId:this.dataForm.projectId, |
|||
} |
|||
searchOperatorWithSite(inData).then(({data}) => { |
|||
this.operatorList=data.rows |
|||
}) |
|||
this.projectOwnerList = JSON.parse(JSON.stringify(this.dataForm.projectOwnerList)); |
|||
this.ownerFlag=true |
|||
}, |
|||
saveOwnerList(){ |
|||
let projectOwnerName=''; |
|||
for (let i = 0; i < this.projectOwnerList.length; i++) { |
|||
let select= this.operatorList.filter(item => item.operatorId === this.projectOwnerList[i]) |
|||
if(select.length>0){ |
|||
projectOwnerName+=select[0].operatorName+';' |
|||
} |
|||
} |
|||
this.dataForm.projectOwnerName=projectOwnerName |
|||
this.dataForm.projectOwnerList=JSON.parse(JSON.stringify(this.projectOwnerList)); |
|||
this.ownerFlag=false |
|||
}, |
|||
userRollModal(){ |
|||
this.userRoleList=JSON.parse(JSON.stringify(this.dataForm.userRoleList)); |
|||
this.userRoleFlag=true |
|||
}, |
|||
saveUserList(){ |
|||
console.log(this.userRoleList) |
|||
let name= ''; |
|||
for (let i = 0; i < this.userRoleList.length; i++) { |
|||
if(this.userRoleList[i].searchCheck||this.userRoleList[i].updateCheck||this.userRoleList[i].downCheck||this.userRoleList[i].deleteCheck){ |
|||
name+=this.userRoleList[i].userDisplay+';' |
|||
} |
|||
} |
|||
this.dataForm.userRoleName=name |
|||
this.dataForm.userRoleList=JSON.parse(JSON.stringify(this.userRoleList)); |
|||
this.userRoleFlag=false |
|||
}, |
|||
changeAll(row){ |
|||
if(row.checkAll){ |
|||
row.searchCheck=true; |
|||
row.updateCheck=true; |
|||
row.downCheck=true; |
|||
row.deleteCheck=true; |
|||
row.searchFlag='Y' |
|||
row.updateFlag='Y' |
|||
row.downFlag='Y' |
|||
row.deleteFlag='Y' |
|||
}else { |
|||
row.searchCheck=false; |
|||
row.updateCheck=false; |
|||
row.downCheck=false; |
|||
row.deleteCheck=false; |
|||
row.searchFlag='N' |
|||
row.updateFlag='N' |
|||
row.downFlag='N' |
|||
row.deleteFlag='N' |
|||
} |
|||
}, |
|||
changeCheck(row,type){ |
|||
if(type==1){ |
|||
if(row.searchCheck){ |
|||
row.searchFlag='Y' |
|||
}else { |
|||
row.searchFlag='N' |
|||
} |
|||
} |
|||
if(type==2){ |
|||
if(row.updateCheck){ |
|||
row.updateFlag='Y' |
|||
}else { |
|||
row.updateFlag='N' |
|||
} |
|||
} |
|||
if(type==3){ |
|||
if(row.downCheck){ |
|||
row.downFlag='Y' |
|||
}else { |
|||
row.downFlag='N' |
|||
} |
|||
} |
|||
if(type==4){ |
|||
if(row.deleteCheck){ |
|||
row.deleteFlag='Y' |
|||
}else { |
|||
row.deleteFlag='N' |
|||
} |
|||
} |
|||
if(row.searchCheck&&row.updateCheck&&row.downCheck&&row.deleteCheck){ |
|||
row.checkAll=true |
|||
}else{ |
|||
row.checkAll=false |
|||
} |
|||
this.$forceUpdate(); |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmit () { |
|||
if(this.dataForm.projectTypeDb==''||this.dataForm.projectTypeDb==null){ |
|||
this.$alert('请选择项目类型!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.customerId==''||this.dataForm.customerId==null){ |
|||
this.$alert('请选择所属客户!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.projectName==''||this.dataForm.projectName==null){ |
|||
this.$alert('请输入项目名称!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.projectSource==''||this.dataForm.projectSource==null){ |
|||
this.$alert('请选择项目来源!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.priority==''||this.dataForm.priority==null){ |
|||
this.$alert('请选择优先级!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.needDate==''||this.dataForm.needDate==null){ |
|||
this.$alert('请选择要求日期!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.projectManagerName==''||this.dataForm.projectManagerName==null){ |
|||
this.$alert('请选择项目经理!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.projectOwnerName==''||this.dataForm.projectOwnerName==null){ |
|||
this.$alert('请选择项目负责人!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.userRoleName==''||this.dataForm.userRoleName==null){ |
|||
this.$alert('请选择权限!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
saveProjectInfo(this.dataForm).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success( '操作成功') |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
|
|||
}, |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style > |
|||
.el-transfer-panel { |
|||
border: 2px solid #17b3a3; |
|||
border-radius: 4px; |
|||
overflow: hidden; |
|||
background: #fff; |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
width: 200px; |
|||
max-height: 100%; |
|||
-webkit-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
position: relative; |
|||
} |
|||
|
|||
.el-transfer-panel .el-transfer-panel__header { |
|||
height: 40px; |
|||
line-height: 40px; |
|||
background: #17b3a3; |
|||
margin: 0; |
|||
padding-left: 15px; |
|||
border-bottom: 1px solid #17b3a3; |
|||
-webkit-box-sizing: border-box; |
|||
box-sizing: border-box; |
|||
color: #000; |
|||
} |
|||
|
|||
.el-transfer-panel .el-transfer-panel__header .el-checkbox .el-checkbox__label { |
|||
font-size: 14px; |
|||
color: #303133; |
|||
font-weight: 400; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,606 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 0px;"> |
|||
<el-form-item :label="'参数卡编码'"> |
|||
<el-input v-model="searchData.projectId" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item > |
|||
<span slot="label" style="" @click="getBaseList(1010,1)"><a herf="#">测试料号</a></span> |
|||
<el-input v-model="searchData.projectType" style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'状态'"> |
|||
<el-input v-model="searchData.projectOwnerName" style="width: 130px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label=" "> |
|||
<el-button @click="search()" type="primary" style="margin-left: 2px;margin-top:0px">查询</el-button> |
|||
<el-button @click="addOrUpdateHandle()" type="primary" style="margin-left: 2px;margin-top: 0px">新增</el-button> |
|||
<download-excel |
|||
:fields="fields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{ '导出' }} |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table |
|||
:data="dataList" |
|||
:height="height" |
|||
border |
|||
v-loading="dataListLoading" |
|||
style="width: 100%; "> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList1" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column |
|||
header-align="center" |
|||
align="center" |
|||
width="150" |
|||
fixed="right" |
|||
label="操作"> |
|||
<template slot-scope="scope"> |
|||
<a type="text" size="small" @click="updateModel(scope.row)">修改</a> |
|||
<a type="text" size="small" @click="deleteData(scope.row)">删除</a> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
@size-change="sizeChangeHandle" |
|||
@current-change="currentChangeHandle" |
|||
:current-page="pageIndex" |
|||
:page-sizes="[20, 50, 100, 1000]" |
|||
:page-size="pageSize" |
|||
:total="totalPage" |
|||
layout="total, sizes, prev, pager, next, jumper"> |
|||
</el-pagination> |
|||
<el-dialog |
|||
width="600px" |
|||
:title="!dataForm.id ? '添加' :'编辑'" |
|||
:close-on-click-modal="false" |
|||
:visible.sync="visible"> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole"> |
|||
<el-form-item :label="'项目料号'"> |
|||
<el-input v-model="dataForm.testPartNo" style="width: 130px" disabled></el-input> |
|||
</el-form-item> |
|||
|
|||
<el-form-item prop="partTypeDesc" :rules="dataRole.partTypeDesc"> |
|||
<span slot="label" style="" @click="getBaseList(1013,1)"><a herf="#">物料类型</a></span> |
|||
<el-input v-model="dataForm.partTypeDesc" style="width: 130px" readonly @focus="getBaseList(1013,1)" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" :rules="dataRole"> |
|||
<el-form-item :label="'物料名称'" prop="partName" :rules="dataRole.partName"> |
|||
<el-input v-model="dataForm.partName" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'物料描述'"> |
|||
<el-input v-model="dataForm.partDesc" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'物料描述'"> |
|||
<el-input v-model="dataForm.partSpec" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'物料图号'"> |
|||
<el-input v-model="dataForm.materialNumber" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-form :inline="true" label-position="top" label-width="100px" > |
|||
<el-form-item :label="'备注'"> |
|||
<el-input v-model="dataForm.remark" style="width: 562px" ></el-input> |
|||
</el-form-item> |
|||
</el-form> |
|||
<span slot="footer" class="dialog-footer"> |
|||
<el-button type="primary" @click="saveData()">{{'确定'}}</el-button> |
|||
<el-button type="primary" @click="visible = false">{{'关闭'}}</el-button> |
|||
</span> |
|||
</el-dialog> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="search" v-drag></add-or-update> |
|||
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
technicalSpecificationListSearch, |
|||
|
|||
} from "@/api/sampleManagement/technicalSpecificationList.js" |
|||
import Chooselist from '@/views/modules/common/Chooselist' |
|||
import AddOrUpdate from './technicalSpecificationList' |
|||
export default { |
|||
components: { |
|||
Chooselist, |
|||
AddOrUpdate, |
|||
}, |
|||
data() { |
|||
return { |
|||
addOrUpdateVisible:false, |
|||
height:200, |
|||
dataList: [], |
|||
searchData: { |
|||
page: 1, |
|||
limit: 100, |
|||
site: this.$store.state.user.site, |
|||
username: this.$store.state.user.name, |
|||
projectId: '', |
|||
}, |
|||
pageIndex: 1, |
|||
pageSize: 100, |
|||
totalPage: 0, |
|||
visible:false, |
|||
dataListLoading: false, |
|||
currentRow:'', |
|||
columnList1:[ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1CodeNo', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "codeNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "参数卡编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1Status', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "statusDesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "状态", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1FinalPartNo', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "finalPartNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "最终产品编码", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1TestPartNo', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "testPartNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "项目料号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1PartName', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "partDesc", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "物料名称", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1RevNo', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "revNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "版本号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1ECNFlag', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "ecnFlag", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "ECN变更", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1EcnNo', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "ecnNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "ECN单据号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1ProofingNo', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "proofingNo", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "打样申请单号", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1CreateDate', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "createDate", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "创建时间", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1CreateBy', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "createBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "创建人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1UpdateDate', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "updateDate", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "上次修改日期", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1UpdateBy', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "updateBy", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "修改人", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
},{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 103002, |
|||
serialNumber: '103002Table1ecnAddress', |
|||
tableId: "103002Table1", |
|||
tableName: "技术参数卡列表", |
|||
columnProp: "ecnAddress", |
|||
headerAlign: "center", |
|||
align: "left", |
|||
columnLabel: "ECN文档链接", |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 200 |
|||
}, |
|||
], |
|||
dataForm:{ |
|||
id:'', |
|||
site: '', |
|||
projectId: '', |
|||
testPartNo:'', |
|||
partType:'', |
|||
partTypeDesc:'', |
|||
partName:'', |
|||
partDesc:'', |
|||
partSpec:'', |
|||
remark:'', |
|||
materialNumber:'', |
|||
username:'', |
|||
}, |
|||
dataRole: { |
|||
partTypeDesc: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
partName: [ |
|||
{ |
|||
required: true, |
|||
message: ' ', |
|||
trigger: 'change' |
|||
} |
|||
], |
|||
}, |
|||
// 导出 start |
|||
exportData: [], |
|||
exportName: '技术参数卡清单'+this.dayjs().format('YYYYMMDDHHmmss'), |
|||
exportHeader: ["技术参数卡清单"], |
|||
exportFooter: [], |
|||
// 导出 end |
|||
} |
|||
}, |
|||
mounted() { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight - 520; |
|||
}) |
|||
}, |
|||
methods: { |
|||
// 每页数 |
|||
sizeChangeHandle (val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.search() |
|||
}, |
|||
// 当前页 |
|||
currentChangeHandle (val) { |
|||
this.pageIndex = val |
|||
this.search() |
|||
}, |
|||
search(){ |
|||
this.searchData.limit = this.pageSize |
|||
this.searchData.page = this.pageIndex |
|||
technicalSpecificationListSearch(this.searchData).then(({data}) => { |
|||
if (data.code == 0) { |
|||
this.dataList1 = data.page.list |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
this.totalPage = data.page.totalCount |
|||
} |
|||
this.dataListLoading = false |
|||
}) |
|||
}, |
|||
// 获取基础数据列表S |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.tagNo1 = type |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 1013) { |
|||
if(type==1) { |
|||
strVal = this.dataForm.partType |
|||
} |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/* 列表方法的回调 */ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 1013) { |
|||
if(this.tagNo1==1) { |
|||
this.dataForm.partType = val.Base_id |
|||
this.dataForm.partTypeDesc = val.Base_desc |
|||
} |
|||
} |
|||
}, |
|||
// 新增 / 修改 |
|||
addOrUpdateHandle (id) { |
|||
this.addOrUpdateVisible = true |
|||
this.$nextTick(() => { |
|||
this.$refs.addOrUpdate.init(id) |
|||
}) |
|||
}, |
|||
addModal(){ |
|||
if(this.searchData.projectId==""||this.searchData.projectId==null){ |
|||
this.$alert('请选择项目!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
this.dataForm={ |
|||
id:0, |
|||
site: this.searchData.site, |
|||
projectId: this.searchData.projectId, |
|||
testPartNo:'', |
|||
partType:'', |
|||
partTypeDesc:'', |
|||
partName:'', |
|||
partDesc:'', |
|||
partSpec:'', |
|||
remark:'', |
|||
materialNumber:'', |
|||
username:this.$store.state.user.name, |
|||
} |
|||
this.visible=true; |
|||
}, |
|||
updateModel(row){ |
|||
this.dataForm={ |
|||
id:row.id, |
|||
site: row.site, |
|||
projectId: row.projectId, |
|||
testPartNo:row.testPartNo, |
|||
partType:row.partType, |
|||
partTypeDesc:row.partTypeDesc, |
|||
partName:row.partName, |
|||
partDesc:row.partDesc, |
|||
partSpec:row.partSpec, |
|||
remark:row.remark, |
|||
materialNumber:row.materialNumber, |
|||
username:this.$store.state.user.name, |
|||
} |
|||
this.visible=true; |
|||
}, |
|||
saveData(){ |
|||
if(this.dataForm.partType==''||this.dataForm.partType==null){ |
|||
this.$alert('请选择物料类别!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
if(this.dataForm.partName==''||this.dataForm.partName==null){ |
|||
this.$alert('请输入物料名称!', '错误', { |
|||
confirmButtonText: '确定' |
|||
}) |
|||
return false; |
|||
} |
|||
saveProjectPart(this.dataForm).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success( '操作成功') |
|||
this.visible = false |
|||
this.searchTable(); |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}, |
|||
deleteData(){ |
|||
this.$confirm('确定要删除这条数据?', '提示', { |
|||
confirmButtonText: '确定', |
|||
cancelButtonText: '取消', |
|||
type: 'warning' |
|||
}).then(() => { |
|||
deleteProjectPartWithId(this.dataForm).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.$message.success( '操作成功') |
|||
this.searchTable(); |
|||
} else { |
|||
this.$message.error(data.msg) |
|||
} |
|||
}) |
|||
}).catch(() => { |
|||
}) |
|||
}, |
|||
//导出excel |
|||
createExportData() { |
|||
|
|||
return this.dataList; |
|||
|
|||
}, |
|||
startDownload() { |
|||
// this.exportData = this.dataList |
|||
|
|||
}, |
|||
finishDownload() { |
|||
}, |
|||
fields() { |
|||
let json = "{" |
|||
this.columnList1.forEach((item, index) => { |
|||
if (index == this.columnList1.length - 1) { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" |
|||
} else { |
|||
json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + "," |
|||
} |
|||
}) |
|||
json += "}" |
|||
let s = eval("(" + json + ")") |
|||
|
|||
return s |
|||
}, |
|||
}, |
|||
} |
|||
</script> |
|||
|
|||
<style scoped> |
|||
|
|||
</style> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue