|
|
@@ -1,13 +1,2459 @@
|
|
|
<template>
|
|
|
+ <div class="main-div" style="position: relative;">
|
|
|
+ <DkButton type="primary" style="position:fixed;right: 100px;z-index: 1000;height: 30px"
|
|
|
+ v-if="this.type == this.$config.formMode.add"
|
|
|
+ @click="purchaseBasedOnSales(true)"> {{ $t('purchaseBasedOnSales') }}
|
|
|
+ </DkButton>
|
|
|
+ <DkCollapse @on-change="changeCollapse" ref="collapse">
|
|
|
+ <DkPanel prop="essentialInformation">
|
|
|
|
|
|
+ <!-- 单据信息 -->
|
|
|
+ <DkForm slot="content" ref="formInline" v-model="formData" :rules="ruleInline" name="dk-form"
|
|
|
+ style="width:100%" @onValidate="onValidate" :label-max-words="5">
|
|
|
+ <!--所属公司-->
|
|
|
+ <DkFormItem :errorMessage="getErrMessage('ascpId')" :label="$t('affiliatedCompany')"
|
|
|
+ prop="ascpId" :required="true">
|
|
|
+ <SelectMagnifier v-model="formData.ascpId" :displayText="formData.cpName"
|
|
|
+ :type="this.$config.MagnifierType.company"
|
|
|
+ :readonly="checkColumnIsEdit('ascpId')"
|
|
|
+ @ok="ascpIdOk"
|
|
|
+ :initSearchFlag="true"
|
|
|
+ searchType="S"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--采购单号-->
|
|
|
+ <DkFormItem prop="orderNo" :label="$t('procureOrderNo')">
|
|
|
+ <InputPop ref="orderNo" v-model="formData.orderNo" :readonly="true"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--供应商-->
|
|
|
+ <DkFormItem prop="supplierId" :label="$t('supplier')" :required="true"
|
|
|
+ :errorMessage="getErrMessage('supplierId')">
|
|
|
+ <SelectMagnifier v-model="formData.supplierId" :display-text="formData.supplierName"
|
|
|
+ :type="this.$config.MagnifierType.supplier"
|
|
|
+ :other-condition="{cpId:$store.state.user.cpId,
|
|
|
+ orgId:$store.state.user.orgId}"
|
|
|
+ @ok="supplierOk"
|
|
|
+ :initSearchFlag="true"
|
|
|
+ :readonly="checkColumnIsEdit('supplierId')"
|
|
|
+ searchType="S"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--预计收货时间-->
|
|
|
+ <DkFormItem :errorMessage="getErrMessage('entryTime')" :label="$t('expectedDeliverDate')"
|
|
|
+ prop="entryTime" :required="false">
|
|
|
+ <DatePickerPop v-model="formData.entryTime"
|
|
|
+ :placeholder="$t('inputWords',{'search-name':$t('entryTime')})"
|
|
|
+ :readonly="checkColumnIsEdit('entryTime')"
|
|
|
+ type="date" :short-cut-flag="true"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--收货仓库-->
|
|
|
+ <DkFormItem prop="entryWhId" :label="$t('receivingWarehouse')" :required="true"
|
|
|
+ :errorMessage="getErrMessage('entryWhId')">
|
|
|
+ <SelectMagnifier v-model="formData.entryWhId" :displayText="formData.warehouseName"
|
|
|
+ :type="this.$config.MagnifierType.warehousePurchase"
|
|
|
+ @ok="warehouseOk"
|
|
|
+ :other-condition="{flgValid: true, ascpId: $store.state.user.ascpId}"
|
|
|
+ :initSearchFlag="true"
|
|
|
+ searchType="S"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--收货人-->
|
|
|
+ <DkFormItem prop="contactName" :label="$t('consignee')" :required="true">
|
|
|
+ <SelectMagnifier v-model="formData.contactName" :display-text="formData.contactName"
|
|
|
+ :type="this.$config.MagnifierType.address"
|
|
|
+ :other-condition="{customerId:$store.state.user.sale2CustomerId}"
|
|
|
+ @ok="addressOk"
|
|
|
+ :initSearchFlag="true"
|
|
|
+ :readonly="checkColumnIsEdit('contactName')"
|
|
|
+ searchType="S"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--收货电话-->
|
|
|
+ <DkFormItem prop="contactPhones" :label="$t('consigneePhone')">
|
|
|
+ <InputPop :telephone="true" ref="contactPhones" :readonly="true" v-model="formData.contactPhones"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!-- <!–地址定位–>-->
|
|
|
+ <!-- <Col class="Col" span="6">-->
|
|
|
+ <!-- <DkFormItem prop="customerDistrict" :label="$t('addressing')">-->
|
|
|
+ <!-- <RegionsChoose v-model="regionData" :options="cityData" :default-value="formData.addressName"-->
|
|
|
+ <!-- ref="customerDistrict"-->
|
|
|
+ <!-- @on-choose="chooseAddress"></RegionsChoose>-->
|
|
|
+ <!-- </DkFormItem>-->
|
|
|
+ <!-- </Col>-->
|
|
|
+ <!-- <!–门牌号–>-->
|
|
|
+ <!-- <Col class="Col" span="6">-->
|
|
|
+ <!-- <DkFormItem :errorMessage="getErrMessage('addressNo')" prop="addressNo" :required="true">-->
|
|
|
+ <!-- <InputPop ref="addressNo"-->
|
|
|
+ <!-- v-model="formData.addressNo"-->
|
|
|
+ <!-- @input="setAddressFull"/>-->
|
|
|
+ <!-- </DkFormItem>-->
|
|
|
+ <!-- </Col>-->
|
|
|
+ <!--收货地址-->
|
|
|
+ <DkFormItem :label="$t('takeOverAddress')" :errorMessage="getErrMessage('addressFull')"
|
|
|
+ prop="addressFull" :required="true">
|
|
|
+ <InputPop ref="addressFull" :readonly="true" v-model="formData.addressFull"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--备注-->
|
|
|
+ <DkFormItem prop="remarks">
|
|
|
+ <InputPop ref="remarks" v-model="formData.remarks" :readonly="checkColumnIsEdit('remarks')"
|
|
|
+ maxlength=500 textareaFlag/>
|
|
|
+ </DkFormItem>
|
|
|
+ </DkForm>
|
|
|
+ </DkPanel>
|
|
|
+ </DkCollapse>
|
|
|
+
|
|
|
+ <!--商品信息-->
|
|
|
+ <div style="display: flex;margin-top: 30px">
|
|
|
+ <DkCollapse @on-change="changeCollapse" ref="collapse">
|
|
|
+ <DkPanel prop="goodsInformation">
|
|
|
+ <div id="search-cond-div-goods-info" ref="search-cond-div-goods-info"
|
|
|
+ slot="content">
|
|
|
+ <EditTreeTable ref="goodsTable" :data="formData.goodsList" showFooter exchange-field="replaceableSku"
|
|
|
+ major-field="itemId"
|
|
|
+ combined-field="promotionId"
|
|
|
+ :new-row-flag="!(!this.formData.orgId)"
|
|
|
+ :readonly="checkColumnIsEdit('goodsTable')"
|
|
|
+ :amount-name="this.type == this.$config.formMode.add?'itemAmount':'tItemAmount'"
|
|
|
+ :columns-social="(this.type == this.$config.formMode.add
|
|
|
+ || this.type == this.$config.formMode.approval)?goodsColumns:goodsColumnsEdit"
|
|
|
+ :columns="(this.type == this.$config.formMode.add
|
|
|
+ || this.type == this.$config.formMode.approval)?(visUserSensitive? goodsColumns : goodsColumns.filter(it => !it.flgUserSensitive))
|
|
|
+ :(visUserSensitive ?goodsColumnsEdit : goodsColumnsEdit.filter(it => !it.flgUserSensitive))"
|
|
|
+ :orgId="this.formData.orgId"
|
|
|
+ :customerId="this.formData.customerId"
|
|
|
+ :saleChannelCode="this.formData.salesChannelCode"
|
|
|
+ :defWhId="this.formData.defWhId"
|
|
|
+ :supplierWhName="this.formData.supplierWhName"
|
|
|
+ :entryWhId="this.formData.entryWhId"
|
|
|
+ :purchaseWhFlag="true"
|
|
|
+ :flgHidePrice="!visUserSensitive"
|
|
|
+ controlId="skuId"
|
|
|
+ @on-choose="getTotals"
|
|
|
+ @changeValue="changeValue"
|
|
|
+ :height="400"
|
|
|
+ ></EditTreeTable>
|
|
|
+ <div>
|
|
|
+ <DkForm slot="content" ref="goodsFootFormData" v-model="goodsFootFormData" :labelMaxWords="5"
|
|
|
+ name="dk-form"
|
|
|
+ class="form-content-class">
|
|
|
+ <DkRow>
|
|
|
+ <!--货物金额-->
|
|
|
+ <Col class="Col" span="6" v-if="visUserSensitive">
|
|
|
+ <DkFormItem prop="sumGoodsAmount">
|
|
|
+ <InputNumberPop ref="sumGoodsAmount" v-model="goodsFootFormData.sumGoodsAmount" :clearable="false"
|
|
|
+ :digits="2" :readonly="true"/>
|
|
|
+ </DkFormItem>
|
|
|
+ </Col>
|
|
|
+ <!--总重量-->
|
|
|
+ <Col class="Col" span="6">
|
|
|
+ <DkFormItem prop="sumWeight">
|
|
|
+ <InputNumberPop ref="sumWeight" v-model="goodsFootFormData.sumWeight" :digits="2"
|
|
|
+ :readonly="true" unit="KG"/>
|
|
|
+ </DkFormItem>
|
|
|
+ </Col>
|
|
|
+ <!--总体积-->
|
|
|
+ <Col class="Col" span="6">
|
|
|
+ <DkFormItem prop="sumVolume">
|
|
|
+ <InputNumberPop ref="sumVolume" v-model="goodsFootFormData.sumVolume" :digits="2"
|
|
|
+ :readonly="true" unit="m³"/>
|
|
|
+ </DkFormItem>
|
|
|
+ </Col>
|
|
|
+ </DkRow>
|
|
|
+ </DkForm>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </DkPanel>
|
|
|
+ </DkCollapse>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!--附件-->
|
|
|
+ <div style="display: flex;margin-bottom: 80px">
|
|
|
+ <DkCollapse @on-change="changeCollapse" ref="collapse">
|
|
|
+ <DkPanel prop="files">
|
|
|
+ <div id="search-cond-div-files-info" ref="search-cond-div-files-info"
|
|
|
+ slot="content">
|
|
|
+ <DkPicWall v-model="formData.annexPaths" :disabled="this.allCanNoEdit?true:false"
|
|
|
+ folder="t_order/annex_paths" :accept="$config.uploadFileConfig.acceptPicType"
|
|
|
+ :format="['jpg','jpeg','png']"></DkPicWall>
|
|
|
+ </div>
|
|
|
+ </DkPanel>
|
|
|
+ </DkCollapse>
|
|
|
+ </div>
|
|
|
+ <!-- 下部分按钮区域-->
|
|
|
+ <!--分销订单-->
|
|
|
+ <DkSaveButton
|
|
|
+ v-if="this.type != this.$config.formMode.approval"
|
|
|
+ ref="saveButton" :disabled="allCanNoEdit"
|
|
|
+ :showQuotation=true :loading="loading"
|
|
|
+ right-button="purchase-order-save"
|
|
|
+ @save="submitForm(true)"
|
|
|
+ @close="closeForm">
|
|
|
+ <!--分销暂存-->
|
|
|
+ <DkButton ref="saveQuotation" type="primary"
|
|
|
+ v-if="!formData.orderStatus || formData.orderStatus === this.$config.orderStatus.staging "
|
|
|
+ @click="submitForm(false)" style="margin-right: 10px;" :loading="loading">{{ $t('staging') }}
|
|
|
+ </DkButton>
|
|
|
+ </DkSaveButton>
|
|
|
+
|
|
|
+ <!--以销定采-->
|
|
|
+ <DkModal
|
|
|
+ :loading="loading"
|
|
|
+ v-model="purchaseBasedOnSalesFlag"
|
|
|
+ :title="$t('purchaseBasedOnSales')"
|
|
|
+ width="1500px"
|
|
|
+ @modalOk="purchaseBasedOnSalesOk"
|
|
|
+ @modalCancel="clearPurchaseBasedOnSales"
|
|
|
+ >
|
|
|
+ <card :padding=0 style="margin-top: 1px;padding: 0">
|
|
|
+ <!-- 查询条件-->
|
|
|
+ <DkForm ref="purchaseBasedOnSalesFormData" v-model="purchaseBasedOnSalesFormData"
|
|
|
+ name="purchase-based-on-sales-form"
|
|
|
+ class="form-content-class" style="margin-top: 5px">
|
|
|
+ <DkButton @click="purchaseBasedOnSales(true)"> {{ $t('search') }}</DkButton>
|
|
|
+ <DkButton style="margin-left: 5px" @click="clearPurchaseBasedOnSales"> {{ $t('clear') }}</DkButton>
|
|
|
+ <!--订单单号-->
|
|
|
+ <DkFormItem prop="orderNo" :label="$t('orderNo')">
|
|
|
+ <InputPop ref="orderNo" v-model="purchaseBasedOnSalesFormData.orderNo"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--商品型号-->
|
|
|
+ <DkFormItem prop="skuModel" :label="$t('skuModel')">
|
|
|
+ <InputPop ref="skuModel" v-model="purchaseBasedOnSalesFormData.skuModel"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--商品编码-->
|
|
|
+ <DkFormItem prop="skuCode" :label="$t('goodCode')">
|
|
|
+ <InputPop ref="skuCode" v-model="purchaseBasedOnSalesFormData.skuCode"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--商品名称-->
|
|
|
+ <DkFormItem prop="skuName" :label="$t('skuName')">
|
|
|
+ <InputPop ref="skuName" v-model="purchaseBasedOnSalesFormData.skuName"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--客户名称-->
|
|
|
+ <DkFormItem prop="customerName" :label="$t('customerName')">
|
|
|
+ <InputPop ref="customerName" v-model="purchaseBasedOnSalesFormData.customerName"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--客户电话-->
|
|
|
+ <DkFormItem prop="customerPhone" :label="$t('customerPhone')">
|
|
|
+ <InputPop ref="customerPhone" v-model="purchaseBasedOnSalesFormData.customerPhone"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--详细地址-->
|
|
|
+ <DkFormItem prop="addressFull" :label="$t('customerAddress')">
|
|
|
+ <InputPop ref="addressFull" v-model="purchaseBasedOnSalesFormData.addressFull"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--部门-->
|
|
|
+ <DkFormItem prop="orgId" :label="$t('orgId')">
|
|
|
+ <SelectMagnifier v-model="purchaseBasedOnSalesFormData.orgId"
|
|
|
+ :display-text="purchaseBasedOnSalesFormData.orgName"
|
|
|
+ :type="this.$config.MagnifierType.organization"
|
|
|
+ :other-condition="{cpId:$store.state.user.cpId}"
|
|
|
+ searchType="S"/>
|
|
|
+ </DkFormItem>
|
|
|
+ <!--送货日期-->
|
|
|
+ <DkFormItem prop="deliveryTime">
|
|
|
+ <DatePickerPop v-model="purchaseBasedOnSalesFormData.deliveryTime"
|
|
|
+ :placeholder="$t('inputWords',{'search-name':$t('estimateDeliveryDate')})"
|
|
|
+ type="date" :short-cut-flag="true"/>
|
|
|
+ </DkFormItem>
|
|
|
+ </DkForm>
|
|
|
+ <DkTable primaryKey="itemId"
|
|
|
+ ref="table-purchase-based-on-sales-select" :id="'table-'+$options.name"
|
|
|
+ name="table"
|
|
|
+ :data="purchaseBasedOnSalesTableData"
|
|
|
+ :height="purchaseBasedOnSalesHeight"
|
|
|
+ :lazy="false"
|
|
|
+ :selectFlag="false"
|
|
|
+ :operateFlag="false"
|
|
|
+ :link-click-checked="true"
|
|
|
+ @pageChange="purchaseBasedOnSalePageSizeChange">
|
|
|
+ <DkTableColumn class-name="fixed-left" type="checkbox" fixed="left" width="45"></DkTableColumn>
|
|
|
+ <DkTableColumn type="seq" align="center" width="60" min-width="44px"></DkTableColumn>
|
|
|
+ <DkTableColumn v-for="(item,index) in purchaseBasedOnSalesColumns" :key="index" :field="item.field"
|
|
|
+ :title="item.title"
|
|
|
+ :width="item.width"
|
|
|
+ :filter="false"
|
|
|
+ :resize-flag="index === purchaseBasedOnSalesColumns.length - 1"></DkTableColumn>
|
|
|
+ </DkTable>
|
|
|
+ </card>
|
|
|
+ </DkModal>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+
|
|
|
+import {formMixin} from '@/mixins/form'
|
|
|
+
|
|
|
export default {
|
|
|
- name: "form"
|
|
|
+ components: {},
|
|
|
+ mixins: [formMixin],
|
|
|
+ data() {
|
|
|
+ let self = this
|
|
|
+ return {
|
|
|
+ //用户敏感信息隐藏
|
|
|
+ visUserSensitive: false,
|
|
|
+ //以销定采
|
|
|
+ purchaseBasedOnSalesFlag: false,
|
|
|
+ purchaseBasedOnSalesTableData: [],
|
|
|
+ purchaseBasedOnSalesHeight: 400,
|
|
|
+ purchaseBasedOnSalesColumns: [
|
|
|
+ {field: 'orderNo', width: '200px', title: self.$t('saleOrderNo'), type: 'text'},
|
|
|
+ {
|
|
|
+ field: 'transferableQuantity',
|
|
|
+ width: '120px',
|
|
|
+ type: 'number',
|
|
|
+ digits: 0,
|
|
|
+ sum: true
|
|
|
+ },//可转采购数量
|
|
|
+ {field: 'skuModel', type: 'text'},//商品型号
|
|
|
+ {field: 'skuName', width: '200px', type: 'text'},//商品名称
|
|
|
+ {field: 'skuCode', width: '100px', type: 'text'},//商品编码
|
|
|
+ {field: 'makingTime', width: '200px', type: 'text'},//订单日期
|
|
|
+ {field: 'entryTime', width: '200px', title: self.$t('expectedDeliverDate'), type: 'text'},//预计送货日期
|
|
|
+ {field: 'outStatusStringDetail', width: '200px', title: self.$t('orderStatus'), type: 'text'},//单据状态
|
|
|
+ {field: 'customerName', width: '200px', type: 'text'},//客户名称
|
|
|
+ {field: 'customerPhone', width: '200px', type: 'text'},//客户电话
|
|
|
+ {field: 'addressFull', width: '200px', type: 'text'},//客户地址
|
|
|
+ {field: 'orgName', width: '200px', title: self.$t('orgId'), type: 'text'},//业务部门
|
|
|
+ {field: 'staffName', width: '200px', title: self.$t('staffId'), type: 'text'},//业务员
|
|
|
+ {field: 'priceSale', width: '120px', title: self.$t('salePrice'), type: 'text'},//销售单价
|
|
|
+ {field: 'itemAmount', width: '120px', title: self.$t('saleAmount'), type: 'text'},//销售金额
|
|
|
+ {field: 'warehouseName', width: '120px', type: 'text'},//仓库
|
|
|
+ {field: 'brandName', width: '120px', type: 'text'},//商品品牌
|
|
|
+ {field: 'nonStandardCode', width: '120px', type: 'text'},//非标号
|
|
|
+ {field: 'skuWeight', width: '120px', type: 'number', digits: 2, sum: true},//重量
|
|
|
+ {field: 'skuVolume', width: '120px', type: 'number', digits: 2, sum: true},//体积
|
|
|
+ {field: 'remarks', width: '120px', type: 'text'},//备注
|
|
|
+ // {field: 'outGoingQuantity', width: '120px', type: 'number', digits: 0, dataType: 'number', sum: true},
|
|
|
+ // {field: 'outQuantity', width: '120px', type: 'number', digits: 0, dataType: 'number', sum: true},
|
|
|
+ // {field: 'rejectQuantity', width: '120px', type: 'number', digits: 0, dataType: 'number', sum: true},
|
|
|
+ // {field: 'skuTypeName', width: '120px', type: 'text'},
|
|
|
+ // {field: 'promotionTypeName', width: '120px', type: 'text'},
|
|
|
+ // {field: 'promotionPriceTypeName', width: '120px', type: 'text'},
|
|
|
+ ],
|
|
|
+ purchaseBasedOnSalePageInfo: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 0
|
|
|
+ },
|
|
|
+ orderId: null,
|
|
|
+ procureList: [],//每次以销定采选择后存放数据
|
|
|
+ //连接业务接口
|
|
|
+ purchaseBasedOnSalesFormData: {
|
|
|
+ orderNo: null,//订单单号
|
|
|
+ deliveryTime: null,//送货日期
|
|
|
+ customerName: null,//客户名称
|
|
|
+ customerPhone: null,//客户电话
|
|
|
+ addressFull: null,//详细地址
|
|
|
+ orgId: null,//业务部门
|
|
|
+ orgName: null,//业务名称
|
|
|
+ skuModel: null,//商品型号
|
|
|
+ skuCode: null,//商品名称
|
|
|
+ skuName: null,//商品编码
|
|
|
+ },
|
|
|
+ //画面模式选项角标
|
|
|
+ bottomList: ['1', '2', '3', '5'],
|
|
|
+ setCustomerFlag: false, // 是否是选择客户设置以及编辑时设置
|
|
|
+ loading: false,
|
|
|
+ //一直可以编辑的列(客户名称(暂时不让改)、客户来源、 客户送货信息:客户地址、联系人、联系电话、小区档案 预计收货日期、备注、附件)
|
|
|
+ alwaysEditColumns: ['remarks', 'designRemarks', 'customerFrom',
|
|
|
+ 'addressName', 'addressNo', 'contractNo', 'entryTime', 'estateId', 'contactName', 'contactPhones'],
|
|
|
+ customerColumns: ['customerName', 'addressNo', 'addressGcj02', 'contactName', 'contactPhones', 'addressName'],
|
|
|
+ allCanEdit: true, //是否可以进行大编辑
|
|
|
+ allCanNoEdit: false, //是否所有的都不允许编辑
|
|
|
+ formData: {
|
|
|
+ ascpId: null,//所属公司Id
|
|
|
+ sale1Id: null,//二级商户
|
|
|
+ sale2Id: null,//一级商户
|
|
|
+ cpId: null,//公司ID
|
|
|
+ cpName: null,//所属公司
|
|
|
+ orderId: 0, //订单Id
|
|
|
+ orderNo: null,
|
|
|
+ supplierId: null,//供应商Id
|
|
|
+ supplierName: null,//供应商名称
|
|
|
+ supplierCode: null,//供应商编码
|
|
|
+ entryTime: null,//预计收货日期
|
|
|
+ entryWhId: null,//默认仓库
|
|
|
+ warehouseName: null,
|
|
|
+ orgId: self.$store.state.user.orgId,
|
|
|
+ staffId: self.$store.state.user.staffId,
|
|
|
+ staffName: null,
|
|
|
+ staffCode: null,
|
|
|
+ erpUserCode: null,
|
|
|
+ orgName: null,
|
|
|
+ orgCode: null,
|
|
|
+ erpOrgCode: null,
|
|
|
+ salesChannel: null,//销售渠道
|
|
|
+ salesChannelName: null,//销售渠道名称
|
|
|
+ salesChannelCode: null,//销售渠道编码
|
|
|
+ remarks: null,
|
|
|
+ sale2OrgId: null,
|
|
|
+ goodsList: [],
|
|
|
+ feeFormData: {},
|
|
|
+ files: [],
|
|
|
+ feeList: [], //费用金额
|
|
|
+ sumFeeAmount: 0,//累计费用金额
|
|
|
+ receiptList: [], //定金金额
|
|
|
+ // 交货方式
|
|
|
+ deliveryType: null,
|
|
|
+ remarksInside: null,
|
|
|
+ defWhId: null,//默认仓库
|
|
|
+ supplierWhName: null,//经销商仓库
|
|
|
+ // 附件
|
|
|
+ annexPaths: [],
|
|
|
+ //地址id
|
|
|
+ addressId: null,
|
|
|
+ //客户信息
|
|
|
+ customerId: null,//客户Id
|
|
|
+ customerName: null,//客户名称
|
|
|
+ customerCode: null,//客户编码
|
|
|
+ customerPhone: null,//客户电话
|
|
|
+ customerFrom: null,//客户来源
|
|
|
+ customerFromName: null,//客户来源
|
|
|
+ contactName: null,//联系人
|
|
|
+ contactPhones: null,//联系电话
|
|
|
+ addressArea: null,//行政区划
|
|
|
+ addressFull: null,//详细地址
|
|
|
+ addressGcj02: null,//地址坐标(gcj02)
|
|
|
+ addressName: null,//小区或POI
|
|
|
+ addressNo: null,//门牌号
|
|
|
+ estateId: null,//小区档案
|
|
|
+ customerDistrict: {},//记录选择的客户区域
|
|
|
+ erpPushStatus: null,//推送结果
|
|
|
+ apvResult: null,//审批结果
|
|
|
+ editTime: null,//编辑的时间戳
|
|
|
+ orderStatus: null,//订单状态
|
|
|
+ docCode: null,//单据类型
|
|
|
+ orderType: null,//订单类型
|
|
|
+ staffList: [],//业务员数组
|
|
|
+ orgList: [],//组织机构数组
|
|
|
+ designStatusFlag: false,//设计状态标识
|
|
|
+ },
|
|
|
+ orderType: null,
|
|
|
+ regionData: [],//客户区域
|
|
|
+ cityData: [],//客户区域
|
|
|
+ // 校验规则
|
|
|
+ ruleInline: {
|
|
|
+ //所属公司
|
|
|
+ cpName: [
|
|
|
+ {required: true, trigger: 'none'}
|
|
|
+ ],
|
|
|
+ //供应商
|
|
|
+ supplierId: [
|
|
|
+ {required: true, trigger: 'none', type: 'number'}
|
|
|
+ ],
|
|
|
+ //收货仓库
|
|
|
+ entryWhId: [
|
|
|
+ {required: true, trigger: 'none', type: 'number'}
|
|
|
+ ],
|
|
|
+ // 收货地址
|
|
|
+ customerDistrict: [
|
|
|
+ {required: true, trigger: 'none', type: 'object'}
|
|
|
+ ],
|
|
|
+ //客户地址
|
|
|
+ addressFull: [
|
|
|
+ {required: true, trigger: 'none'}
|
|
|
+ ],
|
|
|
+ //联系人
|
|
|
+ contactName: [
|
|
|
+ {required: true, trigger: 'none'}
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ //监听上一次所选的用户
|
|
|
+ userFormData: {},
|
|
|
+ tableHeight: 300,
|
|
|
+ // 保存错误消息
|
|
|
+ errMessage: {},
|
|
|
+ goodsColumns: [
|
|
|
+ {
|
|
|
+ field: 'skuModel',
|
|
|
+ controlId: 'skuId',
|
|
|
+ treeNode: true,
|
|
|
+ width: 200,
|
|
|
+ type: 'tableSelect',
|
|
|
+ fixed: 'left',
|
|
|
+ promotionType: true,
|
|
|
+ dataType: self.$config.tableSelectType.goods,
|
|
|
+ tip: self.$t('W_117'),
|
|
|
+ fieldUpdate: [
|
|
|
+ {updateField: 'skuCode', valueFiled: 'skuCode'},
|
|
|
+ {updateField: 'skuModel', valueFiled: 'skuModel'},
|
|
|
+ {updateField: 'itemPrice', valueFiled: 'itemPrice'},
|
|
|
+ {updateField: 'itemQuantity', valueFiled: 'itemQuantity', defaultValue: 1},
|
|
|
+ {updateField: 'skuId', valueFiled: 'skuId'},
|
|
|
+ {updateField: 'skuName', valueFiled: 'skuName'},
|
|
|
+ {updateField: 'spuId', valueFiled: 'spuId'},
|
|
|
+ {updateField: 'spuCode', valueFiled: 'spuCode'},
|
|
|
+ {updateField: 'skuSpecs', valueFiled: 'skuSpecs'},//商品规格
|
|
|
+ {updateField: 'skuUnit', valueFiled: 'skuUnit'},//计量单位
|
|
|
+ {updateField: 'flgEstimate', valueFiled: 'flgEstimate'},//计量标识
|
|
|
+ {updateField: 'salesMode', valueFiled: 'salesMode'},//流通方式
|
|
|
+ {updateField: 'goodsCategoryName', valueFiled: 'goodsCategoryName'},//商品种类
|
|
|
+ {updateField: 'goodsVarietyName', valueFiled: 'goodsCategoryName'},//商品品种
|
|
|
+ {updateField: 'skuSeries', valueFiled: 'skuSeries'},//商品系列
|
|
|
+ {updateField: 'skuBrand', valueFiled: 'skuBrand'},//商品品牌
|
|
|
+ {updateField: 'skuLength', valueFiled: 'skuLength'},
|
|
|
+ {updateField: 'skuWidth', valueFiled: 'skuWidth'},
|
|
|
+ {updateField: 'skuHeight', valueFiled: 'skuHeight'},
|
|
|
+ {updateField: 'skuVolume', valueFiled: 'skuVolume'},
|
|
|
+ {updateField: 'skuWeight', valueFiled: 'skuWeight'},
|
|
|
+ {updateField: 'skuArea', valueFiled: 'skuArea'},
|
|
|
+ {updateField: 'skuType', valueFiled: 'skuType'},
|
|
|
+ {updateField: 'standardId', valueFiled: 'standardId'},
|
|
|
+ {updateField: 'standardItemId', valueFiled: 'standardItemId'},
|
|
|
+ {updateField: 'priceStandard', valueFiled: 'priceStandard'},
|
|
|
+ {updateField: 'promotionId', valueFiled: 'promotionId'},
|
|
|
+ {updateField: 'promotionItemId', valueFiled: 'promotionItemId'},
|
|
|
+ {updateField: 'pricePromotion', valueFiled: 'pricePromotion'},
|
|
|
+ {updateField: 'priceSale', valueFiled: 'priceSale'},
|
|
|
+ {updateField: 'promotionTypeName', valueFiled: 'promotionTypeName'},
|
|
|
+ {updateField: 'promotionPriceType', valueFiled: 'promotionPriceType'},
|
|
|
+ {updateField: 'promotionPriceTypeName', valueFiled: 'promotionPriceTypeName'},
|
|
|
+ {updateField: 'promotionType', valueFiled: 'promotionType'},
|
|
|
+ {updateField: 'promotionName', valueFiled: 'promotionName'},
|
|
|
+ {updateField: 'activityId', valueFiled: 'activityId'},
|
|
|
+ {updateField: 'activityName', valueFiled: 'activityName'},
|
|
|
+ {updateField: 'combinedTypeId', valueFiled: 'combinedTypeId'},
|
|
|
+ {updateField: 'combinedSpecsId', valueFiled: 'combinedSpecsId'},
|
|
|
+ {updateField: 'orderItemQuantity', valueFiled: 'orderItemQuantity'},
|
|
|
+ {updateField: 'discountStandard', valueFiled: 'discountStandard'},
|
|
|
+ {updateField: 'discountPromotion', valueFiled: 'discountPromotion'},
|
|
|
+ {updateField: 'flgGift', valueFiled: 'flgGift'},
|
|
|
+ {updateField: 'nonGlassPriceItems', valueFiled: 'nonGlassPriceItems'},
|
|
|
+ {updateField: 'nonGlassSpuItems', valueFiled: 'nonGlassSpuItems'},
|
|
|
+ {updateField: 'nonGlassListShow', valueFiled: 'nonGlassListShow'},
|
|
|
+ {updateField: 'flgNonStandardType', valueFiled: 'flgNonStandardType'},
|
|
|
+ {updateField: 'specialType', valueFiled: 'specialType'},
|
|
|
+ {updateField: 'cpFlgGift', valueFiled: 'cpFlgGift'},
|
|
|
+ {updateField: 'flgAllowSpecsUndefine', valueFiled: 'flgAllowSpecsUndefine'},
|
|
|
+ {updateField: 'flgSpecsUndefine', valueFiled: 'flgSpecsUndefine'},
|
|
|
+ {updateField: 'specialFormula', valueFiled: 'specialFormula'},
|
|
|
+ {updateField: 'entryWhId', valueFiled: 'entryWhId'},
|
|
|
+ {updateField: 'nonStandardCode', valueFiled: 'nonStandardCode'},
|
|
|
+ {updateField: 'warehouseName', valueFiled: 'warehouseName'},
|
|
|
+ {updateField: 'bomParentId', valueFiled: 'bomParentId'},
|
|
|
+ ],
|
|
|
+ searchDetailFlag: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'skuName',
|
|
|
+ controlId: 'skuId',
|
|
|
+ type: 'tableSelect',
|
|
|
+ width: 300,
|
|
|
+ fixed: 'left',
|
|
|
+ promotionType: true,
|
|
|
+ dataType: self.$config.tableSelectType.goods,
|
|
|
+ fieldUpdate: [
|
|
|
+ {updateField: 'skuCode', valueFiled: 'skuCode'},
|
|
|
+ {updateField: 'skuModel', valueFiled: 'skuModel'},
|
|
|
+ {updateField: 'itemPrice', valueFiled: 'itemPrice'},
|
|
|
+ {updateField: 'itemQuantity', valueFiled: 'itemQuantity', defaultValue: 1},
|
|
|
+ {updateField: 'skuId', valueFiled: 'skuId'},
|
|
|
+ {updateField: 'skuName', valueFiled: 'skuName'},
|
|
|
+ {updateField: 'spuId', valueFiled: 'spuId'},
|
|
|
+ {updateField: 'spuCode', valueFiled: 'spuCode'},
|
|
|
+ {updateField: 'skuSpecs', valueFiled: 'skuSpecs'},//商品规格
|
|
|
+ {updateField: 'skuUnit', valueFiled: 'skuUnit'},//计量单位
|
|
|
+ {updateField: 'flgEstimate', valueFiled: 'flgEstimate'},//计量标识
|
|
|
+ {updateField: 'salesMode', valueFiled: 'salesMode'},//流通方式
|
|
|
+ {updateField: 'goodsCategoryName', valueFiled: 'goodsCategoryName'},//商品种类
|
|
|
+ {updateField: 'goodsVarietyName', valueFiled: 'goodsCategoryName'},//商品品种
|
|
|
+ {updateField: 'skuSeries', valueFiled: 'skuSeries'},//商品系列
|
|
|
+ {updateField: 'skuBrand', valueFiled: 'skuBrand'},//商品品牌
|
|
|
+ {updateField: 'skuLength', valueFiled: 'skuLength'},
|
|
|
+ {updateField: 'skuWidth', valueFiled: 'skuWidth'},
|
|
|
+ {updateField: 'skuHeight', valueFiled: 'skuHeight'},
|
|
|
+ {updateField: 'skuVolume', valueFiled: 'skuVolume'},
|
|
|
+ {updateField: 'skuWeight', valueFiled: 'skuWeight'},
|
|
|
+ {updateField: 'skuArea', valueFiled: 'skuArea'},
|
|
|
+ {updateField: 'skuType', valueFiled: 'skuType'},
|
|
|
+ {updateField: 'standardId', valueFiled: 'standardId'},
|
|
|
+ {updateField: 'standardItemId', valueFiled: 'standardItemId'},
|
|
|
+ {updateField: 'priceStandard', valueFiled: 'priceStandard'},
|
|
|
+ {updateField: 'promotionId', valueFiled: 'promotionId'},
|
|
|
+ {updateField: 'promotionItemId', valueFiled: 'promotionItemId'},
|
|
|
+ {updateField: 'pricePromotion', valueFiled: 'pricePromotion'},
|
|
|
+ {updateField: 'priceSale', valueFiled: 'priceSale'},
|
|
|
+ {updateField: 'promotionTypeName', valueFiled: 'promotionTypeName'},
|
|
|
+ {updateField: 'promotionPriceType', valueFiled: 'promotionPriceType'},
|
|
|
+ {updateField: 'promotionPriceTypeName', valueFiled: 'promotionPriceTypeName'},
|
|
|
+ {updateField: 'promotionType', valueFiled: 'promotionType'},
|
|
|
+ {updateField: 'promotionName', valueFiled: 'promotionName'},
|
|
|
+ {updateField: 'activityId', valueFiled: 'activityId'},
|
|
|
+ {updateField: 'activityName', valueFiled: 'activityName'},
|
|
|
+ {updateField: 'combinedTypeId', valueFiled: 'combinedTypeId'},
|
|
|
+ {updateField: 'combinedSpecsId', valueFiled: 'combinedSpecsId'},
|
|
|
+ {updateField: 'orderItemQuantity', valueFiled: 'orderItemQuantity'},
|
|
|
+ {updateField: 'discountStandard', valueFiled: 'discountStandard'},
|
|
|
+ {updateField: 'discountPromotion', valueFiled: 'discountPromotion'},
|
|
|
+ {updateField: 'flgGift', valueFiled: 'flgGift'},
|
|
|
+ {updateField: 'nonGlassPriceItems', valueFiled: 'nonGlassPriceItems'},
|
|
|
+ {updateField: 'nonGlassSpuItems', valueFiled: 'nonGlassSpuItems'},
|
|
|
+ {updateField: 'nonGlassListShow', valueFiled: 'nonGlassListShow'},
|
|
|
+ {updateField: 'flgNonStandardType', valueFiled: 'flgNonStandardType'},
|
|
|
+ {updateField: 'specialType', valueFiled: 'specialType'},
|
|
|
+ {updateField: 'cpFlgGift', valueFiled: 'cpFlgGift'},
|
|
|
+ {updateField: 'flgAllowSpecsUndefine', valueFiled: 'flgAllowSpecsUndefine'},
|
|
|
+ {updateField: 'flgSpecsUndefine', valueFiled: 'flgSpecsUndefine'},
|
|
|
+ {updateField: 'specialFormula', valueFiled: 'specialFormula'},
|
|
|
+ {updateField: 'entryWhId', valueFiled: 'entryWhId'},
|
|
|
+ {updateField: 'nonStandardCode', valueFiled: 'nonStandardCode'},
|
|
|
+ {updateField: 'warehouseName', valueFiled: 'warehouseName'},
|
|
|
+ {updateField: 'bomParentId', valueFiled: 'bomParentId'},
|
|
|
+ ],
|
|
|
+ searchDetailFlag: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'itemQuantity',
|
|
|
+ type: 'number',
|
|
|
+ shareField: 'orderItemQuantity',
|
|
|
+ digits: 0,
|
|
|
+ sum: true,
|
|
|
+ formula: {
|
|
|
+ itemAmount: ['itemQuantity*priceSale*nonStandardArea', 'itemQuantity', 'priceSale', 'nonStandardArea'],
|
|
|
+ discountStandard: ['priceSale/priceStandard*100', 'priceSale', 'priceStandard'],
|
|
|
+ discountPromotion: ['priceSale/pricePromotion*100', 'priceSale', 'pricePromotion']
|
|
|
+ },
|
|
|
+ },//数量
|
|
|
+ {
|
|
|
+ field: 'priceSale',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ digits: 2,
|
|
|
+ switchField: 'flgGift', // 开关控制的列
|
|
|
+ formula: {
|
|
|
+ itemAmount: ['itemQuantity*priceSale*nonStandardArea', 'itemQuantity', 'priceSale', 'nonStandardArea'],
|
|
|
+ discountStandard: ['priceSale/priceStandard*100', 'priceSale', 'priceStandard'],
|
|
|
+ discountPromotion: ['priceSale/pricePromotion*100', 'priceSale', 'pricePromotion']
|
|
|
+ },
|
|
|
+ shareField: 'percent',
|
|
|
+ percent: ['priceSale/pricePromotion*pricePromotion[child]', 'priceSale', 'pricePromotion[child]', 'pricePromotion']
|
|
|
+ },//价格(子级放在前面,不然replace就不对)
|
|
|
+ {
|
|
|
+ field: 'itemAmount',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ digits: 2,
|
|
|
+ number: true,
|
|
|
+ sum: true,
|
|
|
+ shareField: 'percent',
|
|
|
+ switchField: 'flgGift', // 开关控制的列
|
|
|
+ supply: true, // 补缺,最后一条,用父级-其他子级
|
|
|
+ // amount: ['itemQuantity[child]*priceSale[child]', 'itemQuantity[child]', 'priceSale[child]'],
|
|
|
+ percent: ['itemAmount/pricePromotion*pricePromotion[child]', 'itemAmount', 'pricePromotion[child]', 'pricePromotion'],
|
|
|
+ formulaLate: true, // 只有在changevalue时触发,为了避免价格和数量计算金额,然后再根据金额和数量计算价格
|
|
|
+ formula: {
|
|
|
+ priceSale: ['itemAmount/itemQuantity/nonStandardArea', 'itemAmount', 'itemQuantity', 'nonStandardArea'],
|
|
|
+ discountStandard: ['itemAmount/itemQuantity/priceStandard/nonStandardArea*100', 'itemAmount', 'itemQuantity', 'priceStandard', 'nonStandardArea'],
|
|
|
+ discountPromotion: ['itemAmount/itemQuantity/pricePromotion/nonStandardArea*100', 'itemAmount', 'itemQuantity', 'pricePromotion', 'nonStandardArea']
|
|
|
+ },
|
|
|
+ },//金额
|
|
|
+ {field: 'activityName', type: 'disabled'},//套餐名称
|
|
|
+ {field: 'promotionTypeName', type: 'disabled'},//促销类型
|
|
|
+ {field: 'promotionName', type: 'disabled', title: self.$t('promoName')},//促销名称
|
|
|
+ {
|
|
|
+ field: 'priceStandard',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ showFlag: true,
|
|
|
+ number: true,
|
|
|
+ digits: 2,
|
|
|
+ shareField: 'sumTotal',
|
|
|
+ // 根据子级去计算父级
|
|
|
+ sumTotal: ['orderItemQuantity[child]*priceStandard[child]', 'orderItemQuantity[child]', 'priceStandard[child]']
|
|
|
+ },//商品标价
|
|
|
+ {
|
|
|
+ field: 'pricePromotion',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ showFlag: true,
|
|
|
+ number: true,
|
|
|
+ digits: 2,
|
|
|
+ title: self.$t('standardPriceMoney'),
|
|
|
+ },//商品促销价
|
|
|
+ {
|
|
|
+ field: 'discountStandard',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ showFlag: true,
|
|
|
+ number: true,
|
|
|
+ digits: 2,
|
|
|
+ },//标价折扣
|
|
|
+ {
|
|
|
+ field: 'discountPromotion',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ showFlag: true,
|
|
|
+ number: true,
|
|
|
+ equal: true,
|
|
|
+ digits: 2,
|
|
|
+ },//促销折扣
|
|
|
+ {
|
|
|
+ field: 'entryWhId',
|
|
|
+ type: 'select',
|
|
|
+ title: self.$t('receivingWarehouse'),
|
|
|
+ options: () => self.warehouseList,
|
|
|
+ labelKey: 'whName',
|
|
|
+ valueKey: 'whId',
|
|
|
+ equal: true,
|
|
|
+ },//收货仓库
|
|
|
+ {
|
|
|
+ field: 'nonStandardCode',
|
|
|
+ type: 'disabled',
|
|
|
+ },//非标号
|
|
|
+ {field: 'nonGlassListShow', type: 'nonGlassFlag'},//非标信息
|
|
|
+ {
|
|
|
+ field: 'warehouseName',
|
|
|
+ title: self.$t('supplierWarehouseName'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//经销商仓库
|
|
|
+ {
|
|
|
+ field: 'brandName',
|
|
|
+ title: self.$t('skuBrand'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//商品品牌
|
|
|
+ {
|
|
|
+ field: 'skuWeight',
|
|
|
+ title: self.$t('skuWeight'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//重量
|
|
|
+ {
|
|
|
+ field: 'skuVolume',
|
|
|
+ title: self.$t('skuVolume'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//体积
|
|
|
+ {
|
|
|
+ field: 'flgGift',
|
|
|
+ type: 'switch',
|
|
|
+ width: 100,
|
|
|
+ value: false,
|
|
|
+ controlField: 'cpFlgGift',
|
|
|
+ switchField: 'priceSale' // 开关控制的列
|
|
|
+ },//赠品标识
|
|
|
+ {
|
|
|
+ field: 'remarks', type: 'text', width: 300,
|
|
|
+ equal: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ goodsColumnsEdit: [
|
|
|
+ {
|
|
|
+ field: 'skuModel',
|
|
|
+ controlId: 'skuId',
|
|
|
+ treeNode: true,
|
|
|
+ width: 200,
|
|
|
+ type: 'tableSelect',
|
|
|
+ fixed: 'left',
|
|
|
+ promotionType: true,
|
|
|
+ dataType: self.$config.tableSelectType.goods,
|
|
|
+ tip: self.$t('W_117'),
|
|
|
+ fieldUpdate: [
|
|
|
+ {updateField: 'skuCode', valueFiled: 'skuCode'},
|
|
|
+ {updateField: 'skuModel', valueFiled: 'skuModel'},
|
|
|
+ {updateField: 'itemPrice', valueFiled: 'itemPrice'},
|
|
|
+ {updateField: 'tItemQuantity', valueFiled: 'tItemQuantity', defaultValue: 1},
|
|
|
+ {updateField: 'skuId', valueFiled: 'skuId'},
|
|
|
+ {updateField: 'skuName', valueFiled: 'skuName'},
|
|
|
+ {updateField: 'spuId', valueFiled: 'spuId'},
|
|
|
+ {updateField: 'spuCode', valueFiled: 'spuCode'},
|
|
|
+ {updateField: 'skuSpecs', valueFiled: 'skuSpecs'},//商品规格
|
|
|
+ {updateField: 'skuUnit', valueFiled: 'skuUnit'},//计量单位
|
|
|
+ {updateField: 'flgEstimate', valueFiled: 'flgEstimate'},//计量标识
|
|
|
+ {updateField: 'salesMode', valueFiled: 'salesMode'},//流通方式
|
|
|
+ {updateField: 'goodsCategoryName', valueFiled: 'goodsCategoryName'},//商品种类
|
|
|
+ {updateField: 'goodsVarietyName', valueFiled: 'goodsCategoryName'},//商品品种
|
|
|
+ {updateField: 'skuSeries', valueFiled: 'skuSeries'},//商品系列
|
|
|
+ {updateField: 'skuBrand', valueFiled: 'skuBrand'},//商品品牌
|
|
|
+ {updateField: 'skuLength', valueFiled: 'skuLength'},
|
|
|
+ {updateField: 'skuWidth', valueFiled: 'skuWidth'},
|
|
|
+ {updateField: 'skuHeight', valueFiled: 'skuHeight'},
|
|
|
+ {updateField: 'skuVolume', valueFiled: 'skuVolume'},
|
|
|
+ {updateField: 'skuWeight', valueFiled: 'skuWeight'},
|
|
|
+ {updateField: 'skuArea', valueFiled: 'skuArea'},
|
|
|
+ {updateField: 'skuType', valueFiled: 'skuType'},
|
|
|
+ {updateField: 'standardId', valueFiled: 'standardId'},
|
|
|
+ {updateField: 'standardItemId', valueFiled: 'standardItemId'},
|
|
|
+ {updateField: 'priceStandard', valueFiled: 'priceStandard'},
|
|
|
+ {updateField: 'promotionId', valueFiled: 'promotionId'},
|
|
|
+ {updateField: 'promotionItemId', valueFiled: 'promotionItemId'},
|
|
|
+ {updateField: 'pricePromotion', valueFiled: 'pricePromotion'},
|
|
|
+ {updateField: 'priceSale', valueFiled: 'priceSale'},
|
|
|
+ {updateField: 'promotionTypeName', valueFiled: 'promotionTypeName'},
|
|
|
+ {updateField: 'promotionPriceType', valueFiled: 'promotionPriceType'},
|
|
|
+ {updateField: 'promotionPriceTypeName', valueFiled: 'promotionPriceTypeName'},
|
|
|
+ {updateField: 'promotionType', valueFiled: 'promotionType'},
|
|
|
+ {updateField: 'promotionName', valueFiled: 'promotionName'},
|
|
|
+ {updateField: 'activityId', valueFiled: 'activityId'},
|
|
|
+ {updateField: 'activityName', valueFiled: 'activityName'},
|
|
|
+ {updateField: 'combinedTypeId', valueFiled: 'combinedTypeId'},
|
|
|
+ {updateField: 'combinedSpecsId', valueFiled: 'combinedSpecsId'},
|
|
|
+ {updateField: 'orderItemQuantity', valueFiled: 'orderItemQuantity'},
|
|
|
+ {updateField: 'discountStandard', valueFiled: 'discountStandard'},
|
|
|
+ {updateField: 'discountPromotion', valueFiled: 'discountPromotion'},
|
|
|
+ {updateField: 'flgGift', valueFiled: 'flgGift'},
|
|
|
+ {updateField: 'nonGlassPriceItems', valueFiled: 'nonGlassPriceItems'},
|
|
|
+ {updateField: 'nonGlassSpuItems', valueFiled: 'nonGlassSpuItems'},
|
|
|
+ {updateField: 'nonGlassListShow', valueFiled: 'nonGlassListShow'},
|
|
|
+ {updateField: 'flgNonStandardType', valueFiled: 'flgNonStandardType'},
|
|
|
+ {updateField: 'specialType', valueFiled: 'specialType'},
|
|
|
+ {updateField: 'cpFlgGift', valueFiled: 'cpFlgGift'},
|
|
|
+ {updateField: 'flgAllowSpecsUndefine', valueFiled: 'flgAllowSpecsUndefine'},
|
|
|
+ {updateField: 'flgSpecsUndefine', valueFiled: 'flgSpecsUndefine'},
|
|
|
+ {updateField: 'specialFormula', valueFiled: 'specialFormula'},
|
|
|
+ {updateField: 'entryWhId', valueFiled: 'entryWhId'},
|
|
|
+ {updateField: 'nonStandardCode', valueFiled: 'nonStandardCode'},
|
|
|
+ {updateField: 'warehouseName', valueFiled: 'warehouseName'},
|
|
|
+ {updateField: 'bomParentId', valueFiled: 'bomParentId'},
|
|
|
+ ],
|
|
|
+ searchDetailFlag: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'skuName',
|
|
|
+ controlId: 'skuId',
|
|
|
+ type: 'tableSelect',
|
|
|
+ width: 300,
|
|
|
+ fixed: 'left',
|
|
|
+ promotionType: true,
|
|
|
+ dataType: self.$config.tableSelectType.goods,
|
|
|
+ fieldUpdate: [
|
|
|
+ {updateField: 'skuCode', valueFiled: 'skuCode'},
|
|
|
+ {updateField: 'skuModel', valueFiled: 'skuModel'},
|
|
|
+ {updateField: 'itemPrice', valueFiled: 'itemPrice'},
|
|
|
+ {updateField: 'tItemQuantity', valueFiled: 'tItemQuantity', defaultValue: 1},
|
|
|
+ {updateField: 'skuId', valueFiled: 'skuId'},
|
|
|
+ {updateField: 'skuName', valueFiled: 'skuName'},
|
|
|
+ {updateField: 'spuId', valueFiled: 'spuId'},
|
|
|
+ {updateField: 'spuCode', valueFiled: 'spuCode'},
|
|
|
+ {updateField: 'skuSpecs', valueFiled: 'skuSpecs'},//商品规格
|
|
|
+ {updateField: 'skuUnit', valueFiled: 'skuUnit'},//计量单位
|
|
|
+ {updateField: 'flgEstimate', valueFiled: 'flgEstimate'},//计量标识
|
|
|
+ {updateField: 'salesMode', valueFiled: 'salesMode'},//流通方式
|
|
|
+ {updateField: 'goodsCategoryName', valueFiled: 'goodsCategoryName'},//商品种类
|
|
|
+ {updateField: 'goodsVarietyName', valueFiled: 'goodsCategoryName'},//商品品种
|
|
|
+ {updateField: 'skuSeries', valueFiled: 'skuSeries'},//商品系列
|
|
|
+ {updateField: 'skuBrand', valueFiled: 'skuBrand'},//商品品牌
|
|
|
+ {updateField: 'skuLength', valueFiled: 'skuLength'},
|
|
|
+ {updateField: 'skuWidth', valueFiled: 'skuWidth'},
|
|
|
+ {updateField: 'skuHeight', valueFiled: 'skuHeight'},
|
|
|
+ {updateField: 'skuVolume', valueFiled: 'skuVolume'},
|
|
|
+ {updateField: 'skuWeight', valueFiled: 'skuWeight'},
|
|
|
+ {updateField: 'skuArea', valueFiled: 'skuArea'},
|
|
|
+ {updateField: 'skuType', valueFiled: 'skuType'},
|
|
|
+ {updateField: 'standardId', valueFiled: 'standardId'},
|
|
|
+ {updateField: 'standardItemId', valueFiled: 'standardItemId'},
|
|
|
+ {updateField: 'priceStandard', valueFiled: 'priceStandard'},
|
|
|
+ {updateField: 'promotionId', valueFiled: 'promotionId'},
|
|
|
+ {updateField: 'promotionItemId', valueFiled: 'promotionItemId'},
|
|
|
+ {updateField: 'pricePromotion', valueFiled: 'pricePromotion'},
|
|
|
+ {updateField: 'priceSale', valueFiled: 'priceSale'},
|
|
|
+ {updateField: 'promotionTypeName', valueFiled: 'promotionTypeName'},
|
|
|
+ {updateField: 'promotionPriceType', valueFiled: 'promotionPriceType'},
|
|
|
+ {updateField: 'promotionPriceTypeName', valueFiled: 'promotionPriceTypeName'},
|
|
|
+ {updateField: 'promotionType', valueFiled: 'promotionType'},
|
|
|
+ {updateField: 'promotionName', valueFiled: 'promotionName'},
|
|
|
+ {updateField: 'activityId', valueFiled: 'activityId'},
|
|
|
+ {updateField: 'activityName', valueFiled: 'activityName'},
|
|
|
+ {updateField: 'combinedTypeId', valueFiled: 'combinedTypeId'},
|
|
|
+ {updateField: 'combinedSpecsId', valueFiled: 'combinedSpecsId'},
|
|
|
+ {updateField: 'orderItemQuantity', valueFiled: 'orderItemQuantity'},
|
|
|
+ {updateField: 'discountStandard', valueFiled: 'discountStandard'},
|
|
|
+ {updateField: 'discountPromotion', valueFiled: 'discountPromotion'},
|
|
|
+ {updateField: 'flgGift', valueFiled: 'flgGift'},
|
|
|
+ {updateField: 'nonGlassPriceItems', valueFiled: 'nonGlassPriceItems'},
|
|
|
+ {updateField: 'nonGlassSpuItems', valueFiled: 'nonGlassSpuItems'},
|
|
|
+ {updateField: 'nonGlassListShow', valueFiled: 'nonGlassListShow'},
|
|
|
+ {updateField: 'flgNonStandardType', valueFiled: 'flgNonStandardType'},
|
|
|
+ {updateField: 'specialType', valueFiled: 'specialType'},
|
|
|
+ {updateField: 'cpFlgGift', valueFiled: 'cpFlgGift'},
|
|
|
+ {updateField: 'flgAllowSpecsUndefine', valueFiled: 'flgAllowSpecsUndefine'},
|
|
|
+ {updateField: 'flgSpecsUndefine', valueFiled: 'flgSpecsUndefine'},
|
|
|
+ {updateField: 'specialFormula', valueFiled: 'specialFormula'},
|
|
|
+ {updateField: 'entryWhId', valueFiled: 'entryWhId'},
|
|
|
+ {updateField: 'nonStandardCode', valueFiled: 'nonStandardCode'},
|
|
|
+ {updateField: 'warehouseName', valueFiled: 'warehouseName'},
|
|
|
+ {updateField: 'bomParentId', valueFiled: 'bomParentId'},
|
|
|
+ ],
|
|
|
+ searchDetailFlag: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'tItemQuantity',
|
|
|
+ type: 'number',
|
|
|
+ shareField: 'orderItemQuantity',
|
|
|
+ title: self.$t('itemQuantity'),
|
|
|
+ sum: true,
|
|
|
+ formula: {
|
|
|
+ tItemAmount: ['tItemQuantity*priceSale*nonStandardArea', 'tItemQuantity', 'priceSale', 'nonStandardArea'],
|
|
|
+ discountStandard: ['priceSale/priceStandard*100', 'priceSale', 'priceStandard'],
|
|
|
+ discountPromotion: ['priceSale/pricePromotion*100', 'priceSale', 'pricePromotion']
|
|
|
+ },
|
|
|
+ },//数量
|
|
|
+ {
|
|
|
+ field: 'priceSale',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ digits: 2,
|
|
|
+ switchField: 'flgGift', // 开关控制的列
|
|
|
+ formula: {
|
|
|
+ tItemAmount: ['tItemQuantity*priceSale*nonStandardArea', 'tItemQuantity', 'priceSale', 'nonStandardArea'],
|
|
|
+ discountStandard: ['priceSale/priceStandard*100', 'priceSale', 'priceStandard'],
|
|
|
+ discountPromotion: ['priceSale/pricePromotion*100', 'priceSale', 'pricePromotion']
|
|
|
+ },
|
|
|
+ shareField: 'percent',
|
|
|
+ percent: ['priceSale/pricePromotion*pricePromotion[child]', 'priceSale', 'pricePromotion[child]', 'pricePromotion']
|
|
|
+ },//价格(子级放在前面,不然replace就不对)
|
|
|
+ {
|
|
|
+ field: 'tItemAmount',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ title: self.$t('itemAmount'),
|
|
|
+ digits: 2,
|
|
|
+ number: true,
|
|
|
+ sum: true,
|
|
|
+ shareField: 'percent',
|
|
|
+ switchField: 'flgGift', // 开关控制的列
|
|
|
+ supply: true, // 补缺,最后一条,用父级-其他子级
|
|
|
+ percent: ['tItemAmount/pricePromotion*pricePromotion[child]', 'tItemAmount', 'pricePromotion[child]', 'pricePromotion'],
|
|
|
+ formulaLate: true, // 只有在changevalue时触发,为了避免价格和数量计算金额,然后再根据金额和数量计算价格
|
|
|
+ formula: {
|
|
|
+ priceSale: ['tItemAmount/tItemQuantity/nonStandardArea', 'tItemAmount', 'tItemQuantity', 'nonStandardArea'],
|
|
|
+ discountStandard: ['tItemAmount/tItemQuantity/priceStandard/nonStandardArea*100', 'tItemAmount', 'tItemQuantity', 'priceStandard', 'nonStandardArea'],
|
|
|
+ discountPromotion: ['tItemAmount/tItemQuantity/pricePromotion/nonStandardArea*100', 'tItemAmount', 'tItemQuantity', 'pricePromotion', 'nonStandardArea']
|
|
|
+ },
|
|
|
+ },//金额
|
|
|
+ {field: 'activityName', type: 'disabled'},//套餐名称
|
|
|
+ {field: 'promotionTypeName', type: 'disabled'},//促销类型
|
|
|
+ {field: 'promotionName', type: 'disabled', title: self.$t('promoName')},//促销名称
|
|
|
+ {
|
|
|
+ field: 'priceStandard',
|
|
|
+ showFlag: true,
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ number: true,
|
|
|
+ digits: 2,
|
|
|
+ shareField: 'sumTotal',
|
|
|
+ // 根据子级去计算父级
|
|
|
+ sumTotal: ['orderItemQuantity[child]*priceStandard[child]', 'orderItemQuantity[child]', 'priceStandard[child]']
|
|
|
+ },//商品标价
|
|
|
+ {
|
|
|
+ field: 'pricePromotion',
|
|
|
+ showFlag: true,
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ number: true,
|
|
|
+ digits: 2,
|
|
|
+ title: self.$t('standardPriceMoney'),
|
|
|
+ },//商品促销价
|
|
|
+ {
|
|
|
+ field: 'discountStandard',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ number: true,
|
|
|
+ digits: 2,
|
|
|
+ showFlag: true,
|
|
|
+ },//标价折扣
|
|
|
+ {
|
|
|
+ field: 'discountPromotion',
|
|
|
+ type: 'disabled',
|
|
|
+ flgUserSensitive: true,
|
|
|
+ number: true,
|
|
|
+ equal: true,
|
|
|
+ digits: 2,
|
|
|
+ showFlag: true,
|
|
|
+ },//促销折扣
|
|
|
+ {
|
|
|
+ field: 'entryWhId',
|
|
|
+ type: 'select',
|
|
|
+ title: self.$t('receivingWarehouse'),
|
|
|
+ options: () => self.warehouseList,
|
|
|
+ labelKey: 'whName',
|
|
|
+ valueKey: 'whId',
|
|
|
+ equal: true,
|
|
|
+ },//收货仓库
|
|
|
+ {
|
|
|
+ field: 'nonStandardCode',
|
|
|
+ type: 'disabled',
|
|
|
+ },//非标号
|
|
|
+ {field: 'nonGlassListShow', type: 'nonGlassFlag'},//非标信息
|
|
|
+ {
|
|
|
+ field: 'warehouseName',
|
|
|
+ title: self.$t('supplierWarehouseName'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//经销商仓库
|
|
|
+ {
|
|
|
+ field: 'brandName',
|
|
|
+ title: self.$t('skuBrand'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//商品品牌
|
|
|
+ {
|
|
|
+ field: 'skuWeight',
|
|
|
+ title: self.$t('skuWeight'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//重量
|
|
|
+ {
|
|
|
+ field: 'skuVolume',
|
|
|
+ title: self.$t('skuVolume'),
|
|
|
+ type: 'disabled',
|
|
|
+ },//体积
|
|
|
+ {
|
|
|
+ field: 'flgGift',
|
|
|
+ type: 'switch',
|
|
|
+ width: 100,
|
|
|
+ value: false,
|
|
|
+ controlField: 'cpFlgGift',
|
|
|
+ switchField: 'priceSale' // 开关控制的列
|
|
|
+ },//赠品标识
|
|
|
+ {
|
|
|
+ field: 'remarks', type: 'text', width: 300,
|
|
|
+ equal: true,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ //商品合计信息
|
|
|
+ goodsFootFormData: {
|
|
|
+ sumGoodsAmount: 0,
|
|
|
+ sumStandard: 0,
|
|
|
+ sumPromotion: 0,
|
|
|
+ discountPromotion: 0,
|
|
|
+ discountStandard: 0,
|
|
|
+ sumVolume: 0,
|
|
|
+ sumWeight: 0,
|
|
|
+ sumQuantity: 0,//总数量
|
|
|
+ },
|
|
|
+ receiptList: [],//收款集合
|
|
|
+ //客户收款
|
|
|
+ feeFormData: {
|
|
|
+ sumAmount: 0, //合计金额
|
|
|
+ sumFeeAmount: 0,//费用金额
|
|
|
+ sumReceiptAmount: 0,//定金金额
|
|
|
+ sumUsePrestore: 0,//使用预存
|
|
|
+ usablePrestore: 0,//可用预存
|
|
|
+ sumReceivableAmount: 0,// 定金+使用预存
|
|
|
+ receivable: 0, //剩余应收
|
|
|
+ sumReceiptList: [],//收款
|
|
|
+ },
|
|
|
+ warehouseList: [],//仓库
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ /**
|
|
|
+ * @desc : 分页
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:44
|
|
|
+ */
|
|
|
+ purchaseBasedOnSalePageSizeChange(pageInfo) {
|
|
|
+ this.purchaseBasedOnSalePageInfo = pageInfo
|
|
|
+ this.purchaseBasedOnSales(false)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 以销定采弹窗打开并查询数据
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ purchaseBasedOnSales(modalOpenFlag) {
|
|
|
+ this.purchaseBasedOnSalesFlag = true
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 合并以销定采数量
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ mergeProcureQuantity(list) {
|
|
|
+ //不重复Id集合
|
|
|
+ let ids = []
|
|
|
+ //不重复数据集合
|
|
|
+ let arr = []
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ if (ids.indexOf(list[i].skuId) == -1) {
|
|
|
+ ids.push(list[i].skuId)
|
|
|
+ arr.push(JSON.parse(JSON.stringify(list[i])))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //把重复的数据中的可转采购数量相加
|
|
|
+ for (let index in arr) {
|
|
|
+ let orderS2tobuyVOList = []
|
|
|
+ arr[index].transferableQuantity = list.filter(it => it.skuId == arr[index].skuId).sum('transferableQuantity')
|
|
|
+ arr[index].itemQuantity = arr[index].transferableQuantity
|
|
|
+ arr[index].transferableFlag = true
|
|
|
+ for (let item = 0; item < list.length; item++) {
|
|
|
+ if (list[item].skuId == arr[index].skuId) {
|
|
|
+ let json = {}
|
|
|
+ json.s2orderId = list[item].orderId
|
|
|
+ json.s2orderItemId = list[item].itemId
|
|
|
+ json.buyQuantity = list[item].transferableQuantity
|
|
|
+ orderS2tobuyVOList.push(json)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ arr[index].orderS2tobuyVOList = orderS2tobuyVOList
|
|
|
+ }
|
|
|
+ return arr
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 以销定采选择商品确认带回方法
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ purchaseBasedOnSalesOk() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 关闭弹窗
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ clearPurchaseBasedOnSales() {
|
|
|
+ this.$refs.purchaseBasedOnSalesFormData.$refs['purchase-based-on-sales-form'].resetFields();
|
|
|
+ this.orderId = null
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 所属公司选择后事件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ ascpIdOk(val) {
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 供应商选择后事件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ supplierOk(val) {
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 选择默认仓库
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ warehouseOk(val) {
|
|
|
+ if (val && val.length > 0) {
|
|
|
+ let row = val[0]
|
|
|
+ this.formData.entryWhId = row.whId
|
|
|
+ this.formData.warehouseName = row.whName
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 选择地址
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ addressOk(val) {
|
|
|
+ if (val && val[0]) {
|
|
|
+ if (val[0].addressArea && val[0].addressArea.value) {
|
|
|
+ val[0].addressArea = JSON.parse(val[0].addressArea.value)
|
|
|
+ }
|
|
|
+ if (val[0].addressGcj02 && val[0].addressGcj02.value) {
|
|
|
+ val[0].addressGcj02 = JSON.parse(val[0].addressGcj02.value)
|
|
|
+ }
|
|
|
+ this.formData.contactName = val[0].contactName//联系人
|
|
|
+ this.formData.contactPhones = val[0].contactPhone//联系电话
|
|
|
+ this.formData.addressArea = val[0].addressArea//行政区划
|
|
|
+ this.formData.addressFull = val[0].addressFull//详细地址
|
|
|
+ this.formData.addressGcj02 = val[0].addressGcj02//地址坐标(gcj02)
|
|
|
+ this.formData.addressName = val[0].addressName//小区或POI
|
|
|
+ this.formData.addressNo = val[0].addressNo//门牌号
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 选择地址
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:45
|
|
|
+ */
|
|
|
+ chooseAddress(value) {
|
|
|
+ this.formData.customerDistrict = value;
|
|
|
+ // 说明是清空
|
|
|
+ if (!value) {
|
|
|
+ this.formData.addressName = null;
|
|
|
+ this.formData.addressFull = null;
|
|
|
+ this.formData.addressGcj02 = {};
|
|
|
+ this.formData.addressArea = {};
|
|
|
+ } else {
|
|
|
+ //按照title进行
|
|
|
+ this.formData.addressName = value.addressName;
|
|
|
+ this.formData.addressGcj02 = value.addressGcj02;
|
|
|
+ this.formData.addressArea = value.addressArea;
|
|
|
+ this.formData.addressFull = value.addressFull + (this.formData.addressNo ? this.formData.addressNo : '');
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 拼写详细地址
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ setAddressFull(e) {
|
|
|
+ // 客户区域有值才会拼接详细地址
|
|
|
+ if (!this.setCustomerFlag && this.formData.customerDistrict && this.formData.customerDistrict.addressFull) {
|
|
|
+ this.formData.addressFull = this.formData.customerDistrict.addressFull + (this.formData.addressNo ? this.formData.addressNo : '')
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 上传文件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ uploadFile(response, file, fileList) {
|
|
|
+ if (response.code == 200) {
|
|
|
+ this.formData.files.push(response.data)
|
|
|
+ } else {
|
|
|
+ this.$Message.error(response.message)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 移除文件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ fileRemove(file, fileList) {
|
|
|
+ this.formData.files = fileList.map(m => m.response.data)
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 表单值改变事件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ changeValue(field, row, rowIndex) {
|
|
|
+ if (field == "entryWhId") {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.formData.goodsList[rowIndex].entryWhId = row.whId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 计算合计值
|
|
|
+ this.getTotals(field, row, rowIndex, false);
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 获取商品表格中数量、金额后计算总单信息
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ getTotals(field, row, rowIndex, purchaseFlag) {
|
|
|
+ // console.log("this.$refs['goodsTable'].getTableDataFilter()",this.$refs['goodsTable'].getTableDataFilter())
|
|
|
+ let table = this.$refs['goodsTable'].getTableDataFilter().filter(it => it.flgNonStandardType != 1 && it.flgNonStandardType != 2 && (it.priceStandard && it.priceStandard != 0) && it.priceSale > 0 && it.itemAmount > 0);
|
|
|
+ let itemAmount = 0; // 货物总额
|
|
|
+ let weight = 0;// 总重量
|
|
|
+ let volumn = 0;// 总体积
|
|
|
+ let sumStandard = 0;// 标价总额
|
|
|
+ let sumPromotion = 0; // 标准价总额
|
|
|
+ let quantityName = this.type == this.$config.formMode.edit ? 'tItemQuantity' : 'itemQuantity'
|
|
|
+ let amountName = this.type == this.$config.formMode.edit ? 'tItemAmount' : 'itemAmount'
|
|
|
+ if (table && table.length > 0) {
|
|
|
+ table.forEach(row => {
|
|
|
+ if (row[amountName]) {
|
|
|
+ // 金额
|
|
|
+ itemAmount += parseFloat(row[amountName]);
|
|
|
+ }
|
|
|
+ // 重量
|
|
|
+ if (row.skuWeight && row[quantityName]) {
|
|
|
+ weight += parseFloat(row[quantityName]) * parseFloat(row.skuWeight);
|
|
|
+ }
|
|
|
+ // 体积
|
|
|
+ if (row.skuVolume && row[quantityName]) {
|
|
|
+ volumn += parseFloat(row[quantityName]) * parseFloat(row.skuVolume);
|
|
|
+ }
|
|
|
+ // 标价
|
|
|
+ if (row.priceStandard && row[quantityName]) {
|
|
|
+ if (row.nonStandardArea) {
|
|
|
+ sumStandard += parseFloat(row[quantityName]) * parseFloat(row.priceStandard) * parseFloat(row.nonStandardArea);
|
|
|
+ } else {
|
|
|
+ sumStandard += parseFloat(row[quantityName]) * parseFloat(row.priceStandard);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 标准价
|
|
|
+ if ((row.pricePromotion || parseFloat(row['priceStandard'])) && row[quantityName]) {
|
|
|
+ if (row.nonStandardArea) {
|
|
|
+ sumPromotion += parseFloat(row[quantityName]) * (parseFloat(row['pricePromotion']) ? parseFloat(row['pricePromotion']) : parseFloat(row['priceStandard'])) * parseFloat(row.nonStandardArea);
|
|
|
+ } else {
|
|
|
+ sumPromotion += parseFloat(row[quantityName]) * (parseFloat(row['pricePromotion']) ? parseFloat(row['pricePromotion']) : parseFloat(row['priceStandard']));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如果是组合,需要计算体积和重量
|
|
|
+ if (row['promotionType'] === this.$config.promotionType.combined) {
|
|
|
+ if (row.bomItems && row.bomItems.length > 0) {
|
|
|
+ row.bomItems.forEach(it => {
|
|
|
+ if (it.skuWeight) {
|
|
|
+ weight += parseFloat(it[quantityName]) * parseFloat(it.skuWeight);
|
|
|
+ }
|
|
|
+ // 体积
|
|
|
+ if (it.skuVolume) {
|
|
|
+ volumn += parseFloat(it[quantityName]) * parseFloat(it.skuVolume);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.goodsFootFormData.sumStandard = sumStandard;
|
|
|
+ this.goodsFootFormData.sumPromotion = sumPromotion;
|
|
|
+ // 标价折扣
|
|
|
+ this.goodsFootFormData.discountStandard = sumStandard === 0 ? 0 : parseFloat((itemAmount * 100 / sumStandard).toFixed(2));
|
|
|
+ // 标准价折扣
|
|
|
+ this.goodsFootFormData.discountPromotion = sumPromotion === 0 ? 0 : parseFloat((itemAmount * 100 / sumPromotion).toFixed(2));
|
|
|
+ //非标,售价为0的数据
|
|
|
+ let otherTable = this.$refs['goodsTable'].getTableDataFilter().filter(it => it.flgNonStandardType == 1 || it.flgNonStandardType == 2 || (!it.priceStandard || it.priceStandard == 0));
|
|
|
+ ;
|
|
|
+ for (let item of otherTable) {
|
|
|
+ if (item[amountName]) {
|
|
|
+ // 金额
|
|
|
+ itemAmount += parseFloat(item[amountName]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.goodsFootFormData.sumGoodsAmount = itemAmount;
|
|
|
+ // 计算合计金额
|
|
|
+ this.getSumAmount();
|
|
|
+ this.goodsFootFormData.sumWeight = parseFloat(weight.toFixed(6));
|
|
|
+ this.goodsFootFormData.sumVolume = parseFloat(volumn.toFixed(6));
|
|
|
+ //设计字段赋值
|
|
|
+ if (field && field.flgNonStandard) {
|
|
|
+ this.formData.designStatus = this.$config.orderAllocation.designStatusYes
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 编辑时查询非标参数
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ setNonGlassForm(row) {
|
|
|
+ if (row.nonGlassSpuItems && row.nonGlassSpuItems.length > 0) {
|
|
|
+ row.nonGlassSpuItems.forEach(it => {
|
|
|
+ if (!row.nonGlassForm) {
|
|
|
+ row.nonGlassForm = {}
|
|
|
+ }
|
|
|
+ row.nonGlassForm[it.fieldCode] = null;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (row.nonGlassList && row.nonGlassList.length > 0) {
|
|
|
+ let noInputs = []
|
|
|
+ row.nonGlassList.forEach(fRow => {
|
|
|
+ row.nonGlassForm[fRow.fieldCode] = fRow.optionCode;
|
|
|
+ // 做成不包括文本输入的字符串
|
|
|
+ if (fRow.isScope == 0) {
|
|
|
+ noInputs.push(fRow.fieldName + ":" + fRow.optionName)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ row.nonGlassListShow_no_input = noInputs.join(',')
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 计算合计金额
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ getSumAmount() {
|
|
|
+ // 合计金额=费用金额+货物金额
|
|
|
+ this.feeFormData.sumAmount = this.feeFormData.sumFeeAmount + this.goodsFootFormData.sumGoodsAmount;
|
|
|
+ // 剩余应收=合计金额-收款金额
|
|
|
+ this.feeFormData.receivable = this.feeFormData.sumAmount - this.feeFormData.sumReceivableAmount;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 校验数据
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ validData(flag) {
|
|
|
+ return new Promise(resolve => {
|
|
|
+ // 判断客户的省市区不存在,那么就要重新选addressGcj02
|
|
|
+ if (!this.formData.addressArea || typeof this.formData.addressArea == null
|
|
|
+ || this.formData.addressArea.province == null) {
|
|
|
+ this.$message.error(this.$t('W_061', {'param': this.$t('addressArea')}))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 判断经纬度是否存在
|
|
|
+ if (!this.formData.addressGcj02) {
|
|
|
+ this.$message.error(this.$t('W_061', {'param': this.$t('addressGcj02')}))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 明细必须有数据
|
|
|
+ let table = this.$refs['goodsTable'].tableData.filter(it => it.skuId || (it.bomItems && it.bomItems.length > 0))
|
|
|
+ // console.log("this.getTableChangeData();", this.getTableChangeData())
|
|
|
+ // console.log("this.formData.goodsList", this.formData.goodsList)
|
|
|
+ // let table = this.formData.goodsList
|
|
|
+ if (this.type === this.$config.formMode.add) {
|
|
|
+ if (!table || table.length === 0) {
|
|
|
+ this.$message.error(this.$t('W_012'))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //校验以销定采选择数据
|
|
|
+ for (let index = 0; index < table.length; index++) {
|
|
|
+ //以销定采数据 实际数量大于以可转采购数量
|
|
|
+ let quantityName = this.type == this.$config.formMode.add ? 'itemQuantity' : 'tItemQuantity'
|
|
|
+ if (table[index].transferableFlag && table[index][quantityName] > table[index].transferableQuantity) {
|
|
|
+ this.$message.error(this.$t('W_119', {'param1': (index + 1), 'param2': this.$t('transferableQuantity')}))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //商品标价不可为0、仓库不可为空
|
|
|
+ for (let i = 0; i < table.length; i++) {
|
|
|
+ if (!table[i]['priceStandard'] || table[i]['priceStandard'] == 0) {
|
|
|
+ this.$message.error(this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('W_132'))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!table[i]['entryWhId']) {
|
|
|
+ this.$message.error(this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('W_128'))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!table[i]['warehouseName']) {
|
|
|
+ this.$message.error(this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('W_129'))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 报价单不进行控制
|
|
|
+ if (flag) {
|
|
|
+ // 新建和大编辑才能校验明细
|
|
|
+ if (this.type == this.$config.formMode.add || this.type == this.$config.formMode.edit
|
|
|
+ && this.allCanEdit) {
|
|
|
+ table = this.$refs['goodsTable'].getTableData();
|
|
|
+ // 校验明细中是否有数量没有填写的
|
|
|
+ for (let i = 0; i < table.length; i++) {
|
|
|
+ if (!table[i]['skuId'] && !table[i]['promotionId']) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (this.type == this.$config.formMode.add) {
|
|
|
+ if (!table[i]['itemQuantity'] || table[i]['itemQuantity'] === 0) {
|
|
|
+ this.$message.error(this.$t('W_041', {'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('itemQuantity')}))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (!table[i]['tItemQuantity'] || table[i]['tItemQuantity'] === 0) {
|
|
|
+ this.$message.error(this.$t('W_041', {'param': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('itemQuantity')}))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //校验标价折扣是否超过范围
|
|
|
+ if (table[i]['discountStandard'] && parseFloat(table[i]['discountStandard']) > this.$config.maxDiscount) {
|
|
|
+ this.$message.error(this.$t('W_051', {
|
|
|
+ 'param1': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('discountStandard'),
|
|
|
+ 'param2': this.$config.maxDiscount
|
|
|
+ }))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ //校验标准价折扣是否超过范围
|
|
|
+ if (table[i]['discountPromotion'] && parseFloat(table[i]['discountPromotion']) > this.$config.maxDiscount) {
|
|
|
+ this.$message.error(this.$t('W_051', {
|
|
|
+ 'param1': this.$t('sequence') + (i + 1) + this.$t('rowNo') + this.$t('discountPromotion'),
|
|
|
+ 'param2': this.$config.maxDiscount
|
|
|
+ }))
|
|
|
+ resolve(false);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve(true);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 关闭窗体
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:46
|
|
|
+ */
|
|
|
+ closeForm() {
|
|
|
+ this.formData = {}
|
|
|
+ this.closeTag(this.$route)
|
|
|
+ this.$router.push('/sale/purchase-order/index')
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 提交事件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ submitForm(flag) {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 新建成功后清理数据
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ clearForm() {
|
|
|
+ // 清空数据源
|
|
|
+ this.$refs['goodsTable'].clearTable();
|
|
|
+ // this.formData.goodsList = []
|
|
|
+ for (let feeFormDataKey in this.feeFormData) {
|
|
|
+ this.feeFormData[feeFormDataKey] = 0
|
|
|
+ this.feeFormData.sumReceiptList = []
|
|
|
+ }
|
|
|
+ for (let goodsFootFormDataKey in this.goodsFootFormData) {
|
|
|
+ this.goodsFootFormData[goodsFootFormDataKey] = 0
|
|
|
+ }
|
|
|
+ // 清空附件
|
|
|
+ this.formData.annexPaths = null;
|
|
|
+ this.formData.designRemarks = null;
|
|
|
+ this.formData.designUser = null;
|
|
|
+ this.formData.designStatusFlag = false;
|
|
|
+ this.formData.remarks = null;
|
|
|
+ //设置默认值
|
|
|
+ this.setDefaultValue();
|
|
|
+ },
|
|
|
+
|
|
|
+ /***************************列表及其他事件************************************/
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : tabs切换事件
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ changeElTabs(e) {
|
|
|
+ let name = e
|
|
|
+ this.bottomList = ['1', '2', '3', '4', '5']
|
|
|
+ window.location.href = '#' + name
|
|
|
+ // 如果点击附件直接打开附件上传界面
|
|
|
+ if (e === 'name5') {
|
|
|
+ if (this.$refs['uploadFile']) {
|
|
|
+ this.$refs['uploadFile'].$refs.input.click();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 获取错误信息
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ getErrMessage(prop) {
|
|
|
+ return this.errMessage[prop]
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 保存校验
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ onValidate({prop, status, error}) {
|
|
|
+ this.$set(this.errMessage, prop, error)
|
|
|
+ },
|
|
|
+
|
|
|
+ /***************************设定参数函数************************************/
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 设置保存的参数(小编辑)
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ setSubmitFormParamsLimitEdit() {
|
|
|
+ let params = {}
|
|
|
+ // 小编辑
|
|
|
+ params.limitEdit = true;
|
|
|
+ params.cpId = this.formData.cpId;
|
|
|
+ //所属公司
|
|
|
+ params.ascpId = this.formData.ascpId;
|
|
|
+ params.editTime = new Date(this.formData.editTime).format();
|
|
|
+ //订单Id
|
|
|
+ params.orderId = this.formData.orderId;
|
|
|
+ //订单单号
|
|
|
+ params.orderNo = this.formData.orderNo;
|
|
|
+ //订单类型
|
|
|
+ params.orderType = this.formData.orderType
|
|
|
+ //推送结果
|
|
|
+ params.erpPushStatus = this.formData.erpPushStatus
|
|
|
+ //审批结果
|
|
|
+ params.apvResult = this.formData.apvResult;
|
|
|
+ //制单人
|
|
|
+ params.makingUser = this.formData.staffId
|
|
|
+ params.userCode = this.formData.staffCode
|
|
|
+ params.userName = this.formData.staffName
|
|
|
+ params.erpUserCode = this.formData.erpUserCode;
|
|
|
+ //制单人(采购订单)"
|
|
|
+ params.makingUserPur = this.$store.state.user.id
|
|
|
+ //客户Id
|
|
|
+ params.customerId = this.formData.customerId;
|
|
|
+ //客户名称
|
|
|
+ params.customerName = this.formData.customerName;
|
|
|
+ //行政区域
|
|
|
+ params.addressArea = this.formData.addressArea;
|
|
|
+ //地址坐标
|
|
|
+ params.addressGcj02 = this.formData.addressGcj02;
|
|
|
+ //小区
|
|
|
+ params.addressName = this.formData.addressName;
|
|
|
+ //详细地址
|
|
|
+ params.addressFull = this.formData.addressFull;
|
|
|
+ //门牌号
|
|
|
+ params.addressNo = this.formData.addressNo;
|
|
|
+ //联系人
|
|
|
+ params.contactName = this.formData.contactName;
|
|
|
+ //联系电话
|
|
|
+ params.contactPhones = this.formData.contactPhones;
|
|
|
+ //客户来源
|
|
|
+ params.customerFrom = this.formData.customerFrom;
|
|
|
+ //业务员
|
|
|
+ params.staffId = this.formData.staffId;
|
|
|
+ params.staffCode = this.formData.staffCode;
|
|
|
+ //业务部门
|
|
|
+ params.orgId = this.formData.orgId;
|
|
|
+ params.erpOrgCode = this.formData.erpOrgCode;
|
|
|
+ //销售渠道
|
|
|
+ params.salesChannel = this.formData.salesChannel
|
|
|
+ params.salesChannelName = this.formData.salesChannelName
|
|
|
+ params.salesChannelCode = this.formData.salesChannelCode
|
|
|
+ //仓库
|
|
|
+ params.entryWhId = this.formData.entryWhId;
|
|
|
+ params.warehouseName = this.formData.warehouseName;
|
|
|
+ //供应商
|
|
|
+ params.supplierId = this.formData.supplierId;
|
|
|
+ params.supplierName = this.formData.supplierName;
|
|
|
+ params.supplierCode = this.formData.supplierCode;
|
|
|
+ //一级商户
|
|
|
+ params.sale1Id = this.formData.sale1Id
|
|
|
+ //二级商户
|
|
|
+ params.sale2Id = this.formData.sale2Id
|
|
|
+ //预计收货日期
|
|
|
+ if (this.formData.entryTime) {
|
|
|
+ params.entryTime = this.timestampToTime(Date.parse(this.formData.entryTime));
|
|
|
+ }
|
|
|
+ //备注
|
|
|
+ params.remarks = this.formData.remarks;
|
|
|
+ //附件
|
|
|
+ if (this.formData && this.formData.annexPaths && this.formData.annexPaths.length > 0) {
|
|
|
+ params.annexPaths = this.formData.annexPaths.map(m => {
|
|
|
+ return {
|
|
|
+ name: m.name,
|
|
|
+ url: m.path,
|
|
|
+ type: m.type,
|
|
|
+ docType: "采购订单",
|
|
|
+ createTime: m.createTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return params;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 时间戳转换为 yyyy-mm-dd或yyyy-MM-dd HH-mm-ss
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ timestampToTime(timestamp) {
|
|
|
+ var date = new Date(timestamp);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
|
|
|
+ var Y = date.getFullYear() + '-';
|
|
|
+ var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
|
|
|
+ var D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' ';
|
|
|
+ var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
|
|
|
+ var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
|
|
|
+ var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
|
|
|
+ return Y + M + D + h + m + s;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 设置保存的参数
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:47
|
|
|
+ */
|
|
|
+ setSubmitFormParams(flag) {
|
|
|
+ let params = {...this.formData}
|
|
|
+ params.cpId = this.formData.cpId
|
|
|
+ params.ascpId = this.formData.ascpId
|
|
|
+ //单据类型-分销订单
|
|
|
+ params.docCode = this.$config.docCode.purchaseOrder
|
|
|
+ // 编辑才会传递
|
|
|
+ if (this.type == this.$config.formMode.edit) {
|
|
|
+ params.editTime = new Date(this.formData.editTime).format();
|
|
|
+ }
|
|
|
+ //一级商户
|
|
|
+ params.sale1Id = this.formData.sale1Id
|
|
|
+ //二级商户
|
|
|
+ params.sale2Id = this.formData.sale2Id
|
|
|
+ //仓库
|
|
|
+ params.warehouseId = this.$store.state.user.warehouseId;
|
|
|
+ params.warehouseName = this.$store.state.user.warehouseName;
|
|
|
+ //订单Id
|
|
|
+ params.orderId = this.formData.orderId;
|
|
|
+ //订单状态
|
|
|
+ if (flag) {
|
|
|
+ params.orderStatus = this.$config.orderStatus.done;
|
|
|
+ } else {
|
|
|
+ params.orderStatus = this.$config.orderStatus.staging;
|
|
|
+ }
|
|
|
+ //订单类型
|
|
|
+ if (flag) {
|
|
|
+ params.orderType = this.$config.orderType.order;
|
|
|
+ // this.orderType = this.$config.orderType.order;
|
|
|
+ } else {
|
|
|
+ params.orderType = this.$config.orderType.quote
|
|
|
+ // this.orderType = this.$config.orderType.quote;
|
|
|
+ }
|
|
|
+ //审批结果
|
|
|
+ params.apvResult = this.formData.apvResult;
|
|
|
+ //制单人
|
|
|
+ params.makingUser = this.formData.staffId
|
|
|
+ params.userCode = this.formData.staffCode
|
|
|
+ params.userName = this.formData.staffName
|
|
|
+ params.erpUserCode = this.formData.erpUserCode;
|
|
|
+ //制单人(采购订单)"
|
|
|
+ params.makingUserPur = this.$store.state.user.id
|
|
|
+ //合同号
|
|
|
+ params.contractNo = this.formData.contractNo;
|
|
|
+ //客户电话
|
|
|
+ params.customerPhone = this.formData.customerPhone;
|
|
|
+ //客户Id
|
|
|
+ params.customerId = this.formData.customerId;
|
|
|
+ //客户编码
|
|
|
+ params.customerCode = this.formData.customerCode;
|
|
|
+ //客户名称
|
|
|
+ params.customerName = this.formData.customerName;
|
|
|
+ //行政区域
|
|
|
+ params.addressArea = this.formData.addressArea;
|
|
|
+ //地址坐标
|
|
|
+ params.addressGcj02 = this.formData.addressGcj02;
|
|
|
+ //小区
|
|
|
+ params.addressName = this.formData.addressName;
|
|
|
+ //详细地址
|
|
|
+ params.addressFull = this.formData.addressFull;
|
|
|
+ //门牌号
|
|
|
+ params.addressNo = this.formData.addressNo;
|
|
|
+ //联系人
|
|
|
+ params.contactName = this.formData.contactName;
|
|
|
+ //联系电话
|
|
|
+ params.contactPhones = this.formData.contactPhones;
|
|
|
+ //业务员
|
|
|
+ params.staffId = this.formData.staffId;
|
|
|
+ params.staffCode = this.formData.staffCode;
|
|
|
+ //业务员数组
|
|
|
+ params.staffList = this.formData.staffList;
|
|
|
+ //业务部门
|
|
|
+ params.orgId = this.formData.orgId;
|
|
|
+ params.erpOrgCode = this.formData.erpOrgCode;
|
|
|
+ //业务部门数组
|
|
|
+ params.orgList = this.formData.orgList;
|
|
|
+ //小区档案
|
|
|
+ params.estateId = this.formData.estateId;
|
|
|
+ //客户来源
|
|
|
+ params.customerFrom = this.formData.customerFrom;
|
|
|
+ //渠道
|
|
|
+ if (!params.salesChannel) {
|
|
|
+ params.salesChannel = this.$store.state.user.salesChannel;
|
|
|
+ params.salesChannelName = this.$store.state.user.salesChannelName;
|
|
|
+ params.salesChannelCode = this.$store.state.user.salesChannelCode;
|
|
|
+ }
|
|
|
+ //仓库
|
|
|
+ params.entryWhId = this.formData.entryWhId;
|
|
|
+ params.warehouseName = this.formData.warehouseName;
|
|
|
+ //供应商
|
|
|
+ params.supplierId = this.formData.supplierId;
|
|
|
+ params.supplierName = this.formData.supplierName;
|
|
|
+ params.supplierCode = this.formData.supplierCode;
|
|
|
+ //送货时间
|
|
|
+ if (this.formData.entryTime) {
|
|
|
+ params.entryTime = this.timestampToTime(Date.parse(this.formData.entryTime));
|
|
|
+ }
|
|
|
+ //是否设计
|
|
|
+ params.designStatus = this.formData.designStatusFlag ? this.$config.designStatus.yes : this.$config.designStatus.no;
|
|
|
+ //备注
|
|
|
+ params.remarks = this.formData.remarks;
|
|
|
+ //货物总额
|
|
|
+ params.sumGoodsAmount = this.goodsFootFormData.sumGoodsAmount;
|
|
|
+ //标价总额
|
|
|
+ params.sumStandard = this.goodsFootFormData.sumStandard;
|
|
|
+ //标价折扣
|
|
|
+ params.discountStandard = this.goodsFootFormData.discountStandard;
|
|
|
+ //标准售价
|
|
|
+ params.sumPromotion = this.goodsFootFormData.sumPromotion;
|
|
|
+ //合计金额
|
|
|
+ params.sumAmount = this.feeFormData.sumAmount;
|
|
|
+ //货物总额
|
|
|
+ params.tSumGoodsAmount = this.goodsFootFormData.sumGoodsAmount;
|
|
|
+ //标价总额
|
|
|
+ params.tSumStandard = this.goodsFootFormData.sumStandard;
|
|
|
+ //标价折扣
|
|
|
+ params.tDiscountStandard = this.goodsFootFormData.discountStandard;
|
|
|
+ //标准售价
|
|
|
+ params.tSumPromotion = this.goodsFootFormData.sumPromotion;
|
|
|
+ //合计金额
|
|
|
+ params.tSumAmount = this.feeFormData.sumAmount;
|
|
|
+ //标准售价折扣
|
|
|
+ params.discountPromotion = this.goodsFootFormData.discountPromotion;
|
|
|
+ //总重量
|
|
|
+ params.sumWeight = this.goodsFootFormData.sumWeight ? this.goodsFootFormData.sumWeight : 0;
|
|
|
+ //总体积
|
|
|
+ params.sumVolume = this.goodsFootFormData.sumVolume ? this.goodsFootFormData.sumVolume : 0;
|
|
|
+ //费用金额
|
|
|
+ params.sumFeeAmount = 0;
|
|
|
+ //订单定金
|
|
|
+ params.sumReceiptAmount = 0;
|
|
|
+ //使用预存
|
|
|
+ params.sumUsePrestore = 0;
|
|
|
+ // 收款明细
|
|
|
+ params.receiptVOList = [];
|
|
|
+ // if (params.receiptVOList && params.receiptVOList.length > 0) {
|
|
|
+ // params.receiptVOList = params.receiptVOList.filter(it => it.itemAmount != 0)
|
|
|
+ // for (let i of params.receiptVOList) {
|
|
|
+ // i.settlementType = i.typeId
|
|
|
+ // i.sumAmount = i.itemAmount
|
|
|
+ // //账款-商户
|
|
|
+ // //一级商户
|
|
|
+ // i.sale1Id = this.formData.sale1Id
|
|
|
+ // //二级商户
|
|
|
+ // i.sale2Id = this.formData.sale2Id
|
|
|
+ // //所属商户
|
|
|
+ // i.ascpId = this.formData.ascpId
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // 剩余应收
|
|
|
+ params.receivable = 0;
|
|
|
+ // 收款状态
|
|
|
+ this.feeFormData.sumReceivableAmount = 0
|
|
|
+ if (this.feeFormData.sumReceivableAmount === 0) {
|
|
|
+ //未收款
|
|
|
+ params.receiptStatus = this.$config.receiptStatus.no;
|
|
|
+ } else if (this.feeFormData.sumReceivableAmount < this.feeFormData.sumAmount) {
|
|
|
+ //部分收款
|
|
|
+ params.receiptStatus = this.$config.receiptStatus.part;
|
|
|
+ } else {
|
|
|
+ //收款完成
|
|
|
+ params.receiptStatus = this.$config.receiptStatus.all;
|
|
|
+ }
|
|
|
+ //合计收款金额 使用预存+订单定金
|
|
|
+ // params.sumCollectedAmount = parseFloat(this.feeFormData.sumUsePrestore) + parseFloat(this.feeFormData.sumReceiptAmount);
|
|
|
+ params.sumCollectedAmount = 0;
|
|
|
+ //销售订单明细
|
|
|
+ this.setOrderItem(params);
|
|
|
+ //删除明细的Ids
|
|
|
+ let table = this.$refs['goodsTable'].getDeleteData();
|
|
|
+ if (table && table.length > 0) {
|
|
|
+ params.orderItemDeleteVOList = table.map(it => it.itemId);
|
|
|
+ }
|
|
|
+ //附件
|
|
|
+ if (this.formData && this.formData.annexPaths && this.formData.annexPaths.length > 0) {
|
|
|
+ params.annexPaths = this.formData.annexPaths.map(m => {
|
|
|
+ return {
|
|
|
+ name: m.name,
|
|
|
+ url: m.path,
|
|
|
+ type: m.type,
|
|
|
+ docType: "采购订单",
|
|
|
+ createTime: m.createTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return params
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 获取改变的数据
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:48
|
|
|
+ */
|
|
|
+ getTableChangeData() {
|
|
|
+ let table = this.$refs['goodsTable'].tableData
|
|
|
+ // 过滤掉数量为0的数据
|
|
|
+ table = table.filter(it => it.itemQuantity && it.itemQuantity != 0);
|
|
|
+ return table;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 处理组合中的bom数据
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:48
|
|
|
+ */
|
|
|
+ setCombinedBomData(row, pRow) {
|
|
|
+ if (row.bomItems && row.bomItems.length > 0) {
|
|
|
+ let sumVolume = 0;
|
|
|
+ let sumWeight = 0;
|
|
|
+ let skuVolume = 0;
|
|
|
+ let skuWeight = 0;
|
|
|
+ let itemAmount = 0;
|
|
|
+ let quantityName = this.type == this.$config.formMode.edit ? 'tItemQuantity' : 'itemQuantity'
|
|
|
+ let amountName = this.type == this.$config.formMode.edit ? 'tItemAmount' : 'itemAmount'
|
|
|
+ // 数量
|
|
|
+ row[quantityName] = parseFloat(pRow[quantityName]) * parseFloat(row['orderItemQuantity'])
|
|
|
+ row.bomItems.forEach(it => {
|
|
|
+ skuVolume = parseFloat(it['skuVolume']) * parseFloat(it[quantityName]);
|
|
|
+ sumVolume += skuVolume;
|
|
|
+ skuWeight = parseFloat(it['skuWeight']) * parseFloat(it[quantityName]);
|
|
|
+ sumWeight += skuWeight;
|
|
|
+ if (it['tItemQuantity'] && it['priceSale']) {
|
|
|
+ itemAmount += parseFloat(it['tItemQuantity']) * parseFloat(it['priceSale']);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ row['skuVolume'] = sumVolume;
|
|
|
+ row['skuWeight'] = skuWeight;
|
|
|
+ row[amountName] = itemAmount;
|
|
|
+ row['priceSale'] = row[quantityName] == 0 ? 0 : (itemAmount / row[quantityName]).toFixed(2)
|
|
|
+ row.discountPromotion = row.pricePromotion == 0 ? 0 : (row.priceSale * 100 / row.pricePromotion).toFixed(2);
|
|
|
+ row.discountStandard = row.priceStandard == 0 ? 0 : (row.priceSale * 100 / row.priceStandard).toFixed(2);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 设置明细
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:48
|
|
|
+ */
|
|
|
+ setOrderItem(params) {
|
|
|
+ let table = null;
|
|
|
+ // 报价单取全部
|
|
|
+ if (this.orderType == this.$config.orderType.quote) {
|
|
|
+ table = this.$refs['goodsTable'].getTableDataFilter();
|
|
|
+ } else {
|
|
|
+ table = this.getTableChangeData();
|
|
|
+ }
|
|
|
+ let quantityName = this.type == this.$config.formMode.add ? 'itemQuantity' : 'tItemQuantity'
|
|
|
+ params.orderItemVOList = [];
|
|
|
+ // 如果有子级需要子级加载出来
|
|
|
+ let index = 1;
|
|
|
+ table.forEach((row, rowIndex) => {
|
|
|
+ if (this.type == this.$config.formMode.add) {
|
|
|
+ delete row.itemId
|
|
|
+ }
|
|
|
+ if (row.transferableFlag && row.transferableQuantity == 0) {
|
|
|
+ row.orderS2tobuyVOList = []
|
|
|
+ } else if (row.transferableFlag && row.transferableQuantity > row[quantityName]) {
|
|
|
+ let diff = row.transferableQuantity - row[quantityName]
|
|
|
+ for (let it = 0; it < row.orderS2tobuyVOList.length; it++) {
|
|
|
+ if (diff >= row.orderS2tobuyVOList[it].buyQuantity) {
|
|
|
+ diff -= row.orderS2tobuyVOList[it].buyQuantity
|
|
|
+ row.orderS2tobuyVOList.splice(it, 1)
|
|
|
+ it--
|
|
|
+ } else if (diff < row.orderS2tobuyVOList[it].buyQuantity) {
|
|
|
+ row.orderS2tobuyVOList[it].buyQuantity = row.orderS2tobuyVOList[it].buyQuantity - diff
|
|
|
+ diff = 0
|
|
|
+ }
|
|
|
+ if (diff == 0) {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ row['itemIndex'] = index;
|
|
|
+ row['flgGift'] = row['flgGift'] == null ? false : row['flgGift'];
|
|
|
+ let sumVolume = 0;
|
|
|
+ let sumWeight = 0;
|
|
|
+ let skuVolume = 0;
|
|
|
+ let skuWeight = 0;
|
|
|
+ // 如果有子级,子级需要处理一下
|
|
|
+ if (row['bomItems'] && row['bomItems'].length > 0) {
|
|
|
+ row['bomItems'].forEach(cRow => {
|
|
|
+ index++;
|
|
|
+ cRow['itemIndex'] = index;
|
|
|
+ // 给明细赋值活动id
|
|
|
+ cRow['activityId'] = row['activityId']
|
|
|
+ cRow['whId'] = this.formData.defWhId
|
|
|
+ if (cRow['hasChild'] == 0) {
|
|
|
+ skuVolume = parseFloat(cRow['skuVolume']) * parseFloat(cRow['itemQuantity']);
|
|
|
+ sumVolume += skuVolume;
|
|
|
+ cRow['skuVolume'] = skuVolume;
|
|
|
+ skuWeight = parseFloat(cRow['skuWeight']) * parseFloat(cRow['itemQuantity']);
|
|
|
+ sumWeight += skuWeight;
|
|
|
+ cRow['skuWeight'] = skuWeight;
|
|
|
+ cRow['flgBomCombined'] = false;
|
|
|
+ } else {
|
|
|
+ // 给组合中的bom需要做处理
|
|
|
+ this.setCombinedBomData(cRow, row);
|
|
|
+ cRow['flgBomCombined'] = true;
|
|
|
+ }
|
|
|
+ //售价为0,为赠品
|
|
|
+ if (!cRow['priceSale'] || cRow['priceSale'] == 0) {
|
|
|
+ cRow['flgGift'] = true;
|
|
|
+ } else {
|
|
|
+ cRow['flgGift'] = false;
|
|
|
+ }
|
|
|
+ // 如果标准售价折扣没有值,那么为0
|
|
|
+ cRow.discountPromotion = cRow.discountPromotion ? cRow.discountPromotion : 0;
|
|
|
+ cRow.pricePromotion = cRow.pricePromotion ? cRow.pricePromotion : 0;
|
|
|
+ cRow.discountStandard = cRow.discountStandard ? cRow.discountStandard : 0;
|
|
|
+ cRow.priceStandard = cRow.priceStandard ? cRow.priceStandard : 0;
|
|
|
+ cRow.priceSale = cRow.priceSale ? cRow.priceSale : 0;
|
|
|
+ params.orderItemVOList.push(cRow);
|
|
|
+ })
|
|
|
+ row['skuVolume'] = sumVolume ? sumVolume.toFixed(6) : 0;
|
|
|
+ row['skuWeight'] = sumWeight ? sumWeight.toFixed(6) : 0;
|
|
|
+ } else {
|
|
|
+ row['skuVolume'] = (parseFloat(row['skuVolume']) * parseFloat(row[quantityName])).toFixed(6)
|
|
|
+ row['skuWeight'] = (parseFloat(row['skuWeight']) * parseFloat(row[quantityName])).toFixed(6)
|
|
|
+ row['skuVolume'] = row['skuVolume'] ? row['skuVolume'] : 0
|
|
|
+ row['skuWeight'] = row['skuWeight'] ? row['skuWeight'] : 0
|
|
|
+ }
|
|
|
+ row['flgBomCombined'] = false;
|
|
|
+ // 如果标准售价折扣没有值,那么为0
|
|
|
+ row.discountPromotion = row.discountPromotion ? row.discountPromotion : 0;
|
|
|
+ row.pricePromotion = row.pricePromotion ? row.pricePromotion : 0;
|
|
|
+ row.discountStandard = row.discountStandard ? row.discountStandard : 0;
|
|
|
+ row.priceStandard = row.priceStandard ? row.priceStandard : 0;
|
|
|
+ row.priceSale = row.priceSale ? row.priceSale : 0;
|
|
|
+ row.whId = this.formData.defWhId
|
|
|
+ params.orderItemVOList.push(row);
|
|
|
+ })
|
|
|
+ // 计算总单数量
|
|
|
+ let tableFilter = this.$refs['goodsTable'].getTableDataFilter();
|
|
|
+ // 如果有子级需要子级加载出来
|
|
|
+ let sumQuantity = 0;
|
|
|
+ let categoryQuantityList = []; // 品类数据
|
|
|
+ tableFilter.forEach(row => {
|
|
|
+ // 如果有子级,子级需要处理一下
|
|
|
+ if (row['bomItems'] && row['bomItems'].length > 0) {
|
|
|
+ row['bomItems'].forEach(cRow => {
|
|
|
+ cRow.whId = this.formData.defWhId
|
|
|
+ if (cRow['hasChild'] == 0) {
|
|
|
+ sumQuantity += parseFloat(cRow[quantityName]);
|
|
|
+ if (cRow.skuSpecs == null) {
|
|
|
+ cRow.skuSpecs = " "
|
|
|
+ }
|
|
|
+ if (cRow.skuSpecs && !categoryQuantityList.includes(cRow.skuSpecs)) {
|
|
|
+ categoryQuantityList.push(cRow.skuSpecs)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ sumQuantity += parseFloat(row[quantityName]);
|
|
|
+ if (row.skuSpecs == null) {
|
|
|
+ row.skuSpecs = " "
|
|
|
+ }
|
|
|
+ // 如果没有子级,就加上即可
|
|
|
+ if (row.skuSpecs && !categoryQuantityList.includes(row.skuSpecs)) {
|
|
|
+ categoryQuantityList.push(row.skuSpecs)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 给总单数量赋值
|
|
|
+ params.sumQuantity = sumQuantity;
|
|
|
+ // 给总单数量赋值(编辑时取实际的量)
|
|
|
+ params.tSumQuantity = sumQuantity;
|
|
|
+ // 给品类数赋值
|
|
|
+ params.categoryQuantity = categoryQuantityList.length;
|
|
|
+ // 获取特殊标识
|
|
|
+ params.intentionTags = this.$libaray.getSpecilType(params.orderItemVOList);
|
|
|
+ },
|
|
|
+ /***************************created调用数据接口函数************************************/
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 通过id查询
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:48
|
|
|
+ */
|
|
|
+ detail(id) {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 判断列是否可以编辑
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:48
|
|
|
+ */
|
|
|
+ checkColumnIsEdit(field) {
|
|
|
+ let flag = false;
|
|
|
+ if (this.type === this.$config.formMode.edit) {
|
|
|
+ // 如果所有的列不允许编辑,返回true
|
|
|
+ if (this.allCanNoEdit) {
|
|
|
+ flag = true;
|
|
|
+ } else if (this.allCanEdit) {
|
|
|
+ flag = false;
|
|
|
+ } else {
|
|
|
+ // 小编辑时,只能编辑,可以编辑的列
|
|
|
+ if (this.alwaysEditColumns.includes(field)) {
|
|
|
+ flag = false;
|
|
|
+ } else {
|
|
|
+ flag = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 新建也是大编辑
|
|
|
+ this.allCanEdit = true;
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 赋值
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:48
|
|
|
+ */
|
|
|
+ setEntityByEdit(data) {
|
|
|
+ //对 editTime 进行处理
|
|
|
+ for (let key of Object.keys(data)) {
|
|
|
+ if (key == 'editTime') {
|
|
|
+ let lastIndex = data[key].lastIndexOf(".");
|
|
|
+ data[key] = data[key].substring(0, lastIndex)
|
|
|
+ data[key] = data[key].replace("T", " ");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.warehouseList.push({
|
|
|
+ whId: data.entryWhId,
|
|
|
+ whName: data.warehouseName,
|
|
|
+ entryWhId: data.entryWhId,
|
|
|
+ })
|
|
|
+ this.setCustomerFlag = true;
|
|
|
+ //编辑的时间戳
|
|
|
+ this.formData.editTime = data.editTime;
|
|
|
+ //订单状态
|
|
|
+ this.formData.orderStatus = data.orderStatus;
|
|
|
+ //冲正、分销不允许编辑
|
|
|
+ if (data.orderStatus === this.$config.orderStatus.reverse
|
|
|
+ || data.orderStatus === this.$config.orderStatus.distribution) {
|
|
|
+ this.allCanNoEdit = true;
|
|
|
+ } else if (data.apvResult === this.$config.approvalStatus.refuse ||
|
|
|
+ data.apvResult === this.$config.approvalStatus.error ||
|
|
|
+ data.orderType == this.$config.orderType.quote) {
|
|
|
+ // 审批状态是拒绝和异常、报价单是可以进行大编辑
|
|
|
+ this.allCanEdit = true;
|
|
|
+ } else {
|
|
|
+ this.allCanEdit = false;
|
|
|
+ }
|
|
|
+ this.formData.apvResult = data.apvResult
|
|
|
+ //订单类型
|
|
|
+ this.formData.orderType = data.orderType
|
|
|
+ this.orderType = data.orderType
|
|
|
+ //订单Id
|
|
|
+ this.formData.orderId = data.orderId;
|
|
|
+ //订单号
|
|
|
+ this.formData.orderNo = data.orderNo;
|
|
|
+ //客户电话
|
|
|
+ this.formData.customerPhone = data.customerPhone;
|
|
|
+ //客户Id
|
|
|
+ this.formData.customerId = data.customerId;
|
|
|
+ // 客户编码
|
|
|
+ this.formData.customerCode = data.customerCode;
|
|
|
+ //客户名称
|
|
|
+ this.formData.customerName = data.customerName;
|
|
|
+ //行政区域
|
|
|
+ this.formData.addressArea = data.addressArea;
|
|
|
+ //地址坐标
|
|
|
+ this.formData.addressGcj02 = data.addressGcj02;
|
|
|
+ //小区
|
|
|
+ this.formData.addressName = data.addressName;
|
|
|
+ //详细地址
|
|
|
+ this.formData.addressFull = data.addressFull;
|
|
|
+ //门牌号
|
|
|
+ this.formData.addressNo = data.addressNo;
|
|
|
+ if (data.addressFull) {
|
|
|
+ // 设置地址(不包括门牌号)
|
|
|
+ this.formData.customerDistrict = {}
|
|
|
+ this.formData.customerDistrict.addressFull = data.addressFull.replace(data.addressNo, '')
|
|
|
+ }
|
|
|
+ //联系人
|
|
|
+ this.formData.contactName = data.contactName ? data.contactName : this.formData.contactName
|
|
|
+ //联系电话
|
|
|
+ this.formData.contactPhones = data.contactPhones ? data.contactPhones : this.formData.contactPhones
|
|
|
+ if (!this.$route.query.editId) {
|
|
|
+ // 给业务员赋默认值
|
|
|
+ this.formData.staffId = data.staffId ? data.staffId : this.formData.staffId
|
|
|
+ this.formData.staffName = data.staffName ? data.staffName : this.formData.staffName
|
|
|
+ // 给业务部门赋默认值
|
|
|
+ this.formData.orgId = data.orgId ? data.orgId : this.formData.orgId
|
|
|
+ this.formData.orgName = data.orgName ? data.orgName : this.formData.orgName
|
|
|
+ }
|
|
|
+ //小区档案
|
|
|
+ this.formData.estateId = data.estateId ? data.estateId : this.formData.estateId
|
|
|
+ this.formData.estateName = data.estateName ? data.estateName : this.formData.estateName;
|
|
|
+ //客户来源
|
|
|
+ this.formData.customerFrom = data.customerFrom ? data.customerFrom : this.formData.customerFrom;
|
|
|
+ //预计送货日期
|
|
|
+ this.formData.entryTime = data.entryTime ? data.entryTime : this.formData.entryTime;
|
|
|
+ //所属公司Id
|
|
|
+ this.formData.ascpId = data.sale2Id ? data.sale2Id : this.formData.ascpId;
|
|
|
+ this.formData.cpName = data.sale2AscpName ? data.sale2AscpName : this.formData.cpName;
|
|
|
+ //供应商Id
|
|
|
+ this.formData.supplierId = data.supplierId ? data.supplierId : this.formData.supplierId;
|
|
|
+ //供应商名称
|
|
|
+ this.formData.supplierName = data.supplierName ? data.supplierName : this.formData.supplierName;
|
|
|
+ //供应商编码
|
|
|
+ this.formData.supplierCode = data.supplierCode ? data.supplierCode : this.formData.supplierCode;
|
|
|
+ //默认仓库
|
|
|
+ this.formData.entryWhId = data.entryWhId ? data.entryWhId : this.formData.entryWhId;
|
|
|
+ //默认仓库
|
|
|
+ this.formData.warehouseName = data.warehouseName ? data.warehouseName : this.formData.warehouseName;
|
|
|
+ //是否设计
|
|
|
+ this.formData.designStatusFlag = data.designStatus === this.$config.designStatus.yes ? true : false;
|
|
|
+ //交货方式
|
|
|
+ this.formData.deliveryType = data.deliveryType;
|
|
|
+ //备注
|
|
|
+ this.formData.remarks = data.remarks;
|
|
|
+ //表格下方金额赋值
|
|
|
+ if (this.type == this.$config.formMode.approval) {
|
|
|
+ //货物总额
|
|
|
+ this.goodsFootFormData.sumGoodsAmount = data.sumGoodsAmount;
|
|
|
+ //标价总额
|
|
|
+ this.goodsFootFormData.sumStandard = data.sumStandard;
|
|
|
+ //标价折扣
|
|
|
+ this.goodsFootFormData.discountStandard = data.discountStandard;
|
|
|
+ //标准售价
|
|
|
+ this.goodsFootFormData.sumPromotion = data.sumPromotion;
|
|
|
+ //标准售价折扣
|
|
|
+ this.goodsFootFormData.discountPromotion = data.discountPromotion;
|
|
|
+ //合计金额
|
|
|
+ this.feeFormData.sumAmount = data.sumAmount;
|
|
|
+ } else {
|
|
|
+ //货物总额
|
|
|
+ this.goodsFootFormData.sumGoodsAmount = data.tSumGoodsAmount;
|
|
|
+ //标价总额
|
|
|
+ this.goodsFootFormData.sumStandard = data.tSumStandard;
|
|
|
+ //标价折扣
|
|
|
+ this.goodsFootFormData.discountStandard = data.tDiscountStandard;
|
|
|
+ //标准售价
|
|
|
+ this.goodsFootFormData.sumPromotion = data.tSumPromotion;
|
|
|
+ //标准售价折扣
|
|
|
+ this.goodsFootFormData.discountPromotion = data.tDiscountPromotion;
|
|
|
+ //合计金额
|
|
|
+ this.feeFormData.sumAmount = data.tSumAmount;
|
|
|
+ }
|
|
|
+ //总重量
|
|
|
+ this.goodsFootFormData.sumWeight = data.sumWeight;
|
|
|
+ //总体积
|
|
|
+ this.goodsFootFormData.sumVolume = data.sumVolume;
|
|
|
+ //总数量
|
|
|
+ this.goodsFootFormData.sumQuantity = data.tSumQuantity;
|
|
|
+ //费用金额
|
|
|
+ this.feeFormData.sumFeeAmount = data.sumFeeAmount;
|
|
|
+ //订单定金
|
|
|
+ this.feeFormData.sumReceiptAmount = data.sumReceiptAmount;
|
|
|
+ //使用预存
|
|
|
+ this.feeFormData.sumUsePrestore = data.sumUsePrestore;
|
|
|
+ // 预存+定金
|
|
|
+ this.feeFormData.sumReceivableAmount = data.sumCollectedAmount;
|
|
|
+ // 收款明细
|
|
|
+ this.receiptList = data.receiptVOList;
|
|
|
+ this.feeFormData.sumReceiptList = data.receiptVOList;
|
|
|
+ // 剩余应收
|
|
|
+ this.feeFormData.receivable = data.receivable;
|
|
|
+ //推送结果
|
|
|
+ this.formData.erpPushStatus = data.erpPushStatus;
|
|
|
+ if (!this.$route.query.editId) {
|
|
|
+ // 订单明细
|
|
|
+ this.formData.goodsList = data.orderItemVOList;
|
|
|
+ let children = []
|
|
|
+ // 把明细的子级放到children中
|
|
|
+ if (data.orderItemVOList && data.orderItemVOList.length > 0) {
|
|
|
+ data.orderItemVOList.forEach(row => {
|
|
|
+ row.warehouseName = row.whName
|
|
|
+ //分销销售订单转采购明细存在
|
|
|
+ if (row.orderS2tobuyVOList && row.orderS2tobuyVOList.length > 0) {
|
|
|
+ row.transferableQuantity = row.orderS2tobuyVOList.filter(it => it.buyQuantity).sum('buyQuantity')
|
|
|
+ row.transferableFlag = true
|
|
|
+ }
|
|
|
+ if (row['bomItems'] && row['bomItems'].length > 0) {
|
|
|
+ row['bomItems'].forEach(it => {
|
|
|
+ it.warehouseName = it.whName
|
|
|
+ children.push(it);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 如果是大编辑,非标参数需要设置
|
|
|
+ if (this.allCanEdit && row.nonGlassList && row.nonGlassList.length > 0) {
|
|
|
+ this.setNonGlassForm(row);
|
|
|
+ // 面积
|
|
|
+ if (row.nonStandardArea) {
|
|
|
+ row.nonStandardArea = row.nonStandardArea.toFixed(6)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.$refs['goodsTable'].children = children;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.formData.designUser = data.designUser
|
|
|
+ this.formData.designRemarks = data.designRemarks
|
|
|
+ this.formData.designUserName = data.designUserName;
|
|
|
+ this.setCustomerFlag = false;
|
|
|
+ if (data.annexPaths) {
|
|
|
+ this.formData.annexPaths = data.annexPaths.map(m => {
|
|
|
+ return {
|
|
|
+ name: m.name,
|
|
|
+ path: m.url,
|
|
|
+ type: m.type,
|
|
|
+ docType: m.docType,
|
|
|
+ createTime: m.createTime
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 页面初始化所需下拉数据
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:49
|
|
|
+ */
|
|
|
+ initSelectData() {
|
|
|
+ //查询所属公司
|
|
|
+ if (this.type == this.$config.formMode.add) {
|
|
|
+ this.getCpId()
|
|
|
+ }
|
|
|
+ //查询客户
|
|
|
+ this.getCustomer()
|
|
|
+ //查询供应商
|
|
|
+ if (this.type == this.$config.formMode.add) {
|
|
|
+ this.getSupplier()
|
|
|
+ }
|
|
|
+ //查询默认收货地址
|
|
|
+ this.getAddress()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询客户
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:49
|
|
|
+ */
|
|
|
+ getCustomer() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 获取业务员
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getStaff(staffId) {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 获取业务部门 销售渠道
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getOrgAndSaleChannel(orgId) {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询仓库
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getWarehouse() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询供应商
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getSupplier() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询所属公司
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getCpId() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询仓库
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getCpIdWarehouse() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询明细仓库
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getDetailWarehouse() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 查询默认收货地址
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ getAddress() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 设置默认值
|
|
|
+ * @author : 付斌
|
|
|
+ * @date : 2024-02-19 10:50
|
|
|
+ */
|
|
|
+ setDefaultValue() {
|
|
|
+ //客户赋值
|
|
|
+ this.formData.sale2OrgId = this.$store.state.user.sale2OrgId
|
|
|
+ this.formData.sale2StaffId = this.$store.state.user.sale2StaffId
|
|
|
+ this.formData.supplierId = this.$store.state.user.sale2SupplierId
|
|
|
+ //地址赋值
|
|
|
+ if (this.$store.state.user.cityName) {
|
|
|
+ let city = this.$store.state.user.cityName;
|
|
|
+ let filterRows = this.cityData.filter(it => it.key == city);
|
|
|
+ if (!filterRows || filterRows.length === 0) {
|
|
|
+ // 给城市赋值
|
|
|
+ this.cityData.push({key: city, value: city})
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.focusItem = 'supplierId'; // 给第一个组件赋值,可以在混入中自动去聚焦
|
|
|
+ if (this.$route.query && this.$route.query.editId) {
|
|
|
+ this.orderId = this.$route.query.editId
|
|
|
+ this.purchaseBasedOnSales(true)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 在实例创建完成后被立即同步调用
|
|
|
+ * @author : 寇珊珊
|
|
|
+ * @date : 2022/3/3 10:32
|
|
|
+ */
|
|
|
+ created() {
|
|
|
+ this.focusItem = 'supplierId'; // 给第一个组件赋值,可以在混入中自动去聚焦
|
|
|
+ this.primaryKey = 'purOrderId' // 设置主键Id
|
|
|
+ // 根据用户敏感信息,设置隐藏列
|
|
|
+ let us = this.$store.state.user.userSensitive.filter(f => f.isCheck && f.docCode == this.$config.docCode.fxPurchaseOrder
|
|
|
+ && f.itemName == this.$config.sensitiveItemName.purchasePrice);
|
|
|
+ if (us.length > 0) {
|
|
|
+ this.visUserSensitive = true;
|
|
|
+ }
|
|
|
+ //查询页面初始化所需数据
|
|
|
+ this.initSelectData();
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @desc : 实例被挂载后调用
|
|
|
+ * @author : 寇珊珊
|
|
|
+ * @date : 2022/3/3 10:31
|
|
|
+ */
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+<style lang="less" scoped>
|
|
|
+.imageWrap {
|
|
|
+ width: 100%;
|
|
|
+ height: 90px;
|
|
|
+ border: 1px solid red;
|
|
|
+}
|
|
|
+
|
|
|
+.tab-class {
|
|
|
+ width: 100%;
|
|
|
+ height: 32px;
|
|
|
+ position: fixed;
|
|
|
+ z-index: 999;
|
|
|
+ background: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.Col {
|
|
|
+ margin-bottom: 3px;
|
|
|
+}
|
|
|
+
|
|
|
+//暗锚
|
|
|
+.hide-anchor {
|
|
|
+ position: relative;
|
|
|
+ top: -50px;
|
|
|
+ display: block;
|
|
|
+ height: 0;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
+.form-content-class {
|
|
|
+ padding-left: 8px;
|
|
|
+ width: 98%
|
|
|
+}
|
|
|
+
|
|
|
+.search-button-class {
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ display: flex;
|
|
|
+ height: 28px;
|
|
|
+ width: 24px;
|
|
|
+ cursor: pointer;
|
|
|
+ border-bottom: 1px solid rgb(220, 222, 226);
|
|
|
+ border-right: 1px solid rgb(220, 222, 226);
|
|
|
+ border-top: 1px solid rgb(220, 222, 226);
|
|
|
+}
|
|
|
+
|
|
|
+.close-class {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 24px;
|
|
|
+ position: absolute;
|
|
|
+ top: 5px;
|
|
|
+ right: 15px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ height: 24px;
|
|
|
+ color: #a0a5ac;
|
|
|
+ z-index: 99;
|
|
|
+}
|
|
|
</style>
|