|
@@ -3,14 +3,14 @@
|
|
<el-page-header @back="goBack" :content="listItem ? '编辑':'新增'"></el-page-header>
|
|
<el-page-header @back="goBack" :content="listItem ? '编辑':'新增'"></el-page-header>
|
|
|
|
|
|
<div class="main-title">
|
|
<div class="main-title">
|
|
- <div class="title">工程订单</div>
|
|
|
|
|
|
+ <div class="title">订单信息</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-form ref="mainForm" :model="mainForm" label-width="100px" size="small" label-position="left">
|
|
|
|
|
|
+ <el-form ref="mainForm" :model="mainForm" :rules="mainFormRules" label-width="80px" size="small" label-position="right">
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="工程订单" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入工程订单"></el-input>
|
|
|
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" v-if="listItem">
|
|
|
|
+ <el-form-item label="订单号" prop="id">
|
|
|
|
+ <el-input v-model="listItem.id" readonly></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
|
|
<el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
|
|
@@ -25,136 +25,233 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
<el-col :xs="24" :sm="12" :lg="8">
|
|
- <el-form-item label="品类" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入品类"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="工程登录单号" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入工程登录单号"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="项目名称" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入项目名称"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="单据类型" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入单据类型"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="经销商编码" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入经销商编码"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="使用单位" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入使用单位"></el-input>
|
|
|
|
|
|
+ <el-form-item label="产品大类" prop="type">
|
|
|
|
+ <el-select v-model="mainForm.type" placeholder="选择产品大类" style="width: 100%">
|
|
|
|
+ <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
|
|
|
|
+ </el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="安装地址" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入安装地址"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="工程编号" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入工程编号"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="厂工程编码" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入厂工程编码"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="工程登录类型" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入工程登录类型"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="24" :lg="24">
|
|
|
|
- <el-form-item label="格力回复" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入格力回复"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="24" :lg="24">
|
|
|
|
- <el-form-item label="格力内部备注" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入格力内部备注"></el-input>
|
|
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :xs="24" :sm="12" :lg="8" v-if="listItem">
|
|
|
|
+ <el-form-item label="业务员" prop="serviceName">
|
|
|
|
+ <el-input v-model="listItem.serviceName" readonly></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xs="24" :sm="24" :lg="24">
|
|
|
|
- <el-form-item label="备注" prop="warehouse">
|
|
|
|
|
|
+ <el-col :xs="24" :sm="16" :lg="16">
|
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
<el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
|
|
<el-input v-model="mainForm.remark" placeholder="请输入备注"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="制单人" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入制单人"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8" style="height: 51px;">
|
|
|
|
- <el-form-item label="制单日期" prop="date">
|
|
|
|
- <el-date-picker
|
|
|
|
- v-model="mainForm.date"
|
|
|
|
- type="date"
|
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
|
- style="width: 100%;"
|
|
|
|
- placeholder="选择日期">
|
|
|
|
- </el-date-picker>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :xs="24" :sm="12" :lg="8">
|
|
|
|
- <el-form-item label="文件编号" prop="warehouse">
|
|
|
|
- <el-input v-model="mainForm.remark" placeholder="请输入文件编号"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
</el-row>
|
|
</el-row>
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
<div class="main-title">
|
|
<div class="main-title">
|
|
<div class="title">货品信息</div>
|
|
<div class="title">货品信息</div>
|
|
- <el-button type="primary" size="small" icon="el-icon-plus">添加货品</el-button>
|
|
|
|
|
|
+ <div v-if="!listItem">
|
|
|
|
+ <el-select v-model="warehouseValue" placeholder="请选择发货仓库" size="small" style="margin-right: 10px">
|
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item, index) in warehouseList" :key="index"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-search" @click="checkStock">检查库存</el-button>
|
|
|
|
+ <el-divider direction="vertical"></el-divider>
|
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-plus" @click="openDialog">添加货品</el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="table" style="margin-top: 20px">
|
|
<div class="table" style="margin-top: 20px">
|
|
- <el-table :data="detailData.kingDeeTransferItems" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
|
|
|
|
|
|
+ <el-table :data="goodsList" element-loading-text="Loading" border fit highlight-current-row stripe max-height="400">
|
|
<el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
|
|
<el-table-column align="center" label="序号" type="index" width="50"></el-table-column>
|
|
- <el-table-column align="center" label="引用记录" prop="materialNumber" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="销售类型" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="产品编码" prop="model" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="产品名称" prop="baseUnitId" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="规格型号" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="单位" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="总数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="是否使用返利" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="返利使用比例" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="是否直调" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="直调数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="已发货数量" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="单价" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="金额" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="返利" prop="qty" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
- <el-table-column align="center" label="备注" prop="qty" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
|
|
+ <el-table-column align="center" label="销售类型" prop="saleTypeName" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品编码" prop="materialCode" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品名称" prop="materialName" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="规格型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="单位" prop="unit" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="单价" prop="price" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="数量" prop="qty" min-width="100" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input v-model="scope.row.qty" size="small"></el-input>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="订单金额" min-width="100" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{scope.row.price * scope.row.qty}}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="返利钱包" prop="walletRebateId" min-width="160" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select v-model="scope.row.walletRebateId" placeholder="选择返利钱包" size="small" @change="changeWallet(scope.$index)">
|
|
|
|
+ <el-option label="不使用" value=""></el-option>
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in flWalletList"
|
|
|
|
+ :key="item.customerWalletId"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.customerWalletId">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="返利金额" min-width="100" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{scope.row.price * scope.row.qty * scope.row.rebateRate}}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="格力折扣" min-width="100" show-overflow-tooltip>
|
|
|
|
+ {{scope.row.qty * scope.row.discAmount}}
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="现金钱包" prop="walletRebateId2" min-width="160" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-select v-model="scope.row.walletRebateId2" placeholder="选择现金钱包" size="small">
|
|
|
|
+ <el-option label="不使用" value=""></el-option>
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in xjWalletList"
|
|
|
|
+ :key="item.customerWalletId"
|
|
|
|
+ :label="item.name"
|
|
|
|
+ :value="item.customerWalletId">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="实付金额" prop="qty" min-width="100" show-overflow-tooltip>
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ {{(scope.row.price * scope.row.qty) - (scope.row.price * scope.row.qty * scope.row.rebateRate) - (scope.row.qty * scope.row.discAmount)}}
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="是否直调" prop="isDirectTransfer" min-width="100">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-checkbox v-model="scope.row.isDirectTransfer"></el-checkbox>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="直调数量" prop="directTransferQty" min-width="100">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input v-model="scope.row.directTransferQty" size="small"></el-input>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="备注" prop="remark" min-width="160">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-input v-model="scope.row.remark" size="small"></el-input>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column align="center" label="税率" prop="tax" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="总仓库" prop="status1" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="仓库状态" prop="status2" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="操作" width="100" fixed="right">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-button type="text" @click="deleteItem(scope.$index)">删除</el-button>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="page-footer">
|
|
<div class="page-footer">
|
|
<div class="footer" :class="classObj">
|
|
<div class="footer" :class="classObj">
|
|
<el-button type="primary" @click="clickSubmitForm">保 存</el-button>
|
|
<el-button type="primary" @click="clickSubmitForm">保 存</el-button>
|
|
- <el-button type="primary" @click="clickSubmitForm">提交审核</el-button>
|
|
|
|
<el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
|
|
<el-popconfirm title="确定关闭吗?" @onConfirm="goBack" style="margin-left: 10px;">
|
|
<el-button slot="reference">关 闭</el-button>
|
|
<el-button slot="reference">关 闭</el-button>
|
|
</el-popconfirm>
|
|
</el-popconfirm>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <el-dialog title="添加产品" :visible.sync="isShowDialog" width="80%">
|
|
|
|
+ <el-form ref="screenForm" :model="screenForm" size="small" label-position="left">
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
|
+ <el-form-item prop="type">
|
|
|
|
+ <el-select v-model="screenForm.type" placeholder="选择品类" style="width: 100%">
|
|
|
|
+ <el-option v-for="item in typeList" :key="item.dictCode" :label="item.dictValue" :value="item.dictCode"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
|
+ <el-form-item prop="salesType">
|
|
|
|
+ <el-select v-model="screenForm.salesType" placeholder="选择销售类型" style="width: 100%">
|
|
|
|
+ <el-option v-for="item in salesTypeList" :key="item.id" :label="item.saleName" :value="item.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
|
+ <el-form-item prop="proNum">
|
|
|
|
+ <el-input v-model="screenForm.proNum" placeholder="请输入产品编码"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
|
+ <el-form-item prop="proName">
|
|
|
|
+ <el-input v-model="screenForm.proName" placeholder="请输入产品名称"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
|
+ <el-form-item prop="proModel">
|
|
|
|
+ <el-input v-model="screenForm.proModel" placeholder="请输入产品型号"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="12" :sm="6" :lg="6">
|
|
|
|
+ <el-form-item prop="price1" style="display: flex">
|
|
|
|
+ <el-input v-model="screenForm.price1" placeholder="请输入价格" style="width: 46%"></el-input>
|
|
|
|
+ <span> - </span>
|
|
|
|
+ <el-input v-model="screenForm.price2" placeholder="请输入价格" style="width: 46%"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :xs="12" :sm="12" :lg="12" class="tr">
|
|
|
|
+ <el-form-item label="">
|
|
|
|
+ <el-button size="small" @click="resetScreenForm">清空</el-button>
|
|
|
|
+ <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+
|
|
|
|
+ <div class="tables">
|
|
|
|
+ <div class="table">
|
|
|
|
+ <el-table :data="leftGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="leftSelectionChange">
|
|
|
|
+ <el-table-column align="center" type="selection" width="55" :selectable='checkboxSelect'></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ <div class="pagination clearfix" style="margin-top: 10px">
|
|
|
|
+ <div class="fr">
|
|
|
|
+ <el-pagination
|
|
|
|
+ @current-change="handleTableCurrentChange"
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
+ :page-size="10"
|
|
|
|
+ background
|
|
|
|
+ layout="prev, pager, next"
|
|
|
|
+ :total="listTotal">
|
|
|
|
+ </el-pagination>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="buttons">
|
|
|
|
+ <el-button size="small" type="primary" @click="addAllGoods">全部添加</el-button>
|
|
|
|
+ <el-button size="small" type="primary" @click="addGoods">添 加</el-button>
|
|
|
|
+ <el-button size="small" type="danger" @click="deleteGoods">删 除</el-button>
|
|
|
|
+ <el-button size="small" type="danger" @click="deleteAllGoods">全部删除</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="table">
|
|
|
|
+ <el-table :data="rightGoodsList" element-loading-text="Loading" border fit highlight-current-row stripe height="400" @selection-change="rightSelectionChange">
|
|
|
|
+ <el-table-column align="center" type="selection" width="55"></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品编码" prop="number" min-width="100" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品名称" prop="name" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品型号" prop="specification" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
|
+ <el-table-column align="center" label="产品价格" prop="batchPrice" min-width="80" show-overflow-tooltip></el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="closeDialog">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitAddGoods">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getDetail } from "@/api/supply/engin";
|
|
|
|
|
|
+import { getDetail, addData, editData, getSalesTypeList, getGoodsList, getWalletList, getWarehouseList, checkStock } from "@/api/supply/retail";
|
|
|
|
+import { getDictList } from '@/api/common'
|
|
|
|
+import { findElem } from '@/utils/util'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'RetailForm',
|
|
name: 'RetailForm',
|
|
@@ -162,10 +259,46 @@ export default {
|
|
props: ['listItem'],
|
|
props: ['listItem'],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- detailData: {},
|
|
|
|
mainForm: {
|
|
mainForm: {
|
|
|
|
+ date: '',
|
|
|
|
+ type: '',
|
|
|
|
+ remark: '',
|
|
|
|
+ },
|
|
|
|
+ mainFormRules: {
|
|
|
|
+ date: [
|
|
|
|
+ { required: true, message: '请选择单据日期', trigger: 'change' }
|
|
|
|
+ ],
|
|
|
|
+ type: [
|
|
|
|
+ { required: true, message: '请选择品类', trigger: 'change' }
|
|
|
|
+ ],
|
|
|
|
+ },
|
|
|
|
+ goodsList: [],
|
|
|
|
|
|
|
|
+ warehouseList: [],
|
|
|
|
+ warehouseValue: '',
|
|
|
|
+ isShowDialog: false,
|
|
|
|
+ screenForm: {
|
|
|
|
+ type: '',
|
|
|
|
+ salesType: '',
|
|
|
|
+ proNum: '',
|
|
|
|
+ proName: '',
|
|
|
|
+ proModel: '',
|
|
|
|
+ price1: '',
|
|
|
|
+ price2: '',
|
|
},
|
|
},
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ listTotal: 0,
|
|
|
|
+ salesTypeList: [],
|
|
|
|
+ typeList: [],
|
|
|
|
+
|
|
|
|
+ leftGoodsList: [],
|
|
|
|
+ rightGoodsList: [],
|
|
|
|
+
|
|
|
|
+ leftSelection: [],
|
|
|
|
+ rightSelection: [],
|
|
|
|
+
|
|
|
|
+ xjWalletList: [],
|
|
|
|
+ flWalletList: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
|
|
@@ -182,7 +315,12 @@ export default {
|
|
},
|
|
},
|
|
|
|
|
|
created() {
|
|
created() {
|
|
- this.getDetail();
|
|
|
|
|
|
+ this.getDictList();
|
|
|
|
+ this.getWalletList();
|
|
|
|
+ this.getWarehouseList();
|
|
|
|
+ if(this.listItem) {
|
|
|
|
+ this.getDetail();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
@@ -194,12 +332,253 @@ export default {
|
|
// 获取详情
|
|
// 获取详情
|
|
getDetail() {
|
|
getDetail() {
|
|
getDetail({id: this.listItem.id}).then(res => {
|
|
getDetail({id: this.listItem.id}).then(res => {
|
|
- this.detailData = res.data;
|
|
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取仓库列表
|
|
|
|
+ getWarehouseList() {
|
|
|
|
+ getWarehouseList({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.warehouseList = res.data.records;
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 获取钱包列表
|
|
|
|
+ getWalletList() {
|
|
|
|
+ getWalletList({
|
|
|
|
+ customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
|
+ type: 'COMMONLY'
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.xjWalletList = res.data;
|
|
|
|
+ })
|
|
|
|
+ getWalletList({
|
|
|
|
+ customerId: JSON.parse(localStorage.getItem("supply_user")).customerId,
|
|
|
|
+ type: 'REBATE'
|
|
|
|
+ }).then(res => {
|
|
|
|
+ this.flWalletList = res.data;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取销售类型列表
|
|
|
|
+ getSalesTypeList() {
|
|
|
|
+ getSalesTypeList({
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: -1
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.salesTypeList = res.data.records;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ getDictList() {
|
|
|
|
+ getDictList({sysDictEnum: 'PRODUCT_TYPE'}).then(res => {
|
|
|
|
+ this.typeList = res.data;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 获取商品列表
|
|
|
|
+ getGoodsList() {
|
|
|
|
+ getGoodsList({
|
|
|
|
+ pageNum: this.currentPage,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ mainId: this.screenForm.type,
|
|
|
|
+ saleId: this.screenForm.salesType,
|
|
|
|
+ materialCode: this.screenForm.proNum,
|
|
|
|
+ materialName: this.screenForm.proName,
|
|
|
|
+ specification: this.screenForm.proModel,
|
|
|
|
+ price1: this.screenForm.price1,
|
|
|
|
+ price2: this.screenForm.price2,
|
|
|
|
+ }).then(res => {
|
|
|
|
+ let oldGoodsList = this.goodsList;
|
|
|
|
+ let newGoodsList = res.data.records;
|
|
|
|
+ for(let i = 0; i < oldGoodsList.length; i++) {
|
|
|
|
+ let oldItem = oldGoodsList[i]
|
|
|
|
+ for(let j = 0; j < newGoodsList.length; j++) {
|
|
|
|
+ let newItem = newGoodsList[j]
|
|
|
|
+ if(newItem.materialId === oldItem.materialId){
|
|
|
|
+ newGoodsList[j].selected = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res.data.records.forEach(item => {
|
|
|
|
+ item.materialName = item.name;
|
|
|
|
+ item.materialCode = item.number;
|
|
|
|
+ item.saleTypeName = item.saleName;
|
|
|
|
+ item.unit = item.baseUnit;
|
|
|
|
+ item.price = item.batchPrice;
|
|
|
|
+ item.tax = item.taxRate;
|
|
|
|
+ item.isDirectTransfer = false;
|
|
|
|
+ item.directTransferQty = '';
|
|
|
|
+ item.status1 = '';
|
|
|
|
+ item.status2 = '';
|
|
|
|
+ item.rebateAmount = '';
|
|
|
|
+ item.rebateRate = '';
|
|
|
|
+ });
|
|
|
|
+ this.leftGoodsList = res.data.records;
|
|
|
|
+ this.listTotal = res.data.total;
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 查询重复值并禁选
|
|
|
|
+ checkboxSelect(row, rowIndex) {
|
|
|
|
+ if (row.selected) {
|
|
|
|
+ return false // 禁用
|
|
|
|
+ }else{
|
|
|
|
+ return true // 不禁用
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 点击 选择商品
|
|
|
|
+ openDialog() {
|
|
|
|
+ this.getSalesTypeList();
|
|
|
|
+ this.getGoodsList();
|
|
|
|
+ this.isShowDialog = true;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 提交筛选表单
|
|
|
|
+ submitScreenForm() {
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.getGoodsList();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 重置筛选表单
|
|
|
|
+ resetScreenForm() {
|
|
|
|
+ this.$refs.screenForm.resetFields();
|
|
|
|
+ this.currentPage = 1;
|
|
|
|
+ this.getGoodsList();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 更改列表当前页
|
|
|
|
+ handleTableCurrentChange(val) {
|
|
|
|
+ this.currentPage = val;
|
|
|
|
+ this.getGoodsList();
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 关闭 弹窗
|
|
|
|
+ closeDialog() {
|
|
|
|
+ this.isShowDialog = false;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 左侧列表选择
|
|
|
|
+ leftSelectionChange(val) {
|
|
|
|
+ this.leftSelection = val;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 右侧列表选择
|
|
|
|
+ rightSelectionChange(val) {
|
|
|
|
+ this.rightSelection = val;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 数组去重
|
|
|
|
+ delRepeat(arr1, arr2) {
|
|
|
|
+ let allArr = arr1.concat(arr2); // 两个数组对象合并
|
|
|
|
+ let newArr = []; // 存放去重后数据的新数组
|
|
|
|
+ for(let i=0; i<allArr.length; i++){ // 循环allArr数组对象的内容
|
|
|
|
+ let flag = true; // 建立标记,判断数据是否重复,true为不重复
|
|
|
|
+ for(let j=0; j<newArr.length; j++){ // 循环新数组的内容
|
|
|
|
+ if(allArr[i].materialId == newArr[j].materialId){ // 让allArr数组对象的内容与新数组的内容作比较,相同的话,改变标记为false
|
|
|
|
+ flag = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(flag){ // 判断是否重复
|
|
|
|
+ newArr.push(allArr[i]); // 不重复的放入新数组。 新数组的内容会继续进行上边的循环。
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return newArr;
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 全部添加
|
|
|
|
+ addAllGoods() {
|
|
|
|
+ this.rightGoodsList = this.delRepeat(this.leftGoodsList, this.rightGoodsList);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 添加
|
|
|
|
+ addGoods() {
|
|
|
|
+ this.rightGoodsList = this.delRepeat(this.leftSelection, this.rightGoodsList);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 删除
|
|
|
|
+ deleteGoods() {
|
|
|
|
+ let rightGoodsList = this.rightGoodsList;
|
|
|
|
+ let rightSelection = this.rightSelection;
|
|
|
|
+ for(let i = 0; i < rightGoodsList.length; i++) {
|
|
|
|
+ for(let j = 0; j < rightSelection.length; j++) {
|
|
|
|
+ if(rightSelection[j].materialId == rightGoodsList[i].materialId){
|
|
|
|
+ this.rightGoodsList.splice(i, 1);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 全部删除
|
|
|
|
+ deleteAllGoods() {
|
|
|
|
+ this.rightGoodsList = [];
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 确定 添加产品
|
|
|
|
+ submitAddGoods() {
|
|
|
|
+ this.goodsList = this.delRepeat(this.rightGoodsList, this.goodsList);
|
|
|
|
+ this.isShowDialog = false;
|
|
|
|
+ this.leftGoodsList = [];
|
|
|
|
+ this.rightGoodsList = [];
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 删除产品
|
|
|
|
+ deleteItem(index) {
|
|
|
|
+ this.goodsList.splice(index, 1);
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 修改返利钱包
|
|
|
|
+ changeWallet(index) {
|
|
|
|
+ if(this.goodsList[index].walletRebateId) {
|
|
|
|
+ let obj = this.flWalletList.find(o => o.customerWalletId == this.goodsList[index].walletRebateId);
|
|
|
|
+ this.goodsList[index].rebateRate = obj.rebateRate;
|
|
|
|
+ }else {
|
|
|
|
+ this.goodsList[index].rebateRate = '';
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 检查库存
|
|
|
|
+ checkStock() {
|
|
|
|
+ if(!this.warehouseValue) {
|
|
|
|
+ return this.$errorMsg('请选择仓库');
|
|
|
|
+ }
|
|
|
|
+ let ids = [];
|
|
|
|
+ this.goodsList.forEach(item => {
|
|
|
|
+ ids.push(item.materialId);
|
|
|
|
+ })
|
|
|
|
+ checkStock({
|
|
|
|
+ correspondId: this.warehouseValue,
|
|
|
|
+ materialId: ids.join(',')
|
|
|
|
+ }).then(res => {
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 保存
|
|
clickSubmitForm() {
|
|
clickSubmitForm() {
|
|
|
|
+ this.$refs.mainForm.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ let mainName = this.typeList[findElem(this.typeList, 'dictCode', this.mainForm.type)].dictValue;
|
|
|
|
+ let params = {
|
|
|
|
+ theTime: this.mainForm.date + ' 00:00:00',
|
|
|
|
+ mainId: this.mainForm.type,
|
|
|
|
+ mainName,
|
|
|
|
+ remark: this.mainForm.remark,
|
|
|
|
+ type: 1, // 1:普通零售单,2:政策零售单
|
|
|
|
+ retailOrderItemList: this.goodsList
|
|
|
|
+ }
|
|
|
|
+ addData(params).then(res => {
|
|
|
|
+ this.$successMsg('添加成功');
|
|
|
|
+ this.goBack();
|
|
|
|
+ this.$parent.getList();
|
|
|
|
+ })
|
|
|
|
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -224,4 +603,22 @@ export default {
|
|
padding-left: 10px;
|
|
padding-left: 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .tables {
|
|
|
|
+ display: flex;
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ .table {
|
|
|
|
+ width: 45%;
|
|
|
|
+ }
|
|
|
|
+ .buttons {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ align-items: center;
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ button {
|
|
|
|
+ margin: 0;
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|