<template>
|
<section>
|
<!--工具条-->
|
<SearchBar
|
:buttonList="buttonList"
|
@callFunction="callFunction"
|
></SearchBar>
|
|
<!--
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
<el-form :inline="true" :model="filters" @submit.native.prevent>
|
<el-form-item>
|
<el-input v-model="filters.Name" placeholder="仓库名称"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="getWineOrder">查询</el-button>
|
<el-button type="primary" @click="handleAdd">新增</el-button>
|
<el-button type="primary" @click="handleAdd">编辑</el-button>
|
</el-form-item>
|
</el-form>
|
</el-col>-->
|
<div class="hideBox">
|
<!--列表-->
|
<el-table
|
:data="WMPurchaseInfo"
|
highlight-current-row
|
@current-change="selectCurrentRow"
|
v-loading="listLoading"
|
@selection-change="selsChange"
|
@select="selsChangeOne"
|
ref="multipleTable"
|
style="width: 100%"
|
border
|
>
|
<el-table-column type="selection" width="40"></el-table-column>
|
<el-table-column type="index" width="40"></el-table-column>
|
<el-table-column
|
prop="PurchaseCode"
|
label="采购编号"
|
width="120px"
|
sortable
|
>
|
<template slot-scope="scope">
|
<el-tooltip content="right center" placement="right" effect="light">
|
<div
|
slot="content"
|
v-for="(item, index) in scope.row.PurchaseQuoteDetailList"
|
v-bind:key="index"
|
>
|
<span v-if="item.ProductName"
|
>商品名称:{{ item.ProductName }}
|
</span>
|
|
<span v-if="item.ProductSpec"
|
>商品规格:{{ item.ProductSpec }}</span
|
><br />
|
</div>
|
<span>{{ scope.row.PurchaseCode }}</span>
|
</el-tooltip>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="StatusName"
|
label="审核状态"
|
width="110px"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="WareHouseName"
|
label="仓库"
|
width="110px"
|
sortable
|
></el-table-column>
|
|
<!-- <el-table-column prop="EmployeeId" label="部门" width="" sortable>
|
</el-table-column>-->
|
|
<el-table-column
|
prop="UName"
|
label="申请人"
|
width="90px"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="DName"
|
label="部门名称"
|
width="110px"
|
sortable
|
></el-table-column>
|
|
<el-table-column
|
prop="CheckName"
|
label="审批员"
|
width="110px"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="TypeName"
|
label="采购类型"
|
width="110px"
|
sortable
|
></el-table-column>
|
<!-- <el-table-column prop="IsUse" label="状态" width="" sortable>
|
<template slot-scope="scope">
|
<el-tag
|
:type="scope.row.IsUse == 0 ? 'success' : 'danger'"
|
disable-transitions>{{scope.row.IsUse == 0 ? "启用"":"禁用"}}
|
</el-tag>
|
</template>
|
</el-table-column>-->
|
|
<!-- <el-table-column prop="IsUse" label="状态" width="" :formatter="formatIsUse" sortable>
|
</el-table-column>-->
|
<el-table-column
|
prop="CreateTime"
|
label="创建时间"
|
:formatter="formatDateTime"
|
width="150px"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="UpdateTime"
|
label="修改时间"
|
:formatter="formatDateTime"
|
width="150px"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="ProductUse"
|
label="产品用途"
|
width="130px"
|
sortable
|
></el-table-column>
|
<el-table-column prop="Remark" label="备注" sortable></el-table-column>
|
<el-table-column label="操作" width="280px">
|
<template scope="scope">
|
<el-button
|
class="el-icon-reading jbtn"
|
size="small"
|
@click="handleDetail(scope.$index, scope.row)"
|
>详情</el-button
|
>
|
<el-button
|
class="el-icon-printer jbtn"
|
size="small"
|
v-if="scope.row.Status == 30"
|
@click="handlePrint(scope.$index, scope.row)"
|
>打印</el-button
|
>
|
<el-button
|
class="el-icon-s-platform jbtn"
|
size="small"
|
@click="handlePurchaseInfoLog(scope.$index, scope.row)"
|
>操作日志</el-button
|
>
|
<!-- <el-button
|
class="el-icon-edit jbtn"
|
size="small"
|
v-if="scope.row.Status==20"
|
@click="handleDetail(scope.$index, scope.row)"
|
>重新申请</el-button> -->
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<!--工具条-->
|
<el-col :span="24" class="toolbar">
|
<!-- <el-button
|
class="el-icon-delete-solid"
|
type="danger"
|
@click="batchRemove"
|
:disabled="this.sels.length===0"
|
>批量删除</el-button> -->
|
<el-pagination
|
layout="prev, pager, next"
|
@current-change="handleCurrentChangeWMPurchaseInfo"
|
:page-size="20"
|
:total="totalWMPurchase"
|
style="float: right"
|
></el-pagination>
|
</el-col>
|
<!--打印页面-->
|
<el-dialog
|
title="打印页面"
|
:visible.sync="PrintVisible"
|
v-model="PrintVisible"
|
:close-on-click-modal="false"
|
fullscreen
|
>
|
<el-button class="el-icon-back jbtn" @click.native="PrintVisible = false"
|
>返回</el-button
|
>
|
<el-button
|
v-print="'#printTest'"
|
class="el-icon-printer"
|
v-if="DetailList.Status >= 30"
|
size="small"
|
>打印</el-button
|
>
|
<div id="printTest">
|
<div
|
style="
|
font-size: 30px;
|
line-height: 40px;
|
height: 42px;
|
color: #000;
|
width: 160px;
|
margin: 0 auto;
|
"
|
>
|
外购入库单
|
</div>
|
<h3 style="font-size: 20px; border-bottom: 1px #000; color: #000">
|
采购单信息
|
</h3>
|
<el-table
|
:data="DetailList.PurchaseQuoteDetailList"
|
border
|
style="width: 50%; font-weight: bold"
|
>
|
<el-table-column prop="PurchaseCode" label="采购编号" width="180">
|
<template scope="scope">
|
<el-input
|
@click="a(scope.$index, scope.row)"
|
disabled
|
v-model="DetailList.PurchaseCode"
|
style="border: none"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column prop="CheckName" label="采购审核人" width="180">
|
<template scope="scope">
|
<el-input
|
@click="a(scope.$index, scope.row)"
|
disabled
|
v-model="DetailList.CheckName"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="CreateTime"
|
label="采购时间"
|
:formatter="formatDateTime"
|
width="180"
|
>
|
<template scope="scope">
|
<el-input
|
@click="a(scope.$index, scope.row)"
|
disabled
|
v-model="DetailList.CreateTime"
|
:formatter="formatDateTime"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column prop="Time" label="打印日期" width="180">
|
<template scope="scope">
|
<el-input
|
@click="a(scope.$index, scope.row)"
|
disabled
|
v-model="DetailList.Time"
|
:formatter="formatTime"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column prop="UName" label="采购制单人" width="180">
|
<template scope="scope">
|
<el-input
|
@click="a(scope.$index, scope.row)"
|
disabled
|
v-model="DetailList.UName"
|
></el-input>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<h3 style="font-size: 20px; border-bottom: 1px #000; color: #000">
|
物料列表
|
</h3>
|
<el-divider></el-divider>
|
<el-table
|
:data="DetailList.PurchaseQuoteDetailList"
|
border
|
style="width: 70%; font-weight: bold"
|
>
|
<el-table-column
|
prop="ProductCode"
|
label="物料编号"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="ProductName"
|
label="物料名称"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="ProductSpec"
|
label="物料规格"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="PurchaseUnit"
|
label="单位"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="StorageNum"
|
label="数量"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="Price"
|
label="单价"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="Amount"
|
label="物料金额"
|
width="110"
|
></el-table-column>
|
<el-table-column prop="WareHouseName" label="收料仓库" width="110">
|
<template scope="scope">
|
<el-input
|
@click="a(scope.$index, scope.row)"
|
disabled
|
v-model="DetailList.WareHouseName"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="Remark"
|
label="备注"
|
width="110"
|
></el-table-column>
|
<el-table-column
|
prop="ActualAmount"
|
label="总计物料金额"
|
width="110"
|
></el-table-column>
|
</el-table>
|
<table>
|
<tr style="margin-top: 20px">
|
<td colspan="10">审核人:</td>
|
<td colspan="10">
|
|
|
|
|
|
|
送货人:
|
</td>
|
<td colspan="10">
|
|
|
|
|
|
|
制单人:
|
</td>
|
</tr>
|
</table>
|
</div>
|
</el-dialog>
|
|
<!--详情界面-->
|
<el-dialog
|
title="详情"
|
:visible.sync="editFormVisible"
|
v-model="editFormVisible"
|
:close-on-click-modal="false"
|
fullscreen
|
>
|
<el-button
|
class="el-icon-back jbtn"
|
@click.native="editFormVisible = false"
|
>返回</el-button
|
>
|
<!-- <el-button size="small" @click="handleEdit(scope.$index, scope.row)">批量删除</el-button> -->
|
<el-button
|
size="small"
|
@click.native="editSubmit"
|
:loading="editLoading"
|
v-if="DetailList.CheckAdminId == DetailList.currentID"
|
class="jbtn"
|
>审核</el-button
|
>
|
<!--
|
<el-button
|
v-print="'#printTest'"
|
v-if="DetailList.Status>=30"
|
size="small"
|
>打印</el-button>-->
|
<el-divider></el-divider>
|
<h3 style="font-size: 20px; border-bottom: 1px #000; color: #000">
|
审批流
|
</h3>
|
<el-divider></el-divider>
|
<div class="step">
|
<el-steps
|
:active="DetailList.CheckRankStep"
|
finish-status="success"
|
align-center
|
>
|
<el-step
|
:title="item"
|
:key="item"
|
v-for="item in DetailList.CheckStrStep"
|
></el-step>
|
</el-steps>
|
</div>
|
<!-- :model="DetailList" -->
|
<el-form
|
:model="editForm"
|
label-width="80px"
|
:rules="editFormRules"
|
ref="editForm"
|
style="font-weight: bold"
|
>
|
<h3 style="font-size: 20px; border-bottom: 1px #000; color: #000">
|
基础信息
|
</h3>
|
<el-divider></el-divider>
|
<table>
|
<tr>
|
<td>
|
<el-form-item label="仓库名称:" prop="WareHouseName">
|
<el-input
|
v-model="DetailList.WareHouseName"
|
auto-complete="off"
|
:disabled="true"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
<td>
|
<el-form-item label="部门:" prop="DName">
|
<el-input
|
v-model="DetailList.DName"
|
auto-complete="off"
|
:disabled="true"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
|
<td>
|
<el-form-item label="状态:" prop="StatusName">
|
<el-input
|
v-model="DetailList.StatusName"
|
auto-complete="off"
|
:disabled="true"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
|
<td>
|
<el-form-item label="类型:" prop="TypeName">
|
<el-input
|
v-model="DetailList.TypeName"
|
auto-complete="off"
|
:disabled="true"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
</tr>
|
|
<tr>
|
<td>
|
<el-form-item label="创建时间:" prop="CreateTime">
|
<el-input
|
v-model="DetailList.CreateTime"
|
auto-complete="off"
|
:disabled="true"
|
:formatter="formatDateTime"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
|
<td>
|
<el-form-item label="备注:" prop="Remark">
|
<el-input
|
v-model="DetailList.Remark"
|
auto-complete="off"
|
:disabled="true"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
|
<td>
|
<el-form-item label="产品用途:" prop="ProductUse">
|
<el-input
|
v-model="DetailList.ProductUse"
|
auto-complete="off"
|
:disabled="true"
|
style="width: 300px; text-align: center"
|
></el-input>
|
</el-form-item>
|
</td>
|
</tr>
|
</table>
|
</el-form>
|
<h3 style="font-size: 20px; border-bottom: 1px #000; color: #000">
|
商品信息
|
</h3>
|
<el-divider></el-divider>
|
<el-form
|
:model="editForm"
|
label-width="80px"
|
:rules="editFormRules"
|
ref="editForm"
|
style="font-weight: bold"
|
>
|
<el-table
|
:data="DetailList.PurchaseQuoteDetailList"
|
highlight-current-row
|
v-loading="listLoading"
|
style="width: 100%"
|
>
|
<el-table-column type="index" width="80"></el-table-column>
|
<el-table-column
|
prop="ProductName"
|
label="物料名称"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="ProductCode"
|
label="物料编号"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="ProductSpec"
|
label="物料规格"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Quantity"
|
label="初始数"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="CheckNum"
|
label="审批数"
|
v-if="
|
DetailList.Status == 0 &&
|
DetailList.CheckAdminId == DetailList.currentID
|
"
|
sortable
|
>
|
<template scope="scope">
|
<el-input-number
|
v-model="scope.row.CheckNum"
|
auto-complete="off"
|
size="mini"
|
controls-position="right"
|
></el-input-number>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="StockNum"
|
label="库存"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="WeekNum"
|
label="周用量"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="MonthNum"
|
label="月用量"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Remark"
|
label="备注"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="PurchaseQUoteDetailStatusName"
|
label="状态"
|
sortable
|
></el-table-column>
|
<el-table-column label="操作" sortable>
|
<template scope="scope">
|
<el-button
|
v-if="
|
DetailList.Status == 0 &&
|
DetailList.currentID == DetailList.EmployeeId
|
"
|
@click.native.prevent="
|
deleteProductList(scope.$index, scope.row)
|
"
|
type="danger"
|
size="small"
|
>
|
删除
|
</el-button>
|
<el-radio-group
|
v-if="
|
DetailList.Status == 0 &&
|
DetailList.CheckAdminId == DetailList.currentID
|
"
|
v-model="scope.row.Checked"
|
>
|
<el-radio class="radio" :label="1">通过</el-radio>
|
<el-radio class="radio" :label="2">不通过</el-radio>
|
</el-radio-group>
|
<el-input
|
type="textarea"
|
v-model="scope.row.PurchaseQUoteDetailRemark"
|
placeholder="请输入备注"
|
v-if="
|
DetailList.Status == 0 &&
|
DetailList.CheckAdminId == DetailList.currentID
|
"
|
></el-input>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-form>
|
</el-dialog>
|
|
<!--新增界面-->
|
<el-dialog
|
title="新增"
|
:visible.sync="addFormVisible"
|
v-model="addFormVisible"
|
:close-on-click-modal="false"
|
fullscreen
|
v-on:back="mapBack"
|
>
|
<el-button
|
class="el-icon-back jbtn"
|
@click.native="addFormVisible = false"
|
>返回</el-button
|
>
|
<el-form
|
:model="addForm"
|
label-width="80px"
|
:rules="addFormRules"
|
ref="addForm"
|
>
|
<div
|
style="
|
font-size: 30px;
|
line-height: 40px;
|
height: 42px;
|
color: #000;
|
width: 160px;
|
margin: 0 auto;
|
"
|
>
|
采购申请单
|
</div>
|
<el-divider></el-divider>
|
<el-form-item label="仓库:" prop="WareHouseId">
|
<el-select
|
v-model="addForm.WareHouseId"
|
filterable
|
placeholder="请选择仓库,可搜索"
|
@change="handleChange"
|
>
|
<el-option
|
v-for="item in WMWareHouseModules"
|
:key="item.Id"
|
:label="item.Name"
|
:value="item.Id"
|
>
|
<!-- <span style="float: left">{{ item.Name }}</span> -->
|
</el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item label="采购类型" prop="Type">
|
<el-select v-model="addForm.Type" placeholder="请选择采购类型">
|
<el-option
|
v-for="item in statusList"
|
:key="item.value"
|
:label="item.name"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="产品用途" prop="ProductUse">
|
<el-input
|
type="textarea"
|
placeholder="请输入产品用途"
|
v-model="addForm.ProductUse"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="备注">
|
<el-input type="textarea" v-model="addForm.Remark"></el-input>
|
</el-form-item>
|
</el-form>
|
<span>添加入库商品</span>
|
<el-divider></el-divider>
|
<el-button
|
class="el-icon-reading jbtn"
|
size="small"
|
@click="handleSearchProduct()"
|
>请选择入库商品</el-button
|
>
|
<div
|
style="margin-top: 20px"
|
width="100%"
|
class="flex-1"
|
v-if="addForm.noMatchData.length > 0"
|
>
|
<ul
|
v-if="addForm.noMatchData.length > 0"
|
class="infinite-list"
|
style="width: 100%; overflow: auto; max-height: 600px"
|
>
|
<div
|
v-if="addForm.noMatchData.length > 0"
|
style="
|
float: left;
|
width: 40px;
|
padding-top: 20px;
|
margin-right: 15px;
|
"
|
></div>
|
<el-table
|
v-bind:data="addForm.noMatchData"
|
:visible.sync="noLoad"
|
tooltip-effect="dark"
|
style="width: 100%"
|
v-on:selection-change="handleTransChange"
|
>
|
<el-table-column
|
prop="Name"
|
label="商品名称"
|
width="500"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Code"
|
label="物料编号"
|
width="200"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="SpecName"
|
label="规格"
|
width="180"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="UnitName"
|
label="单位"
|
width="180"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Quantity"
|
label="库存"
|
width="180"
|
sortable
|
></el-table-column>
|
<el-table-column label="物料数量" prop="WNum" width="180" sortable>
|
<template slot-scope="scope">
|
<el-input-number
|
style="width: 100px"
|
v-model="scope.row.WNum"
|
class="none"
|
controls-position="right"
|
></el-input-number>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作" width="180">
|
<template slot-scope="scope">
|
<el-button
|
class="jbtn"
|
size="mini"
|
style="width: 50px"
|
v-on:click="handleRemoveItem(scope.$index, scope.row)"
|
>移除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</ul>
|
</div>
|
<div slot="footer" class="dialog-footer text-center">
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
<el-button
|
type="primary"
|
@click.native="addSubmit"
|
:loading="addLoading"
|
>提交</el-button
|
>
|
</div>
|
</el-dialog>
|
<!--商品页面-->
|
<el-dialog
|
title="商品页面"
|
:visible.sync="SearchProductVisible"
|
v-model="SearchProductVisible"
|
:close-on-click-modal="false"
|
width="800px;"
|
>
|
<el-button
|
class="el-icon-back jbtn"
|
@click.native="SearchProductVisible = false"
|
>返回</el-button
|
>
|
<!--工具条-->
|
<el-col :span="24" class="toolbar" style="padding-bottom: 0px">
|
<el-form :inline="true" :model="filters" @submit.native.prevent>
|
<el-form-item>
|
<el-input
|
v-model="filters.name"
|
placeholder="请输入物料名称"
|
></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button class="el-icon-search jbtn" @click="getWMProductList"
|
>查询</el-button
|
>
|
</el-form-item>
|
</el-form>
|
</el-col>
|
<div class="flex-row" style="width: 100%">
|
<div style="margin-top: 20px" class="flex-1">
|
<ul class="infinite-list" style="overflow: auto; max-height: 600px">
|
<!--列表-->
|
|
<el-table
|
:data="WMProductList"
|
highlight-current-row
|
@current-change="selectCurrentRow"
|
v-loading="listLoading"
|
@selection-change="selsChange"
|
style="width: 800px"
|
>
|
<el-table-column type="index" width="50"></el-table-column>
|
<el-table-column
|
prop="Name"
|
label="商品名称"
|
width="280"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Code"
|
label="物料编号"
|
width="120"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="SpecName"
|
label="规格"
|
width="80"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="UnitName"
|
label="单位"
|
width="80"
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Quantity"
|
label="库存"
|
width="80"
|
sortable
|
></el-table-column>
|
|
<el-table-column label="操作" fixed="left" width="80">
|
<template slot-scope="scope">
|
<el-button
|
class="jbtn"
|
size="mini"
|
style="width: 50px"
|
v-on:click="handleAddItem(scope.$index, scope.row)"
|
>添加</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
|
<!--工具条-->
|
<el-col :span="24" class="toolbar">
|
<!-- <el-button type="danger" @click="batchRemove" :disabled="this.sels.length===0">批量删除</el-button> -->
|
<el-pagination
|
layout="prev, pager, next"
|
@current-change="handleCurrentChangeProductList"
|
:page-size="20"
|
:total="total"
|
style="float: right"
|
></el-pagination>
|
</el-col>
|
</ul>
|
</div>
|
</div>
|
</el-dialog>
|
|
<!--操作日志-->
|
<el-dialog
|
title="操作日志"
|
:visible.sync="LogVisible"
|
v-model="LogVisible"
|
:close-on-click-modal="false"
|
>
|
<!--列表-->
|
<el-table
|
:data="WMPurchaseInfoLog"
|
highlight-current-row
|
v-loading="listLoading"
|
@selection-change="selsChange"
|
style="width: 100%"
|
>
|
<el-table-column type="index" width="80"></el-table-column>
|
<el-table-column
|
prop="CreateTime"
|
label="操作时间"
|
:formatter="formatDateTime"
|
width
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="UName"
|
label="操作人"
|
width
|
sortable
|
></el-table-column>
|
<el-table-column
|
prop="Content"
|
label="操作内容"
|
width
|
sortable
|
></el-table-column>
|
</el-table>
|
|
<!--工具条-->
|
<el-col :span="24" class="toolbar">
|
<el-pagination
|
layout="prev, pager, next"
|
@current-change="handleCurrentChangeWMPurchaseInfolog"
|
:page-size="20"
|
:total="total"
|
style="float: right"
|
></el-pagination>
|
</el-col>
|
</el-dialog>
|
</section>
|
</template>
|
<style scoped>
|
.inline-block {
|
display: inline-block;
|
}
|
.flex-row {
|
display: flex;
|
flex-direction: row;
|
}
|
.flex-1 {
|
flex: 1;
|
}
|
.text-center {
|
text-align: center;
|
}
|
.jbtn {
|
background-color: #f90;
|
color: #f3f7fc;
|
border: 1px solid #f90;
|
}
|
.jbtn:hover {
|
background-color: #f90;
|
}
|
.hideBox .el-table thead .el-checkbox__input {
|
display: none !important;
|
}
|
</style>
|
<script>
|
import Com from "@/com/global";
|
import "../../../style/home.css";
|
import util from "../../../../util/date";
|
import {
|
testapi,
|
getWMPurchaseInfoListPage,
|
getWMProductListListPage,
|
removeWMPurchaseInfo,
|
batchRemoveUser,
|
editWMPurchaseInfo,
|
addWMPurchaseInfo,
|
getWMSListPage,
|
DetailWMPurchaseInfo,
|
WMPurchaseInfoLogListPage,
|
WMPurchaseQuoteDetailGetParams, //所有枚举状态获取
|
deleteWMProductList2, //删除商品
|
} from "../../../api/api";
|
import { getButtonList } from "../../../promissionRouter";
|
import SearchBar from "./SearchBar";
|
export default {
|
components: { SearchBar },
|
|
data() {
|
return {
|
DateTime: new Date(),
|
filters: {
|
name: "",
|
StatusOptions: "", //状态下拉--默认待审核
|
startdate: "", //开始时间
|
enddate: "", //结束时间
|
},
|
filtersProductList: {
|
name: "",
|
},
|
StatusModules: [],
|
WMPurchaseInfo: [],
|
WMWareHouseModules: [],
|
WMProductList: [],
|
noMatchData: [],
|
DetailList: [],
|
total: 0,
|
totalWMPurchase: 0,
|
WMPurchaseInfoLog: [],
|
statusList: [
|
{ name: "对内采购", value: 1 },
|
{ name: "对外采购", value: 2 },
|
],
|
EditStatus: [
|
{ name: "通过", value: 1 },
|
{ name: "不通过", value: 2 },
|
],
|
buttonList: [],
|
currentRow: null,
|
page: 1,
|
listLoading: false,
|
sels: [], //列表选中列
|
noLoad: false,
|
selectRows: [],
|
addDialogFormVisible: false,
|
editFormVisible: false, //详情界面是否显示
|
PrintVisible: false, //打印页面是否显示
|
SearchProductVisible: false, //采购时选择商品信息是否显示
|
LogVisible: false, //操作日志是否显示
|
editLoading: false,
|
editFormRules: {
|
CheckNum: [
|
{
|
required: true,
|
message: "审批数量不能小于等于0!",
|
trigger: "blur",
|
},
|
],
|
},
|
//编辑界面数据
|
editForm: {
|
DetailList: [],
|
},
|
|
addFormVisible: false, //新增界面是否显示
|
addLoading: false,
|
addFormRules: {
|
WareHouseId: [
|
{ required: true, message: "请选择仓库", trigger: "blur" },
|
],
|
ProductUse: [
|
{ required: true, message: "请填写产品用途", trigger: "blur" },
|
],
|
Type: [{ required: true, message: "请选择采购类型", trigger: "blur" }],
|
},
|
//新增界面数据
|
addForm: {
|
CheckKey: "",
|
PurchaseCode: "",
|
Status: "",
|
EmployeeId: 0,
|
WareHouseId: 0,
|
Remark: "",
|
UpdateTime: "",
|
CreateTime: "",
|
ProductUse: "",
|
noMatchData: [],
|
inputNum: 0,
|
},
|
};
|
},
|
methods: {
|
mapBack: function () {
|
this.addFormVisible.visible = false;
|
this.addFormVisible.visible = false;
|
this.getWMPurchaseInfoListPage(true);
|
},
|
selsChangeOne(selection, row) {
|
this.currentRow = row;
|
this.$refs.multipleTable.clearSelection();
|
this.$refs.multipleTable.toggleRowSelection(row);
|
this.$refs.multipleTable.setCurrentRow(row);
|
this.selectCurrentRow(row);
|
},
|
selectCurrentRow(val) {
|
this.currentRow = val;
|
console.log(val);
|
this.$refs.multipleTable.clearSelection();
|
this.$refs.multipleTable.toggleRowSelection(val);
|
},
|
callFunction(item, SearchBar) {
|
this.filters = {
|
name: item.nameSearch, //采购编号
|
StatusOptions: item.StatusoptionsSearch, //枚举状态下拉
|
startdate: item.startdateSearch, //开始时间
|
enddate: item.enddateSearch, //结束时间
|
};
|
this[item.Func].apply(this, item);
|
},
|
//显示转换
|
// formatIsUse: function (row, column) {
|
// return row.IsUse == 1 ? '启用' : row.IsUse == 0 ? '禁用' : '未知';
|
// },
|
formatDateTime: function (row, column) {
|
return !row.CreateTime || row.CreateTime == ""
|
? ""
|
: util.formatDate.format(
|
new Date(row.CreateTime),
|
"yyyy-MM-dd hh:mm:ss"
|
);
|
},
|
formatTime: function (row, column) {
|
return !row.Time || row.Time == ""
|
? ""
|
: util.formatDate.format(new Date(row.Time), "yyyy-MM-dd hh:mm:ss");
|
},
|
handleCurrentChangeWMPurchaseInfo(val) {
|
this.page = val;
|
this.getWMPurchaseInfo();
|
},
|
|
//获取采购列表
|
getWMPurchaseInfo() {
|
let para = {
|
page: this.page,
|
key: this.filters.name, //采购编号
|
StatusOptions: this.filters.StatusOptions, //状态筛选
|
startdate: this.filters.startdate, //开始时间
|
enddate: this.filters.enddate, //结束时间
|
};
|
this.listLoading = true;
|
// console.log(para);
|
testapi();
|
//NProgress.start();
|
getWMPurchaseInfoListPage(para).then((res) => {
|
this.totalWMPurchase = res.data.response.dataCount;
|
this.WMPurchaseInfo = res.data.response.data;
|
// this.noMatchData = res.data.response.data;
|
this.listLoading = false;
|
//NProgress.done();
|
});
|
},
|
//移除商品
|
handleRemoveItem: function (index, row) {
|
row.inputNum = 0;
|
this.$delete(this.addForm.noMatchData, index);
|
},
|
handleTransChange: function (selection) {
|
this.selectRows = selection;
|
},
|
handleAddList: function () {
|
for (var i in this.selectRows) {
|
this.handleAddItem(i, this.selectRows[i]);
|
}
|
},
|
//添加商品
|
handleAddItem: function (index, row) {
|
for (var i in this.addForm.noMatchData) {
|
if (this.addForm.noMatchData[i].Id == row.Id) {
|
this.$message({
|
message: "商品已经存在,请填写物料数量!!!",
|
type: "error",
|
});
|
return;
|
}
|
}
|
this.addForm.noMatchData.push(row);
|
this.addForm.noMatchData;
|
console.log(this.addForm.noMatchData);
|
// }
|
},
|
//删除
|
handleDel() {
|
let row = this.currentRow;
|
console.log(row.Id);
|
if (!row) {
|
this.$message({
|
message: "请选择要删除的一行数据!",
|
type: "error",
|
});
|
|
return;
|
}
|
this.$confirm("确认删除该记录吗?", "提示", {
|
type: "warning",
|
})
|
.then(() => {
|
this.listLoading = true;
|
|
let para = { id: row.Id };
|
removeWMPurchaseInfo(para).then((res) => {
|
if (util.isEmt.format(res)) {
|
this.listLoading = false;
|
return;
|
}
|
console.log(para);
|
this.listLoading = false;
|
|
if (res.data.success) {
|
this.$message({
|
message: "删除成功",
|
type: "success",
|
});
|
} else {
|
this.$message({
|
message: res.data.msg,
|
type: "error",
|
});
|
}
|
|
this.getWMPurchaseInfo();
|
});
|
})
|
.catch(() => {});
|
},
|
//显示打印界面
|
handlePrint: function (index, row) {
|
if (!row) {
|
row = this.currentRow;
|
}
|
let prms = { id: row.Id };
|
console.log(prms);
|
DetailWMPurchaseInfo(prms).then((res) => {
|
this.DetailList = res.data.response;
|
});
|
this.PrintVisible = true;
|
},
|
//操作日志分页
|
handleCurrentChangeWMPurchaseInfolog(val) {
|
this.page = val;
|
this.handlePurchaseInfoLog();
|
},
|
//显示操作日志弹窗
|
handlePurchaseInfoLog: function (index, row) {
|
if (!row) {
|
row = this.currentRow;
|
}
|
let prms = { id: row.Id };
|
WMPurchaseInfoLogListPage(prms).then((res) => {
|
this.total = res.data.response.dataCount;
|
this.WMPurchaseInfoLog = res.data.response.data;
|
});
|
this.LogVisible = true;
|
},
|
handleSearchProduct() {
|
this.SearchProductVisible = true;
|
},
|
//显示详情界面
|
handleDetail: function (index, row) {
|
if (!row) {
|
row = this.currentRow;
|
}
|
|
let prms = { id: row.Id };
|
console.log(prms);
|
DetailWMPurchaseInfo(prms).then((res) => {
|
debugger;
|
this.DetailList = res.data.response;
|
console.log("波波bobo");
|
console.log(this.DetailList);
|
});
|
|
this.editFormVisible = true;
|
// this.editForm = Object.assign({}, row);
|
},
|
//显示新增界面
|
handleAdd() {
|
this.addFormVisible = true;
|
this.addForm = {
|
Status: 0,
|
Remark: "",
|
ProductUse: "",
|
WMProductList: [],
|
noMatchData: [],
|
Type: 1,
|
WareHouseId: this.addForm.WareHouseId,
|
};
|
console.log(this.noMatchData);
|
this.getWMProductList();
|
//this.transDataNow.push();
|
console.log(this.addForm);
|
},
|
handleCurrentChangeProductList(val) {
|
this.page = val;
|
this.getWMProductList();
|
},
|
getWMProductList() {
|
let para = {
|
page: this.page,
|
key: this.filters.name,
|
wareHouseId: this.addForm.WareHouseId,
|
};
|
console.log("王朝盛世!!!");
|
|
console.log(para);
|
this.listLoading = true;
|
testapi();
|
getWMProductListListPage(para).then((res) => {
|
this.total = res.data.response.dataCount;
|
this.WMProductList = res.data.response.data;
|
this.listLoading = false;
|
console.log(this.WMProductList);
|
});
|
if (this.filters.name != null) {
|
this.page = 1;
|
}
|
},
|
//合并行或列的计算方法
|
// arraySpanMethod({ row, column, rowIndex, columnIndex }) {
|
// if (rowIndex % 3 === 0) {
|
// if (columnIndex === 0) {
|
// return [1, 3];
|
// } else if (columnIndex === 1) {
|
// return [0, 0];
|
// }
|
// }
|
|
// },
|
//编辑
|
editSubmit: function () {
|
debugger;
|
this.$refs.editForm.validate((valid) => {
|
if (valid) {
|
this.$confirm("确认提交吗?", "提示", {}).then(() => {
|
this.editLoading = true;
|
//NProgress.start();
|
this.editForm = this.DetailList;
|
console.log("1");
|
console.log(this.editForm);
|
console.log("2");
|
console.log(this.DetailList.PurchaseQuoteDetailList.Status);
|
|
let para = Object.assign({}, this.editForm);
|
editWMPurchaseInfo(para).then((res) => {
|
if (util.isEmt.format(res)) {
|
this.editLoading = false;
|
return;
|
}
|
if (res.data.success) {
|
this.editLoading = false;
|
//NProgress.done();
|
this.$message({
|
message: res.data.msg,
|
type: "success",
|
});
|
this.$refs["editForm"].resetFields();
|
this.editFormVisible = false;
|
this.getWMPurchaseInfo();
|
} else {
|
this.editLoading = false;
|
this.$message({
|
message: res.data.msg,
|
type: "error",
|
});
|
}
|
});
|
});
|
}
|
});
|
},
|
//新增
|
addSubmit: function () {
|
this.$refs.addForm.validate((valid) => {
|
if (valid) {
|
this.$confirm("确认提交吗?", "提示", {}).then(() => {
|
this.addLoading = true;
|
//NProgress.start();
|
let para = Object.assign({}, this.addForm);
|
addWMPurchaseInfo(para).then((res) => {
|
if (util.isEmt.format(res)) {
|
this.addLoading = false;
|
return;
|
}
|
if (res.data.success) {
|
this.addLoading = false;
|
//NProgress.done();
|
this.$message({
|
message: res.data.msg,
|
type: "success",
|
});
|
this.$refs["addForm"].resetFields();
|
this.addFormVisible = false;
|
this.getWMPurchaseInfo();
|
} else {
|
this.addLoading = false;
|
this.$message({
|
message: res.data.msg,
|
type: "error",
|
});
|
}
|
});
|
});
|
}
|
});
|
},
|
selsChange: function (sels) {
|
this.sels = sels;
|
},
|
//批量删除
|
batchRemove: function () {
|
// return;
|
|
var ids = this.sels.map((item) => item.Id).toString();
|
this.$confirm("确认删除选中记录吗?", "提示", {
|
type: "warning",
|
})
|
.then(() => {
|
this.listLoading = true;
|
//NProgress.start();
|
let para = { ids: ids };
|
|
batchRemoveUser(para).then((res) => {
|
this.listLoading = false;
|
//NProgress.done();
|
this.$message({
|
message: "该功能未开放",
|
type: "warning",
|
});
|
console.log(res);
|
});
|
})
|
.catch(() => {});
|
},
|
//删除商品
|
deleteProductList: function (index, row) {
|
this.$confirm("确认删除商品吗?", "提示", {}).then(() => {
|
let para = { id: row.Id };
|
deleteWMProductList2(para).then((res) => {
|
if (util.isEmt.format(res)) {
|
return;
|
}
|
if (res.data.success) {
|
this.$message({
|
message: res.data.msg,
|
type: "success",
|
});
|
this.$refs["editForm"].resetFields();
|
this.editFormVisible = false;
|
this.getWMPurchaseInfo();
|
} else {
|
this.$message({
|
message: res.data.msg,
|
type: "error",
|
});
|
}
|
});
|
});
|
},
|
//选择仓库联动商品列表
|
handleChange(value) {
|
this.getWMProductList();
|
},
|
},
|
mounted() {
|
this.getWMPurchaseInfo();
|
// this.getWMProductList();
|
|
//仓库列表
|
getWMSListPage().then((res) => {
|
this.WMWareHouseModules = res.data.response.data;
|
//赋值默认选择第一个仓库
|
this.addForm.WareHouseId = this.WMWareHouseModules[0].Id;
|
});
|
// getWMProductListListPage().then((res) => {
|
// this.WMProductList = res.data.response.data;
|
// });
|
let routers = window.localStorage.router
|
? JSON.parse(window.localStorage.router)
|
: [];
|
this.buttonList = getButtonList(this.$route.path, routers);
|
},
|
};
|
</script>
|