Browse Source

收藏夹+demo

master
ruanqi 2 years ago
parent
commit
4d71edeaa7
  1. 2
      src/api/project/project.js
  2. 22
      src/views/modules/project/projectInfo/projectInfo.vue
  3. 420
      src/views/modules/project/projectInfo/project_info_part.vue
  4. 2
      src/views/modules/project/projectInfo/project_upload_file.vue

2
src/api/project/project.js

@ -28,3 +28,5 @@ export const getCustomerContactData = data => createAPI(`/project/getCustomerCon
export const getContactChooseData= data => createAPI(`/project/getContactChooseData`,'post',data)
export const saveProjectContactList= data => createAPI(`/project/saveProjectContactList`,'post',data)
export const deleteProjectInfo= data => createAPI(`/project/deleteProjectInfo`,'post',data)
export const getProjectInfoPartList= data => createAPI(`/project/getProjectInfoPartList`,'post',data)
export const saveProjectPart= data => createAPI(`/project/saveProjectPart`,'post',data)

22
src/views/modules/project/projectInfo/projectInfo.vue

@ -216,6 +216,9 @@
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="项目物料" name="part">
<projectPart ref="projectPart" @refreshPageTables="getFileContentData()" ></projectPart>
</el-tab-pane>
</el-tabs>
<el-dialog
width="530px"
@ -261,10 +264,14 @@
deleteProjectInfo,
} from "@/api/project/project.js"
import projectUploadFile from "./project_upload_file";/*上传文件的組件*/
import projectPart from "./project_info_part";/*組件*/
export default {
components: {
Chooselist,AddOrUpdate,
Chooselist,
AddOrUpdate,
projectUploadFile,
projectPart,
},
name: "null",
data() {
@ -961,7 +968,7 @@
},
addUploadFileModal(){
let currentData = {
site: this.$store.state.user.site,
site: this.currentRow.site,
createBy: this.$store.state.user.name,
projectId: this.currentRow.projectId,
projectName: this.currentRow.projectName,
@ -1005,6 +1012,17 @@
if (this.activeName == 'customer_contact') {
this.getCustomerContactData();
}
if (this.activeName == 'part') {
this.refreshPartTable();
}
},
refreshPartTable(){
let inData={
site: this.currentRow.site,
projectId: this.currentRow.projectId,
username:this.$store.state.user.name
}
this.$refs.projectPart.init(inData)
},
//
getFileContentData() {

420
src/views/modules/project/projectInfo/project_info_part.vue

@ -0,0 +1,420 @@
<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>
<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" >
<el-form-item :label="'项目料号'">
<el-input v-model="dataForm.testPartNo" style="width: 130px" disabled></el-input>
</el-form-item>
<el-form-item >
<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" >
<el-form-item :label="'物料名称'">
<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,
} 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: '101002003Table3TestPartNo',
tableId: "101002003Table3",
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: '101002003Table3PartType',
tableId: "101002003Table3",
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: '101002003Table3PartTypeDesc',
tableId: "101002003Table3",
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: '101002003Table3PartName',
tableId: "101002003Table3",
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: '101002003Table3PartDesc',
tableId: "101002003Table3",
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: '101002003Table3PartSpec',
tableId: "101002003Table3",
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: '101002003Table3MaterialNumber',
tableId: "101002003Table3",
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: '101002003Table3Remark',
tableId: "101002003Table3",
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: '101002003Table3CreateDate',
tableId: "101002003Table3",
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: '101002003Table3CreateBy',
tableId: "101002003Table3",
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: '101002003Table3UpdateDate',
tableId: "101002003Table3",
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: '101002003Table3UpdateBy',
tableId: "101002003Table3",
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:'',
},
}
},
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 = [];
}
});
},
/*关闭modal*/
closeDialog(){
//
this.$emit('refreshPageTables');
//
this.visible = false;
},
addModal(){
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;
},
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)
}
})
},
},
}
</script>
<style scoped>
</style>

2
src/views/modules/project/projectInfo/project_upload_file.vue

@ -1,6 +1,6 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="500px" style="height: 650px;" class="customer-dialog">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="400px" style="" class="customer-dialog">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<el-col :span="12">

Loading…
Cancel
Save