This commit is contained in:
bryan sun
2019-10-17 18:13:47 +08:00
18 changed files with 1149 additions and 588 deletions

View File

@@ -42,8 +42,8 @@ export function searchTable(...params) {
data: {
type: '1',
name: '车间装配管理_领料单_三表_查询数据',
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&零件类型=${params[6]}`,
Pagination: params[4] + '&' + params[5]
param: `机床流水号_check=${params[0]}&机床流水号=${params[1]}&组件流水号_check=${params[2]}&组件流水号=${params[3]}&名称_check=${params[4]}&名称=${params[5]}&零件类型=${params[8]}`,
Pagination: params[6] + '&' + params[7]
}
})
}
@@ -91,7 +91,7 @@ export function searchListDetail(...params) {
method: 'post',
data: {
type: '1',
name: '车间装配管理_领料单明细_查询数据',
name: '车间装配管理_领料单明细_查询数据_新',
param: `领料单流水号=${params[0]}`
}
})
@@ -120,3 +120,15 @@ export function dropListDetail(num) {
}
})
}
// 查询领料单明细详情
export function searchListDetailMX(...params) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '车间装配管理_领料单明细_详情_查询数据',
param: `领料单流水号=${params[0]}&基本件流水号=${params[1]}&标准件和外购件流水号=${params[2]}`
}
})
}

View File

@@ -54,7 +54,7 @@ export function searchListDetail(...params) {
method: 'post',
data: {
type: '1',
name: '车间装配管理_领料单明细_查询数据',
name: '车间装配管理_领料单明细_查询数据_新',
param: `领料单流水号=${params[0]}`
}
})
@@ -102,8 +102,8 @@ export function submitOutStore(...params) {
method: 'post',
data: {
type: '2',
name: '库存管理_物料出库_出库记录_增加数据',
param: `物料流水号=${params[0]}&货位流水号=${params[1]}&出库数量=${params[2]}&出库人流水号=${params[3]}&基本件流水号=${params[4]}&标准件和外购件流水号=${params[5]}&请购单明细流水号=${params[6]}&领料单流水号=${params[7]}&领料人流水号=${params[8]}&仓库流水号=${params[9]}&出库类别=${params[10]}`
name: '库存管理_物料出库_出库记录_增加数据_循环',
param: `领料单明细水号=${params[0]}&基本件流水号=${params[1]}&物料流水号组=${params[2]}&标准件和外购件流水号=${params[3]}&请购单明细流水号=${params[4]}&件流水号=${params[5]}&机床流水号=${params[6]}&出库数量组=${params[7]}&出库人流水号=${params[8]}&领料人编号=${params[9]}&出库类别=${params[10]}&领料单流水号=${params[11]}`
}
})
}

View File

@@ -76,14 +76,14 @@ export function getExport2(num) {
})
}
// 查询分配后的标准件和外购件
export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, check2, val2, check3, val3, person, check4, val4, check5, val5, check6, val6, val7) {
export function searchMaterial(pageCurrent, pageSize, num1, check1, val1, check2, val2, check3, val3, person, check4, val4, check5, val5, check6, val6, val7, val8, val9, val10) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: 'xqs_采购管理_采购部采购_查询物料_分配后_带库存',
param: `物料状态编号=${num1}&物料名称_check=${check1}&物料名称=${val1}&物料规格_check=${check2}&物料规格=${val2}&物料型号_check=${check3}&物料型号=${val3}&人员编号=${person}&项目流水号_check=${check4}&项目流水号=${val4}&机床流水号_check=${check5}&机床流水号=${val5}&组件流水号_check=${check6}&组件流水号=${val6}&零件类型=${val7}`,
param: `物料状态编号=${num1}&物料名称_check=${check1}&物料名称=${val1}&物料规格_check=${check2}&物料规格=${val2}&物料型号_check=${check3}&物料型号=${val3}&人员编号=${person}&项目流水号_check=${check4}&项目流水号=${val4}&机床流水号_check=${check5}&机床流水号=${val5}&组件流水号_check=${check6}&组件流水号=${val6}&零件类型=${val7}&时间_check=${val8}&开始时间=${val9}&结束时间=${val10}`,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -353,3 +353,37 @@ export function searchMerge(num) {
}
})
}
export function getPerson(num) {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: 'select * from dbo.人事档案管理_人员名单 inner join dbo.菜单系统模块_人员与角色 ' +
'on 人事档案管理_人员名单.人员编号=菜单系统模块_人员与角色.人员编号 ' +
'where 角色编号=3 or 角色编号=2'
}
})
}
export function tiaozheng1(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购件入库_创建询价单_调整采购任务_循环执行',
param: '人员编号=' + num1 + '&标准件和外购件流水号组=' + num2
}
})
}
export function tiaozheng2(num1, num2) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '采购件入库_创建询价单_调整采购任务_基本件_循环执行',
param: '人员编号=' + num1 + '&基本件流水号组=' + num2
}
})
}

View File

@@ -11,18 +11,18 @@ export function initSupplier() {
}
})
}
// export function initSupplier(num) {
// return request({
// url: '',
// method: 'post',
// data: {
// type: '3',
// name: `SELECT distinct 供应商流水号,供应商名称
// FROM 采购管理_询价单_视图
// where not EXISTS (select * from 采购管理_采购合同_采购部 where 是否启用 = 1 and 是否未通过 is null and 询价单编号 = 采购合同编号) and 采购员流水号 = ${num}`
// }
// })
// }
export function initSupplier11(num) {
return request({
url: '',
method: 'post',
data: {
type: '3',
name: ` SELECT distinct 供应商流水号,供应商名称
FROM 采购管理_询价单_视图
where not EXISTS (select * from 采购管理_采购合同_采购部 where 是否启用 = 1 and 是否未通过 is null and 询价单编号 = 采购合同编号) and 采购员流水号 = ${num}`
}
})
}
// 查询询价单列表 表1
export function searchInquirySheet(check1, value1, check2, value2, check3, id, check4, supplier) {
return request({

View File

@@ -1,39 +1,50 @@
import request from '@/utils/request'
export function searchCailiao(name) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_外购备料到货_材料查询',
param: `供应商=${name}`
}
})
}
// 查询采购单
export function searchPurchaseOrder(pageCurrent, pageSize, check1, num, check2, name) {
export function searchPurchaseOrder(pageCurrent, pageSize, check1, num, check2, name, material) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_采购计划_查询数据_到货',
param: `采购单号_check=${check1}&采购单号=${num}&供应商_check=${check2}&供应商=${name}`,
param: `采购单号_check=${check1}&采购单号=${num}&供应商_check=${check2}&供应商=${name}&材料=${material}`,
Pagination: pageCurrent + '&' + pageSize
}
})
}
// 查询采购计划明细
export function searchMateriel(num) {
export function searchMateriel(num, num1) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_采购计划明细_查询数据_未选入',
param: `采购计划流水号=${num}`
param: `采购计划流水号=${num}&材料=${num1}`
}
})
}
// 查询到货单
export function searchArriveOrder(num, num1, num2, num3, num5, pageCurrent, pageSize) {
export function searchArriveOrder(num, num1, num2, num3, num5, num6, num7, pageCurrent, pageSize) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_到货单查询_新',
param: `供应商名称_check=${num}&供应商名称=${num1}&开始日期_check=${num2}&开始日期=${num3}&结束日期=${num5}`,
param: `供应商名称_check=${num}&供应商名称=${num1}&开始日期_check=${num2}&开始日期=${num3}&结束日期=${num5}&是否关联_check=${num6}&是否关联=${num7}`,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -97,14 +108,14 @@ export function deleteArrivalMX(num) {
}
})
}
export function EditArrivalOrderMX(num, num1, num2, num3, num4, num5) {
export function EditArrivalOrderMX(num, num2, num3, num4, num5) {
return request({
url: '',
method: 'post',
data: {
type: '2',
name: '备料管理_编辑到货单明细',
param: `到货单明细流水号=${num}&材料=${num1}&数量=${num2}&单位=${num3}&单价=${num4}&金额=${num5}`
param: `到货单明细流水号=${num}&数量=${num2}&单位=${num3}&单价=${num4}&金额=${num5}`
}
})
}

View File

@@ -1,14 +1,14 @@
import request from '@/utils/request'
// 发票查询
export function searchInvoice(pageCurrent, pageSize, check1, num1, check2, supplierName0) {
export function searchInvoice(pageCurrent, pageSize, check1, num1, check2, supplierName0, num2, num3, num4, num5, num6) {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_发票_查询数据',
param: '发票号_check=' + check1 + '&发票号=' + num1 + '&供应商名称_check=' + check2 + '&供应商名称=' + supplierName0,
param: '发票号_check=' + check1 + '&发票号=' + num1 + '&供应商名称_check=' + check2 + '&供应商名称=' + supplierName0 + '&供应商流水号_check=' + num2 + '&供应商流水号=' + num3 + '&日期_check=' + num4 + '&开始日期=' + num5 + '&结束日期=' + num6,
Pagination: pageCurrent + '&' + pageSize
}
})
@@ -156,3 +156,13 @@ export function addMateriel(num, num1) {
}
})
}
export function getGongyingshang() {
return request({
url: '',
method: 'post',
data: {
type: '1',
name: '备料管理_发票_初始化获取供应商'
}
})
}

View File

@@ -16,7 +16,8 @@ export const uploadInvoiceScan1 = `http://192.168.1.231:8411/submit/uploadInvoic
export const download = `http://192.168.1.231:8411/submit/downloadFile.ashx` // ContractInformationManagement
export const uploadPerson = `http://192.168.1.231:8411/submit/uploadPerson.ashx`
export const uploadOP = `http://192.168.1.231:8411/submit/uploadOP.ashx`
export const url = `http://192.168.0.110:8005/submit/MESCommonBase.ashx` // 采购件入库、离线件入库
export const url = `http://192.168.1.231:8411/submit/MESCommonBase.ashx` // 采购件入库、离线件入库
export const ExcelDownLoad = 'http://192.168.1.231:8411/submit/downloadFile.ashx' // 导出excel
// 技术中心程序发布时要更改下面所有的IP到0段
export const ServerIP = `http://192.168.1.231:8411/webpage/file/`
@@ -25,7 +26,7 @@ export const downloadFileMachine = `http://192.168.1.231:8411/submit/downloadFil
export const MESUploadFile = `http://192.168.1.231:8411/submit/MESUploadFile.ashx`
export const MESDownloadFile = `http://192.168.1.231:8411/submit/MESDownloadFile.ashx`
const service = axios.create({
baseURL: `http://192.168.0.110:8005/submit/MESCommonBase.ashx`,
baseURL: `http://192.168.1.231:8411/submit/MESCommonBase.ashx`,
timeout: 1500000 // 请求超时时间
})
export default service

View File

@@ -21,6 +21,16 @@
:label="item.label"
:value="item.value"/>
</el-select>
<span>名称:</span>
<el-input v-model="Name" placeholder="名称" clearable size="small"/>
<span>领料情况:</span>
<el-select v-model="PickingValue" placeholder="领料情况" size="small" clearable>
<el-option
v-for="item in Picking"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button size="small" type="success" icon="el-icon-search" style="margin: 0 0 0 10px" @click="pageCurrent0=1;pageSize0=20;pageCurrent1=1;pageSize1=20;pageCurrent2=1;pageSize2=20;searchTable()">查询</el-button>
</div>
<el-tabs v-model="PartType" type="card" @tab-click="searchTable()">
@@ -67,6 +77,11 @@
{{ scope.row.备件总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="领料单编号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;">
<el-pagination
@@ -118,6 +133,11 @@
{{ scope.row.备件总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="领料单编号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;">
<el-pagination
@@ -174,6 +194,11 @@
{{ scope.row.备件总数量 }}
</template>
</el-table-column>
<el-table-column align="center" label="领料单编号" min-width="100px">
<template slot-scope="scope">
{{ scope.row.领料单编号 }}
</template>
</el-table-column>
</el-table>
<div class="block" style="float:right;">
<el-pagination
@@ -292,7 +317,7 @@
</el-table-column>
<el-table-column label="已领数量" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column v-if="true" label="备料确认" align="center" sortable prop="是否备料确认" width="100">
@@ -303,13 +328,35 @@
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" sortable prop="是否领料确认" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否领料确认)===1" type="success" size="mini">已领料</el-tag>
<el-tag v-else type="warning" size="mini">未领</el-tag>
<el-tag v-if="(Number(scope.row.总数量) <= Number(scope.row.出库数量1)) || Number(scope.row.是否领料确认) === 1" type="success" size="mini">已领料</el-tag>
<el-tag v-else-if="Number(scope.row.总数量) > Number(scope.row.出库数量1) && Number(scope.row.出库数量1) > 0" type="primary" size="mini">未领</el-tag>
<el-tag v-else-if="Number(scope.row.出库数量1) === 0" type="warning" size="mini">未领料</el-tag>
</template>
</el-table-column>
<el-table-column v-if="true" label="操作" align="center" width="100">
<el-table-column v-if="true" label="操作" align="center" width="230">
<template slot-scope="scope">
<el-button :disabled="!!scope.row.是否出库 || Number(scope.row.是否领料确认)===1" size="mini" plain type="danger" icon="el-icon-delete" @click="dropListDetail(scope.row)">删除</el-button>
<el-popover placement="right" width="500" trigger="click">
<el-table :data="gridData" highlight-current-row size="mini" show-summary>
<el-table-column width="50" align="center" type="index" label="序号"/>
<el-table-column min-width="100" align="center" label="姓名">
<template slot-scope="scope">
{{ scope.row.姓名 }}
</template>
</el-table-column>
<el-table-column min-width="150" align="center" label="领料时间">
<template slot-scope="scope">
{{ scope.row.操作日期 }}
</template>
</el-table-column>
<el-table-column min-width="100" align="center" label="数量" prop="出库数量">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
</template>
</el-table-column>
</el-table>
<el-button slot="reference" type="primary" size="mini" icon="el-icon-search" plain @click="searchTable02(scope.row)">查看详情</el-button>
</el-popover>
<el-button :disabled="!!scope.row.是否出库 || Number(scope.row.是否领料确认)===1" size="mini" plain type="danger" icon="el-icon-delete" style="margin-left: 10px" @click="dropListDetail(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -339,7 +386,7 @@
</template>
<script>
import { initPickPerson, initMachineProject, searchgroup, searchTable, searchList, createList, dropList, selectIntoList, searchListDetail, dropListDetail } from '@/api/Inventory/CreatePickingList'
import { initPickPerson, initMachineProject, searchgroup, searchTable, searchList, createList, dropList, selectIntoList, searchListDetail, dropListDetail, searchListDetailMX } from '@/api/Inventory/CreatePickingList'
import request from '@/utils/request'
import { mapGetters } from 'vuex'
export default {
@@ -349,6 +396,16 @@ export default {
PartType: '基本件',
machineNumberValue: '',
machineNumber: [],
PickingValue: '',
Picking: [{
value: 0,
label: '未领'
}, {
value: 1,
label: '已领'
}],
Name: '',
gridData: [],
groupNumberValue: '',
groupNumber: [],
tableData0: [],
@@ -472,34 +529,43 @@ export default {
},
// 标准件
searchTable0() {
let check1, check2
let check1, check2, check3
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent0, this.pageSize0, 1).then(response => {
this.Name ? check3 = 1 : check3 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, check3, this.Name, this.pageCurrent0, this.pageSize0, 1).then(response => {
console.log(response.data.rows)
this.tableData0 = response.data.rows
this.total0 = response.data.total
})
},
// 外购件
searchTable1() {
let check1, check2
let check1, check2, check3
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent1, this.pageSize1, 2).then(response => {
this.Name ? check3 = 1 : check3 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, check3, this.Name, this.pageCurrent1, this.pageSize1, 2).then(response => {
this.tableData1 = response.data.rows
this.total1 = response.data.total
})
},
// 基本件
searchTable2() {
let check1, check2
let check1, check2, check3
this.machineNumberValue ? check1 = 1 : check1 = 0
this.groupNumberValue ? check2 = 1 : check2 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, this.pageCurrent2, this.pageSize2, 3).then(response => {
this.Name ? check3 = 1 : check3 = 0
searchTable(check1, this.machineNumberValue, check2, this.groupNumberValue, check3, this.Name, this.pageCurrent2, this.pageSize2, 3).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
},
searchTable02(row) {
searchListDetailMX(row.领料单流水号, row.基本件流水号, row.标准件和外购件流水号).then(response => {
this.gridData = response.data
})
},
handleSizeChange0(val) {
this.pageSize0 = val
this.pageCurrent0 = 1

View File

@@ -55,11 +55,11 @@
<h4>领料单明细{{ pickingListNumberShow }}</h4>
</el-col>
<el-col style="float:left;width: 200px;margin-top:15px">
<el-button :disabled="multipleSelection.length===0" size="small" type="warning" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="multipleSelection.length===0" size="small" type="primary" @click="inputPassword()">领料确认</el-button>
<el-button :disabled="SELECTION.length===0" size="small" type="warning" @click="prepareConfirm()">备料确认</el-button>
<el-button :disabled="SELECTION.length===0" size="small" type="primary" @click="inputPassword()">领料确认</el-button>
</el-col>
</el-row>
<el-table :data="pickListTable2" highlight-current-row stripe border style="width: 100%;" size="mini" height="400" @row-click="clickListDetail" @selection-change="handleSelectionChange">
<el-table :data="pickListTable2" highlight-current-row stripe border style="width: 100%;" size="mini" height="400" @selection-change="handleSelectionChange">
<el-table-column type="selection" align="center" width="55"/>
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="名称" sortable prop="名称" align="center" min-width="100">
@@ -97,14 +97,19 @@
{{ scope.row.备件数量 }}
</template>
</el-table-column>
<el-table-column label="已领数量" align="center" min-width="50">
<el-table-column label="货位存量" align="center" min-width="50">
<template slot-scope="scope">
{{ scope.row.出库数量 }}
{{ scope.row.请购单明细流水号 ? scope.row.货位存量 : scope.row.货位存量1 }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="200">
<el-table-column label="已领数量" align="center" min-width="50">
<template slot-scope="scope">
<el-input v-model="scope.row.备注" size="mini" @change="UpdateRemark(scope.row)"/>
{{ scope.row.出库数量1 }}
</template>
</el-table-column>
<el-table-column label="出库数量" align="center" width="200">
<template slot-scope="scope">
<el-input-number v-model="scope.row.出库数量" size="mini"/>
</template>
</el-table-column>
<el-table-column v-if="true" label="备料确认" align="center" width="100">
@@ -115,8 +120,9 @@
</el-table-column>
<el-table-column v-if="true" label="领料确认" align="center" width="100">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否领料确认)===1" size="mini" type="success">已领料</el-tag>
<el-tag v-else type="warning" size="mini">未领</el-tag>
<el-tag v-if="(Number(scope.row.总数量) <= Number(scope.row.出库数量1)) || Number(scope.row.是否领料确认) === 1" type="success" size="mini">已领料</el-tag>
<el-tag v-else-if="Number(scope.row.总数量) > Number(scope.row.出库数量1) && Number(scope.row.出库数量1) > 0" type="primary" size="mini">未领</el-tag>
<el-tag v-else-if="Number(scope.row.出库数量1) === 0" type="warning" size="mini">未领料</el-tag>
</template>
</el-table-column>
<!--<el-table-column label="操作" align="center" width="100" fixed="right">-->
@@ -127,65 +133,64 @@
</el-table>
</el-card>
<el-card>
<el-row>
<el-col :span="12">
<h4 style="margin-top:0">物料货位数量信息</h4>
</el-col>
<el-col :span="12">
占用数量{{ 占用数量 }}
</el-col>
</el-row>
<el-table :data="StockNumberTable" border stripe style="width: 100%;" size="mini" height="300" show-summary>
<el-table-column label="序号" align="center" type="index" width="50"/>
<el-table-column label="名称" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料名称 || scope.row.零件名称 }}
</template>
</el-table-column>
<el-table-column label="图号或型号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料型号 || scope.row.零件图号 || '—' }}
</template>
</el-table-column>
<el-table-column label="规格" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.物料规格 || scope.row.规格 || '—' }}
</template>
</el-table-column>
<el-table-column label="仓库名称" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.仓库名称 }}
</template>
</el-table-column>
<el-table-column label="货位名称" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.货位名称 }}
</template>
</el-table-column>
<el-table-column label="货位存量" align="center" min-width="70" prop="货位存量">
<template slot-scope="scope">
{{ scope.row.货位存量 }}
</template>
</el-table-column>
<el-table-column label="机床图号" align="center" min-width="100">
<template slot-scope="scope">
{{ scope.row.机床图号 || '—' }}
</template>
</el-table-column>
<el-table-column label="组号" align="center" min-width="70">
<template slot-scope="scope">
{{ scope.row.组号 || '—' }}
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200px">
<template slot-scope="scope" align="center">
<el-button :disabled="审批未通过" size="mini" type="primary" @click="outStore(scope.row)">出库</el-button>
<el-button :disabled="审批未通过" size="mini" type="warning" @click="errorRecord(scope.row)">异常记录</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!--<el-card>-->
<!--<el-row>-->
<!--<el-col :span="12">-->
<!--<h4 style="margin-top:0">物料货位数量信息</h4>-->
<!--</el-col>-->
<!--<el-col :span="12">-->
<!--占用数量{{ 占用数量 }}-->
<!--</el-col>-->
<!--</el-row>-->
<!--<el-table :data="StockNumberTable" border stripe style="width: 100%;" size="mini" height="300" show-summary>-->
<!--<el-table-column label="序号" align="center" type="index" width="50"/>-->
<!--<el-table-column label="名称" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料名称 || scope.row.零件名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="图号或型号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料型号 || scope.row.零件图号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="规格" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.物料规格 || scope.row.规格 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="仓库名称" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.仓库名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="货位名称" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.货位名称 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="货位存量" align="center" min-width="70" prop="货位存量">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.货位存量 }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="机床图号" align="center" min-width="100">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.机床图号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="组号" align="center" min-width="70">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.组号 || '—' }}-->
<!--</template>-->
<!--</el-table-column>-->
<!--<el-table-column label="操作" align="center" width="200px">-->
<!--<template slot-scope="scope" align="center">-->
<!--<el-button :disabled="审批未通过" size="mini" type="primary" @click="outStore(scope.row)">出库</el-button>-->
<!--<el-button :disabled="审批未通过" size="mini" type="warning" @click="errorRecord(scope.row)">异常记录</el-button>-->
<!--</template>-->
<!--</el-table-column>-->
<!--</el-table>--><!--</el-card>-->
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible1" title="物料出库" center width="380px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="left">
@@ -255,16 +260,22 @@
<el-dialog v-el-drag-dialog :visible.sync="dialogFormVisible3" title="领料确认" center width="380px">
<el-form ref="form3" :model="form3" :rules="rules3" label-position="left">
<el-form-item label="领料人" prop="personName" label-width="100px" size="small">
<el-input v-model="form3.personName" readonly size="small" placeholder="领料人" style="width: 200px"/>
<el-form-item label="出库类别" prop="outTypeValue" label-width="100px">
<el-select v-model="form3.outTypeValue" size="small" placeholder="出库类别" style="width: 200px;margin-right:10px">
<el-option
v-for="item in outType"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
<el-form-item label="密码" prop="password" label-width="100px" size="small">
<el-input v-model="form3.password" size="small" placeholder="密码" style="width: 200px"/>
<el-form-item label="人员编号" prop="password" label-width="100px" size="small">
<el-input v-model="form3.password" size="small" placeholder="人员编号" style="width: 200px"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="dialogFormVisible3=false">取消</el-button>
<el-button type="primary" @click="pickConfirm()"> </el-button>
<el-button type="primary" @click="pickConfirm1()"> </el-button>
</div>
</el-dialog>
@@ -340,7 +351,7 @@ export default {
货位流水号: ''
},
form3: {
personName: '',
outTypeValue: '',
password: ''
},
form4: {
@@ -360,7 +371,8 @@ export default {
reason: [{ required: true, message: '请输入' }]
},
rules3: {
password: [{ required: true, message: '请输入' }]
password: [{ required: true, message: '请输入' }],
outTypeValue: [{ required: true, message: '请选择' }]
},
rules4: {
仓库流水号: [{ required: true, message: '请输入' }],
@@ -370,15 +382,16 @@ export default {
machine: [],
group: [],
person: [],
materialNum: '', // 中间变量物料流水号
machineValue: '', // 中间变量机床流水号
groupNumValue: '', // 中间变量组件流水号
basePartNum: '', // 中间变量基本件流水号
purchaseBillNum: '', // 中间变量请购单明细流水号
parchasePartNum: '', // 中间变量标准件和外购件流水号
SELECTION: [],
materialNum: [], // 中间变量物料流水号
machineValue: [], // 中间变量机床流水号
groupNumValue: [], // 中间变量件流水号
basePartNum: [], // 中间变量基本件流水号
purchaseBillNum: [], // 中间变量请购单明细流水号
parchasePartNum: [], // 中间变量标准件和外购件流水号
inventoryNum: '', // 中间变量仓库流水号
locationNum: '', // 中间变量货位流水号
outNumber: 0, // 中间变量出库数量
outNumber: [], // 中间变量出库数量
inventoryName: [],
locateName: [],
物料流水号: '',
@@ -476,13 +489,6 @@ export default {
}
})
},
// 多选
handleSelectionChange(val) {
this.multipleSelection = []
val.map(v => {
this.multipleSelection.push(v.领料单明细流水号)
})
},
// 备料确认
prepareConfirm() {
this.$confirm('是否备料确认?', '提示', {
@@ -629,12 +635,39 @@ export default {
this.pickListTable2 = res.data
})
},
// 多选
handleSelectionChange(val) {
console.log(val)
this.SELECTION = val
},
// 提交领料确认
pickConfirm1() {
for (let i = 0; i < this.SELECTION.length; i++) {
this.multipleSelection.push(this.SELECTION[i].领料单明细流水号)
this.basePartNum.push(this.SELECTION[i].基本件流水号)
this.materialNum.push(this.SELECTION[i].物料流水号)
this.parchasePartNum.push(this.SELECTION[i].标准件和外购件流水号)
this.purchaseBillNum.push(this.SELECTION[i].请购单明细流水号)
this.groupNumValue.push(this.SELECTION[i].组件流水号)
this.machineValue.push(this.SELECTION[i].机床流水号)
this.outNumber.push(this.SELECTION[i].出库数量)
}
submitOutStore(this.multipleSelection, this.basePartNum, this.materialNum, this.parchasePartNum, this.purchaseBillNum, this.groupNumValue, this.machineValue, this.outNumber, this.id, this.form3.password, this.form3.outTypeValue, this.pickingListNum).then(response => {
if (response.data[0].result === '1') {
this.$message.success('出库成功')
this.dialogFormVisible3 = false
searchListDetail(this.pickingListNum).then(res => {
this.pickListTable2 = res.data
})
} else { this.$message.error('操作失败') }
})
},
// 查看领料单明细相关的物料货位数量
clickListDetail(row) {
row && row.基本件流水号 ? (this.basePartNum = row.基本件流水号, this.materialNum = null, this.parchasePartNum = null, this.purchaseBillNum = null) : this.basePartNum
row && row.物料流水号 ? (this.materialNum = row.物料流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.materialNum
row && row.标准件和外购件流水号 ? (this.parchasePartNum = row.标准件和外购件流水号, this.basePartNum = null, this.purchaseBillNum = null) : this.parchasePartNum
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.parchasePartNum
row && row.请购单明细流水号 ? (this.purchaseBillNum = row.请购单明细流水号, this.basePartNum = null, this.materialNum = null, this.parchasePartNum = null) : this.purchaseBillNum
row && row.机床流水号 ? this.machineValue = row.机床流水号 : this.machineValue
row && row.组件流水号 ? this.groupNumValue = row.组件流水号 : this.groupNumValue
row && row.总数量 ? this.outNumber = row.总数量 : this.outNumber
@@ -642,112 +675,14 @@ export default {
searchStockNumber1(this.materialNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select 物料名称
,物料规格
,物料型号
,sum(零件数量 * 机床数量) as 占用数量
,PDM_零件明细表_标准件和外购件.物料流水号
from PDM_零件明细表_标准件和外购件
inner join PDM_组件名称 on PDM_零件明细表_标准件和外购件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 库存管理_物料主文件_基本 on PDM_零件明细表_标准件和外购件.物料流水号 = 库存管理_物料主文件_基本.物料流水号
inner join 车间装配管理_领料单明细 on PDM_零件明细表_标准件和外购件.标准件和外购件流水号 = 车间装配管理_领料单明细.标准件和外购件流水号
where 是否备料确认 = 1 and 是否领料确认 = 0 and PDM_零件明细表_标准件和外购件.物料流水号 = ${this.materialNum}
group by 物料名称
,物料规格
,物料型号
,PDM_零件明细表_标准件和外购件.物料流水号`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
} else if (this.basePartNum) {
searchStockNumber2(this.basePartNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select 零件名称,零件图号,规格,材料,sum(零件数量 * 机床数量) as 占用数量,PDM_零件明细表_基本件.基本件流水号
from PDM_零件明细表_基本件 inner join PDM_组件名称 on PDM_零件明细表_基本件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join PDM_零件明细表_材料 on PDM_零件明细表_基本件.材料流水号 = PDM_零件明细表_材料.材料流水号
inner join 车间装配管理_领料单明细 on PDM_零件明细表_基本件.基本件流水号 = 车间装配管理_领料单明细.基本件流水号
where 是否备料确认 = 1 and 是否领料确认 = 0 and 车间装配管理_领料单明细.基本件流水号 = ${this.basePartNum}
group by 零件名称,零件图号,规格,材料,PDM_零件明细表_基本件.基本件流水号`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
} else if (this.purchaseBillNum) {
searchStockNumber3(this.purchaseBillNum).then(res => {
this.StockNumberTable = res.data
})
const param = {
url: '',
method: 'post',
data: {
type: '3',
name: `select
库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号
,库存管理_物料出库_车间采购_基本件_查询视图.零件图号
,库存管理_物料出库_车间采购_基本件_查询视图.零件名称
,库存管理_物料出库_车间采购_基本件_查询视图.规格
,sum(零件数量 * 机床数量) as 占用数量
from 库存管理_物料出库_车间采购_基本件_查询视图
inner join PDM_零件明细表_基本件 on 库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号 = PDM_零件明细表_基本件.基本件流水号
inner join PDM_组件名称 on PDM_零件明细表_基本件.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
where 请购单明细流水号 = ${this.purchaseBillNum}
group by 库存管理_物料出库_车间采购_基本件_查询视图.基本件流水号
,库存管理_物料出库_车间采购_基本件_查询视图.零件图号
,库存管理_物料出库_车间采购_基本件_查询视图.零件名称
,库存管理_物料出库_车间采购_基本件_查询视图.规格
union
select
库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料型号 as 零件图号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料名称 as 零件名称
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料规格 as 规格
,sum(零件数量 * 机床数量) as 占用数量
from 库存管理_物料出库_车间采购_标准件和外购件_查询视图
inner join PDM_零件明细表_标准件和外购件 on PDM_零件明细表_标准件和外购件.物料流水号 = 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
inner join PDM_组件名称 on 库存管理_物料出库_车间采购_标准件和外购件_查询视图.组件流水号 = PDM_组件名称.组件流水号
inner join PDM_机床名称 on PDM_组件名称.机床流水号 = PDM_机床名称.机床流水号
inner join 库存管理_物料主文件_基本 on 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号 = 库存管理_物料主文件_基本.物料流水号
where 请购单明细流水号 = ${this.purchaseBillNum}
group by 库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料流水号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料型号
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料名称
,库存管理_物料出库_车间采购_标准件和外购件_查询视图.物料规格`
}
}
request(param).then(res => {
if (res.data.length > 0) {
this.占用数量 = res.data[0].占用数量
} else {
this.占用数量 = 0
}
})
}
},
// 出库

View File

@@ -88,11 +88,11 @@
{{ scope.row.零件图号 }}
</template>
</el-table-column>
<el-table-column label="重量" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.重量1 }}
</template>
</el-table-column>
<!--<el-table-column label="重量" align="center" width="140px">-->
<!--<template slot-scope="scope">-->
<!--{{ scope.row.重量1 }}-->
<!--</template>-->
<!--</el-table-column>-->
<el-table-column label="单价" align="center" width="140px">
<template slot-scope="scope">
{{ scope.row.单价 }}

View File

@@ -34,7 +34,7 @@
<el-divider content-position="right"/>
</div>
</el-card>
<el-row>
<el-row id="PurchasingCenter/CreateInquirySheet">
<el-col :span="24">
<el-tabs v-model="tabName" type="border-card" @tab-click="tabClick">
<el-tab-pane label="外购件" name="外购件">
@@ -72,23 +72,44 @@
<span>物料变更:</span>
<el-switch v-model="switchValue" active-color="#13ce66" inactive-color="#ff4949"/>
</el-row>
<el-row style="margin-bottom: 10px">
<el-row style="margin-bottom: 15px">
<span>物料规格:</span>
<el-input v-model="materialSpec" placeholder="物料规格" size="small" clearable/>
<span>物料型号:</span>
<el-input v-model="materialModel" placeholder="物料型号" size="small" clearable/>
<el-button
type="success"
</el-row>
<el-row style="margin-bottom: 10px">
<span class="demonstration">开始时间: </span>
<el-date-picker
v-model="startTime"
value-format="yyyy-MM-dd"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent11=1;pageSize11=100;total11=0;searchTable11()">查询</el-button>
<el-button
type="warning"
style="width: 200px"
type="date"
placeholder="选择日期"/>
<span class="demonstration">结束时间:</span>
<el-date-picker
v-model="endTime"
value-format="yyyy-MM-dd"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="exportUninquirySheet">导出未询价物料清单</el-button>
style="width: 200px"
type="date"
placeholder="选择日期"/>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent11=1;pageSize11=100;total11=0;searchTable11()">查询</el-button>
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 10px" @click="exportUninquirySheet">导出未询价物料清单</el-button>
<el-popover v-model="visible" title="调整采购任务" placement="top" width="180">
<div style="text-align: right; margin: 0">
<el-select v-model="PersonValue" style="width:150px" placeholder="人员" size="small" filterable clearable>
<el-option
v-for="item in Person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" size="mini" @click="visible = false;tiaozheng1()">确定</el-button>
</div>
<el-button slot="reference" type="success" size="small" plain style="float: right;margin-right: 20px">调整采购任务</el-button>
</el-popover>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
@@ -275,18 +296,21 @@
<el-input v-model="partName" placeholder="零件名称" size="small" clearable/>
<span>零件规格:</span>
<el-input v-model="partSpec" placeholder="零件规格" size="small" clearable/>
<el-button
type="success"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="pageCurrent12=1;pageSize12=100;total12=0;searchTable12()">查询</el-button>
<el-button
type="warning"
size="small"
icon="el-icon-download"
style="margin-left: 10px"
@click="exportUninquirySheet">导出未询价物料清单</el-button>
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent12=1;pageSize12=100;total12=0;searchTable12()">查询</el-button>
<el-button type="warning" size="small" icon="el-icon-download" style="margin-left: 10px" @click="exportUninquirySheet">导出未询价物料清单</el-button>
<el-popover v-model="visible2" title="调整采购任务" placement="top" width="180">
<div style="text-align: right; margin: 0">
<el-select v-model="PersonValue" style="width:150px" placeholder="人员" size="small" filterable clearable>
<el-option
v-for="item in Person"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-button type="primary" size="mini" @click="visible2 = false;tiaozheng2()">确定</el-button>
</div>
<el-button slot="reference" type="success" size="small" plain style="float: right;margin-right: 20px">调整采购任务</el-button>
</el-popover>
</el-row>
<el-row style="margin-bottom: 10px">
<el-table
@@ -298,7 +322,7 @@
height="500px"
size="mini"
@selection-change="handleSelectionChange2">
<el-table-column :selectable="selectable" align="center" width="35" type="selection"/>
<el-table-column :selectable="selectable" align="center" width="50" type="selection"/>
<!--<el-table-column label="操作" align="center" width="100" fixed="left">-->
<!--<template slot-scope="scope">-->
<!--<el-button :disabled="parseInt(scope.row.询价状态编号)!==1||parseInt(scope.row.是否确认)!==1" type="primary" size="mini" @click="partChange(scope.row)">零件变更</el-button>-->
@@ -877,7 +901,7 @@
</template>
<script>
import { getBillNum, searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
import { tiaozheng2, tiaozheng1, getPerson, getBillNum, searchMaterial, searchPart, searchSupplier, searchCreateInquirySheet, searchCreateInquirySheet2, searchSheetDetail, editInquirySheet,
createInquirySheet, deleteInquirySheet, addInquirySheet1, addInquirySheet2, outInquirySheet, searchAllMaterial, materialChange, saveOrder,
submitUseInventory, initProject, searchMachine, searchGroup, searchBaseInfo, editBaseInfo, getExport1, getExport2, searchMerge } from '@/api/PurchasingCenter/CreateInquirySheet'
import { mapGetters } from 'vuex'
@@ -889,6 +913,14 @@ export default {
name: '', // 创建询价单
data() {
return {
startTime: '',
endTime: '',
标准件和外购件流水号: [],
基本件流水号: [],
visible: false,
visible2: false,
Person: [],
PersonValue: '',
supplierNames: [], // 供应商下拉框
switchValue: false, // 物料变更列显示开关
source: [
@@ -1052,10 +1084,25 @@ export default {
computed: {
...mapGetters([
'name',
'token',
'id' // 人员编号
])
},
watch: {
// 如果路由有变化,会再次执行该方法
'$route': {
handler(route) {
const _this = this
if (route.name === 'CreateInquirySheet') {
setTimeout(() => {
_this.Jump()
}, 1200)
}
}
}
},
created() {
this.getPerson()
this.fetchData()
this.searchTable11() // 查表1
this.searchTable2() // 查表2
@@ -1063,11 +1110,64 @@ export default {
this.searchUnBuyPartNumber()
this.initDirection()
},
mounted() {
setTimeout(() => {
this.Jump()
}, 500)
},
methods: {
Jump() {
window.location.hash = '#PurchasingCenter/CreateInquirySheet'
},
tiaozheng1() {
if (this.标准件和外购件流水号.length !== 0) {
if (this.PersonValue) {
tiaozheng1(this.PersonValue, this.标准件和外购件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('调整成功')
this.searchTable11()
} else {
this.$message.warning('调整失败')
}
})
} else {
this.$message.warning('请选择人员')
}
} else {
this.$message.warning('请选择物料')
}
},
tiaozheng2() {
if (this.基本件流水号.length !== 0) {
if (this.PersonValue) {
tiaozheng2(this.PersonValue, this.基本件流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('调整成功')
this.searchTable12()
} else {
this.$message.warning('调整失败')
}
})
} else {
this.$message.warning('请选择人员')
}
} else {
this.$message.warning('请选择物料')
}
},
getPerson() {
getPerson().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Person.push({
value: response.data[i].人员编号,
label: response.data[i].姓名
})
}
})
},
initDirection() {
const direction = this.$getDirection()
direction.on('keyup', function(e, val) {
console.log(val)
if (e.keyCode === 39) {
direction.next()
}
@@ -1083,8 +1183,9 @@ export default {
})
},
clickCard1(project, machine) {
var hight = this.$refs.height1.offsetHeight
document.documentElement.scrollTop = hight + 140
window.location.hash = '#PurchasingCenter/CreateInquirySheet'
// var hight = this.$refs.height1.offsetHeight
// document.documentElement.scrollTop = hight + 140
this.projectValue = project
this.machine = []
this.machineValue = ''
@@ -1105,8 +1206,9 @@ export default {
})
},
clickCard2(project, machine) {
var hight = this.$refs.height1.offsetHeight
document.documentElement.scrollTop = hight + 140
window.location.hash = '#PurchasingCenter/CreateInquirySheet'
// var hight = this.$refs.height1.offsetHeight
// document.documentElement.scrollTop = hight + 140
this.projectValue = project
this.machine = []
this.machineValue = ''
@@ -1162,7 +1264,6 @@ export default {
}
}).then(res => {
this.machines1 = res.data
console.log(this.machines1)
})
},
async searchUnBuyPartNumber() {
@@ -1364,7 +1465,6 @@ export default {
this.dialogVisible4 = true
},
// cancelUseInventory(row) { // 取消使用滞货
// console.log(row)
// this.backlogMaterialNum = row.物料流水号
// this.backlogGroupPartNum = row.组件零件流水号
// this.cancelNum = row.使用滞货数量
@@ -1373,7 +1473,6 @@ export default {
// cancelButtonText: '取消',
// type: 'warning'
// }).then(() => {
// console.log(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum)
// cancelUseInventory(this.backlogMaterialNum, this.cancelNum, this.backlogGroupPartNum).then(response => {
// if (response.data[0].result === '1') {
// this.searchTable11()
@@ -1409,14 +1508,15 @@ export default {
return row['供货商'].trim() === value
},
searchTable11() { // 查询外购件列表
let check1, check2, check3, check4, check5, check6
let check1, check2, check3, check4, check5, check6, check7
this.materialName ? check1 = 1 : check1 = 0
this.materialSpec ? check2 = 1 : check2 = 0
this.materialModel ? check3 = 1 : check3 = 0
this.projectValue ? check4 = 1 : check4 = 0
this.machineValue ? check5 = 1 : check5 = 0
this.groupValue ? check6 = 1 : check6 = 0
searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue, 2).then(response => {
this.startTime && this.endTime ? check7 = 1 : check7 = 0
searchMaterial(this.pageCurrent11, this.pageSize11, this.materialStatusValue[this.materialStatusValue.length - 1], check1, this.materialName, check2, this.materialSpec, check3, this.materialModel, this.id, check4, this.projectValue, check5, this.machineValue, check6, this.groupValue, 2, check7, this.startTime, this.endTime).then(response => {
this.tableData11 = response.data.rows
this.total11 = response.data.total
const remark = []
@@ -1675,7 +1775,6 @@ export default {
printNode.remove()
})
}).catch(res => {
console.log(res)
this.$message({
type: 'info',
message: '已取消操作'
@@ -1724,7 +1823,6 @@ export default {
}
})
}).catch(res => {
console.log(res)
this.$message({
type: 'info',
message: '已取消操作'
@@ -1734,17 +1832,21 @@ export default {
handleSelectionChange1(val) { // 标准件和外购件多选
this.groupPartNum = []
this.allNum = []
this.标准件和外购件流水号 = []
for (let i = 0; i < val.length; i++) {
this.groupPartNum[i] = val[i].组件零件流水号
this.allNum[i] = val[i].待询价数量
this.标准件和外购件流水号[i] = val[i].标准件和外购件流水号
}
},
handleSelectionChange2(val) { // 基本件多选
this.groupPartBasicNum = []
this.allNum = []
this.基本件流水号 = []
for (let i = 0; i < val.length; i++) {
this.groupPartBasicNum[i] = val[i].组件零件基本件流水号
this.allNum[i] = val[i].零件数量
this.基本件流水号[i] = val[i].基本件流水号
}
},
addInquirySheet() { // 追加物料
@@ -1894,7 +1996,6 @@ export default {
},
partChange(row) { // 零件变更 基本件
this.$message('没有基本件的标准库')
console.log(row)
},
searchMaterial() {
if (this.materialName0 || this.materialSpec0 || this.materialModel0) {

View File

@@ -3,6 +3,17 @@
<el-card>
<el-form label-width="90px" label-position="right">
<el-row>
<el-col :span="6">
<el-form-item label="供应商:">
<el-select v-model="supplierValue11" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData11()" @change="selectHetong()">
<el-option
v-for="item in supplier11"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="合同编号:">
<el-select v-model="contractNumValue" filterable size="small" placeholder="合同编号" style="width:100%" @change="contractChange">
@@ -14,6 +25,8 @@
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="6">
<el-form-item label="供应商:">
<!--<el-select v-model="supplierValue" clearable filterable size="small" placeholder="供应商" style="width:100%" @focus="fetchData" @change="supplierChange">-->
@@ -163,11 +176,11 @@
</template>
</el-table-column>
</el-table>
<el-tooltip :open-delay="1000" content="一键删除交货期" placement="right">
<el-tooltip v-show="false" :open-delay="1000" content="一键删除交货期" placement="right">
<el-button type="danger" icon="el-icon-date" size="small" @click="deleteAllDate()"/>
</el-tooltip>
<span>①选择合同模板</span>
<el-radio-group v-model="demoRadio" size="small" @change="demoChange">
<el-radio-group v-show="false" v-model="demoRadio" size="small" @change="demoChange">
<el-radio-button label="模板1"/>
<el-radio-button label="模板2" disabled/>
<!--<el-radio-button label="自定义" disabled/>-->
@@ -195,7 +208,7 @@
<script>
import Tinymce from '@/components/Tinymce'
import { initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo, savePrice, saveContractHeader, searchContractHeader, saveRemark } from '@/api/PurchasingCenter/CreatePurchaseContract'
import { initSupplier11, initSupplier, searchInquirySheet, searchSheetContract, doneContract, searchBaseInfo, savePrice, saveContractHeader, searchContractHeader, saveRemark } from '@/api/PurchasingCenter/CreatePurchaseContract'
import { convertCurrency } from '@/vendor/int2Chinese'
import { mapGetters } from 'vuex'
import { sleep, groupBy } from '@/utils/tool'
@@ -206,6 +219,8 @@ export default {
inject: ['reload'],
data() {
return {
supplierValue11: '', // 供应商查询条件
supplier11: [],
quickChangePrice: true,
supplier: [],
year: '',
@@ -227,7 +242,7 @@ export default {
hasTax: '含税',
taxRate: 0.13,
preview: false, // 预览
demoRadio: '', // 模板radio
demoRadio: '模板1', // 模板radio
content: ``, // 合同格式模板
contentNew: ``, // tinymce的
contractName: '采购合同', // 合同名称
@@ -267,14 +282,51 @@ export default {
])
},
created() {
this.fetchData11()
this.fetchData()
this.initDirection()
this.demo1()
},
methods: {
fetchData11() {
initSupplier11(this.id).then(res => {
this.supplier11 = []
for (let i = 0; i < res.data.length; i++) {
this.supplier11.push({
value: res.data[i].供应商流水号,
label: res.data[i].供应商名称
})
}
})
},
selectHetong() {
this.contractNumValue = ''
this.tableData1 = []
if (this.supplierValue11) { this.asdasd = 1 } else { this.asdasd = 0 }
searchInquirySheet(0, 0, 0, 0, 1, this.id, this.asdasd, this.supplierValue11).then(response => { // 初始化询价单号
this.contractNums = []
for (let i = 0; i < response.data.length; i++) {
this.contractNums.push({
value: response.data[i].询价单流水号,
label: response.data[i].询价单编号,
supplierName: response.data[i].供应商名称,
supplierValue: response.data[i].供应商流水号,
supplierAddress: response.data[i].地址,
legalPerson: response.data[i].企业性质, // 法人
trustee: response.data[i].注册资本 || '', // 受托人
bank1: response.data[i].开户行 || '', // 开户行
account1: response.data[i].帐号 || '', // 帐号
taxCode1: response.data[i].税号 || '', // 税号
phone1: response.data[i].电话号码 || '', // 电话
fax1: response.data[i].传真 || '', // 传真
postCode1: response.data[i].货期 || '' // 邮编
})
}
})
},
initDirection() {
const direction = this.$getDirection()
direction.on('keyup', function(e, val) {
console.log(val)
if (e.keyCode === 39) {
direction.next()
}
@@ -518,152 +570,152 @@ export default {
case '模板2':
this.demo2()
break
// case '自定义':
// this.customization()
// break
// case '自定义':
// this.customization()
// break
}
},
demo1() { // 选择合同模板1
this.content = `
<h2 style="text-align: center;">
<strong>采购合同</strong>
<strong>采购合同</strong>
</h2>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 25%; text-align: center;" rowspan="2">
<h1>
<strong>GAOJING</strong>
</h1>
</td>
<td style="width: 25%;">
<h4 style="text-align: center;">合同名称:</h4>
</td>
<td id="contractName" style="width: 25%;text-align: center;"></td>
<td style="width: 25%;text-align: center;" rowspan="2"></td>
</tr>
<tr>
<td style="width: 25%;">
<h4 style="text-align: center;">合同编号:</h4>
</td>
<td id="contractNum" style="width: 25%;text-align: center;"></td>
</tr>
</tbody>
<tbody>
<tr>
<td style="width: 25%; text-align: center;" rowspan="2">
<h1>
<strong>GAOJING</strong>
</h1>
</td>
<td style="width: 25%;">
<h4 style="text-align: center;">合同名称:</h4>
</td>
<td id="contractName" style="width: 25%;text-align: center;"></td>
<td style="width: 25%;text-align: center;" rowspan="2"></td>
</tr>
<tr>
<td style="width: 25%;">
<h4 style="text-align: center;">合同编号:</h4>
</td>
<td id="contractNum" style="width: 25%;text-align: center;"></td>
</tr>
</tbody>
</table>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 15%;">买方:</td>
<td style="width: 35%;">江苏高精机电装配有限公司</td>
<td style="width: 15%;">卖方:</td>
<td id="supplierName" style="width: 35%;"></td>
</tr>
<tr>
<td style="width: 15%;">地址:</td>
<td style="width: 35%;">${this.companyAddress}</td>
<td style="width: 15%;">地址:</td>
<td id="supplierAddress" style="width: 35%;"></td>
</tr>
<tr>
<td style="width: 15%;">法定代表人:</td>
<td style="width: 35%;">徐秀兵</td>
<td style="width: 15%;">法定代表人:</td>
<td id="legalPerson" style="width: 35%;"></td>
</tr>
</tbody>
<tbody>
<tr>
<td style="width: 15%;">买方:</td>
<td style="width: 35%;">江苏高精机电装配有限公司</td>
<td style="width: 15%;">卖方:</td>
<td id="supplierName" style="width: 35%;"></td>
</tr>
<tr>
<td style="width: 15%;">地址:</td>
<td style="width: 35%;">${this.companyAddress}</td>
<td style="width: 15%;">地址:</td>
<td id="supplierAddress" style="width: 35%;"></td>
</tr>
<tr>
<td style="width: 15%;">法定代表人:</td>
<td style="width: 35%;">徐秀兵</td>
<td style="width: 15%;">法定代表人:</td>
<td id="legalPerson" style="width: 35%;"></td>
</tr>
</tbody>
</table>
<p>根据中华人民共和国合同法及相关法律法规,经买卖双方平等协商,就卖方向买方出售合同项下产品事宜达成一致,签订本合同(明细表及合同通用条款)如下:</p>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 20%;">合同总额RMB</td>
<td class="actualTotal" style="width: 20%;"></td>
<td style="width: 20%;">大写:</td>
<td id="actualTotal_zh" style="width: 40%;"></td>
</tr>
<tr>
<td style="width: 20%;" rowspan="3">交货地点:</td>
<td style="width: 20%;">地址:</td>
<td style="width: 30%;" colspan="2">${this.sendAddress}</td>
</tr>
<tr>
<td style="width: 20%;">联系人:</td>
<td style="width: 30%;" colspan="2">${this.name}</td>
</tr>
<tr>
<td style="width: 20%;">联系电话:</td>
<td style="width: 30%;" colspan="2">${this.phone2}</td>
</tr>
<tr>
<td style="width: 20%;">交货日期:</td>
<td id="deliveryDate" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">开票信息:</td>
<td id="invoiceInfo" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">支付日期:</td>
<td id="payDate" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">支付方式:</td>
<td id="payMethod" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">其他说明:</td>
<td id="otherInfo" style="width: 30%;" colspan="3"></td>
</tr>
</tbody>
<tbody>
<tr>
<td style="width: 20%;">合同总额RMB</td>
<td class="actualTotal" style="width: 20%;"></td>
<td style="width: 20%;">大写:</td>
<td id="actualTotal_zh" style="width: 40%;"></td>
</tr>
<tr>
<td style="width: 20%;" rowspan="3">交货地点:</td>
<td style="width: 20%;">地址:</td>
<td style="width: 30%;" colspan="2">${this.sendAddress}</td>
</tr>
<tr>
<td style="width: 20%;">联系人:</td>
<td style="width: 30%;" colspan="2">${this.name}</td>
</tr>
<tr>
<td style="width: 20%;">联系电话:</td>
<td style="width: 30%;" colspan="2">${this.phone2}</td>
</tr>
<tr>
<td style="width: 20%;">交货日期:</td>
<td id="deliveryDate" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">开票信息:</td>
<td id="invoiceInfo" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">支付日期:</td>
<td id="payDate" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">支付方式:</td>
<td id="payMethod" style="width: 30%;" colspan="3"></td>
</tr>
<tr>
<td style="width: 20%;">其他说明:</td>
<td id="otherInfo" style="width: 30%;" colspan="3"></td>
</tr>
</tbody>
</table>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 50%;">
<span>卖方:${this.supplierName}(盖章)</span><br>
<span>受托人:${this.trustee}</span><br>
<span>开户行:${this.bank1}</span><br>
<span>账号:${this.account1}</span><br>
<span>税号:${this.taxCode1}</span><br>
<span>电话:${this.phone1}</span><br>
<span>传真:${this.fax1}</span><br>
<span>邮编:${this.postCode1}</span>
</td>
<td style="width: 50%;">
<span>买方:江苏高精机电装配有限公司(盖章)</span><br>
<span>受托人:${this.name}</span><br>
<span>开户行:${this.bank2}</span><br>
<span>账号:${this.account2}</span><br>
<span>税号:${this.taxCode2}</span><br>
<span>电话:${this.phone2}</span><br>
<span>传真:${this.fax2}</span><br>
<span>邮编:${this.postCode2}</span>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td style="width: 50%;">
<span>卖方:${this.supplierName}(盖章)</span><br>
<span>受托人:${this.trustee}</span><br>
<span>开户行:${this.bank1}</span><br>
<span>账号:${this.account1}</span><br>
<span>税号:${this.taxCode1}</span><br>
<span>电话:${this.phone1}</span><br>
<span>传真:${this.fax1}</span><br>
<span>邮编:${this.postCode1}</span>
</td>
<td style="width: 50%;">
<span>买方:江苏高精机电装配有限公司(盖章)</span><br>
<span>受托人:${this.name}</span><br>
<span>开户行:${this.bank2}</span><br>
<span>账号:${this.account2}</span><br>
<span>税号:${this.taxCode2}</span><br>
<span>电话:${this.phone2}</span><br>
<span>传真:${this.fax2}</span><br>
<span>邮编:${this.postCode2}</span>
</td>
</tr>
</tbody>
</table>
<p style="text-align: right;">日期_${this.year}_年_${this.month}_月_${this.day}_日</p>
<hr />
<p style="text-align: center;">
<strong>明细表</strong>
(<strong id="hasTax"></strong>)
<strong>明细表</strong>
(<strong id="hasTax"></strong>)
</p>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody id="tbody">
<tr id="tableHead">
<td>序号</td>
<td>机床号-组号</td>
<td>名称</td>
<td>图号或型号</td>
<td>规格</td>
<td>数量</td>
<td>单位</td>
<td>单价</td>
<td>合计</td>
<td>交货时间</td>
<td>备注</td>
</tr>
</tbody>
<tbody id="tbody">
<tr id="tableHead">
<td>序号</td>
<td>机床号-组号</td>
<td>名称</td>
<td>图号或型号</td>
<td>规格</td>
<td>数量</td>
<td>单位</td>
<td>单价</td>
<td>合计</td>
<td>交货时间</td>
<td>备注</td>
</tr>
</tbody>
</table>
<span>未税合计:</span><span id="untaxTotal"></span><span>元</span><br>
<span>税额:</span><span id="tax"></span><br>

View File

@@ -341,6 +341,9 @@ export default {
}, {
label: '合同模板2',
value: 2
}, {
label: '采购计划',
value: 3
}],
contractValue: 1,
contractNum: [], // 合同号

View File

@@ -88,11 +88,12 @@
</el-tooltip>
</div>
<el-table v-loading="" :data="tableData2" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="单号状态" align="center" width="100" fixed="left">
<el-table-column label="采购状态" align="center" width="100" fixed="left">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.采购计划状态)===0" type="warning" size="mini">编辑中</el-tag>
<el-tag v-if="Number(scope.row.采购计划状态)===1" type="primary" size="mini">已保存</el-tag>
<el-tag v-if="Number(scope.row.采购计划状态)===2" type="success" size="mini">导出</el-tag>
<el-tag v-if="Number(scope.row.采购计划状态)===3" type="success" size="mini">到货</el-tag>
<el-tag v-if="Number(scope.row.采购计划状态)===4" type="info" size="mini">已结算</el-tag>
</template>
</el-table-column>
<el-table-column label="采购计划单号" align="center" min-width="170">
@@ -134,12 +135,12 @@
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button :disabled="parseInt(scope.row.采购计划状态)===2" type="text" style="margin-left: 20px" size="mini" icon="el-icon-edit-outline" @click="editPurchaseOrder(scope.row)"/>
<el-button :disabled="parseInt(scope.row.采购计划状态)===3 || parseInt(scope.row.采购计划状态)===4" type="text" style="margin-left: 20px" size="mini" icon="el-icon-edit-outline" @click="editPurchaseOrder(scope.row)"/>
</div>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button :disabled="parseInt(scope.row.采购计划状态)===2" type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deletePurchaseOrder(scope.row)"/>
<el-button :disabled="parseInt(scope.row.采购计划状态)===3 || parseInt(scope.row.采购计划状态)===4" type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deletePurchaseOrder(scope.row)"/>
</div>
</el-tooltip>
</template>
@@ -157,6 +158,13 @@
@current-change="handleCurrentChange2"/>
</div>
<el-table v-loading="" :data="tableData3" border highlight-current-row stripe style="margin: 3px 0" size="mini">
<el-table-column label="采购状态" align="center">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否到货)===0" type="warning" size="mini">未到货</el-tag>
<el-tag v-if="Number(scope.row.是否到货)===1" type="success" size="mini">已到货</el-tag>
<el-tag v-if="Number(scope.row.是否到货)===2" type="info" size="mini">已结算</el-tag>
</template>
</el-table-column>
<el-table-column label="物料编码" align="center" width="200">
<template slot-scope="scope">
{{ scope.row.物料零件编码 }}
@@ -184,24 +192,24 @@
</el-table-column>
<el-table-column label="成品尺寸(长、宽、高)" align="center" min-width="250px">
<template slot-scope="scope">
<el-input v-model="scope.row.成品尺寸" size="mini" style="width:240px" @change="saveWeight(scope.$index, scope.row)"/>
<el-input :disabled="parseInt(scope.row.是否到货)===1 || parseInt(scope.row.是否到货)===2" v-model="scope.row.成品尺寸" size="mini" style="width:240px" @change="saveWeight(scope.$index, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="单位" align="center" width="100px">
<template slot-scope="scope">
<el-input v-model="scope.row.单位" size="mini" style="width:70px" @change="saveMoney(scope.$index, scope.row)"/>
<el-input :disabled="parseInt(scope.row.是否到货)===1 || parseInt(scope.row.是否到货)===2" v-model="scope.row.单位" size="mini" style="width:70px" @change="saveMoney(scope.$index, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="备注" min-width="200px">
<template slot-scope="scope">
<el-input v-model="scope.row.备注1" :disabled="disable" size="mini" style="width:180px" @change="saveRemarks(scope.$index, scope.row)"/>
<el-input :disabled="parseInt(scope.row.是否到货)===1 || parseInt(scope.row.是否到货)===2" v-model="scope.row.备注1" size="mini" style="width:180px" @change="saveRemarks(scope.$index, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200px">
<template slot-scope="scope">
<el-tooltip :open-delay="1000" effect="dark" content="物料移出采购计划" placement="top">
<div style="display: inline-block">
<el-button type="info" size="mini" icon="el-icon-right" plain @click="deleteMateriel(scope.row)">物料移出采购计划</el-button>
<el-button :disabled="parseInt(scope.row.是否到货)===1 || parseInt(scope.row.是否到货)===2" type="info" size="mini" icon="el-icon-right" plain @click="deleteMateriel(scope.row)">物料移出采购计划</el-button>
</div>
</el-tooltip>
</template>
@@ -402,8 +410,7 @@ export default {
Remarks: [], // 备注组
tableData4: [], // 合同模板
采购计划状态: '',
paramRow: '', // 参数row
disable: false // 其他的禁用
paramRow: '' // 参数row
}
},
computed: {
@@ -601,7 +608,6 @@ export default {
if (response.data[0].result === '1') {
this.$message.success('删除成功')
this.searchTable2()
this.disable = true
searchMateriel(this.purchasingOrderNumber).then(response => {
this.tableData3 = response.data
})

View File

@@ -16,6 +16,14 @@
style="width:260px"
start-placeholder="开始日期"
end-placeholder="结束日期"/>
<span>关联情况:</span>
<el-select v-model="PickingValue" placeholder="关联情况" size="small" clearable>
<el-option
v-for="item in Picking"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<el-tooltip :open-delay="1200" effect="dark" content="查询到货单" placement="top">
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent4=1;pageSize4=10;total4=0;searchTable4()">查询</el-button>
</el-tooltip>
@@ -26,6 +34,12 @@
<h3>到货单</h3>
<el-table v-loading="" :data="tableData4" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable5">
<el-table-column width="60" align="center" type="index" label="序号"/>
<el-table-column label="关联情况" align="center" min-width="280">
<template slot-scope="scope">
<el-tag v-if="Number(scope.row.是否关联) === 1" type="success" size="mini">已结算</el-tag>
<el-tag v-else type="primary" size="mini">未结算</el-tag>
</template>
</el-table-column>
<el-table-column label="供应商" align="center" min-width="280">
<template slot-scope="scope">
{{ scope.row.供应商名称 }}
@@ -45,17 +59,17 @@
<template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="添加到货明细" placement="top">
<div style="display: inline-block">
<el-button type="success" size="mini" icon="el-icon-circle-plus-outline" plain @click="addArrivalOrderMX(scope.row)">添加到货明细</el-button>
<el-button :disabled="Number(scope.row.是否关联) === 1" type="success" size="mini" icon="el-icon-circle-plus-outline" plain @click="addArrivalOrderMX(scope.row)">添加到货明细</el-button>
</div>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" style="margin-left: 20px" icon="el-icon-edit-outline" @click="editArrivalOrder(scope.row)"/>
<el-button :disabled="Number(scope.row.是否关联) === 1" type="text" size="mini" style="margin-left: 20px" icon="el-icon-edit-outline" @click="editArrivalOrder(scope.row)"/>
</div>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deleteArrivalOrder(scope.row)"/>
<el-button :disabled="Number(scope.row.是否关联) === 1" type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deleteArrivalOrder(scope.row)"/>
</div>
</el-tooltip>
</template>
@@ -114,17 +128,17 @@
<template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="关联备料材料" placement="top">
<div style="display: inline-block">
<el-button type="warning" size="mini" icon="el-icon-circle-plus-outline" plain @click="addArrivalCL(scope.row)">关联备料材料</el-button>
<el-button :disabled="disable === '1'" type="warning" size="mini" icon="el-icon-circle-plus-outline" plain @click="addArrivalCL(scope.row)">关联备料材料</el-button>
</div>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" style="margin-left: 20px" icon="el-icon-edit-outline" @click="editArrivalMX(scope.row)"/>
<el-button :disabled="disable === '1'" type="text" size="mini" style="margin-left: 20px" icon="el-icon-edit-outline" @click="editArrivalMX(scope.row)"/>
</div>
</el-tooltip>
<el-tooltip :open-delay="1200" effect="dark" content="删除" placement="top">
<div style="display: inline-block">
<el-button type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deleteArrivalMX(scope.row)"/>
<el-button :disabled="disable === '1'" type="text" size="mini" style="margin-left: 20px" icon="el-icon-delete" @click="deleteArrivalMX(scope.row)"/>
</div>
</el-tooltip>
</template>
@@ -168,7 +182,7 @@
</el-table-column>
<el-table-column label="单件重量" align="center" width="150px">
<template slot-scope="scope">
<el-input-number v-model="scope.row.单件重量" :step="1" size="mini" style="width:120px" @change="save(scope.$index, scope.row)"/>
<el-input-number v-model="scope.row.单件重量" :disabled="disable === '1'" :step="1" :min="0" size="mini" style="width:120px" @change="save(scope.$index, scope.row)"/>
</template>
</el-table-column>
<el-table-column label="总重量" align="center" prop="总重量">
@@ -195,7 +209,7 @@
<template slot-scope="scope">
<el-tooltip effect="dark" content="取消关联" placement="top">
<div style="display: inline-block">
<el-button type="primary" size="mini" plain @click="deleteMateriel(scope.row)">取消关联</el-button>
<el-button :disabled="disable === '1'" type="primary" size="mini" plain @click="deleteMateriel(scope.row)">取消关联</el-button>
</div>
</el-tooltip>
</template>
@@ -233,7 +247,7 @@
type="primary"
size="small"
icon="el-icon-check"
@click="submitAddArrivalOrder">确定</el-button>
@click="submitAddArrivalOrder">保存</el-button>
<el-button
v-show="title==='编辑到货单'"
type="primary"
@@ -246,18 +260,24 @@
<el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 200px" width="430px">
<el-form ref="form1" :model="form1" :rules="rules1" label-position="right" label-width="120px">
<el-row>
<el-form-item label="材料" prop="材料">
<el-input v-model="form1.材料" size="small"/>
<el-form-item v-show="title1==='添加到货明细'" label="材料" prop="CailiaoValue">
<el-select v-model="form1.CailiaoValue" placeholder="材料" size="small" filterable>
<el-option
v-for="item in Cailiao"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="数量" prop="数量">
<el-input-number v-model="form1.数量" :precision="2" :step="1" size="medium" @change="Calculation"/>
<el-input-number v-model="form1.数量" :precision="2" :step="1" :min="0" size="medium" @change="Calculation"/>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="单价" prop="单价">
<el-input-number v-model="form1.单价" :precision="2" :step="1" size="medium" @change="Calculation"/>
<el-input-number v-model="form1.单价" :precision="2" :step="1" :min="0" size="medium" @change="Calculation"/>
</el-form-item>
</el-row>
<el-row>
@@ -272,12 +292,20 @@
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button
v-show="title1==='添加到货明细'"
type="warning"
size="small"
plain
icon="el-icon-check"
@click="submitAddArrivalOrderMX">保存</el-button>
<el-button
v-show="title1==='添加到货明细'"
type="primary"
plain
size="small"
icon="el-icon-check"
@click="submitAddArrivalOrderMX">确定</el-button>
@click="submitAddArrivalOrderMX1">继续添加</el-button>
<el-button
v-show="title1==='编辑到货明细'"
type="primary"
@@ -294,6 +322,8 @@
<el-tooltip :open-delay="1200" effect="dark" content="查询采购计划单" placement="top">
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="pageCurrent2=1;pageSize2=10;total2=0;searchTable2()">查询</el-button>
</el-tooltip>
<span style="font-size: 15px;margin-left: 10px;font-weight: bold">材料:</span><span>{{ 材料111 }}</span>
<span style="font-size: 15px;margin-left: 10px;font-weight: bold">材料数量:</span><span>{{ 材料数量 }}</span>
</div>
<el-table v-loading="" :data="tableData2" border stripe style="max-height: 460px;" height="230px" size="mini" highlight-current-row @row-click="searchTable3">
<el-table-column label="采购计划单号" align="center">
@@ -384,21 +414,36 @@
</template>
<script>
import { searchPurchaseOrder, searchMateriel, addMateriel, searchArriveOrder, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, saveWeight, searchTable5, searchSupplier, deleteArrivalMX, EditArrivalOrderMX, AddArrivalOrderMX, deleteMateriel, searchTable6 } from '@/api/WorkshopProcurement/NewArrivalList.js'
import { searchCailiao, searchPurchaseOrder, searchMateriel, addMateriel, searchArriveOrder, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, saveWeight, searchTable5, searchSupplier, deleteArrivalMX, EditArrivalOrderMX, AddArrivalOrderMX, deleteMateriel, searchTable6 } from '@/api/WorkshopProcurement/NewArrivalList.js'
import { mapGetters } from 'vuex'
export default {
data() {
return {
Cailiao: [],
purchasingOrder: '',
ArrivalOrderNumber: '',
ArrivalOrderMXNumber: '',
supplierName0: '',
arrest: [],
check: 0,
材料111: '',
Name: '',
单价: '',
数量: '',
SUM: 0,
PickingValue: '',
Picking: [{
value: 0,
label: '未结算'
}, {
value: 1,
label: '已结算'
}],
ALLMoney: '',
材料数量: '',
材料名称: '',
未绑定数量: '',
tableData2: [],
total2: 0,
pageCurrent2: 1,
@@ -413,12 +458,14 @@ export default {
tableData5: [],
到货单流水号: '',
dateRange: '',
中间变量: '',
form: {
备注: '',
日期: '',
supplierNameValue: ''
},
form1: {
CailiaoValue: '',
材料: '',
数量: '',
单位: 'KG',
@@ -432,12 +479,13 @@ export default {
dialogVisible2: false,
title: '',
title1: '',
disable: '',
rules: {
supplierNameValue: [{ required: true, message: '请选择供应商' }],
日期: [{ required: true, message: '请选择日期' }]
},
rules1: {
材料: [{ required: true, message: '请填写材料' }],
CailiaoValue: [{ required: true, message: '请选择材料' }],
数量: [{ required: true, message: '请填写数量' }],
单位: [{ required: true, message: '请填写单位' }],
单价: [{ required: true, message: '请填写单价' }]
@@ -459,10 +507,21 @@ export default {
this.searchTable4()
},
methods: {
searchCailiao() {
this.Cailiao = []
searchCailiao(this.供应商111).then(response => {
for (let i = 0; i < response.data.length; i++) {
this.Cailiao.push({
value: response.data[i].材料,
label: response.data[i].材料
})
}
})
},
searchTable2() { // 查询采购单列表
this.purchasingOrder ? this.check3 = 1 : this.check3 = 0
this.supplierName0 ? this.check4 = 1 : this.check4 = 0
searchPurchaseOrder(this.pageCurrent2, this.pageSize2, this.check3, this.purchasingOrder, this.check4, this.supplierName0).then(response => {
searchPurchaseOrder(this.pageCurrent2, this.pageSize2, this.check3, this.purchasingOrder, this.check4, this.supplierName0, this.材料111).then(response => {
this.tableData2 = response.data.rows
this.total2 = response.data.total
})
@@ -477,7 +536,7 @@ export default {
},
searchTable3(row) { // 查询采购计划明细
this.采购计划流水号 = row.采购计划流水号
searchMateriel(this.采购计划流水号).then(response => {
searchMateriel(this.采购计划流水号, this.材料111).then(response => {
this.tableData3 = response.data
})
},
@@ -529,8 +588,13 @@ export default {
const { columns, data } = param
const sums = []
columns.forEach((column, index) => {
if (index === 5) {
sums[index] = '重量:'
if (index === 3) {
sums[index] = '未绑定重量:'
return
} else if (index === 4) {
sums[index] = this.未绑定数量
} if (index === 5) {
sums[index] = '绑定重量:'
return
} else if (index === 6) {
const values = data.map(item => Number(item['总重量']))
@@ -571,27 +635,50 @@ export default {
},
// 查询到货单
searchTable4() {
this.tableData5 = []
this.tableData6 = []
this.Name ? this.check = 1 : this.check = 0
this.dateRange ? this.check = 1 : (this.check = 0, this.dateRange = '')
searchArriveOrder(this.check, this.Name, this.check1, this.dateRange[0], this.dateRange[1], this.pageCurrent4, this.pageSize4).then(response => {
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
if (this.PickingValue === 0 || this.PickingValue === 1) {
this.check2 = 1
} else {
this.check2 = 0
}
searchArriveOrder(this.check, this.Name, this.check1, this.dateRange[0], this.dateRange[1], this.check2, this.PickingValue, this.pageCurrent4, this.pageSize4).then(response => {
this.tableData4 = response.data.rows
this.total4 = response.data.total
})
},
save(index, row) {
this.SUM = 0
this.allWeight = parseInt(row.批次数量 * row.单件重量 * 100) / 100
this.ALLMoney = parseInt(this.allWeight * this.单价 * 100) / 100
saveWeight(row.采购计划明细流水号, row.单件重量, this.allWeight, this.ALLMoney).then(response => {
console.log(response)
if (response.data[0].result === '1') {
this.$message.success('录入成功')
searchTable6(this.ArrivalOrderMXNumber).then(response => {
this.tableData6 = response.data
})
} else {
this.$message.error('录入失败')
}
})
for (let i = 0; i < this.tableData6.length; i++) {
this.SUM += parseFloat(this.tableData6[i].单件重量) * parseFloat(this.tableData6[i].批次数量)
}
if (this.数量 - this.SUM < 0) {
this.$message.warning('总重量已超出上限')
searchTable6(this.ArrivalOrderMXNumber).then(response => {
this.tableData6 = response.data
if (response.data.length !== 0) {
this.未绑定数量 = response.data[0].未绑定数量
}
})
} else {
saveWeight(row.采购计划明细流水号, row.单件重量, this.allWeight, this.ALLMoney).then(response => {
if (response.data[0].result === '1') {
this.$message.success('录入成功')
searchTable6(this.ArrivalOrderMXNumber).then(response => {
this.tableData6 = response.data
if (response.data.length !== 0) {
this.未绑定数量 = response.data[0].未绑定数量
}
})
} else {
this.$message.error('录入失败')
}
})
}
},
Calculation() {
this.form1.金额 = this.form1.单价 * this.form1.数量
@@ -690,8 +777,11 @@ export default {
})
},
searchTable5(row) {
this.disable = row.是否关联
console.log(this.disable)
this.tableData6 = []
this.到货单流水号 = row.到货单流水号
this.ArrivalOrderNumber = row.到货单流水号
searchTable5(this.到货单流水号).then(response => {
this.tableData5 = response.data
})
@@ -700,8 +790,10 @@ export default {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.供应商111 = row.供应商流水号
this.searchCailiao()
this.title1 = '添加到货明细'
this.form1.材料 = ''
this.form1.CailiaoValue = ''
this.form1.数量 = ''
this.form1.单价 = ''
this.form1.金额 = ''
@@ -709,29 +801,42 @@ export default {
this.dialogVisible1 = true
},
submitAddArrivalOrderMX() {
this.form1.金额 = this.form1.数量 * this.form1.单价
this.$refs['form1'].validate((valid) => {
if (valid) {
AddArrivalOrderMX(this.ArrivalOrderNumber, this.form1.材料, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新增到货材料成功')
searchTable5(this.ArrivalOrderNumber).then(response => {
this.tableData5 = response.data
})
this.dialogVisible1 = false
} else { this.$message.error('新建到货单失败') }
})
} else {
return false
}
})
if (this.form1.数量 > 0) {
this.form1.金额 = this.form1.数量 * this.form1.单价
this.$refs['form1'].validate((valid) => {
if (valid) {
AddArrivalOrderMX(this.ArrivalOrderNumber, this.form1.CailiaoValue, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
if (response.data[0].result === '1') {
this.$message.success('新增到货材料成功')
searchTable5(this.ArrivalOrderNumber).then(response => {
this.tableData5 = response.data
})
// this.dialogVisible1 = false
} else { this.$message.error('新建到货单失败') }
})
} else {
return false
}
})
} else {
this.$message.error('数量不能为0')
}
},
submitAddArrivalOrderMX1() {
this.searchCailiao()
this.form1.CailiaoValue = ''
this.form1.数量 = ''
this.form1.单价 = ''
this.form1.金额 = ''
},
editArrivalMX(row) {
if (this.$refs['form1'] !== undefined) {
this.$refs['form1'].resetFields()
}
this.供应商111 = row.供应商流水号
this.searchCailiao()
this.title1 = '编辑到货明细'
this.form1.材料 = row.材料
// this.form1.CailiaoValue = row.材料
this.form1.数量 = row.数量
this.form1.单位 = row.单位
this.form1.单价 = row.单价
@@ -740,10 +845,11 @@ export default {
this.dialogVisible1 = true
},
submitEditArrivalOrderMX() {
this.form1.CailiaoValue = '1'
this.form1.金额 = this.form1.数量 * this.form1.单价
this.$refs['form1'].validate((valid) => {
if (valid) {
EditArrivalOrderMX(this.ArrivalOrderMXNumber, this.form1.材料, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
EditArrivalOrderMX(this.ArrivalOrderMXNumber, this.form1.数量, this.form1.单位, this.form1.单价, this.form1.金额).then(response => {
if (response.data[0].result === '1') {
this.$message.success('编辑到货材料成功')
searchTable5(this.ArrivalOrderNumber).then(response => {
@@ -781,19 +887,26 @@ export default {
searchTable6(row) {
this.ArrivalOrderMXNumber = row.到货单明细流水号
this.单价 = row.单价
this.数量 = row.数量
searchTable6(this.ArrivalOrderMXNumber).then(response => {
this.tableData6 = response.data
if (response.data.length !== 0) {
this.中间变量 = response.data[0].单件重量
this.未绑定数量 = response.data[0].未绑定数量
}
})
},
addArrivalCL(row) {
this.材料111 = row.材料
this.材料数量 = row.数量
this.supplierName0 = row.供应商流水号
this.ArrivalOrderMXNumber = row.到货单明细流水号
this.tableData3 = []
this.dialogVisible2 = true
this.searchTable2()
},
handleSelectionChange(val) {
this.arrest = val
console.log(val)
},
// 选入
addMateriel() {
@@ -811,12 +924,14 @@ export default {
addMateriel(this.ArrivalOrderMXNumber, this.工艺计划流水号组, this.采购计划明细流水号组).then(response => {
if (response.data[0].result === '1') {
this.$message.success('关联成功')
this.dialogVisible2 = false
searchMateriel(this.采购计划流水号).then(response => {
this.tableData3 = response.data
})
searchTable6(this.ArrivalOrderMXNumber).then(response => {
this.tableData6 = response.data
if (response.data.length !== 0) {
this.未绑定数量 = response.data[0].未绑定数量
}
})
} else { this.$message.error('关联失败') }
})
@@ -828,12 +943,14 @@ export default {
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(row)
deleteMateriel(row.到货单明细绑定流水号, row.采购计划明细流水号).then(response => {
if (response.data[0].result === '1') {
this.$message.success('取消成功')
searchTable6(this.ArrivalOrderMXNumber).then(response => {
this.tableData6 = response.data
if (response.data.length !== 0) {
this.未绑定数量 = response.data[0].未绑定数量
}
})
} else { this.$message.error('取消失败') }
})

View File

@@ -1,24 +1,41 @@
<template>
<div class="app-container">
<el-card>
<span>发票号:</span>
<el-input v-model="invoiceNum" placeholder="发票号" size="small" style="margin: 3px 0;width: 130px" clearable/>
<span style="margin-left: 10px">供应商:</span>
<el-input v-model="supplierName0" placeholder="供应商" size="small" style="width:130px" clearable/>
<el-tooltip :open-delay="1200" effect="dark" content="查询外购备料发票信息" placement="top">
<el-button
type="success"
<el-row>
<span>发票号:</span>
<el-input v-model="invoiceNum" placeholder="发票号" size="small" style="margin: 3px 0;width: 180px" clearable/>
<span>供应商:</span>
<el-input v-show="false" v-model="supplierName0" placeholder="供应商" size="small" style="width:130px" clearable @focus="fetchData"/>
<el-select v-model="gongyingshangValue" placeholder="供应商" style="width: 180px" size="small" filterable clearable @change="searchTable1">
<el-option
v-for="item in gongyingshang"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
<span v-show="false" class="demonstration">时间段:</span>
<el-date-picker
v-show="false"
v-model="startTime"
value-format="yyyy-MM-dd"
size="small"
icon="el-icon-search"
style="margin-left: 10px"
@click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-tooltip>
<el-button
type="primary"
size="small"
icon="el-icon-circle-plus-outline"
style="margin-left: 10px"
@click="addTable1()">新增发票</el-button>
style="width: 180px"
type="date"
placeholder="选择日期"/>
<span v-show="false" class="demonstration">~</span>
<el-date-picker
v-show="false"
v-model="endTime"
value-format="yyyy-MM-dd"
size="small"
style="width: 180px"
type="date"
placeholder="选择日期"/>
<el-tooltip :open-delay="1200" effect="dark" content="查询外购备料发票信息" placement="top">
<el-button type="success" size="small" icon="el-icon-search" style="margin-left: 10px" @click="total1=0;pageCurrent1=1;pageSize1=10;searchTable1()">查询</el-button>
</el-tooltip>
<el-button type="primary" size="small" icon="el-icon-circle-plus-outline" style="margin-left: 10px" @click="addTable1()">新增发票</el-button>
</el-row>
</el-card>
<el-card>
<el-table
@@ -97,7 +114,7 @@
{{ scope.row.备注 }}
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right" width="250px">
<el-table-column align="center" label="操作" fixed="right" width="300px">
<template slot-scope="scope">
<el-tooltip :open-delay="1200" effect="dark" content="关联到货单" placement="top">
<div style="display: inline-block">
@@ -109,6 +126,7 @@
@click="aboutArrival(scope.row)">关联到货单</el-button>
</div>
</el-tooltip>
<el-button type="primary" size="mini" icon="el-icon-download" style="margin-left:10px" @click="downloadExcel(scope.row)">导出</el-button>
<el-tooltip :open-delay="1200" effect="dark" content="编辑" placement="top">
<div style="display: inline-block">
<el-button
@@ -234,12 +252,19 @@
</div>
</template>
<script>import { searchInvoice, addInvoice, editInvoice, deleteInvoice, searchSupplier, searchInvoiceDetail, searchArriveOrder, addMateriel, deleteInvoiceMX } from '@/api/WorkshopProcurement/OutsourcingMaterialsInvoice'
<script>
import { searchInvoice, addInvoice, editInvoice, deleteInvoice, searchSupplier, searchInvoiceDetail, searchArriveOrder, addMateriel, deleteInvoiceMX, getGongyingshang } from '@/api/WorkshopProcurement/OutsourcingMaterialsInvoice'
import { mapGetters } from 'vuex'
import { ExcelDownLoad } from '@/utils/request'
export default {
name: '', // 发票交接单
data() {
return {
gongyingshangValue: '',
gongyingshang: [],
startTime: '',
endTime: '',
contractNumValue: '',
supplierName0: '',
contractNums: [],
@@ -305,11 +330,23 @@ export default {
})
}
})
this.gongyingshangValue = ''
this.gongyingshang = []
getGongyingshang().then(response => {
for (let i = 0; i < response.data.length; i++) {
this.gongyingshang.push({
label: response.data[i].供应商名称,
value: response.data[i].供应商
})
}
})
},
searchTable1() {
this.invoiceNum ? this.check1 = 1 : this.check1 = 0
this.supplierName0 ? this.check2 = 1 : this.check2 = 0
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.supplierName0).then(response => {
this.gongyingshangValue ? this.check3 = 1 : this.check3 = 0
this.startTime && this.endTime ? this.check4 = 1 : this.check4 = 0
searchInvoice(this.pageCurrent1, this.pageSize1, this.check1, this.invoiceNum, this.check2, this.supplierName0, this.check3, this.gongyingshangValue, this.check4, this.startTime, this.endTime).then(response => {
for (let j = 0; j < response.data.rows.length; j++) {
response.data.rows[j].开票金额 = parseInt(response.data.rows[j].开票金额 * 100) / 100
if (response.data.rows[j].开票时间 !== null) {
@@ -438,7 +475,6 @@ export default {
})
},
deleteTable1(row) {
console.log(row)
this.$confirm('确认删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
@@ -506,9 +542,56 @@ export default {
message: '已取消操作'
})
})
},
downloadExcel(row) {
const _ExcelDownLoad = ExcelDownLoad
this.download(`${_ExcelDownLoad}?Fapiao=${row.发票流水号}&name=${row.供应商名称}`)
},
/**
* 下载
* @param {String} url 目标文件地址
* @param {String} filename 想要保存的文件名称
*/
download(url) {
this.getBlob(url, function(blob, filename) {
saveAs(blob, filename)
})
},
getBlob(url, cb) {
var xhr = new XMLHttpRequest()
xhr.open('GET', url, true)
xhr.responseType = 'blob'
xhr.onload = function() {
if (xhr.status === 200) {
const name = xhr.getResponseHeader('content-disposition').split('=')[1]
cb(xhr.response, name)
}
}
xhr.send()
}
}
}
/**
* 保存
* @param {Blob} blob
* @param {String} filename 想要保存的文件名称
*/
function saveAs(blob, filename = '下载文件.xls') {
if (window.navigator.msSaveOrOpenBlob) {
navigator.msSaveBlob(blob, filename)
} else {
var link = document.createElement('a')
var body = document.querySelector('body')
link.href = window.URL.createObjectURL(blob)
link.download = filename
// fix Firefox
link.style.display = 'none'
body.appendChild(link)
link.click()
body.removeChild(link)
window.URL.revokeObjectURL(link.href)
}
}
</script>
<style scoped>

View File

@@ -90,7 +90,7 @@
<el-card>
<div style="width:60%;margin-left: 18%">
<el-card>
<el-card v-show="type==='1' || type==='2'">
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="2" align="center" style="font-weight: bold">GAOJING</td>
@@ -215,6 +215,49 @@
<div style="line-height: 25px;margin-top: 10px">签订时间____年__月__日</div>
<div style="line-height: 25px">有效期限____年__月__日至____年__月__日</div>
</el-card>
<el-card v-show="type==='3'">
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr style="height: 60px">
<th colspan="14"><h3>江苏高精机电装备有限公司</h3></th>
</tr>
<tr style="height: 40px">
<th colspan="14"><h4>{{ 采购合同名称 }}</h4></th>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 15%">下单单位</td>
<td colspan="5" style="text-align: center;width: 35%">{{ supplier }}</td>
<td colspan="2" style="text-align: center;width: 15%">单号</td>
<td colspan="5" style="text-align: center;width: 35%">{{ contract }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 15%">下单日期</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 操作日期 }}</td>
<td colspan="2" style="text-align: center;width: 15%">计划完成日期</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 规定到货时间 }}</td>
</tr>
</table>
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 0px">
<tr id="tablehead10" style="height: 35px">
<td style="text-align: center;width: 7%">序号</td>
<td colspan="2" style="text-align: center;width: 20%">物料编码</td>
<td colspan="2" style="text-align: center;width: 10%">名称</td>
<td colspan="2" style="text-align: center;width: 10%">材料</td>
<td colspan="2" style="text-align: center;width: 8%">单位</td>
<td colspan="2" style="text-align: center;width: 8%">数量</td>
<td colspan="2" style="text-align: center;width: 17%">备注</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
<td colspan="2" style="text-align: center;width: 20%">{{ list.图号 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.物料名称 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.规格 }}</td>
<td colspan="2" style="text-align: center;width: 8%">{{ list.单位 }}</td>
<td colspan="2" style="text-align: center;width: 8%">{{ list.数量 }}</td>
<td colspan="2" style="text-align: center;width: 17%">{{ list.备注 }}</td>
</tr>
</table>
<div style="margin-top: 20px">联系人:___________ 联系电话:___________ </div>
</el-card>
</div>
</el-card>
@@ -278,6 +321,7 @@
<script>
import { initContract, initBuyer, searchTable1, searchTable2, submitApproval } from '@/api/WorkshopProcurement/ProcurementContractApproval'
import $ from 'jquery'
import QRCode from 'qrcode'
export default {
@@ -290,6 +334,9 @@ export default {
check3: 0,
check4: 0,
startEndDate: '',
采购合同名称: '',
规定到货时间: '',
操作日期: '',
contract: '',
contractNumValue: '',
contractNum: [],
@@ -436,57 +483,72 @@ export default {
},
searchTable2(row) {
this.type = row.模板类型
console.log(row)
console.log(this.type)
this.规定到货时间 = row.规定到货时间
this.操作日期 = row.操作日期
this.采购合同名称 = row.采购合同名称
this.textarea = row.合同文本
this.supplier = row.供应商名称
this.contract = row.采购合同编号
this.taxRate = row.税率
this.RMB = row.总金额_文本
this.TotalAmount = row.总金额
this.TotalAmount1 = parseInt((row.含税总金额) * 100) / 100
this.RMB1 = row.含税总金额_文本
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
if (row.总金额 === '0') {
this.TotalAmount = ''
this.TotalAmount1 = ''
} else {
this.TotalAmount = row.总金额
this.TotalAmount1 = parseInt((row.含税总金额) * 100) / 100
}
QRCode.toDataURL(row.采购合同流水号, opts, function(err, url) {
if (err) throw err
const img = document.getElementById('img')
img.src = url
})
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
this.RMB1 = row.含税总金额_文本
if (this.type === '1' || this.type === '2') {
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
document.getElementById('tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].图号
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].规格
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].备注
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData')[j].children[7].innerHTML = response.data[j].金额
}
})
QRCode.toDataURL(row.采购合同流水号, opts, function(err, url) {
if (err) throw err
const img = document.getElementById('img')
img.src = url
})
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].图号
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].规格
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].备注
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData')[j].children[7].innerHTML = response.data[j].金额
}
})
} else {
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns = response.data
})
}
}
}
}

View File

@@ -111,11 +111,11 @@
<el-card>
<div style="width:900px;margin-left: 350px">
<el-card>
<div id="export">
<div v-show="type==='1' || type==='2'" id="export">
<table id="1" cellspacing="0px" align="center" border width="100%" style="">
<tr style="height: 40px">
<td colspan="2" align="center" style="font-weight: bold">GAOJING</td>
<td colspan="5" align="center" style="font-weight: bold">产品销售合同</td>
<td colspan="5" align="center" style="font-weight: bold">{{ 采购合同名称 }}</td>
<td colspan="1" rowspan="3" style="width: 119px"><img id="img" alt=""></td>
</tr>
<tr style="height: 40px">
@@ -237,6 +237,49 @@
<div style="line-height: 25px;margin-top: 10px">签订时间____年__月__日</div>
<div style="line-height: 25px">有效期限____年__月__日至____年__月__日</div>
</div>
<div v-show="type === '3'" id="WGBLD" style="width: 880px;margin: 0 auto">
<table cellspacing="0px" align="center" border="1 solid black" width="100%">
<tr style="height: 60px">
<th colspan="14"><h3>江苏高精机电装备有限公司</h3></th>
</tr>
<tr style="height: 40px">
<th colspan="14"><h4>{{ 采购合同名称 }}</h4></th>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 15%">下单单位</td>
<td colspan="5" style="text-align: center;width: 35%">{{ supplier }}</td>
<td colspan="2" style="text-align: center;width: 15%">单号</td>
<td colspan="5" style="text-align: center;width: 35%">{{ contract }}</td>
</tr>
<tr style="height: 40px">
<td colspan="2" style="text-align: center;width: 15%">下单日期</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 操作日期 }}</td>
<td colspan="2" style="text-align: center;width: 15%">计划完成日期</td>
<td colspan="5" style="text-align: center;width: 35%">{{ 规定到货时间 }}</td>
</tr>
</table>
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 0px">
<tr id="tablehead10" style="height: 35px">
<td style="text-align: center;width: 7%">序号</td>
<td colspan="2" style="text-align: center;width: 20%">物料编码</td>
<td colspan="2" style="text-align: center;width: 10%">名称</td>
<td colspan="2" style="text-align: center;width: 10%">材料</td>
<td colspan="2" style="text-align: center;width: 8%">单位</td>
<td colspan="2" style="text-align: center;width: 8%">数量</td>
<td colspan="2" style="text-align: center;width: 17%">备注</td>
</tr>
<tr v-for="(list, index) in returns" :key="index" style="height: 35px">
<td style="text-align: center;width: 7%">{{ index + 1 }}</td>
<td colspan="2" style="text-align: center;width: 20%">{{ list.图号 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.物料名称 }}</td>
<td colspan="2" style="text-align: center;width: 10%">{{ list.规格 }}</td>
<td colspan="2" style="text-align: center;width: 8%">{{ list.单位 }}</td>
<td colspan="2" style="text-align: center;width: 8%">{{ list.数量 }}</td>
<td colspan="2" style="text-align: center;width: 17%">{{ list.备注 }}</td>
</tr>
</table>
<div style="margin-top: 20px">联系人:___________ 联系电话:___________ </div>
</div>
</el-card>
</div>
</el-card>
@@ -300,6 +343,9 @@ export default {
value: 3,
label: '未审批'
}],
采购合同名称: '',
规定到货时间: '',
操作日期: '',
approvalValue: '',
RMB: '',
TotalAmount: '',
@@ -424,15 +470,27 @@ export default {
})
},
exportTable() {
const htmlNode = $('#export').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
if (this.type === '1' || this.type === '2') {
const htmlNode = $('#export').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
} else {
const htmlNode = $('#WGBLD').html()
const body = $('body')
body.children().hide()
const printNode = $(htmlNode)
body.append(printNode)
window.print()
body.children().not('script').show()
body.children().not('#app').hide()
printNode.remove()
}
},
handleSizeChange1(val) {
this.pageCurrent1 = 1
@@ -446,6 +504,9 @@ export default {
searchTable2(row) {
this.type = row.模板类型
console.log(this.type)
this.规定到货时间 = row.规定到货时间
this.操作日期 = row.操作日期
this.采购合同名称 = row.采购合同名称
this.textarea = row.合同文本
this.supplier = row.供应商名称
this.contract = row.采购合同编号
@@ -459,48 +520,55 @@ export default {
this.TotalAmount1 = parseInt((row.含税总金额) * 100) / 100
}
this.RMB1 = row.含税总金额_文本
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
}
QRCode.toDataURL(row.采购合同流水号, opts, function(err, url) {
if (err) throw err
const img = document.getElementById('img')
img.src = url
})
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
if (this.type === '1' || this.type === '2') {
document.getElementById('23').innerText = this.textarea
this.contractValue = parseInt(row.采购合同流水号)
const opts = {
errorCorrectionLevel: 'H',
type: 'image/jpeg',
rendererOpts: {
quality: 0.3
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
QRCode.toDataURL(row.采购合同流水号, opts, function(err, url) {
if (err) throw err
const img = document.getElementById('img')
img.src = url
})
searchTable2(this.contractValue).then(response => {
this.returns = response.data
const children = document.getElementsByClassName('tableData')
const parent = document.getElementById('4')
if (children.length !== 0) {
for (let i = children.length - 1; i >= 0; i--) {
parent.removeChild(children[i])
}
}
const tr = []
for (let i = 0; i < this.returns.length; i++) {
tr[i] = document.createElement('tr')
tr[i].setAttribute('class', 'tableData')
tr[i].innerHTML = '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' +
'<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>' + '<td colspan="1" align="center"></td>'
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].图号
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].规格
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].备注
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData')[j].children[7].innerHTML = response.data[j].金额
}
})
$('#tableHead').after(tr[i])
}
for (let j = 0; j < this.returns.length; j++) {
document.getElementsByClassName('tableData')[j].children[0].innerHTML = response.data[j].图号
document.getElementsByClassName('tableData')[j].children[1].innerHTML = response.data[j].物料名称
document.getElementsByClassName('tableData')[j].children[2].innerHTML = response.data[j].规格
document.getElementsByClassName('tableData')[j].children[3].innerHTML = response.data[j].物料计划到货时间.split(' ')[0]
document.getElementsByClassName('tableData')[j].children[4].innerHTML = response.data[j].备注
document.getElementsByClassName('tableData')[j].children[5].innerHTML = response.data[j].数量
document.getElementsByClassName('tableData')[j].children[6].innerHTML = response.data[j].单价
document.getElementsByClassName('tableData')[j].children[7].innerHTML = response.data[j].金额
}
})
} else {
this.contractValue = parseInt(row.采购合同流水号)
searchTable2(this.contractValue).then(response => {
this.returns = response.data
})
}
// searchTable3(this.contractValue).then(response => {
// this.returns1 = response.data
// const children1 = document.getElementsByClassName('tableData1')