更新
This commit is contained in:
@@ -9,14 +9,14 @@
|
||||
<el-checkbox v-model="all" size="small">查询全部</el-checkbox>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="打印备料单" placement="top"/>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="打印备料单" placement="top">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left:0px" @click="exportTable('BL')">导出备料单</el-button>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="将选中零件分配为外购备料" placement="top">
|
||||
<el-button type="primary" size="small" icon="el-icon-success" plain style="margin-left:0px" @click="edit2()">分配外购备料</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="将选中零件分配为自家备料" placement="top">
|
||||
<el-button type="warning" size="small" icon="el-icon-success" plain style="margin-left:10px" @click="edit()">自家备料</el-button>
|
||||
<el-button type="warning" size="small" icon="el-icon-success" plain style="margin-left:10px" @click="edit()">分配自家备料</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="将选中零件分配为外购备料" placement="top">
|
||||
<el-button type="primary" size="small" icon="el-icon-success" plain style="margin-left:10px" @click="edit2()">外购备料</el-button>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="打印备料单" placement="top">
|
||||
<el-button type="primary" size="small" icon="el-icon-printer" style="margin-left:10px" @click="exportTable('BL')">打印自家备料单</el-button>
|
||||
</el-tooltip>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
@@ -552,7 +552,6 @@ export default {
|
||||
this.err = 0
|
||||
if (this.groupValue) {
|
||||
this.listLoading = true
|
||||
alert(122)
|
||||
if (this.groupName.indexOf('MX') > -1) {
|
||||
for (let i = 0; i < this.tableDataAll.length; i++) {
|
||||
const data = this.tableDataAll[i]
|
||||
@@ -566,6 +565,13 @@ export default {
|
||||
if (resp.data[0].result === '0') {
|
||||
this.err++
|
||||
}
|
||||
} else {
|
||||
const total = parseInt(data.备件数量) + parseFloat(data.装机数量) * parseInt(data.部件数量)
|
||||
const resp = await transferMX(data.图号或者型号, data.名称, total, data.备注, data.标记, data.设计者编号, data.组件流水号, data.材料流水号, data.规格, 1, data.是否传递, data.序号, data.id, data.备件数量, data.部件数量, 1)
|
||||
await sleep(10)
|
||||
if (resp.data[0].result === '0') {
|
||||
this.err++
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const total = parseInt(data.备件数量) + parseFloat(data.装机数量) * parseInt(data.部件数量)
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
<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="pageCurrent1=1;pageSize1=10;total1=0;searchTable1()">查询</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="向选择的采购单里添加采购零件" placement="top">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入物料</el-button>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="向选择的采购计划里添加采购零件" placement="top">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入外购备料</el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="将零件打回重新分配备料计划" placement="top">
|
||||
<el-button type="danger" size="small" icon="el-icon-download" style="margin-left: 10px" @click="back">打回</el-button>
|
||||
<el-button type="danger" size="small" icon="el-icon-download" style="margin-left: 10px" @click="back">打回重新分配</el-button>
|
||||
</el-tooltip>
|
||||
<el-table v-loading="loading1" :data="tableData1" border stripe highlight-current-row style="width: 100%;margin-top:3px;" height="330" size="mini" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" align="center" width="55"/>
|
||||
@@ -75,16 +75,16 @@
|
||||
|
||||
<el-card>
|
||||
<div> <!--slot="header"-->
|
||||
<span>采购单号:</span>
|
||||
<el-input v-model="purchasingOrder" placeholder="采购单号" size="small" style="margin: 3px 0" clearable/>
|
||||
<span>采购计划单号:</span>
|
||||
<el-input v-model="purchasingOrder" placeholder="采购计划单号" size="small" style="margin: 3px 0" clearable/>
|
||||
<span style="margin-left: 10px">供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="查询采购单" placement="top">
|
||||
<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>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addPurchaseOrder">创建采购单</el-button>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="保存选中的采购单" placement="top">
|
||||
<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-plus" style="margin-left: 10px" @click="addPurchaseOrder">创建采购计划单</el-button>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="保存选中的采购计划单" placement="top">
|
||||
<el-button type="baocun" size="small" icon="el-icon-download" style="margin-left: 10px" @click="saveMateriel">保存采购计划单</el-button>
|
||||
</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">
|
||||
@@ -95,12 +95,12 @@
|
||||
<el-tag v-if="Number(scope.row.采购计划状态)===2" type="success" size="mini">已导出</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单号" align="center" min-width="170">
|
||||
<el-table-column label="采购计划单号" align="center" min-width="170">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单名称" align="center" min-width="170">
|
||||
<el-table-column label="采购计划单名称" align="center" min-width="170">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
@@ -127,19 +127,19 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip effect="dark" content="编辑" placement="top">
|
||||
<el-tooltip :open-delay="600" effect="dark" content="编辑" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button :disabled="parseInt(scope.row.采购计划状态)===2" type="text" size="mini" icon="el-icon-edit-outline" @click="editPurchaseOrder(scope.row)"/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-tooltip :open-delay="600" 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)"/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="导出打印采购计划" placement="top">
|
||||
<el-tooltip :open-delay="600" effect="dark" content="打印采购计划单" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button type="text" size="mini" icon="el-icon-download" style="margin-left: 20px" @click="exportExcel(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-printer" style="margin-left: 20px" @click="exportExcel(scope.row)"/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
@@ -156,7 +156,7 @@
|
||||
@size-change="handleSizeChange2"
|
||||
@current-change="handleCurrentChange2"/>
|
||||
</div>
|
||||
<el-table v-loading="" :data="tableData3" border highlight-current-row stripe style="margin: 3px 0" height="200px" size="mini">
|
||||
<el-table v-loading="" :data="tableData3" border highlight-current-row stripe style="margin: 3px 0" height="500px" size="mini">
|
||||
<el-table-column label="物料编码" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料零件编码 }}
|
||||
@@ -182,26 +182,26 @@
|
||||
{{ scope.row.批次数量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成品尺寸(长、宽、高)" align="center">
|
||||
<el-table-column label="成品尺寸(长、宽、高)" align="center" min-width="250px">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.成品尺寸" size="mini" style="width:120px" @change="saveWeight(scope.$index, scope.row)"/>
|
||||
<el-input 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">
|
||||
<el-table-column label="单位" align="center" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.单位" size="mini" style="width:120px" @change="saveMoney(scope.$index, scope.row)"/>
|
||||
<el-input 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="备注">
|
||||
<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:150px" @change="saveRemarks(scope.$index, scope.row)"/>
|
||||
<el-input v-model="scope.row.备注1" :disabled="disable" size="mini" style="width:180px" @change="saveRemarks(scope.$index, scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<el-table-column label="操作" align="center" width="200px">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip effect="dark" content="移出" placement="top">
|
||||
<el-tooltip effect="dark" content="物料移出采购计划" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button type="text" size="mini" icon="el-icon-delete" @click="deleteMateriel(scope.row)"/>
|
||||
<el-button type="info" size="mini" icon="el-icon-right" plain @click="deleteMateriel(scope.row)">物料移出采购计划</el-button>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
@@ -209,119 +209,11 @@
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible1" title="供应商选择" center style="min-height: 300px">
|
||||
<el-form ref="form1" :model="form1" label-position="left" label-width="90px" class="searchForm">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称:">
|
||||
<el-input v-model="supplierName" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="企业性质">
|
||||
<el-input v-model="enterpriseNature" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="货期">
|
||||
<el-input v-model="goodTime" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="注册资本">
|
||||
<el-input v-model="registeredCapital" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税号">
|
||||
<el-input v-model="taxNum" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="电子邮箱">
|
||||
<el-input v-model="EMail" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="地址" >
|
||||
<el-input v-model="address" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="account" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="开户行">
|
||||
<el-input v-model="openingBank" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="电话号码">
|
||||
<el-input v-model="phone" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="传真">
|
||||
<el-input v-model="fax" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
style="margin-left: 45px;margin-top: 4px"
|
||||
icon="el-icon-search"
|
||||
@click="searchSupplier">查询</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitSelectSupplier">确定</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="small"
|
||||
icon="el-icon-delete"
|
||||
@click="emptySupplierDetail">清空</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-table :data="tableData01" size="mini" style="width: 100%;margin-top:10px" height="400px" border highlight-current-row stripe @row-click="showSupplierDetail">
|
||||
<el-table-column align="center" label="供应商名称" min-width="250">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="企业性质" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.企业性质 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="创立日期" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.创立日期 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="注册资本" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.注册资本 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-el-drag-dialog :title="title2" :visible.sync="dialogVisible2" center style="min-height: 300px" width="750px">
|
||||
<el-form ref="form2" :model="form2" :rules="rules2" label-position="right" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="采购单名称" prop="采购单名称">
|
||||
<el-form-item label="采购计划单名称" prop="采购计划单名称">
|
||||
<el-input v-model="form2.采购单名称" size="small"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -333,10 +225,14 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="供应商名称" prop="供应商名称">
|
||||
<el-input v-model="form2.供应商名称" size="small" readonly>
|
||||
<el-button slot="append" icon="el-icon-search" @click="dialogVisible1=true"/>
|
||||
</el-input>
|
||||
<el-form-item label="供应商" prop="supplierNameValue">
|
||||
<el-select v-model="form2.supplierNameValue" placeholder="供应商" size="small" filterable>
|
||||
<el-option
|
||||
v-for="item in supplierNames"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -354,13 +250,13 @@
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
v-show="title2==='创建采购单'"
|
||||
v-show="title2==='创建采购计划单'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitAddPurchaseOrder">确定</el-button>
|
||||
<el-button
|
||||
v-show="title2==='编辑采购单'"
|
||||
v-show="title2==='编辑采购计划单'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@@ -392,7 +288,7 @@
|
||||
<table cellspacing="0px" align="center" border="1 solid black" width="100%" style="margin-top: 0px">
|
||||
<tr id="tablehead" 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: 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>
|
||||
@@ -418,8 +314,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { initPartDrawing, searchPurchasedMaterials, searchPurchaseOrder, searchSupplier, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, searchMateriel,
|
||||
addMateriel, deleteMateriel, saveMateriel, searchRawMaterial, addMateriel2, saveWeight, edit2 } from '@/api/WorkshopProcurement/CreatingPurchasingMaterials'
|
||||
import { initPartDrawing, searchPurchasedMaterials, searchPurchaseOrder, addPurchaseOrder, searchSupplier, editPurchaseOrder, deletePurchaseOrder, searchMateriel,
|
||||
addMateriel, deleteMateriel, saveMateriel, saveMateriel1, searchRawMaterial, addMateriel2, saveWeight, edit2 } from '@/api/WorkshopProcurement/CreatingPurchasingMaterials'
|
||||
import QRCode from 'qrcode'
|
||||
import $ from 'jquery'
|
||||
import { mapGetters } from 'vuex'
|
||||
@@ -431,6 +327,7 @@ export default {
|
||||
RawMaterialGroup: [],
|
||||
RawMaterialName: '',
|
||||
tableData: [],
|
||||
supplierNames: [],
|
||||
pageCurrent: 1,
|
||||
pageSize: 10,
|
||||
total: null,
|
||||
@@ -490,13 +387,12 @@ export default {
|
||||
form2: {
|
||||
采购计划流水号: '',
|
||||
采购单名称: '',
|
||||
供应商流水号: '',
|
||||
供应商名称: '',
|
||||
supplierNameValue: '',
|
||||
计划完成日期: ''
|
||||
},
|
||||
rules2: { // 采购表单验证规则
|
||||
采购单名称: [{ required: true, message: '请填写采购单名称' }],
|
||||
供应商名称: [{ required: true, message: '请选择供应商' }],
|
||||
supplierNameValue: [{ required: true, message: '请选择供应商' }],
|
||||
计划完成日期: [{ required: true, message: '请选择计划完成日期' }]
|
||||
},
|
||||
tableData3: [],
|
||||
@@ -526,6 +422,14 @@ export default {
|
||||
methods: {
|
||||
// 获取原材料
|
||||
searchRawMaterial() {
|
||||
searchSupplier(0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '').then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
this.supplierNames.push({
|
||||
label: response.data[i].供应商名称,
|
||||
value: response.data[i].供应商流水号
|
||||
})
|
||||
}
|
||||
})
|
||||
searchRawMaterial(this.RawMaterialName, this.pageCurrent, this.pageSize).then(response => {
|
||||
this.tableData = response.data.rows
|
||||
this.total = parseInt(response.data.total)
|
||||
@@ -639,9 +543,9 @@ export default {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.title2 = '创建采购单'
|
||||
this.title2 = '创建采购计划单'
|
||||
this.form2.离线合同名称 = ''
|
||||
this.form2.供应商流水号 = ''
|
||||
this.form2.supplierNameValue = ''
|
||||
this.form2.供应商名称 = ''
|
||||
this.form2.计划完成日期 = ''
|
||||
this.dialogVisible2 = true
|
||||
@@ -649,7 +553,7 @@ export default {
|
||||
submitAddPurchaseOrder() { // 新建采购单
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
addPurchaseOrder(this.form2.采购单名称, this.form2.供应商流水号, this.id, this.form2.计划完成日期).then(response => {
|
||||
addPurchaseOrder(this.form2.采购单名称, this.form2.supplierNameValue, this.id, this.form2.计划完成日期).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('新建采购单成功')
|
||||
this.searchTable2()
|
||||
@@ -665,18 +569,17 @@ export default {
|
||||
if (this.$refs['form2'] !== undefined) {
|
||||
this.$refs['form2'].resetFields()
|
||||
}
|
||||
this.title2 = '编辑采购单'
|
||||
this.title2 = '编辑采购计划单'
|
||||
this.form2.采购计划流水号 = row.采购计划流水号
|
||||
this.form2.采购单名称 = row.采购单名称
|
||||
this.form2.供应商流水号 = row.供应商
|
||||
this.form2.供应商名称 = row.供应商名称
|
||||
this.form2.supplierNameValue = row.供应商
|
||||
this.form2.计划完成日期 = row.计划完成日期
|
||||
this.dialogVisible2 = true
|
||||
},
|
||||
submitEditPurchaseOrder() {
|
||||
this.$refs['form2'].validate((valid) => {
|
||||
if (valid) {
|
||||
editPurchaseOrder(this.form2.采购计划流水号, this.form2.采购单名称, this.form2.供应商流水号, this.form2.计划完成日期).then(response => {
|
||||
editPurchaseOrder(this.form2.采购计划流水号, this.form2.采购单名称, this.form2.supplierNameValue, this.form2.计划完成日期).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('修改采购单成功')
|
||||
this.searchTable2()
|
||||
@@ -689,7 +592,7 @@ export default {
|
||||
})
|
||||
},
|
||||
deletePurchaseOrder(row) { // 删除采购单
|
||||
this.$confirm('确定删除该合同?', '提示', {
|
||||
this.$confirm('确定删除该备料计划?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -711,58 +614,6 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
searchSupplier() { // 查询创立日期和注册资本大于符合条件的数据
|
||||
this.supplierName ? this.supplierCheck1 = 1 : (this.supplierCheck1 = 0, this.supplierName = '')
|
||||
this.enterpriseNature ? this.supplierCheck2 = 1 : (this.supplierCheck2 = 0, this.enterpriseNature = '')
|
||||
this.createDate ? this.supplierCheck3 = 1 : (this.supplierCheck3 = 0, this.createDate = '')
|
||||
this.registeredCapital ? this.supplierCheck4 = 1 : (this.supplierCheck4 = 0, this.registeredCapital = '')
|
||||
this.taxNum ? this.supplierCheck5 = 1 : (this.supplierCheck5 = 0, this.taxNum = '')
|
||||
this.EMail ? this.supplierCheck6 = 1 : (this.supplierCheck6 = 0, this.EMail = '')
|
||||
this.address ? this.supplierCheck7 = 1 : (this.supplierCheck7 = 0, this.address = '')
|
||||
this.account ? this.supplierCheck8 = 1 : (this.supplierCheck8 = 0, this.account = '')
|
||||
this.openingBank ? this.supplierCheck9 = 1 : (this.supplierCheck9 = 0, this.openingBank = '')
|
||||
this.phone ? this.supplierCheck10 = 1 : (this.supplierCheck10 = 0, this.phone = '')
|
||||
this.fax ? this.supplierCheck11 = 1 : (this.supplierCheck11 = 0, this.fax = '')
|
||||
this.goodTime ? this.supplierCheck12 = 1 : (this.supplierCheck12 = 0, this.goodTime = '')
|
||||
searchSupplier(this.supplierCheck1, this.supplierName, this.supplierCheck2, this.enterpriseNature, this.supplierCheck3, this.createDate, this.supplierCheck4, this.registeredCapital, this.supplierCheck5, this.taxNum, this.supplierCheck6, this.EMail, this.supplierCheck7, this.address, this.supplierCheck8, this.account, this.supplierCheck9, this.openingBank, this.supplierCheck10, this.phone, this.supplierCheck11, this.fax, this.supplierCheck12, this.goodTime).then(response => {
|
||||
this.tableData01 = response.data
|
||||
})
|
||||
},
|
||||
showSupplierDetail(row) {
|
||||
this.form2.供应商流水号 = row.供应商流水号
|
||||
this.form2.供应商名称 = row.供应商名称
|
||||
this.supplierValue = row.供应商流水号
|
||||
this.supplierName = row.供应商名称
|
||||
this.enterpriseNature = row.企业性质
|
||||
this.createDate = row.创立日期
|
||||
this.registeredCapital = row.注册资本
|
||||
this.taxNum = row.税号
|
||||
this.EMail = row.电子信箱
|
||||
this.address = row.地址
|
||||
this.account = row.帐号
|
||||
this.openingBank = row.开户行
|
||||
this.phone = row.电话号码
|
||||
this.fax = row.传真
|
||||
this.goodTime = row.货期
|
||||
},
|
||||
emptySupplierDetail() {
|
||||
this.supplierValue = ''
|
||||
this.supplierName = ''
|
||||
this.enterpriseNature = ''
|
||||
this.createDate = ''
|
||||
this.registeredCapital = ''
|
||||
this.taxNum = ''
|
||||
this.EMail = ''
|
||||
this.address = ''
|
||||
this.account = ''
|
||||
this.openingBank = ''
|
||||
this.phone = ''
|
||||
this.fax = ''
|
||||
this.goodTime = ''
|
||||
},
|
||||
submitSelectSupplier() { // 确定选择供应商
|
||||
this.dialogVisible1 = false
|
||||
},
|
||||
searchTable3(row) { // 查询采购计划明细
|
||||
this.purchasingOrderNumber = row.采购计划流水号
|
||||
this.采购单名称 = row.采购单名称
|
||||
@@ -851,28 +702,60 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
exportExcel() {
|
||||
this.$confirm('确定导出该合同?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const htmlNode = $('#WGBLD').html()
|
||||
const body = $('body')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
window.print()
|
||||
body.removeAttr('style')
|
||||
body.children().not('script').show()
|
||||
body.children().not('#app').hide()
|
||||
printNode.remove()
|
||||
}).catch(res => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
exportExcel(row) {
|
||||
if (row.采购计划状态 === '0') {
|
||||
this.$confirm('该采购计划没有保存,是否确定保存并打印?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
saveMateriel1(row.采购计划流水号).then(response => {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('保存成功并打印')
|
||||
this.searchTable2()
|
||||
} else {
|
||||
this.$message.success('保存失败')
|
||||
}
|
||||
})
|
||||
const htmlNode = $('#WGBLD').html()
|
||||
const body = $('body')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
window.print()
|
||||
body.removeAttr('style')
|
||||
body.children().not('script').show()
|
||||
body.children().not('#app').hide()
|
||||
printNode.remove()
|
||||
}).catch(res => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$confirm('确定打印备料计划?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const htmlNode = $('#WGBLD').html()
|
||||
const body = $('body')
|
||||
body.children().hide()
|
||||
const printNode = $(htmlNode)
|
||||
body.append(printNode)
|
||||
window.print()
|
||||
body.removeAttr('style')
|
||||
body.children().not('script').show()
|
||||
body.children().not('#app').hide()
|
||||
printNode.remove()
|
||||
}).catch(res => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消操作'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,19 +144,19 @@
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData1" stripe size="mini" show-summary>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="采购单号">
|
||||
<el-table-column min-width="150" align="center" label="发票号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
{{ scope.row.发票号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="150" align="center" label="采购单名称">
|
||||
<el-table-column min-width="150" align="center" label="供应商名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="计划总额" prop="请款金额">
|
||||
<el-table-column min-width="100" align="center" label="开票金额" prop="开票金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
{{ scope.row.开票金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -142,19 +142,19 @@
|
||||
<el-popover placement="right" width="500" trigger="click">
|
||||
<el-table :data="gridData1" stripe size="mini" show-summary>
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="采购单号">
|
||||
<el-table-column min-width="150" align="center" label="发票号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
{{ scope.row.发票号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="150" align="center" label="采购单名称">
|
||||
<el-table-column min-width="150" align="center" label="供应商名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="计划总额" prop="请款金额">
|
||||
<el-table-column min-width="100" align="center" label="开票金额" prop="开票金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.请款金额 }}
|
||||
{{ scope.row.开票金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -41,19 +41,19 @@
|
||||
{{ scope.row.备注 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip effect="dark" content="新增到货材料" placement="top">
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="添加到货明细" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalOrderMX(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalOrderMX(scope.row)">添加到货明细</el-button>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="编辑" placement="top">
|
||||
<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)"/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<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)"/>
|
||||
</div>
|
||||
@@ -73,14 +73,25 @@
|
||||
@current-change="handleCurrentChange4"/>
|
||||
</div>
|
||||
<h3>到货单明细</h3>
|
||||
<el-table v-loading="" :data="tableData5" border highlight-current-row stripe style="margin: 3px 0" height="200px" size="mini" @row-click="searchTable6">
|
||||
<el-table
|
||||
v-loading=""
|
||||
:data="tableData5"
|
||||
:summary-method="getSummaries"
|
||||
border
|
||||
show-summary
|
||||
highlight-current-row
|
||||
stripe
|
||||
style="margin: 3px 0"
|
||||
height="200px"
|
||||
size="mini"
|
||||
@row-click="searchTable6">
|
||||
<el-table-column width="60" align="center" type="index" label="序号"/>
|
||||
<el-table-column label="材料" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.材料 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="数量" align="center">
|
||||
<el-table-column label="数量" align="center" prop="数量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.数量 }}
|
||||
</template>
|
||||
@@ -100,19 +111,19 @@
|
||||
{{ scope.row.金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="150" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="200" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip effect="dark" content="关联材料" placement="top">
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="关联备料材料" placement="top">
|
||||
<div style="display: inline-block">
|
||||
<el-button type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalCL(scope.row)"/>
|
||||
<el-button type="text" size="mini" icon="el-icon-circle-plus-outline" @click="addArrivalCL(scope.row)">关联备料材料</el-button>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="编辑" placement="top">
|
||||
<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)"/>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<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)"/>
|
||||
</div>
|
||||
@@ -120,8 +131,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<h3>关联材料</h3>
|
||||
<el-table v-loading="" :data="tableData6" border highlight-current-row stripe style="margin: 3px 0" height="300px" size="mini">
|
||||
<h3>关联备料材料</h3>
|
||||
<el-table
|
||||
v-loading=""
|
||||
:data="tableData6"
|
||||
:summary-method="getSummaries1"
|
||||
border
|
||||
show-summary
|
||||
highlight-current-row
|
||||
stripe
|
||||
style="margin: 3px 0"
|
||||
height="300px"
|
||||
size="mini">
|
||||
<el-table-column label="物料编码" align="center" width="200">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.物料零件编码 }}
|
||||
@@ -147,11 +168,26 @@
|
||||
{{ scope.row.成品尺寸 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单件重量" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.单件重量" size="mini" style="width:70px" @change="save(scope.$index, scope.row)"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总重量" align="center" prop="总重量">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总重量 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单位 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="总金额" align="center" prop="总金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.总金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" >
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
@@ -173,7 +209,7 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" label-position="right" label-width="120px">
|
||||
<el-row>
|
||||
<el-form-item label="供应商" prop="supplierNameValue">
|
||||
<el-select v-model="form.supplierNameValue" style="width:200px" placeholder="供应商" size="small" filterable>
|
||||
<el-select v-model="form.supplierNameValue" placeholder="供应商" size="small" filterable>
|
||||
<el-option
|
||||
v-for="item in supplierNames"
|
||||
:key="item.value"
|
||||
@@ -218,7 +254,12 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="数量" prop="数量">
|
||||
<el-input v-model="form1.数量" size="small"/>
|
||||
<el-input-number v-model="form1.数量" :precision="2" :step="1" 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-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
@@ -226,26 +267,21 @@
|
||||
<el-input v-model="form1.单位" size="small"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="单价" prop="单价">
|
||||
<el-input v-model="form1.单价" size="small"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="金额" prop="金额">
|
||||
<el-input v-model="form1.金额" size="small"/>
|
||||
<el-input-number v-model="form1.金额" :precision="2" :step="1" size="medium"/>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button
|
||||
v-show="title1==='新增到货材料'"
|
||||
v-show="title1==='添加到货明细'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="submitAddArrivalOrderMX">确定</el-button>
|
||||
<el-button
|
||||
v-show="title1==='编辑到货材料'"
|
||||
v-show="title1==='编辑到货明细'"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@@ -253,23 +289,21 @@
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" title="关联材料" center style="min-height: 200px" width="55%">
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" title="关联备料材料" center style="min-height: 200px" width="55%">
|
||||
<div>
|
||||
<span>采购单号:</span>
|
||||
<el-input v-model="purchasingOrder" placeholder="采购单号" size="small" style="margin: 3px 0" clearable/>
|
||||
<span style="margin-left: 10px">供应商:</span>
|
||||
<el-input v-model="supplierName0" placeholder="供应商" size="small" clearable/>
|
||||
<el-tooltip :open-delay="1200" effect="dark" content="查询采购单" placement="top">
|
||||
<span>采购计划单号:</span>
|
||||
<el-input v-model="purchasingOrder" placeholder="采购计划单号" size="small" style="margin: 3px 0" clearable/>
|
||||
<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>
|
||||
</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">
|
||||
<el-table-column label="采购计划单号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单号 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="采购单名称" align="center">
|
||||
<el-table-column label="采购计划单名称" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.采购单名称 }}
|
||||
</template>
|
||||
@@ -333,26 +367,26 @@
|
||||
{{ scope.row.成品尺寸 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" align="center" >
|
||||
<el-table-column label="单位" align="center" width="60px">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.单位 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" >
|
||||
<el-table-column label="备注" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注1 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入原材料</el-button>
|
||||
<el-button type="primary" size="small" icon="el-icon-download" style="margin-left: 10px" @click="addMateriel">选入备料材料</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { searchPurchaseOrder, searchMateriel, addMateriel, searchArriveOrder, addPurchaseOrder, editPurchaseOrder, deletePurchaseOrder, searchTable5, searchSupplier, deleteArrivalMX, EditArrivalOrderMX, AddArrivalOrderMX, deleteMateriel, searchTable6 } from '@/api/WorkshopProcurement/NewArrivalList.js'
|
||||
import { 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 {
|
||||
@@ -365,6 +399,8 @@ export default {
|
||||
arrest: [],
|
||||
check: 0,
|
||||
Name: '',
|
||||
单价: '',
|
||||
ALLMoney: '',
|
||||
tableData2: [],
|
||||
total2: 0,
|
||||
pageCurrent2: 1,
|
||||
@@ -387,10 +423,11 @@ export default {
|
||||
form1: {
|
||||
材料: '',
|
||||
数量: '',
|
||||
单位: '',
|
||||
单位: 'KG',
|
||||
单价: '',
|
||||
金额: ''
|
||||
},
|
||||
allWeight: '',
|
||||
supplierNames: [],
|
||||
dialogVisible: false,
|
||||
dialogVisible1: false,
|
||||
@@ -446,9 +483,96 @@ export default {
|
||||
this.tableData3 = response.data
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 1) {
|
||||
sums[index] = '总数量:'
|
||||
return
|
||||
} else if (index === 2) {
|
||||
const values = data.map(item => Number(item['数量']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index]
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 4) {
|
||||
sums[index] = '总金额:'
|
||||
return
|
||||
} else if (index === 5) {
|
||||
const values = data.map(item => Number(item['金额']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' 元'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
getSummaries1(param) {
|
||||
const { columns, data } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 5) {
|
||||
sums[index] = '总重量:'
|
||||
return
|
||||
} else if (index === 6) {
|
||||
const values = data.map(item => Number(item['总重量']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index]
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
} else if (index === 7) {
|
||||
sums[index] = '总金额:'
|
||||
return
|
||||
} else if (index === 8) {
|
||||
const values = data.map(item => Number(item['总金额']))
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr)
|
||||
if (!isNaN(value)) {
|
||||
return Number(prev) + Number(curr)
|
||||
} else {
|
||||
return Number(prev)
|
||||
}
|
||||
}, 0)
|
||||
sums[index] += ' 元'
|
||||
} else {
|
||||
sums[index] = 'N/A'
|
||||
}
|
||||
}
|
||||
})
|
||||
return sums
|
||||
},
|
||||
// 查询到货单
|
||||
searchTable4() {
|
||||
console.log(this.dateRange)
|
||||
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 => {
|
||||
@@ -456,6 +580,24 @@ export default {
|
||||
this.total4 = response.data.total
|
||||
})
|
||||
},
|
||||
save(index, row) {
|
||||
this.allWeight = row.批次数量 * row.单件重量
|
||||
this.ALLMoney = this.allWeight * this.单价
|
||||
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('录入失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
Calculation() {
|
||||
this.form1.金额 = this.form1.单价 * this.form1.数量
|
||||
},
|
||||
handleSizeChange4(val) { // 采购单列表分页
|
||||
this.pageSize4 = val
|
||||
this.pageCurrent4 = 1
|
||||
@@ -473,6 +615,7 @@ export default {
|
||||
this.title = '新增到货单'
|
||||
this.form.备注 = ''
|
||||
this.form.supplierNameValue = ''
|
||||
this.supplierNames = []
|
||||
this.dialogVisible = true
|
||||
searchSupplier(0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '', 0, '').then(response => {
|
||||
for (let i = 0; i < response.data.length; i++) {
|
||||
@@ -528,7 +671,7 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteArrivalOrder(row) { // 删除采购单
|
||||
this.$confirm('确定删除该合同?', '提示', {
|
||||
this.$confirm('确定删除该到货单?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -537,6 +680,8 @@ export default {
|
||||
if (response.data[0].result === '1') {
|
||||
this.$message.success('删除成功')
|
||||
this.searchTable4()
|
||||
this.tableData5 = []
|
||||
this.tableData6 = []
|
||||
} else { this.$message.error('数据占用,删除失败') }
|
||||
})
|
||||
}).catch(() => {
|
||||
@@ -547,6 +692,7 @@ export default {
|
||||
})
|
||||
},
|
||||
searchTable5(row) {
|
||||
this.tableData6 = []
|
||||
this.到货单流水号 = row.到货单流水号
|
||||
searchTable5(this.到货单流水号).then(response => {
|
||||
this.tableData5 = response.data
|
||||
@@ -556,16 +702,16 @@ export default {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '新增到货材料'
|
||||
this.title1 = '添加到货明细'
|
||||
this.form1.材料 = ''
|
||||
this.form1.数量 = ''
|
||||
this.form1.单位 = ''
|
||||
this.form1.单价 = ''
|
||||
this.form1.金额 = ''
|
||||
this.ArrivalOrderNumber = row.到货单流水号
|
||||
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 => {
|
||||
@@ -586,7 +732,7 @@ export default {
|
||||
if (this.$refs['form1'] !== undefined) {
|
||||
this.$refs['form1'].resetFields()
|
||||
}
|
||||
this.title1 = '编辑到货材料'
|
||||
this.title1 = '编辑到货明细'
|
||||
this.form1.材料 = row.材料
|
||||
this.form1.数量 = row.数量
|
||||
this.form1.单位 = row.单位
|
||||
@@ -596,6 +742,7 @@ export default {
|
||||
this.dialogVisible1 = true
|
||||
},
|
||||
submitEditArrivalOrderMX() {
|
||||
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 => {
|
||||
@@ -613,7 +760,7 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteArrivalMX(row) {
|
||||
this.$confirm('确定删除该合同?', '提示', {
|
||||
this.$confirm('确定删除该到货单明细?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -635,13 +782,16 @@ export default {
|
||||
},
|
||||
searchTable6(row) {
|
||||
this.ArrivalOrderMXNumber = row.到货单明细流水号
|
||||
searchTable6(this.到货单流水号).then(response => {
|
||||
this.单价 = row.单价
|
||||
searchTable6(this.ArrivalOrderMXNumber).then(response => {
|
||||
this.tableData6 = response.data
|
||||
})
|
||||
},
|
||||
addArrivalCL(row) {
|
||||
this.supplierName0 = row.供应商流水号
|
||||
this.ArrivalOrderMXNumber = row.到货单明细流水号
|
||||
this.dialogVisible2 = true
|
||||
this.searchTable2()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.arrest = val
|
||||
@@ -701,6 +851,11 @@ export default {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-table__footer-wrapper tbody td, .el-table__header-wrapper tbody td {
|
||||
/* background-color: #7eaced; */
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
.offlineContract td{
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
@@ -735,3 +890,10 @@ export default {
|
||||
top: 5px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.el-table__footer-wrapper tbody td, .el-table__header-wrapper tbody td {
|
||||
background-color: #F5F7FA;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
@expand-change="searchTable02">
|
||||
<el-table-column type="expand" label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-table :data="gridData" class="subTableHeader" stripe border size="mini" style="width: 40%">
|
||||
<el-table :data="gridData" class="subTableHeader" show-summary stripe border size="mini" style="width: 40%">
|
||||
<el-table-column width="50" align="center" type="index" label="序号"/>
|
||||
<el-table-column min-width="150" align="center" label="供应商">
|
||||
<template slot-scope="scope">
|
||||
@@ -46,6 +46,11 @@
|
||||
{{ scope.row.日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" align="center" prop="到货金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.到货金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="100" align="center" label="备注">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
@@ -100,7 +105,7 @@
|
||||
type="text"
|
||||
size="mini"
|
||||
icon="el-icon-share"
|
||||
@click="aboutArrival(scope.row)"/>
|
||||
@click="aboutArrival(scope.row)">关联到货单</el-button>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
<el-tooltip effect="dark" content="编辑" placement="top">
|
||||
@@ -138,10 +143,10 @@
|
||||
@current-change="handleCurrentChange1"/>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="23%">
|
||||
<el-dialog v-el-drag-dialog :title="title1" :visible.sync="dialogVisible1" center style="min-height: 300px" width="400px">
|
||||
<el-form ref="form1" :model="form1" :rules="rules1" label-width="110px">
|
||||
<el-form-item label="供应商" prop="supplierNameValue">
|
||||
<el-select v-model="form1.supplierNameValue" style="width:200px" placeholder="供应商" size="small" filterable>
|
||||
<el-select v-model="form1.supplierNameValue" placeholder="供应商" size="small" filterable>
|
||||
<el-option
|
||||
v-for="item in supplierNames"
|
||||
:key="item.value"
|
||||
@@ -171,8 +176,6 @@
|
||||
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible" title="关联到货单" center style="min-height: 200px" width="45%">
|
||||
<div>
|
||||
<span style="margin-left: 10px">供应商:</span>
|
||||
<el-input v-model="Name" placeholder="供应商" size="small" clearable/>
|
||||
<span style="margin-left: 10px">时间段:</span>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
@@ -201,6 +204,11 @@
|
||||
{{ scope.row.日期.split(' ')[0] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.到货金额 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.备注 }}
|
||||
@@ -324,9 +332,9 @@ export default {
|
||||
},
|
||||
// 查询到货单
|
||||
searchTable4() {
|
||||
console.log(this.dateRange)
|
||||
console.log(this.Name)
|
||||
this.Name ? this.check = 1 : this.check = 0
|
||||
this.dateRange ? this.check = 1 : (this.check = 0, this.dateRange = '')
|
||||
this.dateRange ? this.check1 = 1 : (this.check1 = 0, this.dateRange = '')
|
||||
searchArriveOrder(this.check, this.Name, this.check1, this.dateRange[0], this.dateRange[1], this.pageCurrent4, this.pageSize4).then(response => {
|
||||
this.tableData4 = response.data.rows
|
||||
this.total4 = response.data.total
|
||||
@@ -449,8 +457,10 @@ export default {
|
||||
})
|
||||
},
|
||||
aboutArrival(row) {
|
||||
this.Name = row.供应商
|
||||
this.发票流水号 = row.发票流水号
|
||||
this.dialogVisible = true
|
||||
this.searchTable4()
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.arrest = val
|
||||
|
||||
@@ -30,7 +30,19 @@
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-table v-loading="" :data="tableData1" border stripe highlight-current-row style="margin-top: 3px;" height="600px" size="mini" show-summary @expand-change="searchTable02">
|
||||
<el-table
|
||||
v-loading=""
|
||||
:data="tableData1"
|
||||
:row-key="getRowKeys"
|
||||
:expand-row-keys="expands"
|
||||
border
|
||||
stripe
|
||||
highlight-current-row
|
||||
style="margin-top: 3px;"
|
||||
height="600px"
|
||||
size="mini"
|
||||
show-summary
|
||||
@expand-change="searchTable02">
|
||||
<el-table-column type="expand" label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-table :data="gridData" class="subTableHeader" stripe size="mini" show-summary style="width: 40%">
|
||||
@@ -45,7 +57,7 @@
|
||||
{{ scope.row.供应商名称 }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="150" align="center" label="开票金额">
|
||||
<el-table-column min-width="150" align="center" label="开票金额" prop="开票金额">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.开票金额 }}
|
||||
</template>
|
||||
@@ -122,23 +134,17 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" title="采购计划请款" center style="min-height: 300px" width="1200px">
|
||||
<el-dialog v-el-drag-dialog :visible.sync="dialogVisible2" title="采购计划请款" center style="min-height: 300px" width="800px">
|
||||
<span>供应商:</span>
|
||||
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small">
|
||||
<el-select v-model="supplierValue" placeholder="供应商" filterable size="small" clearable @change="pageCurrent1=1;pageSize1=10;total1=0;searchTable01()">
|
||||
<el-option
|
||||
v-for="item in supplier"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"/>
|
||||
</el-select>
|
||||
<el-button
|
||||
type="success"
|
||||
size="small"
|
||||
icon="el-icon-search"
|
||||
style="margin: 0 10px 10px 10px"
|
||||
@click="pageCurrent1=1;pageSize1=10;total1=0;searchTable01()">查询</el-button>
|
||||
<el-table v-loading="" :data="tableData01" border stripe highlight-current-row style="max-height: 300px;" height="300px" size="mini" @selection-change="handleSelectionChange">
|
||||
<el-table-column :selectable="selectable" type="selection" align="center" width="50"/>
|
||||
<el-table-column type="selection" align="center" width="50"/>
|
||||
<el-table-column label="发票号" align="center" min-width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.发票号 }}
|
||||
@@ -156,12 +162,12 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span>合计:<el-input v-model="SUM" size="mini" style="width: 80px; margin: 10px 10px 0 10px"/>元</span>
|
||||
<el-button type="primary" size="small" style="float:right;margin: 10px 10px 0 10px" icon="el-icon-check" @click="submitRequestFund">确定请款</el-button>
|
||||
<el-button type="primary" size="small" style="float:right;margin: 10px 10px 0 10px" icon="el-icon-check" @click="submitRequestFund">提交请款审批</el-button>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>import { searchRequestFund, searchOfflineContract, submitRequestFund, searchRequsetFundDetail, cancelRequestFund } from '@/api/WorkshopProcurement/RequestOutsourcingMaterials'
|
||||
<script>import { searchRequestFund, searchOfflineContract, searchOfflineContract1, submitRequestFund, searchRequsetFundDetail, cancelRequestFund } from '@/api/WorkshopProcurement/RequestOutsourcingMaterials'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
@@ -171,6 +177,7 @@ export default {
|
||||
check1: 0,
|
||||
check2: 0,
|
||||
dateRange: '',
|
||||
expands: [],
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '上季度',
|
||||
@@ -260,25 +267,18 @@ export default {
|
||||
this.searchTable1()
|
||||
},
|
||||
requestFund() { // 请款
|
||||
this.searchTable01()
|
||||
this.dialogVisible2 = true
|
||||
this.supplierValue = ''
|
||||
this.fetchData() // 重新获取供应商
|
||||
this.tableData01 = []
|
||||
},
|
||||
searchTable01() { // 查询待请款
|
||||
if (this.supplierValue) {
|
||||
this.contractGroup = []
|
||||
searchOfflineContract(this.supplierValue).then(response => {
|
||||
this.tableData01 = response.data
|
||||
this.tableData01.map(v => {
|
||||
this.$set(v, '请款金额', 0)
|
||||
v.请款金额 = v.总价 - v.已付金额
|
||||
return v
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.$message.error('请选择供应商')
|
||||
}
|
||||
this.contractGroup = []
|
||||
this.supplierValue ? this.check = 1 : this.check = 0
|
||||
searchOfflineContract1(this.check, this.supplierValue).then(response => {
|
||||
this.tableData01 = response.data
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.SUM = 0
|
||||
@@ -290,9 +290,6 @@ export default {
|
||||
this.sumGroup.push(val[i].开票金额)
|
||||
}
|
||||
},
|
||||
selectable(row, index) { // 控制某行是否可选
|
||||
return parseInt(row.已请款) !== 1 // 已经请款
|
||||
},
|
||||
submitRequestFund() { // 确认请款
|
||||
if (this.supplierValue && this.contractGroup.length !== 0) {
|
||||
submitRequestFund(this.contractGroup, this.sumGroup, this.supplierValue, this.SUM, this.id).then(response => {
|
||||
@@ -307,10 +304,28 @@ export default {
|
||||
}
|
||||
},
|
||||
searchTable02(row) { // 查看详情(请款信息包含的合同)
|
||||
if (this.a === 1) {
|
||||
this.expands.push(row.采购计划请款流水号)
|
||||
this.b = row.采购计划请款流水号
|
||||
this.a = 0
|
||||
} else {
|
||||
if (this.b === row.采购计划请款流水号) {
|
||||
this.expands = []
|
||||
this.a = 1
|
||||
} else {
|
||||
this.expands = []
|
||||
this.expands.push(row.采购计划请款流水号)
|
||||
this.a = 0
|
||||
this.b = row.采购计划请款流水号
|
||||
}
|
||||
}
|
||||
searchRequsetFundDetail(row.采购计划请款流水号).then(response => {
|
||||
this.gridData = response.data
|
||||
})
|
||||
},
|
||||
getRowKeys(row) {
|
||||
return row.采购计划请款流水号
|
||||
},
|
||||
cancelRequestFund(row) { // 取消请款
|
||||
this.$confirm('确定取消请款?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
|
||||
Reference in New Issue
Block a user