parent
639d2439e3
commit
7ac7a68b1b
@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="jnpf.mapper.ProductPriceMapper">
|
||||
|
||||
<select id="queryByKeyword" resultType="jnpf.entity.ProductPriceEntity">
|
||||
SELECT a.* from jg_product_price a where a.status = '1'
|
||||
|
||||
|
||||
<!-- SELECT a.*,b.ticketno vehicleName,c.supplier_name supplierName,d.supplier_nm customerName,e.item_name materialName,f.contract_name salesName,g.contract_name purchaseName,h.F_RealName businessName,-->
|
||||
<!-- i.name naturalName,g.contract_no purchaseContractNo,f.contract_no salesContractNo, j.id purchaseorderItem0Id,k.id salesorderItem0Id,k.rate saleRate,jp.is_payment isPayment-->
|
||||
<!-- from jg_poundlist a-->
|
||||
<!-- LEFT JOIN jg_vehicle b on a.vehicle_id = b.id and b.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_supplier c on a.supplier_id = c.id and c.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_customer d on a.customer_id = d.id and d.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_material e on a.material_id = e.id and e.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_contract f on a.sales_id = f.id and f.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_contract g on a.purchase_id = g.id and g.delete_mark = 0-->
|
||||
<!-- LEFT JOIN base_user h on a.business_id = h.f_id-->
|
||||
<!-- LEFT JOIN jg_natural i on a.natural_id = i.id and i.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_purchaseorder_item0 j on a.id = j.poundlist_id and j.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_salesorder_item0 k on a.id = k.poundlist_id and k.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_purchaseorder jp ON a.purchaseorder_id=jp.id and jp.delete_mark = 0-->
|
||||
<!-- LEFT JOIN jg_salesorder js ON a.salesorder_id=js.id and js.delete_mark = 0-->
|
||||
<!-- ${ew.customSqlSegment} and a.delete_mark = 0-->
|
||||
<!-- <if test="poundlistPagination.keyword != null and poundlistPagination.keyword != ''">-->
|
||||
<!-- AND (b.ticketno LIKE CONCAT('%',#{poundlistPagination.keyword},'%') OR c.supplier_name LIKE CONCAT('%',#{poundlistPagination.keyword},'%') OR d.supplier_nm LIKE CONCAT('%',#{poundlistPagination.keyword},'%'))-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.startDate != null and poundlistPagination.endDate != null">-->
|
||||
<!-- AND a.pound_date > #{poundlistPagination.startDate} AND a.pound_date <= #{poundlistPagination.endDate}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.poundlistNo != null and poundlistPagination.poundlistNo != ''">-->
|
||||
<!-- AND a.poundlist_no LIKE CONCAT('%',#{poundlistPagination.poundlistNo},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.businessId != null and poundlistPagination.businessId != ''">-->
|
||||
<!-- AND h.F_RealName LIKE CONCAT('%',#{poundlistPagination.businessId},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.isInvoicing != null and poundlistPagination.isInvoicing != ''">-->
|
||||
<!-- AND a.is_Invoicing = #{poundlistPagination.isInvoicing}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.isPay != null and poundlistPagination.isPay != ''">-->
|
||||
<!-- AND a.is_pay = #{poundlistPagination.isPay}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.isCollection != null and poundlistPagination.isCollection != ''">-->
|
||||
<!-- AND a.is_collection = #{poundlistPagination.isCollection}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.isExpense != null and poundlistPagination.isExpense != ''">-->
|
||||
<!-- AND a.is_expense = #{poundlistPagination.isExpense}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.purchaseStatus != null and poundlistPagination.purchaseStatus != ''">-->
|
||||
<!-- AND a.purchase_status = #{poundlistPagination.purchaseStatus}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.salesStatus != null and poundlistPagination.salesStatus != ''">-->
|
||||
<!-- AND a.sales_status = #{poundlistPagination.salesStatus}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.materialName != null and poundlistPagination.materialName != ''">-->
|
||||
<!-- AND e.item_name LIKE CONCAT('%',#{poundlistPagination.materialName},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.vehicleName != null and poundlistPagination.vehicleName != ''">-->
|
||||
<!-- AND b.ticketno LIKE CONCAT('%',#{poundlistPagination.vehicleName},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.purchaseName != null and poundlistPagination.purchaseName != ''">-->
|
||||
<!-- AND g.contract_name LIKE CONCAT('%',#{poundlistPagination.purchaseName},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.salesName != null and poundlistPagination.salesName != ''">-->
|
||||
<!-- AND f.contract_name LIKE CONCAT('%',#{poundlistPagination.salesName},'%')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- <if test="poundlistPagination.customerName != null and poundlistPagination.customerName != ''">-->
|
||||
<!-- AND d.supplier_nm LIKE CONCAT('%',#{poundlistPagination.customerName},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.supplierName != null and poundlistPagination.supplierName != ''">-->
|
||||
<!-- AND c.supplier_name LIKE CONCAT('%',#{poundlistPagination.supplierName},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.purchaseOrderId != null and poundlistPagination.purchaseOrderId != ''">-->
|
||||
<!-- AND a.id IN (SELECT poundlist_id from jg_purchaseorder_item0 where purchaseorder_id = #{poundlistPagination.purchaseOrderId})-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.salesOrderId != null and poundlistPagination.salesOrderId != ''">-->
|
||||
<!-- AND a.id IN (SELECT poundlist_id from jg_salesorder_item0 where sales_order_id = #{poundlistPagination.salesOrderId})-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.poundlistIds != null and poundlistPagination.poundlistIds.size()!=0">-->
|
||||
<!-- AND a.id NOT IN-->
|
||||
<!-- <foreach collection="poundlistPagination.poundlistIds" index="index" item="item" open="(" separator="," close=")">-->
|
||||
<!-- #{item}-->
|
||||
<!-- </foreach>-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.settlement != null and poundlistPagination.settlement != ''">-->
|
||||
<!-- AND a.settlement = #{poundlistPagination.settlement}-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.purchaseorderNo != null and poundlistPagination.purchaseorderNo != ''">-->
|
||||
<!-- AND jp.document_no LIKE CONCAT('%',#{poundlistPagination.purchaseorderNo},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.salesorderNo != null and poundlistPagination.salesorderNo != ''">-->
|
||||
<!-- AND js.document_no LIKE CONCAT('%',#{poundlistPagination.salesorderNo},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="poundlistPagination.sidx != null and poundlistPagination.sidx != ''">-->
|
||||
<!-- ORDER BY ${poundlistPagination.sidx} ${poundlistPagination.sort}-->
|
||||
<!-- </if>-->
|
||||
</select>
|
||||
</mapper>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,170 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack"
|
||||
content="详情"/>
|
||||
<div class="options">
|
||||
<el-button @click="goBack">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<JnpfGroupTitle
|
||||
contentPosition="left" :closable= "false" content ="基本信息" >
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label="价格类型"
|
||||
prop="priceType" >
|
||||
<p>{{ dataForm.priceType }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="价格编号"
|
||||
prop="priceNo" >
|
||||
<p>{{dataForm.priceNo}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="报价方"
|
||||
prop="makerId" >
|
||||
<p>{{dataForm.makerId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="有效时间开始"
|
||||
prop="startTime" >
|
||||
<p>{{dataForm.startTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="有效时间结束"
|
||||
prop="endTime" >
|
||||
<p>{{dataForm.endTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="报价方名称"
|
||||
prop="makerName" >
|
||||
<p>{{dataForm.makerName}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" >
|
||||
<jnpf-form-tip-item label="备注"
|
||||
prop="remark" >
|
||||
<p>{{dataForm.remark}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="商品"
|
||||
prop="productId" >
|
||||
<p>{{dataForm.productId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="计价单位"
|
||||
prop="pricingUnitId" >
|
||||
<p>{{dataForm.pricingUnitId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="价格"
|
||||
prop="price" >
|
||||
<p>{{dataForm.price}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: { Detail},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
|
||||
dataForm: {
|
||||
id :'',
|
||||
priceType : "2",
|
||||
priceNo : '',
|
||||
makerId : "",
|
||||
startTime : '',
|
||||
endTime : '',
|
||||
makerName : "",
|
||||
remark : '',
|
||||
productId : "",
|
||||
pricingUnitId : "",
|
||||
price : '',
|
||||
},
|
||||
priceTypeOptions:[{"fullName":"采购价格","id":"1"},{"fullName":"销售价格","id":"2"}],
|
||||
priceTypeProps:{"label":"fullName","value":"id" },
|
||||
pricingUnitIdProps:{"label":"unit_name","value":"id" },
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/scm/ProductPrice/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,631 @@
|
||||
<template>
|
||||
<transition name="el-zoom-in-center">
|
||||
<div class="JNPF-preview-main">
|
||||
<div class="JNPF-common-page-header">
|
||||
<el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" />
|
||||
<div class="options">
|
||||
<el-dropdown class="dropdown" placement="bottom">
|
||||
<el-button style="width:70px">
|
||||
更 多<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<template v-if="dataForm.id">
|
||||
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
|
||||
{{'上一条'}}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item @click.native="next" :disabled='nextDis'>
|
||||
{{'下一条'}}
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)" :loading="continueBtnLoading"
|
||||
:disabled='btnLoading'>
|
||||
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'> 保
|
||||
存</el-button>
|
||||
<el-button @click="goBack"> 取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="基本信息" contentPosition="left">
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="价格类型" prop="priceType">
|
||||
<JnpfRadio v-model="dataForm.priceType" @change="changeData('priceType',-1)" optionType="button"
|
||||
direction="horizontal" size="medium" :options="priceTypeOptions" :props="priceTypeProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="价格编号" prop="priceNo">
|
||||
<JnpfInput v-model="dataForm.priceNo" @change="changeData('priceNo',-1)" placeholder="系统自动生成" readonly
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="报价方" prop="makerId" v-if="dataForm.priceType == 2">
|
||||
<JnpfPopupSelect v-model="dataForm.makerId" @change="makerChangeData" :rowIndex="null"
|
||||
:formData="dataForm" :templateJson="interfaceRes.makerId" placeholder="请选择" propsValue="id"
|
||||
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='makerId'
|
||||
interfaceId="520962013808039429" :pageSize="20" :columnOptions="makerIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
<jnpf-form-tip-item label="报价方" prop="makerId" v-if="dataForm.priceType == 1">
|
||||
<JnpfPopupSelect v-model="dataForm.makerId" @change="makerChangeData" :rowIndex="null"
|
||||
:formData="dataForm" :templateJson="interfaceRes.makerId" placeholder="请选择" propsValue="id"
|
||||
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='makerId'
|
||||
interfaceId="522417703080700549" :pageSize="20" :columnOptions="makerIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="有效时间">
|
||||
<!-- <JnpfDatePicker v-model="dataForm.startTime" @change="changeData('startTime',-1)"
|
||||
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
|
||||
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker> -->
|
||||
<el-date-picker v-model="operationDate" type="daterange" start-placeholder="开始日期"
|
||||
end-placeholder="结束日期" value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="有效时间结束" prop="endTime">
|
||||
<JnpfDatePicker v-model="dataForm.endTime" @change="changeData('endTime',-1)"
|
||||
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择"
|
||||
clearable :style='{"width":"100%"}' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="8">
|
||||
<jnpf-form-tip-item label="报价方名称" prop="makerName">
|
||||
<JnpfPopupSelect v-model="dataForm.makerName" @change="changeData('makerName',-1)" :rowIndex="null"
|
||||
:formData="dataForm" :templateJson="interfaceRes.makerName" placeholder="请选择" propsValue="id"
|
||||
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='makerName'
|
||||
interfaceId="522417703080700549" :pageSize="20" :columnOptions="makerNamecolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col> -->
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="备注" prop="remark">
|
||||
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark',-1)" placeholder="请输入"
|
||||
:style='{"width":"100%"}' true type="textarea" :autosize='{"minRows":4,"maxRows":4}'>
|
||||
</JnpfTextarea>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="商品" prop="productId">
|
||||
<JnpfPopupSelect v-model="dataForm.productId" @change="productChangeData" :rowIndex="null"
|
||||
:formData="dataForm" :templateJson="interfaceRes.productId" placeholder="请选择" propsValue="id"
|
||||
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name' field='productId'
|
||||
interfaceId="529919666429100229" :pageSize="20" :columnOptions="productIdcolumnOptions" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="计价单位" prop="pricingUnitId">
|
||||
<JnpfSelect v-model="dataForm.pricingUnitId" @change="changeData('pricingUnitId',-1)" placeholder="请选择"
|
||||
disabled clearable :style='{"width":"100%"}' :options="pricingUnitIdOptions"
|
||||
:props="pricingUnitIdProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="价格" prop="price">
|
||||
<JnpfInput v-model="dataForm.price" @change="changeData('price',-1)" placeholder="请输入" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
||||
@select="addForSelect" @close="selectDialogVisible=false" />
|
||||
</el-row>
|
||||
</div>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
getDataInterfaceRes
|
||||
} from '@/api/systemData/dataInterface'
|
||||
import {
|
||||
getDictionaryDataSelector
|
||||
} from '@/api/systemData/dictionary'
|
||||
import {
|
||||
getDefaultCurrentValueUserId
|
||||
} from '@/api/permission/user'
|
||||
import {
|
||||
getDefaultCurrentValueDepartmentId
|
||||
} from '@/api/permission/organize'
|
||||
import {
|
||||
getDateDay,
|
||||
getLaterData,
|
||||
getBeforeData,
|
||||
getBeforeTime,
|
||||
getLaterTime
|
||||
} from '@/components/Generator/utils/index.js'
|
||||
import {
|
||||
thousandsFormat
|
||||
} from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
operationDate: [],
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {},
|
||||
//可选范围默认值
|
||||
ableAll: {},
|
||||
tableRows: {},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
priceType: "1",
|
||||
priceNo: undefined,
|
||||
makerId: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
makerName: undefined,
|
||||
remark: undefined,
|
||||
spec: undefined,
|
||||
productId: undefined,
|
||||
pricingUnitId: undefined,
|
||||
price: undefined,
|
||||
version: 0,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule: {
|
||||
priceType: [{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
makerId: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
startTime: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
endTime: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
productId: [{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
}, ],
|
||||
price: [{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
}, ],
|
||||
},
|
||||
priceTypeOptions: [{
|
||||
"fullName": "采购价格",
|
||||
"id": "1"
|
||||
}, {
|
||||
"fullName": "销售价格",
|
||||
"id": "2"
|
||||
}],
|
||||
priceTypeProps: {
|
||||
"label": "fullName",
|
||||
"value": "id"
|
||||
},
|
||||
makerIdcolumnOptions: [{
|
||||
"label": "名称",
|
||||
"value": "name"
|
||||
}, ],
|
||||
makerNamecolumnOptions: [{
|
||||
"label": "名称",
|
||||
"value": "name"
|
||||
}, ],
|
||||
productIdcolumnOptions: [{
|
||||
"label": "名称",
|
||||
"value": "name"
|
||||
}, ],
|
||||
pricingUnitIdOptions: [],
|
||||
pricingUnitIdProps: {
|
||||
"label": "unit_name",
|
||||
"value": "id"
|
||||
},
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
priceType: [],
|
||||
priceNo: [],
|
||||
makerId: [],
|
||||
startTime: [],
|
||||
endTime: [],
|
||||
makerName: [],
|
||||
remark: [],
|
||||
spec: [],
|
||||
productId: [],
|
||||
pricingUnitId: [],
|
||||
price: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
makerChangeData(model, row){
|
||||
this.dataForm.makerName = row.name;
|
||||
},
|
||||
productChangeData(model, row){
|
||||
this.dataForm.pricingUnitId = row.product_unitwarehouse_id;
|
||||
this.dataForm.spec = row.spec;
|
||||
},
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
this.nextDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
this.prevDis = false
|
||||
for (let index = 0; index < this.allList.length; index++) {
|
||||
const element = this.allList[index];
|
||||
if (this.index == index) {
|
||||
this.getInfo(element.id)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/scm/ProductPrice/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
this.getpricingUnitIdOptions();
|
||||
},
|
||||
getpricingUnitIdOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.pricingUnitId))
|
||||
for (let i = 0; i < templateJsonList.length; i++) {
|
||||
let json = templateJsonList[i];
|
||||
if (json.relationField) {
|
||||
let relationFieldAll = json.relationField.split("-");
|
||||
let val = json.defaultValue;
|
||||
if (relationFieldAll.length > 1 && index > -1) {
|
||||
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ?
|
||||
this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||
} else {
|
||||
val = this.dataForm[relationFieldAll]
|
||||
}
|
||||
json.defaultValue = val
|
||||
}
|
||||
}
|
||||
let template = {
|
||||
paramList: templateJsonList
|
||||
}
|
||||
getDataInterfaceRes('529938341609623877', template).then(res => {
|
||||
let data = res.data
|
||||
this.pricingUnitIdOptions = data
|
||||
this.changeDataFormData(1, 'pricingUnitId', 'pricingUnitId', index, '')
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/scm/ProductPrice/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/scm/ProductPrice',
|
||||
method: 'post',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.$nextTick(() => {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
})
|
||||
this.continueBtnLoading = false
|
||||
return
|
||||
}
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
} else {
|
||||
request({
|
||||
url: '/api/scm/ProductPrice/' + this.dataForm.id,
|
||||
method: 'PUT',
|
||||
data: _data
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1000,
|
||||
onClose: () => {
|
||||
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
|
||||
this.visible = false
|
||||
this.btnLoading = false
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
this.continueBtnLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
openSelectDialog(key) {
|
||||
this.currTableConf = this.addTableConf[key]
|
||||
this.currVmodel = key
|
||||
this.selectDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.selectDialog.init()
|
||||
})
|
||||
},
|
||||
addForSelect(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let t = data[i]
|
||||
if (this['get' + this.currVmodel]) {
|
||||
this['get' + this.currVmodel](t)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||
let timeDataValue = null
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
previousDate = getLaterTime(timeTarget, timeValue)
|
||||
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
if (this.operationDate && this.operationDate.length) {
|
||||
this.dataForm.startTime = this.operationDate[0]
|
||||
this.dataForm.endTime = this.operationDate[1]
|
||||
} else {
|
||||
this.startTime = ''
|
||||
this.endTime = ''
|
||||
}
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.operationDate = [];
|
||||
if (this.dataForm.startTime && this.dataForm.endTime) {
|
||||
this.operationDate[0] = new Date(this.dataForm.startTime)
|
||||
this.operationDate[1] = new Date(this.dataForm.endTime)
|
||||
}
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue