制造部创建项目

This commit is contained in:
Sirio
2019-04-12 08:14:24 +08:00
parent 61c767461b
commit 9911c206a0
5 changed files with 510 additions and 1 deletions

View File

@@ -7,7 +7,8 @@ const os = require('os')
const networkInterfaces = os.networkInterfaces() const networkInterfaces = os.networkInterfaces()
const ip = networkInterfaces['WLAN'][1] ? networkInterfaces['WLAN'][1].address : networkInterfaces['WLAN'][0].address // const ip = networkInterfaces['WLAN'][1] ? networkInterfaces['WLAN'][1].address : networkInterfaces['WLAN'][0].address
const ip = '127.0.0.1'
module.exports = { module.exports = {
dev: { dev: {
// Paths // Paths

View File

@@ -0,0 +1,101 @@
import request from '@/utils/request'
export function initProject() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_项目名称_制造部_查询'
}
})
}
export function searchTable1(pageCurrent, pageSize, num1, num3, num5, num6, num7, num8, num9, num10) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '合同信息管理_合同信息_制造部_查询',
param: '合同ID=' + num1 + '=int&项目流水号_check=' + num3 + '=int&开始日期_check=' + num5 + '=int&结束日期_check=' + num6 + '=int&开始日期=' + num7 + '=date&结束日期=' + num8 + '=date&机床型号_check=' + num9 + '=int&机床型号=' + num10 + '=string',
Pagination: pageCurrent + '&' + pageSize
}
})
}
export function selectMachine(code) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'PDM_机床名称_查询数据_通过项目流水号',
param: '项目流水号=' + code
}
})
}
export function addList() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '基础表_合同信息表_制造部_增加数据',
param: '项目名称=' + arguments[0] + '&备注=' + arguments[1] + '&合同签订日期=' + arguments[2]
}
})
}
export function editchar() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_合同信息_制造部_编辑',
param: '项目名称=' + arguments[0] + '&合同信息备注=' + arguments[1] + '&项目流水号=' + arguments[2] + '&合同签订日期=' + arguments[3]
}
})
}
export function delList(num) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '合同信息管理_合同信息_删除',
param: '合同ID=' + num + '=int'
}
})
}
export function submitMachine() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '创建合同_机床名称_增加数据',
param: '项目流水号=' + arguments[0] + '&机床图号=' + arguments[1] + '&机床名称=' + arguments[2] + '&机床数量=' + arguments[3]
}
})
}
export function editMachine() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '创建合同_机床名称_修改数据',
param: '机床流水号=' + arguments[0] + '&机床图号=' + arguments[1] + '&机床名称=' + arguments[2] + '&机床数量=' + arguments[3]
}
})
}
export function delMachine() {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: 'PDM_机床名称_删除数据',
param: '机床流水号=' + arguments[0]
}
})
}

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1554970691504" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1187" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M997.76 494.72l-133.12-76.8 128-72.32a32 32 0 0 0 0-55.68L704 123.52a32 32 0 0 0-32 0L512 213.76 346.88 118.4a32 32 0 0 0-32 0L26.24 284.8a32 32 0 0 0 0 55.68l133.76 76.8-128 72.32a32 32 0 0 0 0 55.68L192 635.52v114.56a32 32 0 0 0 16 27.52l288 166.4a32 32 0 0 0 32 0l288-166.4a32 32 0 1 0-32-55.68L512 880l-256-147.84v-59.52l64 39.04a32 32 0 0 0 32 0L512 620.8l166.4 96a32 32 0 0 0 32 0l106.24-64 181.12-105.6a32 32 0 0 0 0-55.68zM512 288l224 128L512 547.2l-224-128L384 362.88z m172.8-99.84l224 128-108.8 64L576 250.88z m-353.92-5.12L448 250.88l-91.52 53.12L224 380.16 106.24 312.32zM114.56 517.12l108.8-64L320 512l128 71.68-108.8 64z m579.2 135.04L576 583.68 700.16 512l99.84-57.6 117.12 67.84z" fill="#ffffff" p-id="1188"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1554970892523" class="icon" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1369" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><defs><style type="text/css"></style></defs><path d="M896.48 619.75a391.84 391.84 0 0 0 3.87-54.85 385 385 0 0 0-75.11-229.47A388.78 388.78 0 0 0 658 205.23c-6-74.94-68.91-134.08-145.37-134.08S373.4 130.18 367.29 205a388.09 388.09 0 0 0-242.85 359.9 391.53 391.53 0 0 0 4.08 56.38 145.82 145.82 0 0 0-64.66 121.1c0 80.42 65.43 145.84 145.84 145.84a145 145 0 0 0 66.1-15.86q10.39 8 21.27 15.29a388.14 388.14 0 0 0 439.38-6q7.08-5 14-10.38A145 145 0 0 0 814.3 886c80.42 0 145.84-65.43 145.84-145.84a145.8 145.8 0 0 0-63.66-120.41zM512.64 141.86A75.13 75.13 0 1 1 437.5 217a75.22 75.22 0 0 1 75.14-75.14zM134.57 742.38a75.13 75.13 0 1 1 75.13 75.13 75.22 75.22 0 0 1-75.13-75.13z m201.79 86.48c-2.1-1.4-4.18-2.84-6.24-4.3a145 145 0 0 0 25.43-82.19c0-80.42-65.43-145.84-145.84-145.84-4.36 0-8.67 0.2-12.93 0.58a321.4 321.4 0 0 1-1.62-32.22 316.29 316.29 0 0 1 184.41-288.23 145.83 145.83 0 0 0 266 0.2 316.69 316.69 0 0 1 184 288c0 10.06-0.5 20.11-1.44 30.09-4.57-0.43-9.21-0.67-13.89-0.67-80.42 0-145.84 65.43-145.84 145.84a145 145 0 0 0 26.72 84.05 317.42 317.42 0 0 1-358.81 4.64zM814.3 815.3a75.13 75.13 0 1 1 75.13-75.13 75.22 75.22 0 0 1-75.13 75.13z" p-id="1370" fill="#ffffff"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,405 @@
<template>
<div>
<el-card>
<div>
<span>项目名称</span>
<el-select v-model="entryNameValue" clearable filterable placeholder="项目名称" size="small">
<el-option
v-for="item in entryName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span style="">机床型号</span>
<el-input v-model="machine" clearable size="small" style="width:200px" placeholder="请输入机床型号"/>
</div>
<div style="margin-top: 20px">
<span style="margin-top: 20px">开始日期</span>
<el-date-picker
v-model="startTime"
style="width: 205px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择开始日期"/>
<span style="">结束日期</span>
<el-date-picker
v-model="endTime"
style="width: 205px;"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择结束日期"/>
<el-button type="success" icon="el-icon-search" size="small" style="margin-left: 10px" @click="PageSize = 10;PageCurrent = 1;fetchTableData1()">查询</el-button>
<el-button type="primary" icon="el-icon-circle-plus-outline" size="small" style="margin-left: 10px" @click="ADD()">增加</el-button>
</div>
</el-card>
<el-card>
<el-table
v-loading="listLoading"
:data="tableData1"
:row-key="getRowKeys"
:expand-row-keys="expands"
style="width: 100%"
height="500"
border
size="mini"
@expand-change="selectMachine">
<el-table-column type="expand">
<template slot-scope="scope">
<el-table :data="tableData2" border style="width: 612px; text-align: center" size="mini">
<el-table-column label="设备型号" align="center" width="150">
<template slot-scope="scope">
{{ scope.row.机床图号 }}
</template>
</el-table-column>
<el-table-column label="设备名称" align="center" width="160">
<template slot-scope="scope">
{{ scope.row.机床名称 }}
</template>
</el-table-column>
<el-table-column label="机床数量" align="center" width="100">
<template slot-scope="scope">
{{ scope.row.机床数量 }}
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="warning"
icon="el-icon-edit"
@click="editMachine(scope.row);flag = 2">编辑</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click="deleteMachine(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
</el-table-column>
<el-table-column align="center" label="合同编号">
<template slot-scope="scope">
<template>
<el-tag slot="reference">{{ scope.row.合同编号 }}</el-tag>
</template>
</template>
</el-table-column>
<el-table-column align="center" label="项目名称">
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column align="center" label="项目下达日期">
<template slot-scope="scope">
{{ scope.row.合同签订日期 }}
</template>
</el-table-column>
<el-table-column align="center" label="合同信息备注" width="200">
<template slot-scope="scope">
{{ scope.row.合同信息备注 }}
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center">
<template slot-scope="scope">
<el-button
size="mini"
type="warning"
icon="el-icon-plus"
@click.stop="addMachine(scope.row);flag = 1">机床</el-button>
<el-button
size="mini"
type="primary"
icon="el-icon-edit"
@click.stop="handleEdit(scope.row)">编辑</el-button>
<el-button
size="mini"
type="danger"
icon="el-icon-delete"
@click.stop="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
:current-page="PageCurrent"
:page-sizes="[10, 20, 30, 40]"
:page-size="PageSize"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"/>
</div>
</el-card>
<!--新增合同信息对话框-->
<el-dialog :title="title" :visible.sync="dialogFormVisible1" center style="min-height: 300px" width="400px">
<el-form ref="form" :model="form" :rules="rules" label-position="left" label-width="140px" class="demo-ruleForm">
<el-row>
<el-col :span="24">
<el-form-item label="项目名称" prop="EntryName">
<el-input v-model="form.EntryName" size="small" placeholder="请输入项目名称" style="width:200px"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="项目下达日期" prop="contractSigningDate">
<el-date-picker
v-model="form.contractSigningDate"
style="width: 200px"
value-format="yyyy-MM-dd"
size="small"
type="date"
placeholder="请选择项目下达日期"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
style="width: 200px"
type="textarea"
autosize
placeholder="请输入项目介绍"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff('form')">取消</el-button>
<el-button type="primary" @click="submit('form')"> </el-button>
</div>
</el-dialog>
<el-dialog :title="title1" :visible.sync="dialogFormVisible2" center style="min-height: 300px" width="450px">
<el-form ref="form1" :model="form1" :rules="rules1" label-width="140px">
<el-form-item label="设备型号" prop="设备型号">
<el-input v-model="form1.设备型号" size="small" placeholder="请输入设备型号" style="width:200px"/>
</el-form-item>
<el-form-item label="设备名称" prop="设备名称">
<el-input v-model="form1.设备名称" size="small" placeholder="请输入设备名称" style="width:200px"/>
</el-form-item>
<el-form-item label="机床数量" prop="机床数量">
<el-input-number :min="1" v-model="form1.机床数量" controls-position="right" style="width:200px" size="small"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="callOff2('form1')">取消</el-button>
<el-button type="primary" @click="submitMachine('form1')"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import elInput from 'element-ui/packages/input'
import { initProject, searchTable1, selectMachine, addList, editchar, delList, submitMachine, editMachine, delMachine } from '@/api/MarketingCenter/CreateProject'
export default {
components: {
elInput
},
data() {
return {
entryName: [],
entryNameValue: '',
machine: '',
startTime: '',
endTime: '',
PageCurrent: 1,
PageSize: 10,
total: null,
listLoading: false,
entryNameValue_check: 0,
startTime_check: 0,
endTime_check: 0,
machine_check: 0,
a: 1,
b: 1,
c: 1,
tableData1: [],
expands: [],
tableData2: [],
projectNum: '',
hetongID: '',
form: {
EntryName: '', // 项目名称
contractSigningDate: '',
remark: ''
},
dialogFormVisible1: false,
title: '',
rules: { // 表单验证规则
EntryName: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
contractSigningDate: [{ required: true, message: '请选择项目下达日期', trigger: 'change' }]
},
dialogFormVisible2: false,
title1: '',
form1: {
设备型号: '',
设备名称: '',
机床数量: 1
},
rules1: { // 表单验证规则
设备型号: [{ required: true, message: '请输入设备型号', trigger: 'blur' }],
设备名称: [{ required: true, message: '请输入设备名称', trigger: 'blur' }]
},
temp: '',
flag: ''
}
},
created() {
this.init()
this.fetchTableData1()
},
methods: {
init() {
this.getSelect(initProject, ['项目名称', '项目流水号'], 'entryName')
},
handleSizeChange(val) {
this.PageCurrent = 1
this.PageSize = val
this.fetchTableData1()
},
handleCurrentChange(val) {
this.PageCurrent = val
this.fetchTableData1()
},
fetchTableData1() {
if (this.entryNameValue === '' || this.entryNameValue === null) { this.entryNameValue_check = 0 } else { this.entryNameValue_check = 1 }
if (this.startTime === '' || this.startTime === null) { this.startTime_check = 0 } else { this.startTime_check = 1 }
if (this.endTime === '' || this.endTime === null) { this.endTime_check = 0 } else { this.endTime_check = 1 }
if (this.machine === '' || this.machine === null) { this.machine_check = 0 } else { this.machine_check = 1 }
this.listLoading = true
this.getTable(searchTable1, [this.PageCurrent, this.PageSize, this.entryNameValue, this.entryNameValue_check, this.startTime_check, this.endTime_check, this.startTime, this.endTime, this.machine_check, this.machine], ['tableData1', 'total', 'listLoading'])
},
selectMachine(row) {
this.projectNum = row.项目流水号
if (this.a === 1) {
this.expands.push(row.项目流水号)
this.b = row.项目流水号
this.a = 0
} else {
if (this.b === row.项目流水号) {
this.expands = []
this.a = 1
} else {
this.expands = []
this.expands.push(row.项目流水号)
this.a = 0
this.b = row.项目流水号
}
}
selectMachine(row.项目流水号).then(response => {
this.tableData2 = response.data
})
},
getRowKeys(row) {
return row.项目流水号
},
ADD() {
this.addForm('form')
this.dialogFormVisible1 = true
this.temp = 1
this.title = '增加'
},
// 提交添加或者修改
submit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
if (this.temp === 1) {
this.addTableData1()
this.temp = null
} else if (this.temp === 2) {
this.chaEdit()
this.temp = null
}
}
})
},
addTableData1() {
addList(this.form.EntryName, this.form.remark, this.form.contractSigningDate).then(response => {
this.dialogFormVisible1 = false
if (response.data[0].result === '1') {
this.$message.success('添加成功')
this.title = ''
this.fetchTableData1()
} else {
this.$message.error('添加失败')
}
})
},
callOff() {
this.dialogFormVisible1 = false
this.dialogFormVisible2 = false
},
handleEdit(row) {
this.editForm(row, 'form')
this.title = '编辑'
this.dialogFormVisible1 = true
this.form.contractSigningDate = row.合同签订日期
this.form.contractNumber = row.合同编号
this.form.EntryName = row.项目名称
this.hetongID = row.项目流水号
this.form.remark = row.合同信息备注
this.temp = 2
},
chaEdit() {
editchar(this.form.EntryName, this.form.remark, this.hetongID, this.form.contractSigningDate).then(response => {
this.dialogFormVisible1 = false
if (response.data[0].result === '1') {
this.$message.success('信息更新成功')
this.fetchTableData1()
} else {
this.$message.error('信息更新失败')
}
})
},
handleDelete(row) {
this.deleteRow(delList, row.项目流水号, function() { this.fetchTableData1() })
},
addMachine(row) {
this.projectNum = row.项目流水号
this.dialogFormVisible2 = true
this.title1 = '新增'
this.addForm('form1')
},
submitMachine() {
function a() {
selectMachine(this.projectNum).then(response => {
this.tableData2 = response.data
})
this.dialogFormVisible2 = false
}
if (this.flag === 1) {
this.addTable(submitMachine, [this.projectNum, this.form1.设备型号, this.form1.设备名称, this.form1.机床数量], 'form1', a)
} else {
this.editTable(editMachine, [this.c, this.form1.设备型号, this.form1.设备名称, this.form1.机床数量], 'form1', a)
}
},
deleteMachine(row) {
function a() {
selectMachine(this.projectNum).then(response => {
this.tableData2 = response.data
})
}
this.deleteRow(delMachine, row.机床流水号, a)
},
editMachine(row) {
this.flag = 2
this.editForm(row, 'form1')
this.dialogFormVisible2 = true
this.title1 = '编辑'
this.c = row.机床流水号
this.form1.设备型号 = row.机床图号
this.form1.设备名称 = row.机床名称
},
callOff2() {
this.dialogFormVisible2 = false
}
}
}
</script>
<style scoped>
</style>