|
@@ -1,230 +1,221 @@
|
|
|
<template>
|
|
|
- <trade-card title="商品信息">
|
|
|
- <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel" :summary-method="summaryMethod"
|
|
|
- @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle" v-model="goodsForm"
|
|
|
- :before-close="beforeClose" @row-save="handleRowSave" @row-update="handleRowUpdate" @selection-change="goodsSelectionChange">
|
|
|
- <template slot="menuLeft">
|
|
|
- <el-row>
|
|
|
- <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
|
|
|
- </el-button>
|
|
|
- <el-button type="warning" icon="el-icon-plus" size="small"
|
|
|
- :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单
|
|
|
- </el-button>
|
|
|
- <el-button type="info" size="small" @click="cnameData">刷新基础资料</el-button>
|
|
|
- </el-row>
|
|
|
- </template>
|
|
|
- <template slot="headerSerial">
|
|
|
- <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
|
|
|
- :disabled="detailData.status == 1" circle></el-button>
|
|
|
- </template>
|
|
|
- <template slot="codeHeader" slot-scope="{column}">
|
|
|
- <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{column.label}}</span>
|
|
|
- </template>
|
|
|
- //操作栏
|
|
|
- <template slot="menu" slot-scope="{ row, index }">
|
|
|
- <div style="display:flex;justify-content: center;">
|
|
|
- <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
|
|
|
- :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
- <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
|
|
|
- :disabled="detailData.status == 1">删除</el-button>
|
|
|
- <div v-if="!goodsEditShow"
|
|
|
- style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
|
|
|
- <el-tooltip effect="dark" content="向上移动" placement="top">
|
|
|
- <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up"
|
|
|
- @click="moveUp(row, index)" style="color:#409EFF;"></i>
|
|
|
- </el-tooltip>
|
|
|
- <el-tooltip effect="dark" content="向下移动" placement="bottom"> <i
|
|
|
- v-if="index != (data.length - 1)" :disabled="detailData.status == 1"
|
|
|
- class="el-icon-arrow-down" @click="moveDown(row, index)" style="color:#409EFF;"></i>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //产品名称
|
|
|
- <template slot="cnameForm" slot-scope="{type,disabled}">
|
|
|
- <span style="display:flex">
|
|
|
- <el-select v-model="goodsForm.itemId" placeholder="请选择" size="small" filterable
|
|
|
- @change="cnameChange(goodsForm)">
|
|
|
- <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname"
|
|
|
- :value="item.itemId">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- //螺纹
|
|
|
- <template slot="remarksOneForm" slot-scope="{type,disabled}">
|
|
|
- <el-select v-model="goodsForm.remarksOne" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
- @change="propsChange(goodsForm)">
|
|
|
- <el-option v-for="item in ThreadList" :key="item.id" :label="item.dictValue"
|
|
|
- :value="item.dictValue">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- //介质
|
|
|
- <template slot="customTwoForm" slot-scope="{type,disabled}">
|
|
|
- <el-select v-model="goodsForm.customTwo" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
- @change="propsChange(goodsForm)">
|
|
|
- <el-option v-for="item in mediumList" :key="item.id" :label="item.dictValue"
|
|
|
- :value="item.dictValue">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- //颜色
|
|
|
- <template slot="customThreeForm" slot-scope="{type,disabled}">
|
|
|
- <el-select v-model="goodsForm.customThree" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
- @change="propsChange(goodsForm)">
|
|
|
- <el-option v-for="item in colorList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- //电压
|
|
|
- <template slot="customFourForm" slot-scope="{type,disabled}">
|
|
|
- <el-select v-model="goodsForm.customFour" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
- @change="propsChange(goodsForm)">
|
|
|
- <el-option v-for="item in stencilList" :key="item.id" :label="item.dictValue"
|
|
|
- :value="item.dictValue">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- //产品属性
|
|
|
- <template slot="itemPropForm" slot-scope="{type,disabled}">
|
|
|
- <el-input type="textarea" :rows="2" v-model="goodsForm.itemProp" size="small" placeholder="">
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- //阀门配件
|
|
|
- <template slot="partsValveNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsValveName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsValveSalePrice?goodsForm.partsValveSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(0,goodsForm.partsValveValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //瓶帽配件
|
|
|
- <template slot="partsCapNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsCapName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template slot="append">{{goodsForm.partsCapSalePrice?goodsForm.partsCapSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(1,goodsForm.partsCapValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //特殊处理
|
|
|
- <template slot="partsHandleNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsHandleName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsHandleSalePrice?goodsForm.partsHandleSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(2,goodsForm.partsHandleValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //包装方式
|
|
|
- <template slot="partsColourNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsColourName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsColourSalePrice?goodsForm.partsColourSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(3,goodsForm.partsColourValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //特殊颜色
|
|
|
- <template slot="partsModeNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsModeName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsModeSalePrice?goodsForm.partsModeSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(4,goodsForm.partsModeValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //认证
|
|
|
- <template slot="partsAuthenticationNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsAuthenticationName" size="small" placeholder=""
|
|
|
- :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsAuthenticationSalePrice?goodsForm.partsAuthenticationSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(5,goodsForm.partsAuthenticationValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //其他
|
|
|
- <template slot="partsOtherNameForm" slot-scope="{type,disabled}">
|
|
|
- <div style="display:flex;">
|
|
|
- <el-input v-model="goodsForm.partsOtherName" size="small" placeholder="" :disabled="disabled">
|
|
|
- <template
|
|
|
- slot="append">{{goodsForm.partsOtherSalePrice?goodsForm.partsOtherSalePrice:0}}</template>
|
|
|
- </el-input>
|
|
|
- <el-button icon="el-icon-edit" size="mini" @click="openpart(6,goodsForm.partsOtherValue)"
|
|
|
- :disabled="disabled"></el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- //配件信息
|
|
|
- <template slot="partsDescribeForm" slot-scope="{type,disabled}">
|
|
|
- <el-input type="textarea" :rows="2" v-model="goodsForm.partsDescribe" size="small" placeholder=""
|
|
|
- @change="editChange(goodsForm)">
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- //英文名称
|
|
|
- <template slot="enameForm" slot-scope="{type,disabled}">
|
|
|
- <el-input type="textarea" :rows="2" v-model="goodsForm.ename" size="small" placeholder="请点击右边按钮"
|
|
|
- @change="editChange(row)"></el-input>
|
|
|
- </template>
|
|
|
- //产品描述
|
|
|
- <template slot="itemDescriptionForm" slot-scope="{type,disabled}">
|
|
|
- <el-input type="textarea" :rows="2" v-model="goodsForm.itemDescription" size="small" placeholder="请输入"
|
|
|
- @change="editChange(goodsForm)">
|
|
|
- </el-input>
|
|
|
- </template>
|
|
|
- //采购单价
|
|
|
- <template slot="purchaseAmountForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.purchaseAmount" size="small" placeholder="请输入"
|
|
|
- @change="purchaseAmountChange(goodsForm)" :disabled="disabled"></el-input>
|
|
|
- </template>
|
|
|
- //单价
|
|
|
- <template slot="priceForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.price" size="small"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="priceChange(goodsForm)"></el-input>
|
|
|
- </template>
|
|
|
- //数量
|
|
|
- <template slot="orderQuantityForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.orderQuantity" size="small"
|
|
|
- oninput='this.value=this.value.replace(/[^(\d)]/g,"")' @change="priceChange(goodsForm)"></el-input>
|
|
|
- </template>
|
|
|
- //折扣
|
|
|
- <template slot="discountForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.discount" size="small"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="discountChange(goodsForm)"></el-input>
|
|
|
- </template>
|
|
|
- //税率
|
|
|
- <template slot="taxRateForm" slot-scope="{type,disabled}">
|
|
|
- <el-input v-model="goodsForm.taxRate" size="small"
|
|
|
- oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
- @change="taxRateChange(goodsForm)"></el-input>
|
|
|
- </template>
|
|
|
- //产品型号
|
|
|
- <template slot="itemTypeForm" slot-scope="{type,disabled}">
|
|
|
- <el-select v-model="goodsForm.itemType" filterable allow-create default-first-option placeholder="请输入"
|
|
|
- size="small" @focus="itemTypeFocus(goodsForm)">
|
|
|
- <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value"
|
|
|
- :value="item.value">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- </avue-crud>
|
|
|
- <!-- <el-dialog title="导入商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
|
|
|
+ <trade-card title="商品信息">
|
|
|
+ <avue-crud ref="crud" :data="data" :option="tableOption" @row-del="rowDel" :summary-method="summaryMethod"
|
|
|
+ @saveColumn="saveColumn" @resetColumn="resetColumn" :cell-style="cellStyle" v-model="goodsForm"
|
|
|
+ :before-close="beforeClose" @row-save="handleRowSave" @row-update="handleRowUpdate"
|
|
|
+ @selection-change="goodsSelectionChange">
|
|
|
+ <template slot="menuLeft">
|
|
|
+ <el-row>
|
|
|
+ <el-button type="info" icon="el-icon-printer" size="small" @click.stop="openReport()">报表打印
|
|
|
+ </el-button>
|
|
|
+ <el-button type="warning" icon="el-icon-plus" size="small"
|
|
|
+ :disabled="detailData.status == 1 || orderItemIds.length == 0" @click="getInvoice">生成发货单
|
|
|
+ </el-button>
|
|
|
+ <el-button type="info" size="small" @click="cnameData">刷新基础资料</el-button>
|
|
|
+ </el-row>
|
|
|
+ </template>
|
|
|
+ <template slot="headerSerial">
|
|
|
+ <el-button type="primary" icon="el-icon-plus" size="mini" @click.stop="addRow"
|
|
|
+ :disabled="detailData.status == 1" circle></el-button>
|
|
|
+ </template>
|
|
|
+ <template slot="codeHeader" slot-scope="{column}">
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="khEdit('cname')">{{column.label}}</span>
|
|
|
+ </template>
|
|
|
+ //操作栏
|
|
|
+ <template slot="menu" slot-scope="{ row, index }">
|
|
|
+ <div style="display:flex;justify-content: center;">
|
|
|
+ <el-button size="small" icon="el-icon-edit" type="text" @click="rowCell(row, index)"
|
|
|
+ :disabled="disabled || detailData.status == 1">{{ row.$cellEdit ? "保存" : "修改" }}</el-button>
|
|
|
+ <el-button size="small" icon="el-icon-delete" type="text" @click="rowDel(row, index)"
|
|
|
+ :disabled="detailData.status == 1">删除</el-button>
|
|
|
+ <div v-if="!goodsEditShow"
|
|
|
+ style="display:flex;flex-direction: column;justify-content: center;margin-left: 10px;">
|
|
|
+ <el-tooltip effect="dark" content="向上移动" placement="top">
|
|
|
+ <i v-if="index != 0" :disabled="detailData.status == 1" class="el-icon-arrow-up"
|
|
|
+ @click="moveUp(row, index)" style="color:#409EFF;"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ <el-tooltip effect="dark" content="向下移动" placement="bottom"> <i v-if="index != (data.length - 1)"
|
|
|
+ :disabled="detailData.status == 1" class="el-icon-arrow-down" @click="moveDown(row, index)"
|
|
|
+ style="color:#409EFF;"></i>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //产品名称
|
|
|
+ <template slot="cnameForm" slot-scope="{type,disabled}">
|
|
|
+ <span style="display:flex">
|
|
|
+ <el-select v-model="goodsForm.itemId" placeholder="请选择" size="small" filterable
|
|
|
+ @change="cnameChange(goodsForm)">
|
|
|
+ <el-option v-for="item in goodsoptions" :key="item.itemId" :label="item.cname" :value="item.itemId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button icon="el-icon-search" size="small" @click="pickGoods"></el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ //螺纹
|
|
|
+ <template slot="remarksOneForm" slot-scope="{type,disabled}">
|
|
|
+ <el-select v-model="goodsForm.remarksOne" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
+ @change="propsChange(goodsForm)">
|
|
|
+ <el-option v-for="item in ThreadList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ //介质
|
|
|
+ <template slot="customTwoForm" slot-scope="{type,disabled}">
|
|
|
+ <el-select v-model="goodsForm.customTwo" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
+ @change="propsChange(goodsForm)">
|
|
|
+ <el-option v-for="item in mediumList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ //颜色
|
|
|
+ <template slot="customThreeForm" slot-scope="{type,disabled}">
|
|
|
+ <el-select v-model="goodsForm.customThree" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
+ @change="propsChange(goodsForm)">
|
|
|
+ <el-option v-for="item in colorList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ //电压
|
|
|
+ <template slot="customFourForm" slot-scope="{type,disabled}">
|
|
|
+ <el-select v-model="goodsForm.customFour" placeholder="请选择" size="small" :disabled="disabled"
|
|
|
+ @change="propsChange(goodsForm)">
|
|
|
+ <el-option v-for="item in stencilList" :key="item.id" :label="item.dictValue" :value="item.dictValue">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ //产品属性
|
|
|
+ <template slot="itemPropForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="goodsForm.itemProp" size="small" placeholder=""
|
|
|
+ @change="editChange(goodsForm)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ //阀门配件
|
|
|
+ <template slot="partsValveNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsValveName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template slot="append">{{goodsForm.partsValveSalePrice?goodsForm.partsValveSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(0,goodsForm.partsValveValue)"
|
|
|
+ :disabled="disabled"></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //瓶帽配件
|
|
|
+ <template slot="partsCapNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsCapName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template slot="append">{{goodsForm.partsCapSalePrice?goodsForm.partsCapSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(1,goodsForm.partsCapValue)" :disabled="disabled">
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //特殊处理
|
|
|
+ <template slot="partsHandleNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsHandleName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template slot="append">{{goodsForm.partsHandleSalePrice?goodsForm.partsHandleSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(2,goodsForm.partsHandleValue)"
|
|
|
+ :disabled="disabled"></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //包装方式
|
|
|
+ <template slot="partsColourNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsColourName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template slot="append">{{goodsForm.partsColourSalePrice?goodsForm.partsColourSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(3,goodsForm.partsColourValue)"
|
|
|
+ :disabled="disabled"></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //特殊颜色
|
|
|
+ <template slot="partsModeNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsModeName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template slot="append">{{goodsForm.partsModeSalePrice?goodsForm.partsModeSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(4,goodsForm.partsModeValue)" :disabled="disabled">
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //认证
|
|
|
+ <template slot="partsAuthenticationNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsAuthenticationName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template
|
|
|
+ slot="append">{{goodsForm.partsAuthenticationSalePrice?goodsForm.partsAuthenticationSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(5,goodsForm.partsAuthenticationValue)"
|
|
|
+ :disabled="disabled"></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //其他
|
|
|
+ <template slot="partsOtherNameForm" slot-scope="{type,disabled}">
|
|
|
+ <div style="display:flex;">
|
|
|
+ <el-input v-model="goodsForm.partsOtherName" size="small" placeholder="" :disabled="disabled">
|
|
|
+ <template slot="append">{{goodsForm.partsOtherSalePrice?goodsForm.partsOtherSalePrice:0}}</template>
|
|
|
+ </el-input>
|
|
|
+ <el-button icon="el-icon-edit" size="mini" @click="openpart(6,goodsForm.partsOtherValue)"
|
|
|
+ :disabled="disabled"></el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ //配件信息
|
|
|
+ <template slot="partsDescribeForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="goodsForm.partsDescribe" size="small" placeholder=""
|
|
|
+ @change="editChange(goodsForm)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ //英文名称
|
|
|
+ <template slot="enameForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="goodsForm.ename" size="small" placeholder="请点击右边按钮"
|
|
|
+ @change="editChange(goodsForm)"></el-input>
|
|
|
+ </template>
|
|
|
+ //产品描述
|
|
|
+ <template slot="itemDescriptionForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input type="textarea" :rows="2" v-model="goodsForm.itemDescription" size="small" placeholder="请输入"
|
|
|
+ @change="editChange(goodsForm)">
|
|
|
+ </el-input>
|
|
|
+ </template>
|
|
|
+ //采购单价
|
|
|
+ <template slot="purchaseAmountForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input v-model="goodsForm.purchaseAmount" size="small" placeholder="请输入"
|
|
|
+ @change="purchaseAmountChange(goodsForm)" :disabled="disabled"></el-input>
|
|
|
+ </template>
|
|
|
+ //单价
|
|
|
+ <template slot="priceForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input v-model="goodsForm.price" size="small"
|
|
|
+ oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
+ @change="priceChange(goodsForm)"></el-input>
|
|
|
+ </template>
|
|
|
+ //数量
|
|
|
+ <template slot="orderQuantityForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input v-model="goodsForm.orderQuantity" size="small" oninput='this.value=this.value.replace(/[^(\d)]/g,"")'
|
|
|
+ @change="priceChange(goodsForm)"></el-input>
|
|
|
+ </template>
|
|
|
+ //折扣
|
|
|
+ <template slot="discountForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input v-model="goodsForm.discount" size="small"
|
|
|
+ oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
+ @change="discountChange(goodsForm)"></el-input>
|
|
|
+ </template>
|
|
|
+ //税率
|
|
|
+ <template slot="taxRateForm" slot-scope="{type,disabled}">
|
|
|
+ <el-input v-model="goodsForm.taxRate" size="small"
|
|
|
+ oninput="value=value.replace(/[^0-9.]/g,'').replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3')"
|
|
|
+ @change="taxRateChange(goodsForm)"></el-input>
|
|
|
+ </template>
|
|
|
+ //产品型号
|
|
|
+ <template slot="itemTypeForm" slot-scope="{type,disabled}">
|
|
|
+ <el-select v-model="goodsForm.itemType" filterable allow-create default-first-option placeholder="请输入"
|
|
|
+ size="small" @focus="itemTypeFocus(goodsForm)">
|
|
|
+ <el-option v-for="(item, index) in itemtypeList" :key="index" :label="item.value" :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ </avue-crud>
|
|
|
+ <!-- <el-dialog title="导入商品" append-to-body class="el-dialogDeep" :visible.sync="dialogVisible" width="80%"
|
|
|
:close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" @close="closeGoods"
|
|
|
top="5vh" v-dialog-drag>
|
|
|
<span>
|
|
@@ -253,22 +244,24 @@
|
|
|
<el-button type="primary" @click="importGoods" :disabled="selectionList.length !=1">导入</el-button>
|
|
|
</span>
|
|
|
</el-dialog> -->
|
|
|
- <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="报价单明细(E)" @onClose="onClose()">
|
|
|
- </report-dialog>
|
|
|
- <part-library ref="partLibrary" @importPart="importPart"></part-library>
|
|
|
- <price-library ref="library" @importLibray="importLibray" />
|
|
|
- </trade-card>
|
|
|
+ <report-dialog :switchDialog="switchDialog" :reportId="form.id" reportName="报价单明细(E)" @onClose="onClose()">
|
|
|
+ </report-dialog>
|
|
|
+ <part-library ref="partLibrary" @importPart="importPart"></part-library>
|
|
|
+ <price-library ref="library" @importLibray="importLibray" />
|
|
|
+ </trade-card>
|
|
|
</template>
|
|
|
-
|
|
|
+
|
|
|
<script>
|
|
|
-import goodsOption from "../config/commodity.json";
|
|
|
-import tableOption from "../config/customerContact.json";
|
|
|
-import reportDialog from "@/components/report-dialog/main";
|
|
|
-import partLibrary from "@/components/part-library/main";
|
|
|
-import priceLibrary from "@/components/price-Library/main";
|
|
|
-import propertyDialog from "@/components/property-dialog/main";
|
|
|
-import { dateFormat } from "@/util/date";
|
|
|
-import {
|
|
|
+ import goodsOption from "../config/commodity.json";
|
|
|
+ import tableOption from "../config/customerContact.json";
|
|
|
+ import reportDialog from "@/components/report-dialog/main";
|
|
|
+ import partLibrary from "@/components/part-library/main";
|
|
|
+ import priceLibrary from "@/components/price-Library/main";
|
|
|
+ import propertyDialog from "@/components/property-dialog/main";
|
|
|
+ import {
|
|
|
+ dateFormat
|
|
|
+ } from "@/util/date";
|
|
|
+ import {
|
|
|
detail,
|
|
|
submit,
|
|
|
delItem,
|
|
@@ -283,8 +276,8 @@ import {
|
|
|
getParities,
|
|
|
getCode,
|
|
|
getPricebank
|
|
|
-} from "@/api/basicData/salesContract";
|
|
|
-import {
|
|
|
+ } from "@/api/basicData/salesContract";
|
|
|
+ import {
|
|
|
sum,
|
|
|
multiply,
|
|
|
partSum,
|
|
@@ -297,819 +290,857 @@ import {
|
|
|
numCal,
|
|
|
costsCal,
|
|
|
costCal
|
|
|
-} from "@/util/calculate";
|
|
|
-import _ from "lodash";
|
|
|
-export default {
|
|
|
+ } from "@/util/calculate";
|
|
|
+ import _ from "lodash";
|
|
|
+ export default {
|
|
|
name: "customerInformation",
|
|
|
data() {
|
|
|
- return {
|
|
|
- switchDialog: false,
|
|
|
- loading: false,
|
|
|
- itemtypeList: [],
|
|
|
- goodsForm: {},
|
|
|
- tableOption: {},
|
|
|
- goodsoptions: [],
|
|
|
- partList: [],
|
|
|
- ThreadList: [],
|
|
|
- mediumList: [],
|
|
|
- colorList: [],
|
|
|
- stencilList: [],
|
|
|
- selectionList: [],
|
|
|
- orderItemIds: [],
|
|
|
- dialogVisible: false,
|
|
|
- treeDeptId: null,
|
|
|
- treeStyle: "height:" + (window.innerHeight - 315) + "px",
|
|
|
- goodsOption: {},
|
|
|
- goodsList: [],
|
|
|
- page: {
|
|
|
- pageSize: 10,
|
|
|
- currentPage: 1,
|
|
|
- total: 0
|
|
|
- },
|
|
|
- treeOption: {
|
|
|
- nodeKey: "id",
|
|
|
- lazy: true,
|
|
|
- treeLoad: function (node, resolve) {
|
|
|
- const parentId = node.level === 0 ? 0 : node.data.id;
|
|
|
- getDeptLazyTree(parentId).then(res => {
|
|
|
- resolve(
|
|
|
- res.data.data.map(item => {
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- leaf: !item.hasChildren
|
|
|
- };
|
|
|
- })
|
|
|
- );
|
|
|
- });
|
|
|
- },
|
|
|
- addBtn: false,
|
|
|
- menu: false,
|
|
|
- size: "small",
|
|
|
- props: {
|
|
|
- label: "title",
|
|
|
- value: "value",
|
|
|
- children: "children"
|
|
|
- }
|
|
|
- },
|
|
|
- };
|
|
|
- },
|
|
|
- props: {
|
|
|
- data: {
|
|
|
- type: Array
|
|
|
+ return {
|
|
|
+ switchDialog: false,
|
|
|
+ loading: false,
|
|
|
+ itemtypeList: [],
|
|
|
+ goodsForm: {},
|
|
|
+ tableOption: {},
|
|
|
+ goodsoptions: [],
|
|
|
+ partList: [],
|
|
|
+ ThreadList: [],
|
|
|
+ mediumList: [],
|
|
|
+ colorList: [],
|
|
|
+ stencilList: [],
|
|
|
+ selectionList: [],
|
|
|
+ orderItemIds: [],
|
|
|
+ dialogVisible: false,
|
|
|
+ treeDeptId: null,
|
|
|
+ treeStyle: "height:" + (window.innerHeight - 315) + "px",
|
|
|
+ goodsOption: {},
|
|
|
+ goodsList: [],
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
},
|
|
|
- detailData: {
|
|
|
- type: Object
|
|
|
+ treeOption: {
|
|
|
+ nodeKey: "id",
|
|
|
+ lazy: true,
|
|
|
+ treeLoad: function(node, resolve) {
|
|
|
+ const parentId = node.level === 0 ? 0 : node.data.id;
|
|
|
+ getDeptLazyTree(parentId).then(res => {
|
|
|
+ resolve(
|
|
|
+ res.data.data.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ leaf: !item.hasChildren
|
|
|
+ };
|
|
|
+ })
|
|
|
+ );
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addBtn: false,
|
|
|
+ menu: false,
|
|
|
+ size: "small",
|
|
|
+ props: {
|
|
|
+ label: "title",
|
|
|
+ value: "value",
|
|
|
+ children: "children"
|
|
|
+ }
|
|
|
},
|
|
|
- form: {
|
|
|
- type: Object
|
|
|
- }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ data: {
|
|
|
+ type: Array
|
|
|
+ },
|
|
|
+ detailData: {
|
|
|
+ type: Object
|
|
|
+ },
|
|
|
+ form: {
|
|
|
+ type: Object
|
|
|
+ }
|
|
|
},
|
|
|
components: {
|
|
|
- partLibrary,
|
|
|
- propertyDialog,
|
|
|
- priceLibrary,
|
|
|
- reportDialog
|
|
|
+ partLibrary,
|
|
|
+ propertyDialog,
|
|
|
+ priceLibrary,
|
|
|
+ reportDialog
|
|
|
},
|
|
|
async created() {
|
|
|
- this.tableOption = await this.getColumnData(
|
|
|
- this.getColumnName(5),
|
|
|
- tableOption
|
|
|
- );
|
|
|
- this.goodsOption = await this.getColumnData(
|
|
|
- this.getColumnName(28),
|
|
|
- goodsOption
|
|
|
- );
|
|
|
- this.getWorkDicts("Thread").then(res => {
|
|
|
- this.ThreadList = res.data.data;
|
|
|
- });
|
|
|
- this.getWorkDicts("medium").then(res => {
|
|
|
- this.mediumList = res.data.data;
|
|
|
- });
|
|
|
- this.getWorkDicts("property_color").then(res => {
|
|
|
- this.colorList = res.data.data;
|
|
|
- });
|
|
|
- this.getWorkDicts("stencil").then(res => {
|
|
|
- this.stencilList = res.data.data;
|
|
|
- });
|
|
|
- this.getWorkDicts("unit").then(res => {
|
|
|
- this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
|
|
|
- });
|
|
|
- getPricebank(1, 10, { billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(res => {
|
|
|
- if (res.data.data.total > 0) {
|
|
|
- this.goodsoptions = res.data.data.records;
|
|
|
- if (Math.ceil(res.data.data.total / 10) > 1) {
|
|
|
- for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
|
|
|
- getPricebank(i, 10, { billType: "CG", statusTime: dateFormat(new Date(), "yyyy-MM-dd") }).then(e => {
|
|
|
- this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
+ this.tableOption = await this.getColumnData(
|
|
|
+ this.getColumnName(5),
|
|
|
+ tableOption
|
|
|
+ );
|
|
|
+ this.goodsOption = await this.getColumnData(
|
|
|
+ this.getColumnName(28),
|
|
|
+ goodsOption
|
|
|
+ );
|
|
|
+ this.getWorkDicts("Thread").then(res => {
|
|
|
+ this.ThreadList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("medium").then(res => {
|
|
|
+ this.mediumList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("property_color").then(res => {
|
|
|
+ this.colorList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("stencil").then(res => {
|
|
|
+ this.stencilList = res.data.data;
|
|
|
+ });
|
|
|
+ this.getWorkDicts("unit").then(res => {
|
|
|
+ this.findObject(this.tableOption.column, "unit").dicData = res.data.data;
|
|
|
+ });
|
|
|
+ getPricebank(1, 10, {
|
|
|
+ billType: "CG",
|
|
|
+ statusTime: dateFormat(new Date(), "yyyy-MM-dd")
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.data.total > 0) {
|
|
|
+ this.goodsoptions = res.data.data.records;
|
|
|
+ if (Math.ceil(res.data.data.total / 10) > 1) {
|
|
|
+ for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
|
|
|
+ getPricebank(i, 10, {
|
|
|
+ billType: "CG",
|
|
|
+ statusTime: dateFormat(new Date(), "yyyy-MM-dd")
|
|
|
+ }).then(e => {
|
|
|
+ this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
- cellStyle() {
|
|
|
- return "padding:0;height:40px;";
|
|
|
- },
|
|
|
- goodsSelectionChange(list) {
|
|
|
- this.orderItemIds = [];
|
|
|
- list.map(e => {
|
|
|
- this.orderItemIds.push(e.id);
|
|
|
- });
|
|
|
- },
|
|
|
- pickGoods() {
|
|
|
- // this.dialogVisible = !this.dialogVisible;
|
|
|
- this.$refs.library.init(false);
|
|
|
- },
|
|
|
- nodeClick(data) {
|
|
|
- this.treeDeptId = data.id;
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page);
|
|
|
- },
|
|
|
- //费用查询
|
|
|
- onLoad(page, params = {}) {
|
|
|
- let obj = this.deepClone(Object.assign(params, this.search));
|
|
|
- this.loading = true;
|
|
|
- getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
|
|
|
- .then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.page.total = data.total;
|
|
|
- this.goodsList = data.records;
|
|
|
- if (this.page.total) {
|
|
|
- this.goodsOption.height = window.innerHeight - 350;
|
|
|
- }
|
|
|
- })
|
|
|
- .finally(() => {
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- rowClick(row) {
|
|
|
- this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
|
|
|
- },
|
|
|
- // importGoods() {
|
|
|
- // this.upDataOption()
|
|
|
- // this.selectionList.forEach(e => {
|
|
|
- // this.goodsForm.itemId = e.id;
|
|
|
- // this.goodsForm.ename = e.ename;
|
|
|
- // this.goodsForm.code = e.code;
|
|
|
- // this.goodsForm.cname = e.cname;
|
|
|
- // this.goodsForm.corpId = e.corpId;
|
|
|
- // this.goodsForm.corpName = e.corpCode;
|
|
|
- // this.goodsForm.priceCategory = e.goodsTypeName;
|
|
|
- // this.goodsForm.itemUrl = e.url;
|
|
|
- // this.goodsForm.itemProp = null;
|
|
|
- // this.goodsForm.remarksOne = null;
|
|
|
- // this.goodsForm.customTwo = null;
|
|
|
- // this.goodsForm.customThree = null;
|
|
|
- // this.goodsForm.customFour = null;
|
|
|
- // this.goodsForm.customFive = null;
|
|
|
- // this.goodsForm.customSix = null;
|
|
|
- // this.goodsForm.customSeven = null;
|
|
|
- // this.goodsForm.customEight = null;
|
|
|
- // this.goodsForm.customNine = null;
|
|
|
- // this.goodsForm.customTen = null;
|
|
|
- // this.goodsForm.itemDescription = e.cnameDescription;
|
|
|
- // this.goodsForm.partsList = [];
|
|
|
- // this.goodsForm.partsPrice = 0;
|
|
|
- // this.goodsForm.itemType = null;
|
|
|
- // this.goodsForm.tradeTerms = null;
|
|
|
- // this.goodsForm.purchaseCost = 0;
|
|
|
- // this.goodsForm.purchaseAmount = 0;
|
|
|
- // this.goodsForm.price = 0;
|
|
|
- // this.goodsForm.orderQuantity = 0;
|
|
|
- // this.goodsForm.insurance = 0;
|
|
|
- // this.goodsForm.freight = 0;
|
|
|
- // this.goodsForm.discount = null;
|
|
|
- // this.goodsForm.amount = 0;
|
|
|
- // this.goodsForm.taxRate = 0;
|
|
|
- // this.goodsForm.unit = e.unit;
|
|
|
- // this.goodsForm.itemMargin = 0;
|
|
|
- // this.goodsForm.remarks = null;
|
|
|
- // this.goodsForm.exchangeRate = this.form.exchangeRate;
|
|
|
- // this.goodsForm.partsDescribe = null;
|
|
|
- // this.goodsForm.productRemark = e.ename;
|
|
|
- // this.goodsForm.attributeList = this.getAttribute(e.goodsSpecificationList);
|
|
|
- // })
|
|
|
- // this.dialogVisible = false
|
|
|
- // },
|
|
|
- closeGoods() {
|
|
|
- this.selectionList = [];
|
|
|
- this.treeDeptId = "";
|
|
|
- },
|
|
|
- selectionChange(list) {
|
|
|
- this.selectionList = list;
|
|
|
- },
|
|
|
- refreshTable() {
|
|
|
- this.$refs.crud.refreshTable();
|
|
|
- },
|
|
|
- openpart(val, list) {
|
|
|
- this.$refs.partLibrary.init(val, list)
|
|
|
- },
|
|
|
- addRow() {
|
|
|
- if (!this.form.corpId) {
|
|
|
- return this.$message.error("请选择客户名称");
|
|
|
- }
|
|
|
- this.$refs.crud.rowAdd()
|
|
|
- },
|
|
|
- cnameChange(row) {
|
|
|
- this.upDataOption()
|
|
|
- this.goodsoptions.forEach(e => {
|
|
|
- if (e.itemId == row.itemId) {
|
|
|
- row.itemId = e.itemId;
|
|
|
- row.code = e.code;
|
|
|
- row.cname = e.cname;
|
|
|
- row.ename = e.ename;
|
|
|
- row.priceCategory = e.goodsTypeName;
|
|
|
- row.purchaseCost = costCal(e.price, e.taxRate);
|
|
|
- row.purchaseAmount = e.purchaseAmount;
|
|
|
- row.itemProp = null;
|
|
|
- row.remarksOne = null;
|
|
|
- row.customTwo = null;
|
|
|
- row.customThree = null;
|
|
|
- row.customFour = null;
|
|
|
- row.customFive = null;
|
|
|
- row.customSix = null;
|
|
|
- row.customSeven = null;
|
|
|
- row.customEight = null;
|
|
|
- row.customNine = null;
|
|
|
- row.customTen = null;
|
|
|
- row.corpId = e.corpId;
|
|
|
- row.corpName = e.corpCode;
|
|
|
- row.itemDescription = e.cnameDescription;
|
|
|
- row.partsPrice = 0;
|
|
|
- row.itemType = e.specs;
|
|
|
- row.tradeTerms = null;
|
|
|
- row.productPrice = productCal(e.purchaseAmount, 0, this.form.coefficient);
|
|
|
- row.price = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
- row.orderQuantity = 1;
|
|
|
- row.insurance = 0;
|
|
|
- row.freight = 0;
|
|
|
- row.discount = null;
|
|
|
- row.amount = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
- row.taxRate = 0;
|
|
|
- row.unit = e.unit;
|
|
|
- row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
|
|
|
- row.partsDescribe = null;
|
|
|
- row.remarks = null;
|
|
|
- row.exchangeRate = this.form.exchangeRate;
|
|
|
- row.productRemark = e.ename;
|
|
|
- row.attributeList = this.getAttribute(e.goodsSpecificationList)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- importLibray(rows) {
|
|
|
- this.upDataOption()
|
|
|
- rows.forEach(e => {
|
|
|
- this.goodsForm = {
|
|
|
- itemId: e.itemId,
|
|
|
- code: e.code,
|
|
|
- cname: e.cname,
|
|
|
- ename: e.ename,
|
|
|
- priceCategory: e.goodsTypeName,
|
|
|
- purchaseCost: costCal(e.price, e.taxRate),
|
|
|
- purchaseAmount: e.purchaseAmount,
|
|
|
- itemProp: null,
|
|
|
- remarksOne: null,
|
|
|
- customTwo: null,
|
|
|
- customThree: null,
|
|
|
- customFour: null,
|
|
|
- customFive: null,
|
|
|
- customSix: null,
|
|
|
- customSeven: null,
|
|
|
- customEight: null,
|
|
|
- customNine: null,
|
|
|
- customTen: null,
|
|
|
- corpId: e.corpId,
|
|
|
- corpName: e.corpCode,
|
|
|
- itemDescription: e.cnameDescription,
|
|
|
- partsPrice: 0,
|
|
|
- itemType: e.specs,
|
|
|
- tradeTerms: null,
|
|
|
- productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
- price: sellingCal(
|
|
|
- productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
- this.form.exchangeRate
|
|
|
- ),
|
|
|
- orderQuantity: 1,
|
|
|
- insurance: 0,
|
|
|
- freight: 0,
|
|
|
- discount: null,
|
|
|
- amount: sellingCal(
|
|
|
- productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
- this.form.exchangeRate
|
|
|
- ),
|
|
|
- taxRate: 0,
|
|
|
- unit: e.unit,
|
|
|
- itemMargin: grossProfitCal(
|
|
|
- e.purchaseAmount,
|
|
|
- 0,
|
|
|
- sellingCal(
|
|
|
- productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
- this.form.exchangeRate
|
|
|
- ),
|
|
|
- this.form.exchangeRate
|
|
|
- ),
|
|
|
- partsDescribe: null,
|
|
|
- remarks: null,
|
|
|
- exchangeRate: this.form.exchangeRate,
|
|
|
- productRemark: e.ename,
|
|
|
- attributeList: this.getAttribute(e.goodsSpecificationList)
|
|
|
- }
|
|
|
- });
|
|
|
- this.$refs.crud.rowAdd()
|
|
|
- },
|
|
|
- openProperty(row) {
|
|
|
- this.$refs.property.init(row);
|
|
|
- },
|
|
|
- addLibrary() {
|
|
|
- if (!this.form.corpId) {
|
|
|
- return this.$message.error("请选择客户名称");
|
|
|
+ cellStyle() {
|
|
|
+ return "padding:0;height:40px;";
|
|
|
+ },
|
|
|
+ goodsSelectionChange(list) {
|
|
|
+ this.orderItemIds = [];
|
|
|
+ list.map(e => {
|
|
|
+ this.orderItemIds.push(e.id);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ pickGoods() {
|
|
|
+ // this.dialogVisible = !this.dialogVisible;
|
|
|
+ this.$refs.library.init(false);
|
|
|
+ },
|
|
|
+ nodeClick(data) {
|
|
|
+ this.treeDeptId = data.id;
|
|
|
+ this.page.currentPage = 1;
|
|
|
+ this.onLoad(this.page);
|
|
|
+ },
|
|
|
+ //费用查询
|
|
|
+ onLoad(page, params = {}) {
|
|
|
+ let obj = this.deepClone(Object.assign(params, this.search));
|
|
|
+ this.loading = true;
|
|
|
+ getGoods(page.currentPage, page.pageSize, this.treeDeptId, obj)
|
|
|
+ .then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.page.total = data.total;
|
|
|
+ this.goodsList = data.records;
|
|
|
+ if (this.page.total) {
|
|
|
+ this.goodsOption.height = window.innerHeight - 350;
|
|
|
}
|
|
|
- if (!this.form.currency) {
|
|
|
- return this.$message.error("请选择币别");
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ rowClick(row) {
|
|
|
+ this.$refs.goodsCrud.toggleSelection([this.goodsList[row.$index]]);
|
|
|
+ },
|
|
|
+ // importGoods() {
|
|
|
+ // this.upDataOption()
|
|
|
+ // this.selectionList.forEach(e => {
|
|
|
+ // this.goodsForm.itemId = e.id;
|
|
|
+ // this.goodsForm.ename = e.ename;
|
|
|
+ // this.goodsForm.code = e.code;
|
|
|
+ // this.goodsForm.cname = e.cname;
|
|
|
+ // this.goodsForm.corpId = e.corpId;
|
|
|
+ // this.goodsForm.corpName = e.corpCode;
|
|
|
+ // this.goodsForm.priceCategory = e.goodsTypeName;
|
|
|
+ // this.goodsForm.itemUrl = e.url;
|
|
|
+ // this.goodsForm.itemProp = null;
|
|
|
+ // this.goodsForm.remarksOne = null;
|
|
|
+ // this.goodsForm.customTwo = null;
|
|
|
+ // this.goodsForm.customThree = null;
|
|
|
+ // this.goodsForm.customFour = null;
|
|
|
+ // this.goodsForm.customFive = null;
|
|
|
+ // this.goodsForm.customSix = null;
|
|
|
+ // this.goodsForm.customSeven = null;
|
|
|
+ // this.goodsForm.customEight = null;
|
|
|
+ // this.goodsForm.customNine = null;
|
|
|
+ // this.goodsForm.customTen = null;
|
|
|
+ // this.goodsForm.itemDescription = e.cnameDescription;
|
|
|
+ // this.goodsForm.partsList = [];
|
|
|
+ // this.goodsForm.partsPrice = 0;
|
|
|
+ // this.goodsForm.itemType = null;
|
|
|
+ // this.goodsForm.tradeTerms = null;
|
|
|
+ // this.goodsForm.purchaseCost = 0;
|
|
|
+ // this.goodsForm.purchaseAmount = 0;
|
|
|
+ // this.goodsForm.price = 0;
|
|
|
+ // this.goodsForm.orderQuantity = 0;
|
|
|
+ // this.goodsForm.insurance = 0;
|
|
|
+ // this.goodsForm.freight = 0;
|
|
|
+ // this.goodsForm.discount = null;
|
|
|
+ // this.goodsForm.amount = 0;
|
|
|
+ // this.goodsForm.taxRate = 0;
|
|
|
+ // this.goodsForm.unit = e.unit;
|
|
|
+ // this.goodsForm.itemMargin = 0;
|
|
|
+ // this.goodsForm.remarks = null;
|
|
|
+ // this.goodsForm.exchangeRate = this.form.exchangeRate;
|
|
|
+ // this.goodsForm.partsDescribe = null;
|
|
|
+ // this.goodsForm.productRemark = e.ename;
|
|
|
+ // this.goodsForm.attributeList = this.getAttribute(e.goodsSpecificationList);
|
|
|
+ // })
|
|
|
+ // this.dialogVisible = false
|
|
|
+ // },
|
|
|
+ closeGoods() {
|
|
|
+ this.selectionList = [];
|
|
|
+ this.treeDeptId = "";
|
|
|
+ },
|
|
|
+ selectionChange(list) {
|
|
|
+ this.selectionList = list;
|
|
|
+ },
|
|
|
+ refreshTable() {
|
|
|
+ this.$refs.crud.refreshTable();
|
|
|
+ },
|
|
|
+ openpart(val, list) {
|
|
|
+ this.$refs.partLibrary.init(val, list)
|
|
|
+ },
|
|
|
+ addRow() {
|
|
|
+ if (!this.form.corpId) {
|
|
|
+ return this.$message.error("请选择客户名称");
|
|
|
+ }
|
|
|
+ this.$refs.crud.rowAdd()
|
|
|
+ },
|
|
|
+ cnameChange(row) {
|
|
|
+ this.upDataOption()
|
|
|
+ this.goodsoptions.forEach(e => {
|
|
|
+ if (e.itemId == row.itemId) {
|
|
|
+ row.itemId = e.itemId;
|
|
|
+ row.code = e.code;
|
|
|
+ row.cname = e.cname;
|
|
|
+ row.ename = e.ename;
|
|
|
+ row.priceCategory = e.goodsTypeName;
|
|
|
+ row.purchaseCost = costCal(e.price, e.taxRate);
|
|
|
+ row.purchaseAmount = e.purchaseAmount;
|
|
|
+ row.itemProp = null;
|
|
|
+ row.remarksOne = null;
|
|
|
+ row.customTwo = null;
|
|
|
+ row.customThree = null;
|
|
|
+ row.customFour = null;
|
|
|
+ row.customFive = null;
|
|
|
+ row.customSix = null;
|
|
|
+ row.customSeven = null;
|
|
|
+ row.customEight = null;
|
|
|
+ row.customNine = null;
|
|
|
+ row.customTen = null;
|
|
|
+ row.corpId = e.corpId;
|
|
|
+ row.corpName = e.corpCode;
|
|
|
+ row.itemDescription = e.cnameDescription;
|
|
|
+ row.partsPrice = 0;
|
|
|
+ row.itemType = e.specs;
|
|
|
+ row.tradeTerms = null;
|
|
|
+ row.productPrice = productCal(e.purchaseAmount, 0, this.form.coefficient);
|
|
|
+ row.price = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
+ row.orderQuantity = 1;
|
|
|
+ row.insurance = 0;
|
|
|
+ row.freight = 0;
|
|
|
+ row.discount = null;
|
|
|
+ row.amount = sellingCal(productCal(e.purchaseAmount, 0, this.form.coefficient), this.form.exchangeRate);
|
|
|
+ row.taxRate = 0;
|
|
|
+ row.unit = 'PCS';
|
|
|
+ row.itemMargin = grossProfitCal(e.purchaseAmount, 0, sellingCal(productCal(e.purchaseAmount, 0, this
|
|
|
+ .form.coefficient), this.form.exchangeRate), this.form.exchangeRate);
|
|
|
+ row.partsDescribe = null;
|
|
|
+ row.remarks = null;
|
|
|
+ row.exchangeRate = this.form.exchangeRate;
|
|
|
+ row.productRemark = e.ename;
|
|
|
+ row.attributeList = this.getAttribute(e.goodsSpecificationList)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ importLibray(rows) {
|
|
|
+ this.upDataOption()
|
|
|
+ rows.forEach(e => {
|
|
|
+ this.goodsForm = {
|
|
|
+ itemId: e.itemId,
|
|
|
+ code: e.code,
|
|
|
+ cname: e.cname,
|
|
|
+ ename: e.ename,
|
|
|
+ priceCategory: e.goodsTypeName,
|
|
|
+ purchaseCost: costCal(e.price, e.taxRate),
|
|
|
+ purchaseAmount: e.purchaseAmount,
|
|
|
+ itemProp: null,
|
|
|
+ remarksOne: null,
|
|
|
+ customTwo: null,
|
|
|
+ customThree: null,
|
|
|
+ customFour: null,
|
|
|
+ customFive: null,
|
|
|
+ customSix: null,
|
|
|
+ customSeven: null,
|
|
|
+ customEight: null,
|
|
|
+ customNine: null,
|
|
|
+ customTen: null,
|
|
|
+ corpId: e.corpId,
|
|
|
+ corpName: e.corpCode,
|
|
|
+ itemDescription: e.cnameDescription,
|
|
|
+ partsPrice: 0,
|
|
|
+ itemType: e.specs,
|
|
|
+ tradeTerms: null,
|
|
|
+ productPrice: productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
+ price: sellingCal(
|
|
|
+ productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ orderQuantity: 1,
|
|
|
+ insurance: 0,
|
|
|
+ freight: 0,
|
|
|
+ discount: null,
|
|
|
+ amount: sellingCal(
|
|
|
+ productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ taxRate: 0,
|
|
|
+ unit: 'PCS',
|
|
|
+ itemMargin: grossProfitCal(
|
|
|
+ e.purchaseAmount,
|
|
|
+ 0,
|
|
|
+ sellingCal(
|
|
|
+ productCal(e.purchaseAmount, 0, this.form.coefficient),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ this.form.exchangeRate
|
|
|
+ ),
|
|
|
+ partsDescribe: null,
|
|
|
+ remarks: null,
|
|
|
+ exchangeRate: this.form.exchangeRate,
|
|
|
+ productRemark: e.ename,
|
|
|
+ attributeList: this.getAttribute(e.goodsSpecificationList)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$refs.crud.rowAdd()
|
|
|
+ },
|
|
|
+ openProperty(row) {
|
|
|
+ this.$refs.property.init(row);
|
|
|
+ },
|
|
|
+ addLibrary() {
|
|
|
+ if (!this.form.corpId) {
|
|
|
+ return this.$message.error("请选择客户名称");
|
|
|
+ }
|
|
|
+ if (!this.form.currency) {
|
|
|
+ return this.$message.error("请选择币别");
|
|
|
+ }
|
|
|
+ this.$refs.library.init(false);
|
|
|
+ },
|
|
|
+ openReport() {
|
|
|
+ this.switchDialog = !this.switchDialog;
|
|
|
+ },
|
|
|
+ onClose(val) {
|
|
|
+ this.switchDialog = val;
|
|
|
+ },
|
|
|
+ getInvoice() {
|
|
|
+ if (this.$store.getters.outStatus) {
|
|
|
+ this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ type: "warning",
|
|
|
+ callback: action => {
|
|
|
+ console.log(action);
|
|
|
}
|
|
|
- this.$refs.library.init(false);
|
|
|
- },
|
|
|
- openReport() {
|
|
|
- this.switchDialog = !this.switchDialog;
|
|
|
- },
|
|
|
- onClose(val) {
|
|
|
- this.switchDialog = val;
|
|
|
- },
|
|
|
- getInvoice() {
|
|
|
- if (this.$store.getters.outStatus) {
|
|
|
- this.$alert("出口发货单存在,请保存发货单再进行操作", "温馨提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- type: "warning",
|
|
|
- callback: action => {
|
|
|
- console.log(action);
|
|
|
- }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.inInvoice();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cnameData() {
|
|
|
+ this.goodsoptions = []
|
|
|
+ getGoods(1, 10).then(res => {
|
|
|
+ if (res.data.data.total > 0) {
|
|
|
+ this.goodsoptions = res.data.data.records;
|
|
|
+ if (Math.ceil(res.data.data.total / 10) > 1) {
|
|
|
+ for (let i = 2; i <= Math.ceil(res.data.data.total / 10); i++) {
|
|
|
+ getGoods(i, 10).then(e => {
|
|
|
+ this.goodsoptions = this.goodsoptions.concat(e.data.data.records);
|
|
|
});
|
|
|
- } else {
|
|
|
- this.inInvoice();
|
|
|
- }
|
|
|
- },
|
|
|
- cnameData() {
|
|
|
-
|
|
|
- },
|
|
|
- khEdit(status) {
|
|
|
- if (status == 'cname') {
|
|
|
- this.$router.push({
|
|
|
- path: '/basicData/commodityType/index'
|
|
|
- })
|
|
|
+ }
|
|
|
}
|
|
|
- },
|
|
|
- rowCell(row, index) {
|
|
|
- this.getAttribute(JSON.parse(row.attributeList))
|
|
|
- this.$refs.crud.rowEdit(row, index)
|
|
|
- },
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定删除数据?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(() => {
|
|
|
- if (row.id) {
|
|
|
- delItem(row.id).then(res => {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- this.data.splice(row.$index, 1);
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "删除成功!"
|
|
|
- });
|
|
|
- this.data.splice(row.$index, 1);
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ khEdit(status) {
|
|
|
+ if (status == 'cname') {
|
|
|
+ this.$router.push({
|
|
|
+ path: '/basicData/commodityType/index'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ rowCell(row, index) {
|
|
|
+ this.getAttribute(JSON.parse(row.attributeList))
|
|
|
+ this.$refs.crud.rowEdit(row, index)
|
|
|
+ },
|
|
|
+ rowDel(row) {
|
|
|
+ this.$confirm("确定删除数据?", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ if (row.id) {
|
|
|
+ delItem(row.id).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
+ });
|
|
|
+ this.data.splice(row.$index, 1);
|
|
|
});
|
|
|
- },
|
|
|
- moveUp(row, index) {
|
|
|
- this.data[index] = this.data.splice(index - 1, 1, row)[0]
|
|
|
- },
|
|
|
- moveDown(row, index) {
|
|
|
- this.data[index] = this.data.splice(index + 1, 1, row)[0]
|
|
|
- },
|
|
|
- transition(rows) {
|
|
|
- let data = []
|
|
|
- rows.forEach(e => {
|
|
|
- data.push({
|
|
|
- goodId: e.itemId,
|
|
|
- goodTypeId: e.goodTypeId,
|
|
|
- goodTypeName: e.goodsTypeName,
|
|
|
- ename: e.ename,
|
|
|
- corpId: e.corpId,
|
|
|
- corpName: e.corpName,
|
|
|
- goodName: e.cname,
|
|
|
- price: e.purchaseAmount,
|
|
|
- goodNumber: 1,
|
|
|
- amout: e.purchaseAmount,
|
|
|
- partsCost: costCal(e.price, e.taxRate),
|
|
|
- $cellEdit: true
|
|
|
- })
|
|
|
- })
|
|
|
- return data
|
|
|
- },
|
|
|
- purchaseAmountChange(row) {
|
|
|
- row.productPrice = productCal(
|
|
|
- row.purchaseAmount,
|
|
|
- row.partsPrice,
|
|
|
- this.form.coefficient
|
|
|
- );
|
|
|
- row.price = sellingCal(row.productPrice, this.form.exchangeRate);
|
|
|
- row.amount = amountCal(
|
|
|
- row.price,
|
|
|
- row.orderQuantity,
|
|
|
- row.freight,
|
|
|
- row.insurance,
|
|
|
- row.discount
|
|
|
- );
|
|
|
- row.itemMargin = grossProfitCal(
|
|
|
- row.purchaseAmount,
|
|
|
- row.partsPrice,
|
|
|
- row.price,
|
|
|
- this.form.exchangeRate
|
|
|
- );
|
|
|
- },
|
|
|
- priceChange(row) {
|
|
|
- row.amount = amountCal(
|
|
|
- row.price,
|
|
|
- row.orderQuantity,
|
|
|
- row.freight,
|
|
|
- row.insurance,
|
|
|
- row.discount
|
|
|
- );
|
|
|
- row.itemMargin = grossProfitCal(
|
|
|
- row.purchaseAmount,
|
|
|
- row.partsPrice,
|
|
|
- row.price,
|
|
|
- this.form.exchangeRate
|
|
|
- );
|
|
|
- },
|
|
|
- itemTypeFocus(row) {
|
|
|
- this.itemtypeList = [];
|
|
|
- getSpecification({ goodId: row.itemId }).then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.itemtypeList = data.map(item => ({ value: item }));
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
});
|
|
|
- },
|
|
|
- getAttribute(rows) {
|
|
|
- let data = []
|
|
|
- rows.forEach(e => {
|
|
|
- if (e.attributeNo == 'Thread' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "remarksOne").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeNo == 'medium' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "customTwo").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeNo == 'property_color' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "customThree").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeNo == 'stencil' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "customFour").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '阀门配件' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsValveName").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '瓶帽配件' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsCapName").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '特殊处理' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsHandleName").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '包装方式' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsColourName").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '特殊颜色' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsModeName").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '认证' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = false;
|
|
|
- }
|
|
|
- if (e.attributeName == '其他' && e.status == 0) {
|
|
|
- this.findObject(this.tableOption.column, "partsOtherName").disabled = false;
|
|
|
- }
|
|
|
- data.push({
|
|
|
- type: e.type,
|
|
|
- attributeName: e.attributeName,
|
|
|
- attributeNo: e.attributeNo,
|
|
|
- status: e.status,
|
|
|
- })
|
|
|
- })
|
|
|
- return JSON.stringify(data);
|
|
|
- },
|
|
|
- // importProperty(row) {
|
|
|
- // const arr = [];
|
|
|
- // for (let key in row) {
|
|
|
- // if (row[key]) {
|
|
|
- // arr.push(row[key]);
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.goodsForm.itemProp = arr.join(" ");
|
|
|
- // this.goodsForm.remarksOne = row.remarksOne;
|
|
|
- // this.goodsForm.customTwo = row.customTwo;
|
|
|
- // this.goodsForm.customThree = row.customThree;
|
|
|
- // this.goodsForm.customFour = row.customFour;
|
|
|
- // this.goodsForm.customFive = row.customFive;
|
|
|
- // this.goodsForm.customSix = row.customSix;
|
|
|
- // this.goodsForm.customSeven = row.customSeven;
|
|
|
- // this.goodsForm.customEight = row.customEight;
|
|
|
- // this.goodsForm.customNine = row.customNine;
|
|
|
- // this.goodsForm.customTen = row.customTen;
|
|
|
- // this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
|
|
|
- // },
|
|
|
- importPart(rows, type) {
|
|
|
- if (type == 0) {
|
|
|
- this.goodsForm.partsValveCostPrice = 0
|
|
|
- this.goodsForm.partsValveSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsValveCostPrice = sum(this.goodsForm.partsValveCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsValveSalePrice = sum(this.goodsForm.partsValveSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsValveName = names.join(" ")
|
|
|
- this.goodsForm.partsValveValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- if (type == 1) {
|
|
|
- this.goodsForm.partsCapCostPrice = 0
|
|
|
- this.goodsForm.partsCapSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsCapCostPrice = sum(this.goodsForm.partsCapCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsCapSalePrice = sum(this.goodsForm.partsCapSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsCapName = names.join(" ")
|
|
|
- this.goodsForm.partsCapValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- if (type == 2) {
|
|
|
- this.goodsForm.partsHandleCostPrice = 0
|
|
|
- this.goodsForm.partsHandleSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsHandleCostPrice = sum(this.goodsForm.partsHandleCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsHandleSalePrice = sum(this.goodsForm.partsHandleSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsHandleName = names.join(" ")
|
|
|
- this.goodsForm.partsHandleValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- if (type == 3) {
|
|
|
- this.goodsForm.partsColourCostPrice = 0
|
|
|
- this.goodsForm.partsColourSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsColourCostPrice = sum(this.goodsForm.partsColourCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsColourSalePrice = sum(this.goodsForm.partsColourSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsColourName = names.join(" ")
|
|
|
- this.goodsForm.partsColourValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- if (type == 4) {
|
|
|
- this.goodsForm.partsModeCostPrice = 0
|
|
|
- this.goodsForm.partsModeSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsModeCostPrice = sum(this.goodsForm.partsModeCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsModeSalePrice = sum(this.goodsForm.partsModeSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsModeName = names.join(" ")
|
|
|
- this.goodsForm.partsModeValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- if (type == 5) {
|
|
|
- this.goodsForm.partsAuthenticationCostPrice = 0
|
|
|
- this.goodsForm.partsAuthenticationSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsAuthenticationCostPrice = sum(this.goodsForm.partsAuthenticationCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsAuthenticationSalePrice = sum(this.goodsForm.partsAuthenticationSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsAuthenticationName = names.join(" ")
|
|
|
- this.goodsForm.partsAuthenticationValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- if (type == 6) {
|
|
|
- this.goodsForm.partsOtherCostPrice = 0
|
|
|
- this.goodsForm.partsOtherSalePrice = 0
|
|
|
- let names = []
|
|
|
- rows.forEach(e => {
|
|
|
- names.push(e.goodName)
|
|
|
- this.goodsForm.partsOtherCostPrice = sum(this.goodsForm.partsOtherCostPrice, multiply(e.partsCost, e.goodNumber));
|
|
|
- this.goodsForm.partsOtherSalePrice = sum(this.goodsForm.partsOtherSalePrice, e.amout);
|
|
|
- })
|
|
|
- this.goodsForm.partsOtherName = names.join(" ")
|
|
|
- this.goodsForm.partsOtherValue = JSON.stringify(rows)
|
|
|
- }
|
|
|
- this.goodsForm.partsCost = partSum(this.goodsForm.partsValveCostPrice, this.goodsForm.partsCapCostPrice, this.goodsForm.partsHandleCostPrice, this.goodsForm.partsColourCostPrice, this.goodsForm.partsModeCostPrice, this.goodsForm.partsAuthenticationCostPrice, this.goodsForm.partsOtherCostPrice)
|
|
|
- this.goodsForm.partsPrice = partSum(this.goodsForm.partsValveSalePrice, this.goodsForm.partsCapSalePrice, this.goodsForm.partsHandleSalePrice, this.goodsForm.partsColourSalePrice, this.goodsForm.partsModeSalePrice, this.goodsForm.partsAuthenticationSalePrice, this.goodsForm.partsOtherSalePrice)
|
|
|
- // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
|
|
|
- this.goodsForm.productPrice = productCal(
|
|
|
- this.goodsForm.purchaseAmount,
|
|
|
- this.goodsForm.partsPrice,
|
|
|
- this.form.coefficient
|
|
|
- );
|
|
|
- this.goodsForm.price = sellingCal(
|
|
|
- this.goodsForm.productPrice,
|
|
|
- this.form.exchangeRate
|
|
|
- );
|
|
|
- this.goodsForm.amount = amountCal(
|
|
|
- this.goodsForm.price,
|
|
|
- this.goodsForm.orderQuantity,
|
|
|
- this.goodsForm.freight,
|
|
|
- this.goodsForm.insurance,
|
|
|
- this.goodsForm.discount
|
|
|
- );
|
|
|
- this.goodsForm.itemMargin = grossProfitCal(
|
|
|
- this.goodsForm.purchaseAmount,
|
|
|
- this.goodsForm.partsPrice,
|
|
|
- this.goodsForm.price,
|
|
|
- this.form.exchangeRate
|
|
|
- );
|
|
|
- const names = [this.goodsForm.partsValveName, this.goodsForm.partsCapName, this.goodsForm.partsHandleName, this.goodsForm.partsColourName, this.goodsForm.partsModeName, this.goodsForm.partsAuthenticationName, this.goodsForm.partsOtherName];
|
|
|
- const name = []
|
|
|
- names.forEach(e => {
|
|
|
- if (e) {
|
|
|
- name.push(e)
|
|
|
- }
|
|
|
- })
|
|
|
- this.goodsForm.partsDescribe = name.join(" ");
|
|
|
- // this.data[index].partsPriceDescribe = namePrices.join(";");
|
|
|
- this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
|
|
|
- this.priceChange(this.goodsForm);
|
|
|
- },
|
|
|
- propsChange(row) {
|
|
|
- const data = {
|
|
|
- remarksOne: row.remarksOne,
|
|
|
- customTwo: row.customTwo,
|
|
|
- customThree: row.customThree,
|
|
|
- customFour: row.customFour,
|
|
|
- customFive: row.customFive,
|
|
|
- customSix: row.customSix,
|
|
|
- customSeven: row.customSeven,
|
|
|
- customEight: row.customEight,
|
|
|
- customNine: row.customNine,
|
|
|
- customTen: row.customTen,
|
|
|
- };
|
|
|
- const arr = []
|
|
|
- for (let key in data) {
|
|
|
- if (row[key]) {
|
|
|
- arr.push(row[key]);
|
|
|
- }
|
|
|
- }
|
|
|
- this.goodsForm.itemProp = arr.join(' ')
|
|
|
- },
|
|
|
- getproductRemark(row) {
|
|
|
- const ename = row.ename ? row.ename : "";
|
|
|
- const itemDescription = row.itemDescription
|
|
|
- ? row.itemDescription
|
|
|
- : "";
|
|
|
- const itemProp = row.itemProp ? row.itemProp : "";
|
|
|
- const partsDescribe = row.partsDescribe ? (', ' + row.partsDescribe) : "";
|
|
|
- const productRemark =
|
|
|
- ename +
|
|
|
- "\n" +
|
|
|
- itemProp +
|
|
|
- " " +
|
|
|
- itemDescription +
|
|
|
- " " +
|
|
|
- partsDescribe;
|
|
|
- return productRemark
|
|
|
- },
|
|
|
- beforeClose(done) {
|
|
|
- this.upDataOption()
|
|
|
- done();
|
|
|
- },
|
|
|
- upDataOption() {
|
|
|
- this.findObject(this.tableOption.column, "remarksOne").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "customTwo").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "customThree").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "customFour").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsValveName").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsCapName").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsHandleName").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsColourName").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsModeName").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = true;
|
|
|
- this.findObject(this.tableOption.column, "partsOtherName").disabled = true;
|
|
|
-
|
|
|
- },
|
|
|
- discountChange(row) {
|
|
|
- if (row.discount >= 10) {
|
|
|
- row.discount = null;
|
|
|
- this.$message.error("请正确输入折扣");
|
|
|
- }
|
|
|
- this.priceChange(row);
|
|
|
- },
|
|
|
- taxRateChange(row) {
|
|
|
- if (row.taxRate > 100) {
|
|
|
- row.taxRate = 0;
|
|
|
- this.$message.error("请正确输入税率");
|
|
|
- }
|
|
|
- },
|
|
|
- handleRowSave(row, done, loading) {
|
|
|
- this.data.push(row)
|
|
|
- loading()
|
|
|
- done()
|
|
|
- },
|
|
|
- handleRowUpdate(row, index, done, loading) {
|
|
|
- this.data[index] = row
|
|
|
- // this.$refs.crud.rowUpdate()
|
|
|
- loading()
|
|
|
- done()
|
|
|
- },
|
|
|
- async saveColumn() {
|
|
|
- const inSave = await this.saveColumnData(
|
|
|
- this.getColumnName(5),
|
|
|
- this.tableOption
|
|
|
- );
|
|
|
- if (inSave) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.crud.doLayout();
|
|
|
- });
|
|
|
- this.getWorkDicts("cargo_type").then(res => {
|
|
|
- this.findObject(this.tableOption.column, "cargoType").dicData =
|
|
|
- res.data.data;
|
|
|
- });
|
|
|
- this.$message.success("保存成功");
|
|
|
- //关闭窗口
|
|
|
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
- }
|
|
|
- },
|
|
|
- async resetColumn() {
|
|
|
- this.tableOption = tableOption;
|
|
|
- const inSave = await this.delColumnData(
|
|
|
- this.getColumnName(5),
|
|
|
- tableOption
|
|
|
- );
|
|
|
- if (inSave) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.crud.doLayout();
|
|
|
- });
|
|
|
- this.$message.success("重置成功");
|
|
|
- //关闭窗口
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- },
|
|
|
- async saveGoodsColumn() {
|
|
|
- const inSave = await this.saveColumnData(
|
|
|
- this.getColumnName(28),
|
|
|
- this.goodsOption
|
|
|
- );
|
|
|
- if (inSave) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.goodsCrud.doLayout();
|
|
|
- });
|
|
|
- this.$message.success("保存成功");
|
|
|
- //关闭窗口
|
|
|
- this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
- }
|
|
|
- },
|
|
|
- async resetGoodsColumn() {
|
|
|
- this.goodsOption = goodsOption;
|
|
|
- const inSave = await this.delColumnData(
|
|
|
- this.getColumnName(28),
|
|
|
- goodsOption
|
|
|
- );
|
|
|
- if (inSave) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.goodsCrud.doLayout();
|
|
|
- });
|
|
|
- this.$message.success("重置成功");
|
|
|
- //关闭窗口
|
|
|
- setTimeout(() => {
|
|
|
- this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
+ this.data.splice(row.$index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ moveUp(row, index) {
|
|
|
+ this.data[index] = this.data.splice(index - 1, 1, row)[0]
|
|
|
+ },
|
|
|
+ moveDown(row, index) {
|
|
|
+ this.data[index] = this.data.splice(index + 1, 1, row)[0]
|
|
|
+ },
|
|
|
+ transition(rows) {
|
|
|
+ let data = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ data.push({
|
|
|
+ goodId: e.itemId,
|
|
|
+ goodTypeId: e.goodTypeId,
|
|
|
+ goodTypeName: e.goodsTypeName,
|
|
|
+ ename: e.ename,
|
|
|
+ corpId: e.corpId,
|
|
|
+ corpName: e.corpName,
|
|
|
+ goodName: e.cname,
|
|
|
+ price: e.purchaseAmount,
|
|
|
+ goodNumber: 1,
|
|
|
+ amout: e.purchaseAmount,
|
|
|
+ partsCost: costCal(e.price, e.taxRate),
|
|
|
+ $cellEdit: true
|
|
|
+ })
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ },
|
|
|
+ purchaseAmountChange(row) {
|
|
|
+ row.productPrice = productCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ );
|
|
|
+ row.price = sellingCal(row.productPrice, this.form.exchangeRate);
|
|
|
+ row.amount = amountCal(
|
|
|
+ row.price,
|
|
|
+ row.orderQuantity,
|
|
|
+ row.freight,
|
|
|
+ row.insurance,
|
|
|
+ row.discount
|
|
|
+ );
|
|
|
+ row.itemMargin = grossProfitCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ row.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ },
|
|
|
+ priceChange(row) {
|
|
|
+ row.amount = amountCal(
|
|
|
+ row.price,
|
|
|
+ row.orderQuantity,
|
|
|
+ row.freight,
|
|
|
+ row.insurance,
|
|
|
+ row.discount
|
|
|
+ );
|
|
|
+ row.itemMargin = grossProfitCal(
|
|
|
+ row.purchaseAmount,
|
|
|
+ row.partsPrice,
|
|
|
+ row.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ },
|
|
|
+ itemTypeFocus(row) {
|
|
|
+ this.itemtypeList = [];
|
|
|
+ getSpecification({
|
|
|
+ goodId: row.itemId
|
|
|
+ }).then(res => {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.itemtypeList = data.map(item => ({
|
|
|
+ value: item
|
|
|
+ }));
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getAttribute(rows) {
|
|
|
+ let data = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ if (e.attributeNo == 'Thread' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "remarksOne").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeNo == 'medium' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "customTwo").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeNo == 'property_color' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "customThree").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeNo == 'stencil' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "customFour").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '阀门配件' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsValveName").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '瓶帽配件' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsCapName").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '特殊处理' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsHandleName").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '包装方式' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsColourName").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '特殊颜色' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsModeName").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '认证' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = false;
|
|
|
+ }
|
|
|
+ if (e.attributeName == '其他' && e.status == 0) {
|
|
|
+ this.findObject(this.tableOption.column, "partsOtherName").disabled = false;
|
|
|
+ }
|
|
|
+ data.push({
|
|
|
+ type: e.type,
|
|
|
+ attributeName: e.attributeName,
|
|
|
+ attributeNo: e.attributeNo,
|
|
|
+ status: e.status,
|
|
|
+ })
|
|
|
+ })
|
|
|
+ return JSON.stringify(data);
|
|
|
+ },
|
|
|
+ // importProperty(row) {
|
|
|
+ // const arr = [];
|
|
|
+ // for (let key in row) {
|
|
|
+ // if (row[key]) {
|
|
|
+ // arr.push(row[key]);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.goodsForm.itemProp = arr.join(" ");
|
|
|
+ // this.goodsForm.remarksOne = row.remarksOne;
|
|
|
+ // this.goodsForm.customTwo = row.customTwo;
|
|
|
+ // this.goodsForm.customThree = row.customThree;
|
|
|
+ // this.goodsForm.customFour = row.customFour;
|
|
|
+ // this.goodsForm.customFive = row.customFive;
|
|
|
+ // this.goodsForm.customSix = row.customSix;
|
|
|
+ // this.goodsForm.customSeven = row.customSeven;
|
|
|
+ // this.goodsForm.customEight = row.customEight;
|
|
|
+ // this.goodsForm.customNine = row.customNine;
|
|
|
+ // this.goodsForm.customTen = row.customTen;
|
|
|
+ // this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
|
|
|
+ // },
|
|
|
+ importPart(rows, type) {
|
|
|
+ if (type == 0) {
|
|
|
+ this.goodsForm.partsValveCostPrice = 0
|
|
|
+ this.goodsForm.partsValveSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsValveCostPrice = sum(this.goodsForm.partsValveCostPrice, multiply(e.partsCost, e
|
|
|
+ .goodNumber));
|
|
|
+ this.goodsForm.partsValveSalePrice = sum(this.goodsForm.partsValveSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsValveName = names.join(" ")
|
|
|
+ this.goodsForm.partsValveValue = JSON.stringify(rows)
|
|
|
+ }
|
|
|
+ if (type == 1) {
|
|
|
+ this.goodsForm.partsCapCostPrice = 0
|
|
|
+ this.goodsForm.partsCapSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsCapCostPrice = sum(this.goodsForm.partsCapCostPrice, multiply(e.partsCost, e
|
|
|
+ .goodNumber));
|
|
|
+ this.goodsForm.partsCapSalePrice = sum(this.goodsForm.partsCapSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsCapName = names.join(" ")
|
|
|
+ this.goodsForm.partsCapValue = JSON.stringify(rows)
|
|
|
+ }
|
|
|
+ if (type == 2) {
|
|
|
+ this.goodsForm.partsHandleCostPrice = 0
|
|
|
+ this.goodsForm.partsHandleSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsHandleCostPrice = sum(this.goodsForm.partsHandleCostPrice, multiply(e.partsCost, e
|
|
|
+ .goodNumber));
|
|
|
+ this.goodsForm.partsHandleSalePrice = sum(this.goodsForm.partsHandleSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsHandleName = names.join(" ")
|
|
|
+ this.goodsForm.partsHandleValue = JSON.stringify(rows)
|
|
|
+ }
|
|
|
+ if (type == 3) {
|
|
|
+ this.goodsForm.partsColourCostPrice = 0
|
|
|
+ this.goodsForm.partsColourSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsColourCostPrice = sum(this.goodsForm.partsColourCostPrice, multiply(e.partsCost, e
|
|
|
+ .goodNumber));
|
|
|
+ this.goodsForm.partsColourSalePrice = sum(this.goodsForm.partsColourSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsColourName = names.join(" ")
|
|
|
+ this.goodsForm.partsColourValue = JSON.stringify(rows)
|
|
|
+ }
|
|
|
+ if (type == 4) {
|
|
|
+ this.goodsForm.partsModeCostPrice = 0
|
|
|
+ this.goodsForm.partsModeSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsModeCostPrice = sum(this.goodsForm.partsModeCostPrice, multiply(e.partsCost, e
|
|
|
+ .goodNumber));
|
|
|
+ this.goodsForm.partsModeSalePrice = sum(this.goodsForm.partsModeSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsModeName = names.join(" ")
|
|
|
+ this.goodsForm.partsModeValue = JSON.stringify(rows)
|
|
|
+ }
|
|
|
+ if (type == 5) {
|
|
|
+ this.goodsForm.partsAuthenticationCostPrice = 0
|
|
|
+ this.goodsForm.partsAuthenticationSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsAuthenticationCostPrice = sum(this.goodsForm.partsAuthenticationCostPrice, multiply(
|
|
|
+ e.partsCost, e.goodNumber));
|
|
|
+ this.goodsForm.partsAuthenticationSalePrice = sum(this.goodsForm.partsAuthenticationSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsAuthenticationName = names.join(" ")
|
|
|
+ this.goodsForm.partsAuthenticationValue = JSON.stringify(rows)
|
|
|
+ }
|
|
|
+ if (type == 6) {
|
|
|
+ this.goodsForm.partsOtherCostPrice = 0
|
|
|
+ this.goodsForm.partsOtherSalePrice = 0
|
|
|
+ let names = []
|
|
|
+ rows.forEach(e => {
|
|
|
+ names.push(e.goodName)
|
|
|
+ this.goodsForm.partsOtherCostPrice = sum(this.goodsForm.partsOtherCostPrice, multiply(e.partsCost, e
|
|
|
+ .goodNumber));
|
|
|
+ this.goodsForm.partsOtherSalePrice = sum(this.goodsForm.partsOtherSalePrice, e.amout);
|
|
|
+ })
|
|
|
+ this.goodsForm.partsOtherName = names.join(" ")
|
|
|
+ this.goodsForm.partsOtherValue = JSON.stringify(rows)
|
|
|
}
|
|
|
+ this.goodsForm.partsCost = partSum(this.goodsForm.partsValveCostPrice, this.goodsForm.partsCapCostPrice, this
|
|
|
+ .goodsForm.partsHandleCostPrice, this.goodsForm.partsColourCostPrice, this.goodsForm.partsModeCostPrice,
|
|
|
+ this.goodsForm.partsAuthenticationCostPrice, this.goodsForm.partsOtherCostPrice)
|
|
|
+ this.goodsForm.partsPrice = partSum(this.goodsForm.partsValveSalePrice, this.goodsForm.partsCapSalePrice, this
|
|
|
+ .goodsForm.partsHandleSalePrice, this.goodsForm.partsColourSalePrice, this.goodsForm.partsModeSalePrice,
|
|
|
+ this.goodsForm.partsAuthenticationSalePrice, this.goodsForm.partsOtherSalePrice)
|
|
|
+ // 销售价=(配件采购价格+产品价格)/汇率 *(1+客户FOB系数/100)
|
|
|
+ this.goodsForm.productPrice = productCal(
|
|
|
+ this.goodsForm.purchaseAmount,
|
|
|
+ this.goodsForm.partsPrice,
|
|
|
+ this.form.coefficient
|
|
|
+ );
|
|
|
+ this.goodsForm.price = sellingCal(
|
|
|
+ this.goodsForm.productPrice,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ this.goodsForm.amount = amountCal(
|
|
|
+ this.goodsForm.price,
|
|
|
+ this.goodsForm.orderQuantity,
|
|
|
+ this.goodsForm.freight,
|
|
|
+ this.goodsForm.insurance,
|
|
|
+ this.goodsForm.discount
|
|
|
+ );
|
|
|
+ this.goodsForm.itemMargin = grossProfitCal(
|
|
|
+ this.goodsForm.purchaseAmount,
|
|
|
+ this.goodsForm.partsPrice,
|
|
|
+ this.goodsForm.price,
|
|
|
+ this.form.exchangeRate
|
|
|
+ );
|
|
|
+ const names = [this.goodsForm.partsValveName, this.goodsForm.partsCapName, this.goodsForm.partsHandleName, this
|
|
|
+ .goodsForm.partsColourName, this.goodsForm.partsModeName, this.goodsForm.partsAuthenticationName, this
|
|
|
+ .goodsForm.partsOtherName
|
|
|
+ ];
|
|
|
+ const name = []
|
|
|
+ names.forEach(e => {
|
|
|
+ if (e) {
|
|
|
+ name.push(e)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.goodsForm.partsDescribe = name.join(" ");
|
|
|
+ // this.data[index].partsPriceDescribe = namePrices.join(";");
|
|
|
+ this.goodsForm.productRemark = this.getproductRemark(this.goodsForm)
|
|
|
+ this.priceChange(this.goodsForm);
|
|
|
+ },
|
|
|
+ propsChange(row) {
|
|
|
+ const data = {
|
|
|
+ remarksOne: row.remarksOne,
|
|
|
+ customTwo: row.customTwo,
|
|
|
+ customThree: row.customThree,
|
|
|
+ customFour: row.customFour,
|
|
|
+ customFive: row.customFive,
|
|
|
+ customSix: row.customSix,
|
|
|
+ customSeven: row.customSeven,
|
|
|
+ customEight: row.customEight,
|
|
|
+ customNine: row.customNine,
|
|
|
+ customTen: row.customTen,
|
|
|
+ };
|
|
|
+ const arr = []
|
|
|
+ for (let key in data) {
|
|
|
+ if (row[key]) {
|
|
|
+ arr.push(row[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.goodsForm.itemProp = arr.join(' ')
|
|
|
+ },
|
|
|
+ editChange(row) {
|
|
|
+ row.productRemark = this.getproductRemark(row)
|
|
|
+ },
|
|
|
+ getproductRemark(row) {
|
|
|
+ console.log(row)
|
|
|
+ const ename = row.ename ? row.ename : "";
|
|
|
+ const itemDescription = row.itemDescription ?
|
|
|
+ row.itemDescription :
|
|
|
+ "";
|
|
|
+ const itemProp = row.itemProp ? row.itemProp : "";
|
|
|
+ const partsDescribe = row.partsDescribe ? (' ' + row.partsDescribe) : "";
|
|
|
+ const productRemark =
|
|
|
+ ename +
|
|
|
+ "\n" +
|
|
|
+ itemProp +
|
|
|
+ " " +
|
|
|
+ itemDescription +
|
|
|
+ " " +
|
|
|
+ partsDescribe;
|
|
|
+ return productRemark
|
|
|
+ },
|
|
|
+ beforeClose(done) {
|
|
|
+ this.upDataOption()
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ upDataOption() {
|
|
|
+ this.findObject(this.tableOption.column, "remarksOne").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "customTwo").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "customThree").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "customFour").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsValveName").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsCapName").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsHandleName").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsColourName").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsModeName").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsAuthenticationName").disabled = true;
|
|
|
+ this.findObject(this.tableOption.column, "partsOtherName").disabled = true;
|
|
|
+ },
|
|
|
+ discountChange(row) {
|
|
|
+ if (row.discount >= 10) {
|
|
|
+ row.discount = null;
|
|
|
+ this.$message.error("请正确输入折扣");
|
|
|
+ }
|
|
|
+ this.priceChange(row);
|
|
|
+ },
|
|
|
+ taxRateChange(row) {
|
|
|
+ if (row.taxRate > 100) {
|
|
|
+ row.taxRate = 0;
|
|
|
+ this.$message.error("请正确输入税率");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleRowSave(row, done, loading) {
|
|
|
+ this.data.push(row)
|
|
|
+ loading()
|
|
|
+ done()
|
|
|
+ },
|
|
|
+ handleRowUpdate(row, index, done, loading) {
|
|
|
+ this.data[index] = row
|
|
|
+ // this.$refs.crud.rowUpdate()
|
|
|
+ loading()
|
|
|
+ done()
|
|
|
+ },
|
|
|
+ async saveColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(5),
|
|
|
+ this.tableOption
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.getWorkDicts("cargo_type").then(res => {
|
|
|
+ this.findObject(this.tableOption.column, "cargoType").dicData =
|
|
|
+ res.data.data;
|
|
|
+ });
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetColumn() {
|
|
|
+ this.tableOption = tableOption;
|
|
|
+ const inSave = await this.delColumnData(
|
|
|
+ this.getColumnName(5),
|
|
|
+ tableOption
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.crud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ //关闭窗口
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.crud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async saveGoodsColumn() {
|
|
|
+ const inSave = await this.saveColumnData(
|
|
|
+ this.getColumnName(28),
|
|
|
+ this.goodsOption
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.goodsCrud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ //关闭窗口
|
|
|
+ this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async resetGoodsColumn() {
|
|
|
+ this.goodsOption = goodsOption;
|
|
|
+ const inSave = await this.delColumnData(
|
|
|
+ this.getColumnName(28),
|
|
|
+ goodsOption
|
|
|
+ );
|
|
|
+ if (inSave) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.goodsCrud.doLayout();
|
|
|
+ });
|
|
|
+ this.$message.success("重置成功");
|
|
|
+ //关闭窗口
|
|
|
+ setTimeout(() => {
|
|
|
+ this.$refs.goodsCrud.$refs.dialogColumn.columnBox = false;
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- watch: {
|
|
|
- }
|
|
|
-};
|
|
|
+ watch: {}
|
|
|
+ };
|
|
|
</script>
|
|
|
-
|
|
|
+
|
|
|
<style scoped>
|
|
|
-::v-deep .select-component {
|
|
|
+ ::v-deep .select-component {
|
|
|
display: flex;
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
-.page-crad ::v-deep .basic-container__card {
|
|
|
+ .page-crad ::v-deep .basic-container__card {
|
|
|
height: 94.2vh;
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
-.itemTable ::v-deep .el-table {
|
|
|
+ .itemTable ::v-deep .el-table {
|
|
|
width: 738px;
|
|
|
-}
|
|
|
+ }
|
|
|
|
|
|
-::v-deep .el-input-group__append,
|
|
|
-.el-input-group__prepend {
|
|
|
+/* ::v-deep .el-input-group__append,
|
|
|
+ .el-input-group__prepend {
|
|
|
padding: 0 5px;
|
|
|
-}
|
|
|
+ } */
|
|
|
</style>
|
|
|
-
|