外协任务执行

This commit is contained in:
zhangdingyu
2019-11-21 16:46:50 +08:00
parent cd88786518
commit 6a1720bc1f
2 changed files with 156 additions and 258 deletions

View File

@@ -1,5 +1,16 @@
import request from '@/utils/request'
// 初始化 外协厂商
export function initOutHelp() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间生产管理工艺_基础表_外协厂家_查询数据'
}
})
}
// 初始化获取已生成的外协加工任务单
export function getTable(checked, contractNumber, checked1, manufacturers, checked2, time1, time2, num, pageCurrent, pageSize, documentStatus, num3) {
return request({

View File

@@ -1,83 +1,5 @@
<template>
<div class="app-container">
<el-card>
<el-row>
<!--<span>表单号:</span>-->
<!--<el-input v-model="formNumber" size="small" placeholder="表单号" clearable style="width:200px;margin-bottom: 10px"/>-->
<span>外协厂家:</span>
<el-input v-model="manufacturers" size="small" placeholder="外协厂家" style="width:200px" clearable @keyup.enter.native="pageSize=10;pageList=1;fetchData()"/>
<el-button type="success" size="mini" icon="el-icon-search" style="margin-left:10px" @click="pageSize=10;pageList=1;fetchData()">查询</el-button>
<el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd()">新增</el-button>
<!--<span>下达任务日期:</span>-->
<!--<el-date-picker-->
<!--type="date"-->
<!--size="small"-->
<!--placeholder="选择日期"/>-->
<!--<span>单据状态:</span>-->
<!--<el-select v-model="documentStatus" filterable placeholder="请选择" size="small" clearable>-->
<!--<el-option-->
<!--v-for="item in options"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value">-->
<!--<div style="float: left">{{ item.label }}</div>-->
<!--<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>-->
<!--</el-option>-->
<!--</el-select>-->
</el-row>
</el-card>
<el-card>
<el-table v-loading="loading2" :data="List" highlight-current-row height="350" size="mini" stripe border @row-click="searchProcess" >
<el-table-column label="单据状态" prop="单据状态" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.单据状态==='成交'" type="success" size="small">成交</el-tag>
<el-tag v-else type="info" size="small">未成交</el-tag>
</template>
</el-table-column>
<el-table-column label="表单号" prop="表单号" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.表单号 }}
</template>
</el-table-column>
<el-table-column label="外协厂家" prop="外协厂家" align="center" min-width="200px">
<template slot-scope="scope">
{{ scope.row.外协厂家 }}
</template>
</el-table-column>
<el-table-column label="任务下达日期" prop="任务下达日期" align="center" min-width="100px">
<template slot-scope="scope">
{{ scope.row.任务下达日期 }}
</template>
</el-table-column>
<el-table-column label="外协员" prop="外协计划员" align="center" >
<template slot-scope="scope">
{{ scope.row.外协计划员 }}
</template>
</el-table-column>
<el-table-column label="运费" align="center" >
<template slot-scope="scope">
{{ scope.row.运费 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="200px">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" plain style="margin-left:10px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button :disabled="scope.row.单据状态==='成交'" plain type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-show="!loading2"
:current-page="currentPage"
: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-card>
<span>零件号:</span>
<el-input v-model="partNumber" size="small" placeholder="零件号" clearable style="width:200px"/>
@@ -90,24 +12,24 @@
size="mini"
stripe
highlight-current-row
height="450"
height="350"
tooltip-effect="dark"
style="width: 100%;margin-top: 20px"
@selection-change="handleSelectionChange">
<el-table-column
type="selection"
width="55"/>
<el-table-column label="项目名称" prop="项目名称" align="center" >
<el-table-column label="项目名称" prop="项目名称" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.项目名称 }}
</template>
</el-table-column>
<el-table-column label="零件图号" prop="零件图号" align="center" width="120px" >
<el-table-column label="零件图号" prop="零件图号" align="center" width="200px" >
<template slot-scope="scope">
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="零件名称" prop="零件名称" align="center" min-width="140px" >
<el-table-column label="零件名称" prop="零件名称" align="center" min-width="100px" >
<template slot-scope="scope">
{{ scope.row.零件名称 }}
</template>
@@ -142,12 +64,12 @@
{{ (scope.row.外协预算总价格).toFixed(2) }}
</template>
</el-table-column>
<el-table-column label="零件类型" align="center" >
<el-table-column label="零件类型" align="center" width="">
<template slot-scope="scope">
{{ scope.row.是否临时件 }}
</template>
</el-table-column>
<el-table-column label="外协工序" align="center">
<el-table-column label="外协工序" align="center" show-overflow-tooltip>
<template slot-scope="scope">
{{ scope.row.外协工序 }}
</template>
@@ -156,171 +78,131 @@
<el-button type="info" size="mini" icon="el-icon-arrow-down" style="margin-left:10px;margin-top: 15px" @click="getSpareParts">选入零件</el-button>
</el-card>
<el-card>
<el-table v-loading="loading" :data="List3" :summary-method="getSummaries" :row-class-name="tableRowClassName" stripe size="mini" show-summary>
<el-col :span="10">
<!--<span>表单号:</span>-->
<!--<el-input v-model="formNumber" size="small" placeholder="表单号" clearable style="width:200px;margin-bottom: 10px"/>-->
<span>厂家:</span>
<el-input v-model="manufacturers" size="small" placeholder="外协厂家" style="width:160px" clearable @keyup.enter.native="pageSize=10;pageList=1;fetchData()" @clear="pageSize=10;pageList=1;fetchData()"/>
<!--<el-button type="success" size="mini" icon="el-icon-search" style="margin-left:10px" @click="pageSize=10;pageList=1;fetchData()">查询</el-button>-->
<el-button type="primary" size="mini" icon="el-icon-circle-plus-outline" style="margin-left:10px" @click="handleAdd()">新增</el-button>
<el-table v-loading="loading2" :data="List" highlight-current-row height="450" size="mini" stripe border @row-click="searchProcess" >
<el-table-column label="表单号" prop="表单号" align="center" min-width="155px">
<template slot-scope="scope">
{{ scope.row.表单号 }}
</template>
</el-table-column>
<el-table-column label="外协厂家" prop="外协厂家" align="center" min-width="140px">
<template slot-scope="scope">
{{ scope.row.外协厂家 }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="200px">
<template slot-scope="scope">
<el-button type="primary" size="mini" icon="el-icon-edit" plain style="margin-left:10px" @click="handleEdit(scope.row)">编辑</el-button>
<el-button :disabled="scope.row.单据状态==='成交'" plain type="danger" size="mini" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="block" style="margin-top: 10px;">
<el-pagination
v-show="!loading2"
:current-page="currentPage"
: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>
<!--<span>下达任务日期:</span>-->
<!--<el-date-picker-->
<!--type="date"-->
<!--size="small"-->
<!--placeholder="选择日期"/>-->
<!--<span>单据状态:</span>-->
<!--<el-select v-model="documentStatus" filterable placeholder="请选择" size="small" clearable>-->
<!--<el-option-->
<!--v-for="item in options"-->
<!--:key="item.value"-->
<!--:label="item.label"-->
<!--:value="item.value">-->
<!--<div style="float: left">{{ item.label }}</div>-->
<!--<div style="float: right; color: #8492a6; font-size: 13px">{{ item.name }}</div>-->
<!--</el-option>-->
<!--</el-select>-->
</el-col>
<el-col :span="14">
<div>
<!--<span>下调金额:百分比</span>-->
<!--<el-input v-model="money" size="small" clearable style="width: 90px"/>-->
<!--<el-tooltip :open-delay="1200" effect="dark" content="计算选入零件的价格" placement="top">-->
<!--<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="calculatingPrice">计算价格</el-button>-->
<!--</el-tooltip>-->
<el-tooltip :open-delay="1200" effect="dark" content="核对价格信息后确定" placement="top">
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 3px" @click="confirmPrice">保存</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="成交" placement="top">
<el-button type="success" size="mini" icon="el-icon-success" style="margin-left:10px;margin-top: 3px" @click="Deal">成交</el-button>
</el-tooltip>
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;margin-top: 3px" @click="exportTable('RWD')">导出单据</el-button>
</div>
<el-table v-loading="loading" :data="List3" :summary-method="getSummaries" :row-class-name="tableRowClassName" height="488" stripe size="mini" show-summary border>
<el-table-column :index="indexMethod" label="序号" align="center" type="index" width="50px"/>
<el-table-column label="零件图号" align="center" width="200px">
<el-table-column label="零件图号" align="center" width="150px">
<template slot-scope="scope">
{{ 零件图号[scope.$index] }}
</template>
</el-table-column>
<el-table-column label="零件名称" align="center" width="180px">
<el-table-column label="零件名称" align="center" width="130px">
<template slot-scope="scope">
{{ 零件名称[scope.$index] }}
</template>
</el-table-column>
<el-table-column label="数量" align="center" width="100px">
<el-table-column label="数量" align="center" width="70px">
<template slot-scope="scope">
{{ 批次数量[scope.$index] }}
</template>
</el-table-column>
<!--<el-table-column label="零件工艺" align="center">-->
<!--<el-table-column label="[1]" align="center" width="100px">-->
<!--<el-table-column label="预算(加工)" align="center" width="130px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][0] }}-->
<!--{{ 外协预算总价格[scope.$index] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[2]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][1] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[3]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][2] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[4]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][3] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[5]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][4] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[6]" width="100px" align="center">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][5] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[7]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][6] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[8]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][7] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[9]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][8] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[10]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][9] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[11]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][10] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[12]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][11] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[13]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][12] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[14]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][13] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[15]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][14] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[16]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][15] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[17]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][16] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[18]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][17] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[19]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][18] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="[20]" align="center" width="100px">-->
<!--<template slot-scope="scope">-->
<!--{{ process[scope.$index][19] }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table-column>-->
<el-table-column label="加工价格" align="center">
<el-table-column label="预算" align="center" width="130px">
<template slot-scope="scope">
{{ 外协预算总价格[scope.$index] }}
</template>
</el-table-column>
<el-table-column label="成交" align="center" width="130px">
<el-table-column label="成交(加工)" align="center" width="130px">
<template slot-scope="scope">
<el-input v-model="加工价格_成交[scope.$index]" readonly/>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="材料价格" align="center">
<el-table-column label="类别" align="center" width="130px">
<el-table-column label="材料类别" align="center" width="130px">
<template slot-scope="scope">
{{ 外协分类[scope.$index] }}
</template>
</el-table-column>
<el-table-column label="预算" align="center" width="130px">
<template slot-scope="scope">
{{ 材料费[scope.$index] }}
</template>
</el-table-column>
<el-table-column label="成交" align="center" width="130px">
<!--<el-table-column label="预算(材料)" align="center" width="130px">-->
<!--<template slot-scope="scope">-->
<!--{{ 材料费[scope.$index] }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="成交(材料)" align="center" width="130px">
<template slot-scope="scope">
<el-input v-model="材料价格_价格[scope.$index]"/>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="其他价格" align="center" width="120px">
<template slot-scope="scope">
<el-input v-model="其他价格[scope.$index]"/>
</template>
</el-table-column>
<el-table-column label="计划要求" align="center" width="100px">
<el-table-column label="开始" align="center" width="100px">
<el-table-column label="计划开始" align="center" width="100px">
<template slot-scope="scope">
{{ (机加工开始时间[scope.$index]) }}
</template>
</el-table-column>
<el-table-column label="结束" align="center" width="100px">
<el-table-column label="计划结束" align="center" width="100px">
<template slot-scope="scope">
{{ (机加工结束时间[scope.$index]) }}
</template>
</el-table-column>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right">
<template slot-scope="scope">
<el-button
@@ -332,21 +214,9 @@
</template>
</el-table-column>
</el-table>
<div>
<span>下调金额:百分比</span>
<el-input v-model="money" size="small" clearable style="width:200px"/>
<el-tooltip :open-delay="1200" effect="dark" content="计算选入零件的价格" placement="top">
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="calculatingPrice">计算价格</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="核对价格信息后确定" placement="top">
<el-button type="success" size="mini" icon="el-icon-edit" style="margin-left:10px;margin-top: 15px" @click="confirmPrice">确定价格</el-button>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="成交" placement="top">
<el-button type="success" size="mini" icon="el-icon-success" style="margin-left:10px;margin-top: 15px" @click="Deal">成交</el-button>
</el-tooltip>
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px;margin-top: 15px" @click="exportTable('RWD')">导出外协加工任务单</el-button>
</div>
</el-col>
</el-card>
<el-card v-show="card">
<div id="RWD">
<table cellspacing="0px" align="center" width="100%" style="">
@@ -448,9 +318,16 @@
value-format="yyyy-MM-dd"/>
</el-form-item>
<el-form-item label="外协厂家" prop="外协厂家" style="margin-left: 70px">
<el-input v-model="form.外协厂家" readonly placeholder="外协厂家" size="small" style="width:200px" clearable>
<el-button slot="append" icon="el-icon-search" @click="onFocus1();param=1"/>
</el-input>
<el-select v-model="form.外协厂家" placeholder="选择外协厂家" filterable clearable size="small" style="width:200px">
<el-option
v-for="item in ManufacturerName"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<!--<el-input v-model="form.外协厂家" readonly placeholder="外协厂家" size="small" style="width:200px" clearable>-->
<!--<el-button slot="append" icon="el-icon-search" @click="onFocus1();param=1"/>-->
<!--</el-input>-->
</el-form-item>
<el-form-item label="运费" prop="运费" style="margin-left: 70px">
<el-input v-model="form.运费" placeholder="运费" size="small" style="width:200px" clearable/>
@@ -465,7 +342,7 @@
</template>
<script>
import { getTable, getData1, getTable1, getprocedure, searchManufactor, spareParts, addTable, editData, deleteData, insertParts, getParts, getPrice, editData1, deleteData1, getNumber } from '@/api/Outsourcing/OutsourcingTaskExecution'
import { initOutHelp, getTable, getData1, getTable1, getprocedure, searchManufactor, spareParts, addTable, editData, deleteData, insertParts, getParts, getPrice, editData1, deleteData1, getNumber } from '@/api/Outsourcing/OutsourcingTaskExecution'
import { getExplorer, method5, Cleanup } from '@/vendor/exportExcel'
import { convertCurrency } from '@/vendor/int2Chinese'
import { mapGetters } from 'vuex'
@@ -538,6 +415,7 @@ export default {
外协厂家: '',
运费: null
},
ManufacturerName: [], // 厂家名称
rules: {
外协厂家: [{ required: true, message: '请选择外协厂家', trigger: 'change' }],
运费: [{ required: true, message: '请输入运费', trigger: 'blur' }]
@@ -612,6 +490,15 @@ export default {
}
},
fetchData() {
this.ManufacturerName = []
initOutHelp().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.ManufacturerName.push({
label: response.data[i].外协厂家名称,
value: response.data[i].外协厂家流水号
})
}
})
this.loading2 = true
var day3 = new Date(this.time)
var day4 = new Date(this.time)
@@ -834,7 +721,7 @@ export default {
getNumber(this.form.下达任务日期).then(response => {
this.form.表单号 = response.data.result[0].Column1
})
this.form.运费 = null
this.form.运费 = 0
this.form.外协厂家 = ''
this.dialogFormVisible = true
},
@@ -844,7 +731,7 @@ export default {
this.form.运费 = ''
this.$message.error('请输入数字')
} else {
addTable(this.form.表单号, this.id, this.ManufactorNumber1, this.form.下达任务日期, this.form.运费).then(response => {
addTable(this.form.表单号, this.id, this.form.外协厂家, this.form.下达任务日期, this.form.运费).then(response => {
if (response.data[0].result === '1') {
this.$notify({
title: '成功',
@@ -1287,7 +1174,7 @@ export default {
},
// 提交编辑
submitEdit() {
editData(this.Number, this.ManufactorNumber1, this.form.运费, this.Explain).then(response => {
editData(this.Number, this.form.外协厂家, this.form.运费, this.Explain).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑成功')
this.dialogFormVisible = false