jg-waiwang-pro
vayne 5 months ago
commit 8e9f361e0b

@ -2,20 +2,36 @@
<view :class="'jnpf-checkbox jnpf-checkbox-right'">
<view v-if="direction === 'horizontal'">
<u-checkbox-group @change="onChange" :disabled="disabled" style="display: flow-root;">
<u-checkbox v-model="item.checked" label-size='26' v-for="(item, index) in newOptions" :key="index"
:name="item[props.value]">
{{ item[props.label] }}
</u-checkbox>
<template v-if="showOnly">
<u-checkbox v-if="item.checked" v-model="item.checked" label-size='26' v-for="(item, index) in newOptions" :key="index"
:name="item[props.value]">
{{ item[props.label] }}
</u-checkbox>
</template>
<template v-else>
<u-checkbox label-size='26' v-for="(item, index) in newOptions" :key="index"
:name="item[props.value]">
{{ item[props.label] }}
</u-checkbox>
</template>
</u-checkbox-group>
</view>
<!-- -->
<view class="u-select__body u-select__body__multiple" v-else>
<scroll-view :scroll-y="true" style="height: 100%">
<u-checkbox-group @change="onChange" wrap :disabled="disabled">
<u-checkbox v-model="item.checked" :name="item[props.value]" v-for="(item,i) in newOptions"
:key="i">
{{ item[props.label] }}
</u-checkbox>
<template v-if="showOnly">
<u-checkbox v-if="item.checked" v-model="item.checked" :name="item[props.value]" v-for="(item,i) in newOptions"
:key="i">
{{ item[props.label] }}
</u-checkbox>
</template>
<template v-else>
<u-checkbox v-model="item.checked" :name="item[props.value]" v-for="(item,i) in newOptions"
:key="i">
{{ item[props.label] }}
</u-checkbox>
</template>
</u-checkbox-group>
</scroll-view>
</view>
@ -52,6 +68,10 @@
disabled: {
type: Boolean,
default: false
},
showOnly: {
type: Boolean,
default: false
}
},
data() {

@ -2,17 +2,34 @@
<view :class="'jnpf-radio jnpf-radio-right'">
<view class="" v-if="direction === 'horizontal'">
<u-radio-group @change="onChange" :disabled="disabled" v-model="initValue" style="display:flow-root;">
<u-radio label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
{{ item[props.label] }}
</u-radio>
<template v-if="showOnly">
<u-radio v-if="item[props.value] == initValue" label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
{{ item[props.label] }}
</u-radio>
</template>
<template v-else>
<u-radio label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
{{ item[props.label] }}
</u-radio>
</template>
</u-radio-group>
</view>
<!-- -->
<view class="radio-c" v-else>
<u-radio-group @change="onChange" :disabled="disabled" v-model="initValue">
<u-radio label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
<!-- <u-radio label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
{{ item[props.label] }}
</u-radio>
</u-radio> -->
<template v-if="showOnly">
<u-radio v-if="item[props.value] == initValue" label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
{{ item[props.label] }}
</u-radio>
</template>
<template v-else>
<u-radio label-size='26' v-for="(item, index) in options" :key="index" :name="item[props.value]">
{{ item[props.label] }}
</u-radio>
</template>
</u-radio-group>
</view>
</view>
@ -47,6 +64,10 @@
disabled: {
type: Boolean,
default: false
},
showOnly: {
type: Boolean,
default: false
}
},
data() {

@ -484,6 +484,18 @@
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "warehousingReportloss/index",
"style": {
"navigationBarTitleText": ""
}
},
{
"path": "cwCost/index",
"style": {
"navigationBarTitleText": ""
}
}
]
},

@ -4,10 +4,8 @@
label-align="right" :label-width="labelwidth" class="jnpf-form">
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="合同类型" content="合同类型">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>合同类型
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -17,16 +15,14 @@
:left-icon-style="{'color':'#a0acb7'}" prop="contractType">
<jnpf-radio v-model="dataForm.contractType" :disabled="judgeWrite('contractType')"
@change="changeData('contractType',-1)" optionType="button" direction="horizontal"
:props="contractTypeProps" :options="contractTypeOptions">
:props="contractTypeProps" :options="contractTypeOptions" :showOnly="true">
</jnpf-radio>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="基本信息" content="基本信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>基本信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -115,10 +111,8 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="主体信息" content="主体信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>主体信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -147,18 +141,14 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="财务信息" content="财务信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>财务信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="合同信息" content="合同信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>合同信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -170,6 +160,7 @@
</jnpf-select>
</u-form-item>
</view>
<template v-if="dataForm.procurementModel == 1">
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('relatedContractId')" :required="requiredList.relatedContractId"
label="关联销售合同" prop="relatedContractId">
@ -182,6 +173,7 @@
</jnpf-popup-select>
</u-form-item>
</view>
</template>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('subject2')&&fncGetSubject2Show" :required="requiredList.subject2"
:label="fncGetSubject2Label" prop="subject2">
@ -208,10 +200,8 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="交货和运输信息" content="交货和运输信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>交货和运输信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -252,10 +242,8 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value=" 合同条款信息" content=" 合同条款信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>合同条款信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -485,127 +473,127 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="商品明细" content="商品明细">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>商品明细
</u-form-item>
</view>
<view class="jnpf-table" v-if="judgeShow('contractLCommodityList')">
<view class="jnpf-table-item" v-for="(item,i) in dataForm.contractLCommodityList" :key="i">
<view class="jnpf-table-item-title u-flex u-row-between">
<text class="jnpf-table-item-title-num">商品明细({{i+1}})</text>
<view class="jnpf-table-item-title-action"
v-if=" !judgeWrite('contractLCommodityList') && dataForm.contractLCommodityList.length>0"
@click="delcontractlcommodityList(i)">删除</view>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-productId')"
:required="requiredList['contractlcommodityList-productId']" label="商品ID">
<jnpf-popup-select v-model="dataForm.contractLCommodityList[i].productId"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-productId')"
@change="changeData('contractlcommodity-productId',i)" :rowIndex="i"
:formData="dataForm" :templateJson="interfaceRes.contractlcommodityproductId" clearable
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='id' :vModel="'productId'+i"
:columnOptions="contractlcommodityproductIdColumnOptions"
interfaceId="530288111456878597" :pageSize="20" placeholder="请选择" type="popup"
:style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-commodityCode')"
:required="requiredList['contractlcommodityList-commodityCode']" label="商品编码">
<u-input v-model="dataForm.contractLCommodityList[i].commodityCode"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-commodityCode')"
@change="changeData('contractlcommodity-commodityCode',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-commodityName')"
:required="requiredList['contractlcommodityList-commodityName']" label="商品名称">
<u-input v-model="dataForm.contractLCommodityList[i].commodityName"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-commodityName')"
@change="changeData('contractlcommodity-commodityName',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-specifications')"
:required="requiredList['contractlcommodityList-specifications']" label="商品规格">
<u-input v-model="dataForm.contractLCommodityList[i].specifications"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-specifications')"
@change="changeData('contractlcommodity-specifications',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-inventoryUnitId')"
:required="requiredList['contractlcommodityList-inventoryUnitId']" label="库存单位">
<u-input :value="getProductUnitName(dataForm.contractLCommodityList[i].inventoryUnitId)"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-inventoryUnitId')"
@change="changeData('contractlcommodity-inventoryUnitId',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-procureUnit')"
:required="requiredList['contractlcommodityList-procureUnit']" label="采购单位">
<jnpf-select v-model="dataForm.contractLCommodityList[i].procureUnit"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-procureUnit')"
@change="changeData('contractlcommodity-procureUnit',i)" clearable placeholder="请选择"
:props="contractlcommodityprocureUnitProps"
:options="contractlcommodityprocureUnitOptions" :style='{"width":"100%"}'>
</jnpf-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-number')"
:required="requiredList['contractlcommodityList-number']" label="数量">
<u-input v-model="dataForm.contractLCommodityList[i].number"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-number')"
@change="changeData('contractlcommodity-number',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-taxRate')"
:required="requiredList['contractlcommodityList-taxRate']" label="税率">
<u-input v-model="dataForm.contractLCommodityList[i].taxRate"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-taxRate')"
@change="changeData('contractlcommodity-taxRate',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input><span style="padding: 0px 5px">%</span>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-priceRate')"
:required="requiredList['contractlcommodityList-priceRate']" label="含税单价">
<u-input v-model="dataForm.contractLCommodityList[i].priceRate"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-priceRate')"
@change="changeData('contractlcommodity-priceRate',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-totalRate')"
:required="requiredList['contractlcommodityList-totalRate']" label="含税总金额">
<u-input v-model="dataForm.contractLCommodityList[i].totalRate"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-totalRate')"
@change="changeData('contractlcommodity-totalRate',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
</view>
<u-collapse>
<u-collapse-item :title="dataForm.contractLCommodityList[i].commodityName+'(' + (i+1) + ') '" v-for="(item,i) in dataForm.contractLCommodityList" :key="i">
<!-- <view class="jnpf-table-item-title u-flex u-row-between">
<text class="jnpf-table-item-title-num">商品明细({{i+1}})</text>
<view class="jnpf-table-item-title-action"
v-if=" !judgeWrite('contractLCommodityList') && dataForm.contractLCommodityList.length>0"
@click="delcontractlcommodityList(i)">删除</view>
</view> -->
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-productId')"
:required="requiredList['contractlcommodityList-productId']" label="商品ID">
<jnpf-popup-select v-model="dataForm.contractLCommodityList[i].productId"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-productId')"
@change="changeData('contractlcommodity-productId',i)" :rowIndex="i"
:formData="dataForm" :templateJson="interfaceRes.contractlcommodityproductId" clearable
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='id' :vModel="'productId'+i"
:columnOptions="contractlcommodityproductIdColumnOptions"
interfaceId="530288111456878597" :pageSize="20" placeholder="请选择" type="popup"
:style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-commodityCode')"
:required="requiredList['contractlcommodityList-commodityCode']" label="商品编码">
<u-input v-model="dataForm.contractLCommodityList[i].commodityCode"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-commodityCode')"
@change="changeData('contractlcommodity-commodityCode',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-commodityName')"
:required="requiredList['contractlcommodityList-commodityName']" label="商品名称">
<u-input v-model="dataForm.contractLCommodityList[i].commodityName"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-commodityName')"
@change="changeData('contractlcommodity-commodityName',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-specifications')"
:required="requiredList['contractlcommodityList-specifications']" label="商品规格">
<u-input v-model="dataForm.contractLCommodityList[i].specifications"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-specifications')"
@change="changeData('contractlcommodity-specifications',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-inventoryUnitId')"
:required="requiredList['contractlcommodityList-inventoryUnitId']" label="库存单位">
<u-input :value="getProductUnitName(dataForm.contractLCommodityList[i].inventoryUnitId)"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-inventoryUnitId')"
@change="changeData('contractlcommodity-inventoryUnitId',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-procureUnit')"
:required="requiredList['contractlcommodityList-procureUnit']" label="采购单位">
<jnpf-select v-model="dataForm.contractLCommodityList[i].procureUnit"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-procureUnit')"
@change="changeData('contractlcommodity-procureUnit',i)" clearable placeholder="请选择"
:props="contractlcommodityprocureUnitProps"
:options="contractlcommodityprocureUnitOptions" :style='{"width":"100%"}'>
</jnpf-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-number')"
:required="requiredList['contractlcommodityList-number']" label="数量">
<u-input v-model="dataForm.contractLCommodityList[i].number"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-number')"
@change="changeData('contractlcommodity-number',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-taxRate')"
:required="requiredList['contractlcommodityList-taxRate']" label="税率">
<u-input v-model="dataForm.contractLCommodityList[i].taxRate"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-taxRate')"
@change="changeData('contractlcommodity-taxRate',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input><span style="padding: 0px 5px">%</span>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-priceRate')"
:required="requiredList['contractlcommodityList-priceRate']" label="含税单价">
<u-input v-model="dataForm.contractLCommodityList[i].priceRate"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-priceRate')"
@change="changeData('contractlcommodity-priceRate',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractlcommodityList-totalRate')"
:required="requiredList['contractlcommodityList-totalRate']" label="含税总金额">
<u-input v-model="dataForm.contractLCommodityList[i].totalRate"
:disabled="judgeWrite('contractLCommodityList')||judgeWrite('contractlcommodityList-totalRate')"
@change="changeData('contractlcommodity-totalRate',i)" input-align='right' clearable
placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
</u-collapse-item>
</u-collapse>
<view class="jnpf-table-addBtn" @click="addcontractlcommodityList"
v-if="!judgeWrite('contractLCommodityList')">
<u-icon name="plus" color="#2979ff"></u-icon>
@ -614,10 +602,8 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="费用条款" content="费用条款">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>费用条款
</u-form-item>
</view>
<view class="jnpf-table" v-if="judgeShow('contractLFeeClauseList')">
@ -668,10 +654,8 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="付款节点" content="付款节点">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>付款节点
</u-form-item>
</view>
<view class="jnpf-table" v-if="judgeShow('contractLPaymentList')">
@ -743,7 +727,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('totalAmount')" :required="requiredList.totalAmount" label="合计金额(人民币)"
prop="totalAmount">
prop="totalAmount" label-position="top" label-align="left">
<jnpf-number-box v-model="dataForm.totalAmount" :disabled="judgeWrite('totalAmount')"
@change="changeData('totalAmount',-1)" :precision="2" addonAfter="元" :controls="false"
placeholder="数字文本" :step="1">
@ -752,7 +736,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('amountCapitalization')" :required="requiredList.amountCapitalization"
label="大写金额(人民币)" prop="amountCapitalization">
label="大写金额(人民币)" prop="amountCapitalization" label-position="top" label-align="left">
<u-input v-model="dataForm.amountCapitalization" :disabled="judgeWrite('amountCapitalization')"
@change="changeData('amountCapitalization',-1)" input-align='right' clearable placeholder="请输入"
:style='{"width":"100%"}'>
@ -761,10 +745,8 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="其他信息" content="其他信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>其他信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -777,8 +759,7 @@
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('remark')" :required="requiredList.remark" label="备注" label-width="0"
prop="remark">
<u-form-item v-if="judgeShow('remark')" :required="requiredList.remark" label="备注" prop="remark">
<u-input v-model="dataForm.remark" :disabled="judgeWrite('remark')"
@change="changeData('remark',-1)" input-align='right' placeholder="请输入" type="textarea"
:style='{"width":"100%"}'>
@ -787,15 +768,13 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="附件信息" content="附件信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;">
</view>附件信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('contractAppendices')" :required="requiredList.contractAppendices"
label="合同附件" prop="contractAppendices">
label="合同附件" prop="contractAppendices" label-position="top" label-align="left">
<jnpf-file v-model="dataForm.contractAppendices" :disabled="judgeWrite('contractAppendices')"
@change="changeData('contractAppendices',-1)" :list="dataForm.contractAppendices"
tipText="支持格式:.rar .zip .doc .docx .pdf 单个文件不能超过20MB" sizeUnit="MB" :fileSize="20" :limit="9"
@ -805,7 +784,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('ancillaryDocuments')" :required="requiredList.ancillaryDocuments"
label="附属文件" prop="ancillaryDocuments">
label="附属文件" prop="ancillaryDocuments" label-position="top" label-align="left">
<jnpf-file v-model="dataForm.ancillaryDocuments" :disabled="judgeWrite('ancillaryDocuments')"
@change="changeData('ancillaryDocuments',-1)" :list="dataForm.ancillaryDocuments"
tipText="支持格式:.rar .zip .doc .docx .pdf 单个文件不能超过20MB" sizeUnit="MB" :fileSize="20" :limit="9"
@ -815,7 +794,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('transactionAppendices')" :required="requiredList.transactionAppendices"
label="关联交易合同(二级)" prop="transactionAppendices">
label="关联交易合同(二级)" prop="transactionAppendices" label-position="top" label-align="left">
<jnpf-file v-model="dataForm.transactionAppendices" :disabled="judgeWrite('transactionAppendices')"
@change="changeData('transactionAppendices',-1)" :list="dataForm.transactionAppendices"
tipText="支持格式:.rar .zip .doc .docx .pdf 单个文件不能超过20MB" sizeUnit="MB" :fileSize="20" :limit="9"
@ -825,7 +804,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('transactionAppendices2')" :required="requiredList.transactionAppendices2"
label="关联交易合同(三级)" prop="transactionAppendices2">
label="关联交易合同(三级)" prop="transactionAppendices2" label-position="top" label-align="left">
<jnpf-file v-model="dataForm.transactionAppendices2"
:disabled="judgeWrite('transactionAppendices2')"
@change="changeData('transactionAppendices2',-1)" :list="dataForm.transactionAppendices2"
@ -1246,7 +1225,7 @@
"multiple": false,
"children": ""
},
labelwidth: 130 * 1.5,
labelwidth: 180 * 1.5,
menuId: '',
jurisdictionType: '',
ruleList: {

@ -0,0 +1,913 @@
<template>
<view class="jnpf-wrap jnpf-wrap-form" v-if="!loading">
<u-form :model="dataForm" :rules="rules" ref="dataForm" :errorType="['toast']" label-position="left"
label-align="right" :label-width="labelwidth" class="jnpf-form">
<view class="u-p-l-20 u-p-r-20 ">
<u-form-item>
<jnpf-group value="基础信息" content="基础信息" contentPosition="left">
</jnpf-group>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('code')" :required="requiredList.code" label="单据编号" prop="code">
<u-input v-model="dataForm.code" disabled @change="changeData('code',-1)" input-align='right'
placeholder="系统自动生成" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('institutionId')" :required="requiredList.institutionId" label="费用归属"
prop="institutionId">
<jnpf-com-select v-model="dataForm.institutionId" :disabled="judgeWrite('institutionId')"
@change="changeData('institutionId',-1)" selectType="all"
:ableIds="ableAll.institutionIdableIds" clearable placeholder="请选择" type="organize"
:style='{"width":"100%"}'>
</jnpf-com-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('subjectId')" :required="requiredList.subjectId" label="往来单位"
prop="subjectId">
<jnpf-popup-select v-model="dataForm.subjectId" :disabled="judgeWrite('subjectId')"
@change="changeData('subjectId',-1)" :rowIndex="null" :formData="dataForm"
:templateJson="interfaceRes.subjectId" hasPage clearable propsValue="id" popupWidth="800px"
popupTitle="选择数据" popupType="dialog" relationField='name' vModel='subjectId'
:columnOptions="subjectIdColumnOptions" interfaceId="542305697765799941" :pageSize="20"
placeholder="请选择" type="popup" :style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('costTime')" :required="requiredList.costTime" label="费用发生时间"
prop="costTime">
<jnpf-date-time v-model="dataForm.costTime" :disabled="judgeWrite('costTime')"
@change="changeData('costTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" format="yyyy-MM-dd" clearable placeholder="请选择" type="date"
:style='{"width":"100%"}'>
</jnpf-date-time>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('businessCode')" :required="requiredList.businessCode" label="关联数据"
prop="businessCode">
<u-input v-model="dataForm.businessCode" :disabled="judgeWrite('businessCode')"
@change="changeData('businessCode',-1)" input-align='right' clearable placeholder="请输入"
:style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('costType')" :required="requiredList.costType" label="费用单类型"
prop="costType">
<jnpf-select v-model="dataForm.costType" :disabled="judgeWrite('costType')"
@change="changeData('costType',-1)" clearable placeholder="请选择" :props="costTypeProps"
:options="costTypeOptions" :style='{"width":"100%"}'>
</jnpf-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('remark')" :required="requiredList.remark" label="备注" prop="remark">
<u-input v-model="dataForm.remark" :disabled="judgeWrite('remark')"
@change="changeData('remark',-1)" input-align='right' placeholder="请输入" :maxlength="300"
type="textarea" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 ">
<u-form-item>
<jnpf-group value="费用信息" content="费用信息" contentPosition="left">
</jnpf-group>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('costProject')" :required="requiredList.costProject" label="费用项目"
prop="costProject">
<jnpf-cascader v-model="dataForm.costProject" :disabled="judgeWrite('costProject')"
@change="changeData('costProject',-1)" clearable placeholder="请选择" :props="costProjectProps"
:options="costProjectOptions" :style='{"width":"100%"}'>
</jnpf-cascader>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('type')" :required="requiredList.type" label="收付类型" prop="type">
<jnpf-radio v-model="dataForm.type" :disabled="judgeWrite('type')" @change="changeData('type',-1)"
optionType="default" direction="horizontal" :props="typeProps" :options="typeOptions">
</jnpf-radio>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('wayType')" :required="requiredList.wayType" label="付款方式" prop="wayType">
<jnpf-radio v-model="dataForm.wayType" :disabled="judgeWrite('wayType')"
@change="changeData('wayType',-1)" optionType="default" direction="horizontal"
:props="wayTypeProps" :options="wayTypeOptions">
</jnpf-radio>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('wayStatus')" :required="requiredList.wayStatus" label="付款状态"
prop="wayStatus">
<jnpf-radio v-model="dataForm.wayStatus" :disabled="judgeWrite('wayStatus')"
@change="changeData('wayStatus',-1)" optionType="default" direction="horizontal"
:props="wayStatusProps" :options="wayStatusOptions">
</jnpf-radio>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('costPrice')" :required="requiredList.costPrice" label="费用金额"
prop="costPrice">
<u-input v-model="dataForm.costPrice" :disabled="judgeWrite('costPrice')"
@change="changeData('costPrice',-1)" input-align='right' clearable placeholder="请输入"
:style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('payment')" :required="requiredList.payment" label="收付款单号" prop="payment">
<u-input v-model="dataForm.payment" :disabled="judgeWrite('payment')"
@change="changeData('payment',-1)" input-align='right' clearable placeholder="请输入"
:style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('pictures')" :required="requiredList.pictures" label="图片" prop="pictures">
<jnpf-upload v-model="dataForm.pictures" :disabled="judgeWrite('pictures')"
@change="changeData('pictures',-1)" sizeUnit="MB" :fileSize="10" :limit="1"
pathType="defaultPath" :isAccount="0" :value="dataForm.pictures">
</jnpf-upload>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('annexFile')" :required="requiredList.annexFile" label="附件文件"
prop="annexFile">
<jnpf-file v-model="dataForm.annexFile" :disabled="judgeWrite('annexFile')"
@change="changeData('annexFile',-1)" :list="dataForm.annexFile" sizeUnit="MB" :fileSize="10"
:limit="1" pathType="defaultPath" :isAccount="0">
</jnpf-file>
</u-form-item>
</view>
</u-form>
<u-modal v-model="show" :content="content" width='70%' border-radius="16"
:content-style="{fontSize: '28rpx',padding: '20rpx',lineHeight: '44rpx',textAlign: 'left'}"
:titleStyle="{padding: '20rpx'}" :confirm-style="{height: '80rpx',lineHeight: '80rpx'}" :title="title"
confirm-text="确定">
</u-modal>
</view>
</template>
<script>
import {
getDictionaryDataSelector,
getDataInterfaceRes,
getDefaultCurrentValueUserId,
getDefaultCurrentValueDepartmentId
} from '@/api/common'
import comMixin from '../../../workFlow/workFlowForm/mixin'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/index.js'
import request from '@/utils/request'
export default {
mixins: [comMixin],
data() {
return {
idList: [],
index: 0,
actionList: [],
actionListLength: false,
showAction: false,
btnLoading: false,
loading: false,
text: '提示:测试文本',
tableKey: '',
dataForm: {
id: "",
code: '',
institutionId: [],
subjectId: "",
costTime: "",
businessCode: '',
costType: "",
remark: '',
costProject: [],
type: '',
wayType: '',
wayStatus: '',
costPrice: '',
payment: '',
pictures: [],
annexFile: [],
},
rules: {
institutionId: [{
required: true,
message: '费用归属请至少选择一个',
type: 'array',
}, ],
subjectId: [{
required: true,
message: '往来单位请选择',
}, ],
costTime: [{
required: true,
message: '费用发生时间请选择',
}, ],
costType: [{
required: true,
message: '费用单类型请选择',
}, ],
remark: [{
required: true,
message: '备注请输入',
}, ],
costProject: [{
required: true,
message: '费用项目请至少选择一个',
type: 'array',
}, ],
type: [{
required: true,
message: '收付类型不能为空',
}, ],
wayType: [{
required: true,
message: '付款方式不能为空',
}, ],
wayStatus: [{
required: true,
message: '付款状态不能为空',
}, ],
costPrice: [{
required: true,
message: '费用金额请输入',
},
{
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
message: '费用金额请输入正确的金额',
},
],
pictures: [{
required: true,
message: '图片请至少选择一个',
type: 'array',
}, ],
annexFile: [{
required: true,
message: '附件文件请至少选择一个',
type: 'array',
}, ],
},
subjectIdColumnOptions: [{
"label": "类型",
"value": "subjectBasicTypes"
},
{
"label": "名称",
"value": "name"
},
],
costTypeOptions: [{
"fullName": "常规费用",
"id": "1"
}, {
"fullName": "抵扣保证金",
"id": "2"
}, {
"fullName": "抵扣利息",
"id": "3"
}, {
"fullName": "抵扣金额",
"id": "4"
}, {
"fullName": "预付款",
"id": "5"
}, {
"fullName": "预付款抵扣",
"id": "6"
}],
costTypeProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": ""
},
costProjectOptions: [{
"children": [{
"fullName": "交易服务费",
"id": "E1001"
}, {
"fullName": "保险费",
"id": "E1002"
}, {
"fullName": "包装费",
"id": "E1003"
}, {
"fullName": "运费",
"id": "E1004"
}, {
"fullName": "装卸费",
"id": "E1005"
}, {
"fullName": "服务费",
"id": "E1011"
}, {
"fullName": "管理服务费",
"id": "E1012"
}, {
"fullName": "管理服务费退回",
"id": "E1013"
}, {
"fullName": "海关税费",
"id": "E1014"
}, {
"fullName": "技术服务费",
"id": "E1015"
}, {
"fullName": "技术服务费退回",
"id": "E1016"
}, {
"fullName": "交易手续费",
"id": "E1017"
}, {
"fullName": "交易手续费-常规交易",
"id": "E1018"
}, {
"fullName": "交易手续费退回",
"id": "E1019"
}, {
"fullName": "金融服务费-预付回款",
"id": "E1020"
}, {
"fullName": "金融服务费退回-垫资回款",
"id": "E1021"
}, {
"fullName": "金融服务费-垫资回款",
"id": "E1022"
}, {
"fullName": "运费",
"id": "E1023"
}, {
"fullName": "运费退回",
"id": "E1024"
}, {
"fullName": "平台服务费-账户管理费",
"id": "E1025"
}, {
"fullName": "平台服务费-平台分销",
"id": "E1026"
}, {
"fullName": "手续费",
"id": "E1029"
}, {
"fullName": "手续费补贴",
"id": "E1030"
}, {
"fullName": "保障服务费退回-退货运费",
"id": "E1031"
}, {
"fullName": "保障服务费-退货运费",
"id": "E1032"
}, {
"fullName": "保障服务费-担保费",
"id": "E1033"
}],
"fullName": "销售服务",
"id": "E1000"
}, {
"children": [{
"fullName": "采购保证金",
"id": "E2000"
}, {
"fullName": "质量保证金",
"id": "E2001"
}, {
"fullName": "销售保证金",
"id": "E2002"
}, {
"fullName": "合作保证金",
"id": "E2003"
}],
"fullName": "保证金",
"id": "E200"
}, {
"children": [{
"fullName": "广告费",
"id": "E3001"
}, {
"fullName": "促销费用",
"id": "E3002"
}, {
"fullName": "节庆费",
"id": "E3003"
}, {
"fullName": "订单返现费用",
"id": "E3009"
}],
"fullName": "营销活动",
"id": "E3000"
}, {
"children": [{
"fullName": "赔付",
"id": "E4001"
}, {
"fullName": "水费",
"id": "E4002"
}, {
"fullName": "电费",
"id": "E4003"
}, {
"fullName": "气费",
"id": "E4004"
}, {
"fullName": "物业管理费",
"id": "E4005"
}, {
"fullName": "物料消耗",
"id": "E4006"
}, {
"fullName": "信息使用费",
"id": "E4007"
}, {
"fullName": "展览费",
"id": "E4008"
}, {
"fullName": "租赁费",
"id": "E4009"
}, {
"fullName": "修理费",
"id": "E4010"
}],
"fullName": "销售场地",
"id": "E4000"
}, {
"children": [{
"fullName": "折旧费",
"id": "E5001"
}, {
"fullName": "人员工资",
"id": "E5002"
}, {
"fullName": "职工福利费",
"id": "E5003"
}, {
"fullName": "差旅费",
"id": "E5004"
}],
"fullName": "销售人员",
"id": "E5000"
}, {
"children": [{
"fullName": "办公费",
"id": "E6001"
}, {
"fullName": "委托代销手续费",
"id": "E6002"
}, {
"fullName": "销售提成",
"id": "E6003"
}, {
"fullName": "采购奖励",
"id": "E6004"
}, {
"fullName": "佣金退回撤销-分销",
"id": "E6006"
}, {
"fullName": "佣金退回-销售员",
"id": "E6007"
}, {
"fullName": "佣金退回-分销",
"id": "E6008"
}, {
"fullName": "佣金-销售员",
"id": "E6009"
}, {
"fullName": "佣金-分销",
"id": "E6011"
}, {
"fullName": "奖励",
"id": "E6012"
}],
"fullName": "委托销售",
"id": "E6000"
}],
costProjectProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": "children"
},
typeOptions: [{
"fullName": "收款",
"id": "1"
}, {
"fullName": "付款",
"id": "2"
}],
typeProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": ""
},
wayTypeOptions: [{
"fullName": "单独收款",
"id": "1"
}, {
"fullName": "账扣",
"id": "2"
}, {
"fullName": "单据付款",
"id": "3"
}, {
"fullName": "账扣",
"id": "4"
}],
wayTypeProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": ""
},
wayStatusOptions: [{
"fullName": "未收款",
"id": "1"
}, {
"fullName": "已收款",
"id": "2"
}, {
"fullName": "未付款",
"id": "3"
}, {
"fullName": "已付款",
"id": "4"
}],
wayStatusProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": ""
},
labelwidth: 100 * 1.5,
menuId: '',
jurisdictionType: '',
ruleList: {},
interfaceRes: {
code: [],
institutionId: [],
subjectId: [],
costTime: [],
businessCode: [],
costType: [],
remark: [],
costProject: [],
type: [],
wayType: [],
wayStatus: [],
costPrice: [],
payment: [],
pictures: [],
annexFile: [],
},
regList: {},
ableAll: {
institutionIdableIds: [],
},
childIndex: -1,
dataValue: {},
isEdit: false,
userInfo: {},
formatType: {
"yyyy": "yyyy",
"yyyy-MM": "yyyy-mm",
"yyyy-MM-dd": "yyyy-mm-dd",
"yyyy-MM-dd HH:mm": "yyyy-mm-dd hh:MM",
"yyyy-MM-dd HH:mm:ss": "yyyy-mm-dd hh:MM:ss",
"HH:mm:ss": "hh:MM:ss",
"HH:mm": "hh:MM"
},
content: '',
title: '',
show: false,
}
},
onLoad(option) {
uni.$on('linkPageConfirm', (subVal) => {
if (this.tableKey) {
for (let i = 0; i < subVal.length; i++) {
let t = subVal[i]
if (this['get' + this.tableKey]) {
this['get' + this.tableKey](t)
}
}
this.childIndex = -1
this.collapse()
}
})
this.jurisdictionType = option.jurisdictionType
this.menuId = option.menuId
this.userInfo = uni.getStorageSync('userInfo') || {}
this.dataForm.id = option.id || 0
let _title = ""
if (option.jurisdictionType == 'btn_edit') {
_title = "编辑"
}
if (option.jurisdictionType == 'btn_detail') {
_title = "详情"
}
if (option.jurisdictionType == 'btn_add') {
_title = "新增"
}
if (_title) {
uni.setNavigationBarTitle({
title: _title
})
}
this.selfInit()
this.initDefaultData()
this.dataAll()
this.initData()
this.dataValue = JSON.parse(JSON.stringify(this.dataForm))
this.idList = option.idList ? option.idList.split(",") : []
for (let i = 0; i < this.idList.length; i++) {
if (this.idList[i] == option.id) {
this.index = i;
}
}
if (!option.id) {
this.actionList.push({
text: '确定并新增',
id: 'save_add'
})
} else {
let upper = {
text: '上一条',
id: 'upper',
disabled: this.index == 0 ? true : false
}
this.actionList.push(upper)
let lower = {
text: '下一条',
id: 'lower',
disabled: this.index == this.idList.length - 1 ? true : false
}
this.actionList.push(lower)
this.actionList.push({
text: '确定并继续',
id: 'save_proceed'
})
this.collapse()
}
},
onReady() {
this.$nextTick(() => {
setTimeout(() => {
this.$refs.dataForm.setRules(this.rules);
}, 100)
})
},
watch: {
dataForm: {
handler(val, oldVal) {},
deep: true
}
},
methods: {
handleAction(index) {
if (this.actionList[index].id === 'save_add' || this.actionList[index].id === 'save_proceed') {
this.submitForm(1)
} else {
this.calculation(this.actionList[index].id, index)
}
},
calculation(type, index) {
if (type === 'upper') {
this.index--
this.actionList[index + 1].disabled = false
if (this.index == 0) this.actionList[index].disabled = true
} else {
this.index++
this.actionList[index - 1].disabled = false
if (this.index == this.idList.length - 1) this.actionList[index].disabled = true
}
this.dataForm.id = this.idList[this.index]
this.initData()
},
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, edit) {
if (!edit) {
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
}
}
},
clickIcon(label, tipLabel) {
this.content = tipLabel
this.title = label
this.show = true
},
exist() {
let title = [];
let _ruleList = this.ruleList
for (let k in _ruleList) {
let childData = this.dataForm[k]
childData.forEach((item, index) => {
for (let model in _ruleList[k]) {
if (item[model] instanceof Array) {
if (item[model].length == 0) {
title.push(_ruleList[k][model])
}
} else if (!item[model]) {
title.push(_ruleList[k][model])
}
}
})
}
let _regList = this.regList
for (let k in _regList) {
let childData = this.dataForm[k]
for (let n in _regList[k]) {
for (let i = 0; i < _regList[k][n].length; i++) {
const element = _regList[k][n][i]
if (element.pattern) {
element.pattern = element.pattern.toString()
let start = element.pattern.indexOf('/')
let stop = element.pattern.lastIndexOf('/')
let str = element.pattern.substring(start + 1, stop)
let reg = new RegExp(str)
element.pattern = reg
}
childData.forEach((item, index) => {
if (item[n] && !element.pattern.test(item[n])) {
title.push(element.message)
}
})
}
}
}
if (title.length > 0) {
return title[0]
}
},
resetForm() {
uni.navigateBack()
},
dataAll() {
this.collapse()
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValueData ? timeValue : null
} 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 && timeValue) {
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;
},
initData() {
this.$nextTick(function() {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/scm/CwCost/' + this.dataForm.id,
method: 'get',
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
} else {
this.initDefaultData()
}
})
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
initDefaultData() {
if (this.userInfo.organizeIdList instanceof Array && this.userInfo.organizeIdList.length > 0) {
this.dataForm.institutionId = this.userInfo.organizeIdList
}
this.dataForm.costTime = new Date().getTime()
},
selfInit() {
this.$store.commit('base/UPDATE_RELATION_DATA', {})
this.dataAll()
this.initDefaultData()
this.collapse()
},
selfGetInfo(dataForm) {
this.dataForm.id = this.dataForm.id
this.dataInfo(dataForm)
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex = -1
this.collapse()
},
collapse() {
setTimeout(() => {}, 1000);
},
},
}
</script>
<style>
page {
background-color: #f0f2f6;
}
</style>

@ -4,10 +4,7 @@
label-align="right" :label-width="labelwidth" class="jnpf-form">
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="商品类型" content="商品类型">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>商品类型
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -15,16 +12,13 @@
prop="productTypeId">
<jnpf-radio v-model="dataForm.productTypeId" :disabled="judgeWrite('productTypeId')"
@change="changeData('productTypeId',-1)" optionType="default" direction="horizontal"
:props="productTypeIdProps" :options="productTypeIdOptions">
:props="productTypeIdProps" :options="productTypeIdOptions" :showOnly="true">
</jnpf-radio>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="基本信息" content="基本信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>基本信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -104,10 +98,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="商品特性" content="商品特性">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>商品特性
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -148,11 +139,14 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>供应链/财务信息
</u-form-item>
<!-- <u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="供应链/财务信息" content="供应链/财务信息">
</jnpf-text>
</u-form-item>
</u-form-item> -->
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('firstSupplierId')" :required="requiredList.firstSupplierId" label="首选供应商"
@ -195,10 +189,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="单位/价格信息" content="单位/价格信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>单位/价格信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -303,10 +294,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="销售信息" content="销售信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>销售信息
</u-form-item>
</view>
@ -333,10 +321,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="库存信息" content="库存信息">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>库存信息
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -397,10 +382,7 @@
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item>
<jnpf-text
:textStyle='{"color":"#62A2CB","font-weight":"bold","text-decoration":"none","font-size":16,"line-height":32,"font-style":"normal","text-align":"center"}'
value="适配业务范围" content="适配业务范围">
</jnpf-text>
<view style="float: left; width:8px; height: 16px;background-color: cadetblue;margin-right: 8px;"></view>适配业务范围
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
@ -411,7 +393,7 @@
:disabled="judgeWrite('jnpf_jg_product_business_jnpf_businessLineId')"
@change="changeData('jnpf_jg_product_business_jnpf_businessLineId',-1)" optionType="default"
direction="horizontal" :props="jnpf_jg_product_business_jnpf_businessLineIdProps"
:options="jnpf_jg_product_business_jnpf_businessLineIdOptions">
:options="jnpf_jg_product_business_jnpf_businessLineIdOptions" :showOnly="true">
</jnpf-checkbox>
</u-form-item>
</view>
@ -745,7 +727,7 @@
"multiple": false,
"children": ""
},
labelwidth: 120 * 1.5,
labelwidth: 130 * 1.5,
menuId: '',
jurisdictionType: '',
ruleList: {

@ -0,0 +1,808 @@
<template>
<view class="jnpf-wrap jnpf-wrap-form" v-if="!loading">
<u-form :model="dataForm" :rules="rules" ref="dataForm" :errorType="['toast']" label-position="left"
label-align="right" :label-width="labelwidth" class="jnpf-form">
<view class="u-p-l-20 u-p-r-20 ">
<u-form-item>
<jnpf-group value="基础信息" content="基础信息" contentPosition="left">
</jnpf-group>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('reportlossCode')" :required="requiredList.reportlossCode" label="报损单编号"
prop="reportlossCode">
<u-input v-model="dataForm.reportlossCode" disabled @change="changeData('reportlossCode',-1)"
input-align='right' placeholder="系统自动生成" :style='{"width":"100%"}' readonly>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('reportlossType')" :required="requiredList.reportlossType" label="单据类型"
prop="reportlossType">
<jnpf-select v-model="dataForm.reportlossType" :disabled="judgeWrite('reportlossType')"
@change="changeData('reportlossType',-1)" clearable placeholder="请选择"
:props="reportlossTypeProps" :options="reportlossTypeOptions" :style='{"width":"100%"}'>
</jnpf-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('reportlossTime')" :required="requiredList.reportlossTime" label="报损时间"
prop="reportlossTime">
<jnpf-date-time v-model="dataForm.reportlossTime" :disabled="judgeWrite('reportlossTime')"
@change="changeData('reportlossTime',-1)" :startTime="dateTime(false,1,1,'','')"
:endTime="dateTime(false,1,1,'','')" format="yyyy-MM-dd" clearable placeholder="请选择" type="date"
:style='{"width":"100%"}'>
</jnpf-date-time>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('reportlossReason')" :required="requiredList.reportlossReason" label="报损原因"
prop="reportlossReason">
<jnpf-select v-model="dataForm.reportlossReason" :disabled="judgeWrite('reportlossReason')"
@change="changeData('reportlossReason',-1)" clearable placeholder="请选择"
:props="reportlossReasonProps" :options="reportlossReasonOptions" :style='{"width":"100%"}'>
</jnpf-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehouseId')" :required="requiredList.warehouseId" label="仓库名称"
prop="warehouseId">
<jnpf-popup-select v-model="dataForm.warehouseId" :disabled="judgeWrite('warehouseId')"
@change="changeData('warehouseId',-1)" :rowIndex="null" :formData="dataForm"
:templateJson="interfaceRes.warehouseId" hasPage clearable propsValue="id" popupWidth="800px"
popupTitle="选择数据" popupType="dialog" relationField='name' vModel='warehouseId'
:columnOptions="warehouseIdColumnOptions" interfaceId="529617754022498181" :pageSize="20"
placeholder="请选择" type="popup" :style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('remark')" :required="requiredList.remark" label="备注" prop="remark">
<u-input v-model="dataForm.remark" :disabled="judgeWrite('remark')"
@change="changeData('remark',-1)" input-align='right' clearable placeholder="请输入"
:style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 ">
<u-form-item>
<jnpf-group value="商品信息" content="商品信息" contentPosition="left">
</jnpf-group>
</u-form-item>
</view>
<view class="jnpf-table" v-if="judgeShow('warehousingreportlossproductList')">
<view class="jnpf-table-item" v-for="(item,i) in dataForm.warehousingReportlossProductList" :key="i">
<view class="jnpf-table-item-title u-flex u-row-between">
<text class="jnpf-table-item-title-num">({{i+1}})</text>
<view class="jnpf-table-item-title-action"
v-if=" !judgeWrite('warehousingreportlossproductList') && dataForm.warehousingReportlossProductList.length>0"
@click="delwarehousingreportlossproductList(i)">删除</view>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-productId')"
:required="requiredList['warehousingreportlossproductList-productId']" label="商品名称">
<jnpf-popup-select v-model="dataForm.warehousingReportlossProductList[i].productId"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-productId')"
@change="changeData('warehousingreportlossproduct-productId',i)" :rowIndex="i"
:formData="dataForm" :templateJson="interfaceRes.warehousingreportlossproductproductId"
clearable propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='name' :vModel="'productId'+i"
:columnOptions="warehousingreportlossproductproductIdColumnOptions"
interfaceId="529994958833209925" :pageSize="20" placeholder="请选择" type="popup"
:style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-reportlossUnit')"
:required="requiredList['warehousingreportlossproductList-reportlossUnit']" label="报损单位">
<u-input v-model="dataForm.warehousingReportlossProductList[i].reportlossUnit"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-reportlossUnit')"
@change="changeData('warehousingreportlossproduct-reportlossUnit',i)"
input-align='right' clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-spec')"
:required="requiredList['warehousingreportlossproductList-spec']" label="规格">
<u-input v-model="dataForm.warehousingReportlossProductList[i].spec"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-spec')"
@change="changeData('warehousingreportlossproduct-spec',i)" input-align='right'
clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-inventoryUnitId')"
:required="requiredList['warehousingreportlossproductList-inventoryUnitId']" label="库存单位">
<u-input v-model="dataForm.warehousingReportlossProductList[i].inventoryUnitId"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-inventoryUnitId')"
@change="changeData('warehousingreportlossproduct-inventoryUnitId',i)"
input-align='right' clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-availableStock')"
:required="requiredList['warehousingreportlossproductList-availableStock']" label="可用库存">
<u-input v-model="dataForm.warehousingReportlossProductList[i].availableStock"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-availableStock')"
@change="changeData('warehousingreportlossproduct-availableStock',i)"
input-align='right' clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-reportlossNumber')"
:required="requiredList['warehousingreportlossproductList-reportlossNumber']" label="报损数量">
<u-input v-model="dataForm.warehousingReportlossProductList[i].reportlossNumber"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-reportlossNumber')"
@change="changeData('warehousingreportlossproduct-reportlossNumber',i)"
input-align='right' clearable placeholder="请输入" :style='{"width":"100%"}'>
</u-input>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-cargoId')"
:required="requiredList['warehousingreportlossproductList-cargoId']" label="货区名称">
<jnpf-popup-select v-model="dataForm.warehousingReportlossProductList[i].cargoId"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-cargoId')"
@change="changeData('warehousingreportlossproduct-cargoId',i)" :rowIndex="i"
:formData="dataForm" :templateJson="interfaceRes.warehousingreportlossproductcargoId"
hasPage clearable propsValue="id" popupWidth="800px" popupTitle="选择数据"
popupType="dialog" relationField='cargo_name' :vModel="'cargoId'+i"
:columnOptions="warehousingreportlossproductcargoIdColumnOptions"
interfaceId="530700536261903749" :pageSize="20" placeholder="请选择" type="popup"
:style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
<view class="u-p-l-20 u-p-r-20 form-item-box">
<u-form-item v-if="judgeShow('warehousingreportlossproductList-batchNumber')"
:required="requiredList['warehousingreportlossproductList-batchNumber']" label="批次号">
<jnpf-popup-select v-model="dataForm.warehousingReportlossProductList[i].batchNumber"
:disabled="judgeWrite('warehousingreportlossproductList')||judgeWrite('warehousingreportlossproductList-batchNumber')"
@change="changeData('warehousingreportlossproduct-batchNumber',i)" :rowIndex="i"
:formData="dataForm"
:templateJson="interfaceRes.warehousingreportlossproductbatchNumber" hasPage clearable
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
relationField='batchNumber' :vModel="'batchNumber'+i"
:columnOptions="warehousingreportlossproductbatchNumberColumnOptions"
interfaceId="551302018883414213" :pageSize="20" placeholder="请选择" type="popup"
:style='{"width":"100%"}'>
</jnpf-popup-select>
</u-form-item>
</view>
</view>
<view class="jnpf-table-addBtn" @click="addwarehousingreportlossproductList"
v-if="!judgeWrite('warehousingreportlossproductList')">
<u-icon name="plus" color="#2979ff"></u-icon>
<span>{{dataForm.warehousingReportlossProductList.length==0?"添加":"添加"}}</span>
</view>
</view>
</u-form>
<u-modal v-model="show" :content="content" width='70%' border-radius="16"
:content-style="{fontSize: '28rpx',padding: '20rpx',lineHeight: '44rpx',textAlign: 'left'}"
:titleStyle="{padding: '20rpx'}" :confirm-style="{height: '80rpx',lineHeight: '80rpx'}" :title="title"
confirm-text="确定">
</u-modal>
</view>
</template>
<script>
import {
getDictionaryDataSelector,
getDataInterfaceRes,
getDefaultCurrentValueUserId,
getDefaultCurrentValueDepartmentId
} from '@/api/common'
import comMixin from '../../../workFlow/workFlowForm/mixin'
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from '@/components/index.js'
import request from '@/utils/request'
export default {
mixins: [comMixin],
data() {
return {
idList: [],
index: 0,
actionList: [],
actionListLength: false,
showAction: false,
btnLoading: false,
loading: false,
text: '提示:测试文本',
tableKey: '',
dataForm: {
id: "",
reportlossCode: '',
reportlossType: "",
reportlossTime: "",
reportlossReason: "",
warehouseId: "",
remark: '',
warehousingReportlossProductList: [],
},
rules: {
reportlossType: [{
required: true,
message: '单据类型请选择',
}, ],
reportlossTime: [{
required: true,
message: '报损时间请选择',
}, ],
reportlossReason: [{
required: true,
message: '报损原因请选择',
}, ],
warehouseId: [{
required: true,
message: '仓库名称请选择',
}, ],
},
reportlossTypeOptions: [{
"fullName": "采购报损",
"id": "1"
}, {
"fullName": "销售报损",
"id": "2"
}, {
"fullName": "仓库报损",
"id": "3"
}, {
"fullName": "加工报损",
"id": "4"
}, {
"fullName": "其他报损",
"id": "5"
}],
reportlossTypeProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": ""
},
reportlossReasonOptions: [{
"fullName": "质量问题",
"id": "1"
}, {
"fullName": "客户退回",
"id": "2"
}, {
"fullName": "试用",
"id": "3"
}, {
"fullName": "临期报废",
"id": "4"
}, {
"fullName": "其他",
"id": "5"
}],
reportlossReasonProps: {
"label": "fullName",
"value": "id",
"multiple": false,
"children": ""
},
warehouseIdColumnOptions: [{
"label": "仓库名称",
"value": "name"
},
{
"label": "仓库编码",
"value": "code"
},
],
warehousingreportlossproductproductIdColumnOptions: [{
"label": "商品名称",
"value": "name"
},
{
"label": "商品编码",
"value": "code"
},
{
"label": "批次号",
"value": "batch_number"
},
],
warehousingreportlossproductcargoIdColumnOptions: [{
"label": "货区名称",
"value": "cargo_name"
}, ],
warehousingreportlossproductbatchNumberColumnOptions: [{
"label": "批次号",
"value": "batchNumber"
},
{
"label": "商品名称",
"value": "name"
},
],
labelwidth: 100 * 1.5,
menuId: '',
jurisdictionType: '',
ruleList: {
warehousingReportlossProductList: {
'cargoId': '货区名称不能为空',
'batchNumber': '批次号不能为空',
},
},
interfaceRes: {
reportlossCode: [],
reportlossType: [],
reportlossTime: [],
reportlossReason: [],
warehouseId: [],
remark: [],
warehousingreportlossproductproductId: [],
warehousingreportlossproductreportlossUnit: [],
warehousingreportlossproductspec: [],
warehousingreportlossproductinventoryUnitId: [],
warehousingreportlossproductavailableStock: [],
warehousingreportlossproductreportlossNumber: [],
warehousingreportlossproductcargoId: [{
fieldName: "",
field: "businessOrganizeId",
defaultValue: "",
jnpfKey: "popupSelect",
dataType: "varchar",
id: "AyAmdw1",
required: "0",
relationField: "warehouseId",
}, ],
warehousingreportlossproductbatchNumber: [{
fieldName: "",
field: "warehouseId",
defaultValue: "warehouseId",
jnpfKey: "popupSelect",
dataType: "varchar",
id: "TGHGo32",
required: "0",
relationField: "warehouseId",
},
{
fieldName: "",
field: "productId",
defaultValue: "productId",
jnpfKey: "popupSelect",
dataType: "varchar",
id: "SsNGo32",
required: "0",
relationField: "warehousingreportlossproductList-productId",
},
{
fieldName: "",
field: "cargoId",
defaultValue: "",
jnpfKey: "popupSelect",
dataType: "varchar",
id: "aIZs442",
required: "0",
relationField: "warehousingreportlossproductList-cargoId",
},
],
},
regList: {
warehousingReportlossProductList: {
productId: [],
reportlossUnit: [],
spec: [],
inventoryUnitId: [],
availableStock: [],
reportlossNumber: [],
cargoId: [],
batchNumber: [],
},
},
ableAll: {},
childIndex: -1,
dataValue: {},
isEdit: false,
userInfo: {},
formatType: {
"yyyy": "yyyy",
"yyyy-MM": "yyyy-mm",
"yyyy-MM-dd": "yyyy-mm-dd",
"yyyy-MM-dd HH:mm": "yyyy-mm-dd hh:MM",
"yyyy-MM-dd HH:mm:ss": "yyyy-mm-dd hh:MM:ss",
"HH:mm:ss": "hh:MM:ss",
"HH:mm": "hh:MM"
},
content: '',
title: '',
show: false,
}
},
onLoad(option) {
uni.$on('linkPageConfirm', (subVal) => {
if (this.tableKey) {
for (let i = 0; i < subVal.length; i++) {
let t = subVal[i]
if (this['get' + this.tableKey]) {
this['get' + this.tableKey](t)
}
}
this.childIndex = -1
this.collapse()
}
})
this.jurisdictionType = option.jurisdictionType
this.menuId = option.menuId
this.userInfo = uni.getStorageSync('userInfo') || {}
this.dataForm.id = option.id || 0
let _title = ""
if (option.jurisdictionType == 'btn_edit') {
_title = "编辑"
}
if (option.jurisdictionType == 'btn_detail') {
_title = "详情"
}
if (option.jurisdictionType == 'btn_add') {
_title = "新增"
}
if (_title) {
uni.setNavigationBarTitle({
title: _title
})
}
this.selfInit()
this.initDefaultData()
this.dataAll()
this.initData()
this.dataValue = JSON.parse(JSON.stringify(this.dataForm))
this.idList = option.idList ? option.idList.split(",") : []
for (let i = 0; i < this.idList.length; i++) {
if (this.idList[i] == option.id) {
this.index = i;
}
}
if (!option.id) {
this.actionList.push({
text: '确定并新增',
id: 'save_add'
})
} else {
let upper = {
text: '上一条',
id: 'upper',
disabled: this.index == 0 ? true : false
}
this.actionList.push(upper)
let lower = {
text: '下一条',
id: 'lower',
disabled: this.index == this.idList.length - 1 ? true : false
}
this.actionList.push(lower)
this.actionList.push({
text: '确定并继续',
id: 'save_proceed'
})
this.collapse()
}
},
onReady() {
this.$nextTick(() => {
setTimeout(() => {
this.$refs.dataForm.setRules(this.rules);
}, 100)
})
},
watch: {
dataForm: {
handler(val, oldVal) {
this.warehousingreportlossproduct()
},
deep: true
}
},
methods: {
handleAction(index) {
if (this.actionList[index].id === 'save_add' || this.actionList[index].id === 'save_proceed') {
this.submitForm(1)
} else {
this.calculation(this.actionList[index].id, index)
}
},
calculation(type, index) {
if (type === 'upper') {
this.index--
this.actionList[index + 1].disabled = false
if (this.index == 0) this.actionList[index].disabled = true
} else {
this.index++
this.actionList[index - 1].disabled = false
if (this.index == this.idList.length - 1) this.actionList[index].disabled = true
}
this.dataForm.id = this.idList[this.index]
this.initData()
},
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, edit) {
if (!edit) {
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
}
}
},
clickIcon(label, tipLabel) {
this.content = tipLabel
this.title = label
this.show = true
},
exist() {
let title = [];
let _ruleList = this.ruleList
for (let k in _ruleList) {
let childData = this.dataForm[k]
childData.forEach((item, index) => {
for (let model in _ruleList[k]) {
if (item[model] instanceof Array) {
if (item[model].length == 0) {
title.push(_ruleList[k][model])
}
} else if (!item[model]) {
title.push(_ruleList[k][model])
}
}
})
}
let _regList = this.regList
for (let k in _regList) {
let childData = this.dataForm[k]
for (let n in _regList[k]) {
for (let i = 0; i < _regList[k][n].length; i++) {
const element = _regList[k][n][i]
if (element.pattern) {
element.pattern = element.pattern.toString()
let start = element.pattern.indexOf('/')
let stop = element.pattern.lastIndexOf('/')
let str = element.pattern.substring(start + 1, stop)
let reg = new RegExp(str)
element.pattern = reg
}
childData.forEach((item, index) => {
if (item[n] && !element.pattern.test(item[n])) {
title.push(element.message)
}
})
}
}
}
if (title.length > 0) {
return title[0]
}
},
resetForm() {
uni.navigateBack()
},
dataAll() {
this.collapse()
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValueData ? timeValue : null
} 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 && timeValue) {
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;
},
warehousingreportlossproduct() {
let table = this.dataForm.warehousingReportlossProductList
let summaryField = []
let summaryFieldName = {}
let data = {}
let thousandsField = []
for (let i in summaryField) {
let map = {}
let val = 0
for (let j = 0; j < table.length; j++) {
let summary = table[j][summaryField[i]];
if (summary) {
let data = isNaN(summary) ? 0 : Number(summary)
val += data
}
}
map.id = summaryField[i];
map.name = summaryFieldName[summaryField[i]];
map.val = (thousandsField.includes(summaryField[i])) ? Number(val).toLocaleString('zh', {
maximumFractionDigits: '2'
}) : val;
data[summaryField[i]] = map;
}
return data;
},
initData() {
this.$nextTick(function() {
if (this.dataForm.id) {
this.loading = true
request({
url: '/api/scm/WarehousingReportloss/' + this.dataForm.id,
method: 'get',
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
} else {
this.initDefaultData()
}
})
},
beforeSubmit() {
const _data = this.dataList()
return _data
},
initDefaultData() {
this.dataForm.reportlossTime = new Date().getTime()
},
selfInit() {
this.$store.commit('base/UPDATE_RELATION_DATA', {})
this.dataAll()
this.initDefaultData()
this.collapse()
},
selfGetInfo(dataForm) {
this.dataForm.id = this.dataForm.id
this.dataInfo(dataForm)
},
addwarehousingreportlossproductList() {
let value = {}
this.tableKey = 'warehousingreportlossproductList';
this.getwarehousingreportlossproductList(value)
this.childIndex = -1
this.collapse()
},
delwarehousingreportlossproductList(index) {
var that = this
uni.showModal({
title: '提示',
content: '确认删除该条信息吗?',
success: function(res) {
if (res.confirm) {
that.dataForm.warehousingReportlossProductList.splice(index, 1);
that.collapse()
}
}
})
},
getwarehousingreportlossproductList(value) {
let item = {
productId: "",
reportlossUnit: '',
spec: '',
inventoryUnitId: '',
availableStock: '',
reportlossNumber: '',
cargoId: "",
batchNumber: "",
}
let result = {
...item,
...value
}
this.dataForm.warehousingReportlossProductList.push(result)
this.childIndex = this.dataForm.warehousingReportlossProductList.length - 1
this.isEdit = true
this.isEdit = false
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
for (let i = 0; i < _dataAll.warehousingReportlossProductList.length; i++) {
this.childIndex = i
}
this.childIndex = -1
this.collapse()
},
collapse() {
setTimeout(() => {}, 1000);
},
},
}
</script>
<style>
page {
background-color: #f0f2f6;
}
</style>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -76,6 +76,16 @@
@eventReceiver="eventReceiver"
v-if="config.formEnCode === 'produceLine'"
/>
<warehousingReportloss
ref="form"
@eventReceiver="eventReceiver"
v-if="config.formEnCode === 'warehousingReportloss'"
/>
<cwCost
ref="form"
@eventReceiver="eventReceiver"
v-if="config.formEnCode === 'costCode'"
/>
</template>
<template v-if="config.formType == 2">
<dynamicForm
@ -104,6 +114,8 @@ import bom from "@/pages/scm/form/bom/index.vue";
import warehousingInspection from "@/pages/scm/form/warehousingInspection/index.vue";
import workshopLine from "@/pages/scm/form/businessLine1/workshopLineIndex.vue";
import produceLine from "@/pages/scm/form/businessLine1/produceLineIndex.vue";
import warehousingReportloss from "@/pages/scm/form/warehousingReportloss/index.vue";
import cwCost from "@/pages/scm/form/cwCost/index.vue";
export default {
components: {
@ -121,7 +133,9 @@ export default {
bom,
warehousingInspection,
workshopLine,
produceLine
produceLine,
warehousingReportloss,
cwCost
},
props: {
config: {

@ -4,8 +4,8 @@ import cn.dev33.satoken.context.SaHolder;
import jnpf.base.UserInfo;
import jnpf.config.ConfigValueUtil;
import jnpf.database.util.NotTenantPluginHolder;
import jnpf.util.data.DataSourceContextHolder;
import jnpf.util.StringUtil;
import jnpf.util.data.DataSourceContextHolder;
import jnpf.util.UserProvider;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;

@ -2,12 +2,10 @@ package jnpf.database.config;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import jnpf.base.UserInfo;
import jnpf.constant.PermissionConst;
import jnpf.permission.entity.OrganizeEntity;
import jnpf.permission.entity.UserEntity;
import jnpf.permission.service.OrganizeService;
import jnpf.util.DateUtil;
import jnpf.util.StringUtil;

@ -26,7 +26,7 @@
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 3 THEN '退货入库' WHEN 16 THEN '销售收货单入库' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
@ -53,16 +53,15 @@
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 3 THEN '退货入库' WHEN 16 THEN '销售收货单入库' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_warehousing_notification c ON a.warehousing_id = c.id
LEFT JOIN jg_return_cargo_order f ON c.business_id = f.id
LEFT JOIN jg_business_order d ON f.business_id = d.id
LEFT JOIN jg_receipt_order c ON a.warehousing_id = c.id
LEFT JOIN jg_business_order d ON c.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type = '3'
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type = '15'
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<if test="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
and a.id not in
@ -78,18 +77,19 @@
a.warehouse_id warehouseId,
a.warehousing_time warehousingTime,
d.code orderCode,
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 3 THEN '退货入库' WHEN 16 THEN '销售收货单入库' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
case a.warehousing_outbound_type WHEN 3 THEN '退供出库' WHEN 11 THEN '采购发货单出库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_storage a
from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_receipt_order c ON a.warehousing_id = c.id
LEFT JOIN jg_business_order d ON c.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type = '15'
LEFT JOIN jg_warehousing_notification c ON a.warehousing_id = c.id
LEFT JOIN jg_return_cargo_order f ON f.id = c.business_id
LEFT JOIN jg_business_order d ON f.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type = '3'
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<if test="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
and a.id not in
@ -105,19 +105,19 @@
a.warehouse_id warehouseId,
a.warehousing_time warehousingTime,
d.code orderCode,
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_storage_type WHEN 1 THEN '采购入库' WHEN 3 THEN '退货入库' WHEN 16 THEN '销售收货单入库' WHEN 15 THEN '采购收货单入库' END warehousingStorageType,
case a.warehousing_outbound_type WHEN 3 THEN '退供出库' WHEN 11 THEN '采购发货单出库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_storage a
from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_receipt_order c ON a.warehousing_id = c.id
LEFT JOIN jg_delivery_order c ON a.warehousing_id = c.id
LEFT JOIN jg_return_cargo_order f ON f.id = c.business_id
LEFT JOIN jg_business_order d ON f.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type = '16'
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type = 11
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<if test="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
and a.id not in
@ -138,7 +138,7 @@
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 3 THEN '退供出库' WHEN 12 THEN '销售发货单出库' WHEN 11 THEN '采购发货单出库' END warehousingStorageType,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 12 THEN '销售发货单出库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
@ -165,16 +165,15 @@
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 3 THEN '退供出库' WHEN 12 THEN '销售发货单出库' WHEN 11 THEN '采购发货单出库' END warehousingStorageType,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 12 THEN '销售发货单出库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_outbound a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_warehousing_notification c ON a.warehousing_id = c.id
LEFT JOIN jg_return_cargo_order f ON f.id = c.business_id
LEFT JOIN jg_business_order d ON f.business_id = d.id
LEFT JOIN jg_delivery_order c ON a.warehousing_id = c.id
LEFT JOIN jg_business_order d ON c.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type = '3'
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type = 12
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<if test="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
and a.id not in
@ -190,18 +189,19 @@
a.warehouse_id warehouseId,
a.warehousing_time warehousingTime,
d.code orderCode,
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 3 THEN '退供出库' WHEN 12 THEN '销售发货单出库' WHEN 11 THEN '采购发货单出库' END warehousingStorageType,
case a.warehousing_storage_type WHEN 3 THEN '退货入库' WHEN 16 THEN '销售收货单入库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_outbound a
from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_delivery_order c ON a.warehousing_id = c.id
LEFT JOIN jg_business_order d ON c.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type = 12
LEFT JOIN jg_warehousing_notification c ON a.warehousing_id = c.id
LEFT JOIN jg_return_cargo_order f ON c.business_id = f.id
LEFT JOIN jg_business_order d ON f.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type = '3'
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<if test="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
and a.id not in
@ -217,19 +217,19 @@
a.warehouse_id warehouseId,
a.warehousing_time warehousingTime,
d.code orderCode,
(SELECT COUNT(1) from jg_warehousing_outbound_product WHERE warehousing_outbound_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_outbound_poundlist WHERE warehousing_outbound_id = a.id) voucherNum,
(SELECT COUNT(1) from jg_warehousing_storage_product WHERE warehousing_storage_id = a.id) skuNum,
(SELECT COUNT(1) from jg_warehousing_storage_poundlist WHERE warehousing_storage_id = a.id) voucherNum,
a.f_creator_time storageTime,
case a.warehousing_outbound_type WHEN 1 THEN '销售出库' WHEN 3 THEN '退供出库' WHEN 12 THEN '销售发货单出库' WHEN 11 THEN '采购发货单出库' END warehousingStorageType,
case a.warehousing_storage_type WHEN 3 THEN '退货入库' WHEN 16 THEN '销售收货单入库' END warehousingStorageType,
e.name warehouseName
from jg_warehousing_outbound a
from jg_warehousing_storage a
LEFT JOIN flow_task b on a.id = b.f_process_id
LEFT JOIN jg_delivery_order c ON a.warehousing_id = c.id
LEFT JOIN jg_receipt_order c ON a.warehousing_id = c.id
LEFT JOIN jg_return_cargo_order f ON f.id = c.business_id
LEFT JOIN jg_business_order d ON f.business_id = d.id
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id ${ew.customSqlSegment}
and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_outbound_type = 11
LEFT JOIN jg_business_line e ON a.warehouse_id = e.id
${ew.customSqlSegment} and a.f_delete_mark is null and a.document_no not in (SELECT document_no from jg_cw_account_storage where f_delete_mark is null)
and (b.f_status = '2' OR b.f_status is null) and a.warehousing_storage_type = '16'
and d.first_subject_basic_id = #{warehousingStoragePagination.subjectId} and d.contract_id = #{warehousingStoragePagination.contractId}
<if test="warehousingStoragePagination.excludeIdList!= null and warehousingStoragePagination.excludeIdList.size()>0">
and a.id not in

@ -3,18 +3,8 @@ package jnpf.scheduletask.task;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import jnpf.base.UserInfo;
import jnpf.base.entity.DataInterfaceEntity;
import jnpf.base.service.DataInterfaceService;
import jnpf.base.service.DbLinkService;
import jnpf.entity.*;
import jnpf.scheduletask.entity.TimeTaskEntity;
import jnpf.scheduletask.model.ContentNewModel;
import jnpf.scheduletask.model.TaskParameterModel;
import jnpf.service.*;
import jnpf.util.JsonUtil;
import jnpf.util.StringUtil;
import jnpf.util.data.DataSourceContextHolder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@ -33,5 +33,11 @@
<artifactId>jnpf-common-all</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.jnpf</groupId>
<artifactId>jnpf-file-controller</artifactId>
<version>3.5.0-RELEASE</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

@ -0,0 +1,521 @@
package jnpf.util;
import cn.hutool.http.ContentType;
import cn.hutool.poi.excel.ExcelReader;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import jnpf.base.ActionResult;
import jnpf.controller.UtilsController;
import jnpf.model.UploaderVO;
import jnpf.model.voucher.VehiclePictureFolder;
import jnpf.util.context.SpringContext;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.NumberToTextConverter;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* @Author: WangChuang
* @Date: 22/2/2023 11:00
* @Description // TODO实现文件或文件夹的复制到指定目录
* @Version 1.0
*/
public class FileCopy {
public static ArrayList<Object> getInfoAndUpFile(File[] fileList, HttpServletRequest httpServletRequest) throws Exception {
String fileName = "";
// 磅单图片对应的信息
HashMap<String, Object> fileMap = new HashMap<>();
// 车辆图片对应的信息
HashMap<String, Object> carFileMap = new HashMap<>();
HashMap<String, VehiclePictureFolder> folderHashMap = new HashMap<>();
ArrayList<Object> resultList = new ArrayList<>();
File excelFile = null;
for (int i = 0; i < fileList.length; i++) {
File file = fileList[i];
String name = file.getName();
int xlsIndex = 0;
// 将文件夹中的文件上传到文件服务器
if (file.isDirectory()) {
String path = file.getPath();
String parentName = path.substring(path.lastIndexOf("\\") + 1, path.length());
VehiclePictureFolder vehiclePictureFolder = VehiclePictureFolderUtils.getVehiclePictureFolder(parentName);
// 序号
parentName=vehiclePictureFolder.getSerialNumber();
if (!folderHashMap.containsKey(parentName)){
folderHashMap.put(parentName,vehiclePictureFolder);
}
ArrayList<Object> resultListt = getInfoAndUpFile(file.listFiles(), httpServletRequest);
if (resultListt.get(0) != null) {
fileName = fileName+String.valueOf(resultListt.get(0));
}
if (resultListt.get(1) != null) {
carFileMap.putAll ((HashMap<String, Object>) resultListt.get(1));
}
if (resultListt.get(2) != null) {
fileMap.putAll ((HashMap<String, Object>) resultListt.get(2));
}
if (resultListt.get(3)!=null){
folderHashMap.putAll((HashMap<String,VehiclePictureFolder>) resultListt.get(3));
}
}
if (file.isFile()) {
String indexString = name.substring(0, name.lastIndexOf("."));
String parent = file.getParent();
String parentName = parent.substring(parent.lastIndexOf("\\") + 1, parent.length());
VehiclePictureFolder vehiclePictureFolder = VehiclePictureFolderUtils.getVehiclePictureFolder(parentName);
// 序号
parentName=vehiclePictureFolder.getSerialNumber();
if (!folderHashMap.containsKey(parentName)){
folderHashMap.put(parentName,vehiclePictureFolder);
}
// if (parentName.contains("-")){
// parentName=parentName.substring(0,parentName.lastIndexOf("-"));
// }
String substring = name.substring(name.lastIndexOf(".") + 1, name.length());
if (substring.contains("xls") || substring.contains("xlsx")) {
// 进行word操作
excelFile = file;
xlsIndex = i;
} else {
// 这个文件图片的信息
ArrayList<Object> list = new ArrayList<>();
InputStream input = new FileInputStream(file);
// MultipartFile multipartFile = new MultipartFileDto(file.getName(),input);
MultipartFile multipartFile = new MultipartFileDto(file.getName(), file.getName(), ContentType.JSON.toString(), FileCopyUtils.copyToByteArray(input));
UtilsController utilsController = SpringContext.getBean(UtilsController.class);
ActionResult annex = utilsController.uploader("annex", multipartFile, httpServletRequest);
UploaderVO data = (UploaderVO)annex.getData();
String url = data.getUrl();
Map<String,Object> dataMap= JsonUtil.entityToMap(annex.getData());
if (!dataMap.containsKey("fileId")) {
dataMap.put("fileId",url.substring(url.lastIndexOf("/")+1,url.length()));
}
list.add(dataMap);
// 将磅单照片存在磅单列表中
if (indexString.equals("1")||indexString.equals(parentName)) {
if (fileMap.containsKey(parentName)) {
List<Object> o = (List<Object>) fileMap.get(parentName);
o.add(dataMap);
fileMap.put(parentName, o);
} else {
fileMap.put(parentName, list);
}
} else {
if (carFileMap.containsKey(parentName)) {
List<Object> o = (List<Object>) carFileMap.get(parentName);
o.add(dataMap);
carFileMap.put(parentName, o);
} else {
carFileMap.put(parentName, list);
}
}
// 将车辆照片存在车辆照片中
input.close();
}
}
if (i == fileList.length - 1) {
if (excelFile != null) {
ExcelReader reader = ExcelUtil.getReader(excelFile);
reader.setIgnoreEmptyRow(true);
// List<HashMap> read = reader.read(3, reader.read().size(), HashMap.class);
// List<Object> objects1 = reader.readRow(0);
// System.out.println(objects1);
List<Object> objects2 = reader.readColumn(0, 0, 1);
// 公司名字
// String companyStr = String.valueOf(objects2.get(0));
// companyStr=companyStr.substring(0,companyStr.lastIndexOf("公司")+2);
// 销售合同编码
String infoStr = String.valueOf(objects2.get(1));
infoStr = infoStr.replaceAll(" ", "");
// 销售合同编码
String str = infoStr.substring(7, infoStr.indexOf("采购合同编码"));
// 采购合同编码
String str3 = infoStr.substring(infoStr.lastIndexOf("") + 1, infoStr.length());
List<Object> objects = reader.readColumn(0, 3);
// 写入工具类
ExcelWriter writer = reader.getWriter();
// Workbook workbook = writer.getWorkbook();
Sheet sheet = writer.getSheet();
for (int i1 = 0; i1 < objects.size(); i1++) {
Object o = objects.get(i1);
Row row = sheet.getRow(i1 + 3);
if (String.valueOf(o).isEmpty()) {
continue;
}
//// System.out.println(row.getCell(0).getStringCellValue());
// if ( row.getCell(0).getStringCellValue().isEmpty()){
// continue;
// }
Cell cell111 = row.createCell(19);
Cell cell222 = row.createCell(20);
Cell cell333 = row.createCell(21);
Cell cell444 = row.createCell(22);
/*Cell cell6 = row.createCell(25);
Cell cell7 = row.createCell(26);
Cell cell8 = row.createCell(27);*/
Cell strCell7 = row.getCell(1);//日期时间
/*Cell cell5 = row.getCell(9);
Cell strCell1 = row.getCell(8);
Cell strCell2 = row.getCell(7);
Cell strCell3 = row.getCell(6);
Cell strCell4 = row.getCell(5);
Cell strCell5 = row.getCell(11);
Cell strCell6 = row.getCell(12);
Cell strCell7 = row.getCell(1);
Cell strCell8 = row.getCell(3);*/
if (i1 == 0) {
Row row1 = sheet.getRow(2);
Cell cell11 = row1.createCell(19);
cell11.setCellValue("业务类型");
Cell cell22 = row1.createCell(20);
cell22.setCellValue("单据类型");
Cell cell33 = row1.createCell(21);
cell33.setCellValue("凭证图片");
Cell cell44 = row1.createCell(22);
cell44.setCellValue("车辆信息");
}
Object o1 = fileMap.get(String.valueOf(o));
Object o2 = carFileMap.get(String.valueOf(o));
VehiclePictureFolder vehiclePictureFolder1 = folderHashMap.get(String.valueOf(o));
cell111.setCellValue(httpServletRequest.getParameter("businessType"));
cell222.setCellValue(httpServletRequest.getParameter("documentType"));
cell333.setCellValue(String.valueOf(o1).equals("null") ? "" : JsonUtil.getListToJsonArray((List<Map<String,Object>>)o1).toString());
cell444.setCellValue(String.valueOf(o2).equals("null") ? "" :JsonUtil.getListToJsonArray((List<Map<String,Object>>)o2).toString());
/*if (vehiclePictureFolder1!=null){
cell6.setCellValue(vehiclePictureFolder1.getDriverName()!=null?vehiclePictureFolder1.getDriverName():"");
cell7.setCellValue(vehiclePictureFolder1.getPhoneNumber()!=null?vehiclePictureFolder1.getPhoneNumber():"");
cell8.setCellValue(vehiclePictureFolder1.getCarNumber()!=null?vehiclePictureFolder1.getCarNumber():"");
}*/
String stringCellValue = VehiclePictureFolderUtils.getValue(strCell7);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//定义新的日期格式
SimpleDateFormat formatter1 = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
SimpleDateFormat formatter2 = new SimpleDateFormat("yyyy/MM/dd K:mm:ss a");//定义新的日期格式
SimpleDateFormat formatter3 = new SimpleDateFormat("yyyy.MM.dd");//定义新的日期格式
//format():将给定的 Date 格式化为日期/时间字符串。即date--->String
try {
if (stringCellValue.contains("/")){
Date date = formatter2.parse(stringCellValue);//parse():String--->date
strCell7.setCellValue(formatter.format(date));
}
else if (stringCellValue.contains("-")&&stringCellValue.contains(":")){
Date date = formatter.parse(stringCellValue);//parse():String--->date
strCell7.setCellValue(formatter.format(date));
} else if (stringCellValue.contains("-")) {
Date date = formatter1.parse(stringCellValue);//parse():String--->date
strCell7.setCellValue(formatter.format(date));
} else if (stringCellValue.contains(".")) {
Date date = formatter3.parse(stringCellValue);//parse():String--->date
strCell7.setCellValue(formatter.format(date));
}
} catch (Exception e) {
e.printStackTrace();
}
}
writer.flush(excelFile);
writer.close();
reader.close();
InputStream input = new FileInputStream(excelFile);
// MultipartFile multipartFile = new MultipartFileDto(file.getName(),input);
MultipartFile multipartFile = new MultipartFileDto(excelFile.getName(), excelFile.getName(), ContentType.JSON.toString(), FileCopyUtils.copyToByteArray(input));
UtilsController utilsController = SpringContext.getBean(UtilsController.class);
System.out.println(multipartFile.getName());
ActionResult annex = utilsController.uploader("annex", multipartFile, httpServletRequest);
if (annex.getCode() == 200) {
UploaderVO fileLoader = (UploaderVO) annex.getData();
System.out.println(fileLoader);
System.out.println(fileLoader.getName());
resultList.add(fileLoader.getName());
resultList.add(carFileMap);
resultList.add(fileMap);
resultList.add(folderHashMap);
return resultList;
}
input.close();
}
}
}
resultList.add(fileName);
resultList.add(carFileMap);
resultList.add(fileMap);
resultList.add(folderHashMap);
return resultList;
}
public static void createFile(String path) {
File file = new File(path);
if (!file.exists()) {
file.mkdirs();
}
}
/**
* @param path
* @return
* @TODO
*/
public static boolean delAllFile(String path) {
boolean flag = false;
File file = new File(path);
if (!file.exists()) {
return flag;
}
if (!file.isDirectory()) {
return flag;
}
String[] tempList = file.list();
File temp = null;
for (int i = 0; i < tempList.length; i++) {
if (path.endsWith(File.separator)) {
temp = new File(path + tempList[i]);
} else {
temp = new File(path + File.separator + tempList[i]);
}
if (temp.isFile()) {
temp.delete();
}
if (temp.isDirectory()) {
delAllFile(path + "/" + tempList[i]);//先删除文件夹里面的文件
// delFolder(path + "/" + tempList[i]);//再删除空文件夹
flag = true;
}
}
return flag;
}
/**
* base64
*
* @param picturesInfo
* @return
* @throws Exception
*/
public static List<Map<String, Object>> getImageInfo(String picturesInfo) throws Exception {
List<Map<String, Object>> imageBaseList = new ArrayList<>();
if (!picturesInfo.equals("null")) {
for (Object o : JsonUtil.getJsonToJsonArray(picturesInfo)) {
Map<String, String> map = (Map<String, String>) o;
String url = map.get("url");
// System.out.println(url);
String fileName=url.substring(url.lastIndexOf("/")+1,url.length());
int i = url.indexOf("/", 16);
String type = url.substring(16, i);
// System.out.println("type"+type);
// System.out.println("type.toLowerCase()"+type.toLowerCase());
// String fileId = map.get("name");
// 本地文件路径
String filePath = FilePathUtil.getFilePath(type.toLowerCase()) + fileName;
// 获得图片的base64码
String imageBase = FileCopy.getImageBase(filePath);
int[] imgWidthHeight = FileCopy.getImgWidthHeight(filePath);
HashMap<String, Object> map1 = new HashMap<>();
map1.put("imgBase", imageBase);
map1.put("name", fileName);
map1.put("filePath", filePath);
if (imgWidthHeight != null) {
map1.put("width", String.valueOf(imgWidthHeight[0]));
map1.put("height", String.valueOf(imgWidthHeight[1]));
}
imageBaseList.add(map1);
// System.out.println(filePath);
// System.out.println(imageBase);
}
}
return imageBaseList;
}
/**
*
*
* @param
* @return
*/
public static int[] getImgWidthHeight(String srcc) {
if (srcc == null || srcc == "") {
return null;
}
File file = new File(srcc);
if (!file.exists()) {
return null;
}
InputStream is = null;
BufferedImage src = null;
int result[] = {0, 0};
try {
// 获得文件输入流
is = new FileInputStream(file);
// 从流里将图片写入缓冲图片区
src = ImageIO.read(is);
result[0] = src.getWidth(null); // 得到源图片宽
result[1] = src.getHeight(null);// 得到源图片高
is.close(); //关闭输入流
src = null;
} catch (Exception ef) {
ef.printStackTrace();
}
System.gc();
return result;
}
//获得图片的base64码
public static String getImageBase(String src) throws Exception {
if (src == null || src == "") {
return "";
}
File file = new File(src);
if (!file.exists()) {
return "";
}
InputStream in = null;
byte[] data = null;
try {
in = new FileInputStream(file);
data = new byte[in.available()];
in.read(data);
in.close();
} catch (IOException e) {
e.printStackTrace();
}
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(data);
}
public static String setSteColumn(Cell cell){
String cellValue=null;
// 判断数据的类型
switch ( cell.getCellType()) {
case NUMERIC: // 数字
cellValue = String.valueOf(cell.getNumericCellValue());
break;
case STRING: // 字符串
cellValue = String.valueOf(cell.getStringCellValue());
break;
case BOOLEAN: // Boolean
cellValue = String.valueOf(cell.getBooleanCellValue());
break;
case FORMULA: // 公式
cellValue =NumberToTextConverter.toText(cell.getNumericCellValue());//重点,无精度缺失的确切值.
break;
case BLANK: // 空值
cellValue = "";
break;
case ERROR: // 故障
cellValue = "非法字符";
break;
default:
cellValue = "未知类型";
break;
}
return cellValue;
}
public static void copySCMFile(File source, String dest) throws IOException {
File parentFile = source.getParentFile();
if (!parentFile.exists()) {
parentFile.mkdirs();
copyFile(source, dest);
} else {
copyFile(source, dest);
}
}
public static void copyFile(File source, String dest) throws IOException {
if (source.exists()) {
//创建目的地文件夹
File destfile = new File(dest);
if (!destfile.exists()) {
destfile.mkdir();
}
//如果source是文件夹则在目的地址中创建新的文件夹
if (source.isDirectory()) {
File file = new File(dest + "\\" + source.getName());//用目的地址加上source的文件夹名称创建新的文件夹
file.mkdir();
//得到source文件夹的所有文件及目录
File[] files = source.listFiles();
if (files.length == 0) {
return;
} else {
for (int i = 0; i < files.length; i++) {
copyFile(files[i], file.getPath());
}
}
}
//source是文件则用字节输入输出流复制文件
else if (source.isFile()) {
FileInputStream fis = new FileInputStream(source);
//创建新的文件,保存复制内容,文件名称与源文件名称一致
File dfile = new File(dest + "\\" + source.getName());
if (!dfile.exists()) {
dfile.createNewFile();
}
FileOutputStream fos = new FileOutputStream(dfile);
// 读写数据
// 定义数组
byte[] b = new byte[1024];
// 定义长度
int len;
// 循环读取
while ((len = fis.read(b)) != -1) {
// 写出数据
fos.write(b, 0, len);
}
//关闭资源
fos.close();
fis.close();
}
}
}
}

@ -0,0 +1,117 @@
package jnpf.util;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
/**
* @Author: WangChuang
* @Date: 18/2/2023 1:50
* @Description //注释:
* fileMultipartFileMockMultipartFile
* * spring-test
* * MultipartFile
* * MockMultipartFile
* @Version 1.0
*/
public class MultipartFileDto implements MultipartFile {
private final String name;
private String originalFilename;
private String contentType;
private final byte[] content;
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param content the content of the file
*/
public MultipartFileDto(String name, byte[] content) {
this(name, "", null, content);
}
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param contentStream the content of the file as stream
* @throws IOException if reading from the stream failed
*/
public MultipartFileDto(String name, InputStream contentStream) throws IOException {
this(name, "", null, FileCopyUtils.copyToByteArray(contentStream));
}
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param originalFilename the original filename (as on the client's machine)
* @param contentType the content type (if known)
* @param content the content of the file
*/
public MultipartFileDto(String name, String originalFilename, String contentType, byte[] content) {
this.name = name;
this.originalFilename = (originalFilename != null ? originalFilename : "");
this.contentType = contentType;
this.content = (content != null ? content : new byte[0]);
}
/**
* Create a new MultipartFileDto with the given content.
* @param name the name of the file
* @param originalFilename the original filename (as on the client's machine)
* @param contentType the content type (if known)
* @param contentStream the content of the file as stream
* @throws IOException if reading from the stream failed
*/
public MultipartFileDto(String name, String originalFilename, String contentType, InputStream contentStream)
throws IOException {
this(name, originalFilename, contentType, FileCopyUtils.copyToByteArray(contentStream));
}
@Override
public String getName() {
return this.name;
}
@Override
public String getOriginalFilename() {
return this.originalFilename;
}
@Override
public String getContentType() {
return this.contentType;
}
@Override
public boolean isEmpty() {
return (this.content.length == 0);
}
@Override
public long getSize() {
return this.content.length;
}
@Override
public byte[] getBytes() throws IOException {
return this.content;
}
@Override
public InputStream getInputStream() throws IOException {
return new ByteArrayInputStream(this.content);
}
@Override
public void transferTo(File dest) throws IOException, IllegalStateException {
FileCopyUtils.copy(this.content, dest);
}
}

@ -0,0 +1,145 @@
package jnpf.util;
import jnpf.model.voucher.VehiclePictureFolder;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Pattern;
/**
* @Author: WangChuang
* @Date: 3/4/2023 2:01
* @Description //注释:
* @Version 1.0
*/
public class VehiclePictureFolderUtils {
/**
*
* @param str
* @return
*/
public static VehiclePictureFolder getVehiclePictureFolder(String str){
str=str.trim();
VehiclePictureFolder vehiclePictureFolder = new VehiclePictureFolder();
String charStr = getCharStr(str);
vehiclePictureFolder.setSerialNumber(charStr);
String substring = str.substring(str.indexOf(vehiclePictureFolder.getSerialNumber()) + vehiclePictureFolder.getSerialNumber().length(), str.length() );
String carRegex="^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[警京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{0,1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$";
String phoneRegex="0?(13|14|15|16|18|17|19)[0-9]{9}";
String charRegex="[A-Z0-9]{1}";
if (substring.length()>=7){
for (int i = 0; i <= substring.length()-7; i++) {
String carNumber = StringUtil.substring(substring, i, i + 7);
if ( Pattern.matches(carRegex, carNumber)){
String charValue = StringUtil.substring(substring, i+7, i + 8);
if (Pattern.matches(charRegex, charValue)){
vehiclePictureFolder.setCarNumber(carNumber+charValue);
}else {
vehiclePictureFolder.setCarNumber(carNumber);
}
break;
}
}
if (vehiclePictureFolder.getCarNumber()!=null){
String substring1 = substring.substring(0, substring.indexOf(vehiclePictureFolder.getCarNumber()));
String substring2 = substring.substring(substring.indexOf(vehiclePictureFolder.getCarNumber()) + vehiclePictureFolder.getCarNumber().length(), substring.length() );
substring=substring1+substring2;
if (substring1.length()>0){
substring=substring.replaceAll(substring1,"");
}
}
if (substring.length()>=11){
for (int i = 0; i <= substring.length()-11; i++) {
String phone = StringUtil.substring(substring, i, i + 11);
if ( Pattern.matches(phoneRegex, phone)){
vehiclePictureFolder.setPhoneNumber(phone);
break;
}
}
if (vehiclePictureFolder.getPhoneNumber()!=null){
String substring1 = substring.substring(0, substring.indexOf(vehiclePictureFolder.getPhoneNumber()));
String substring2 = substring.substring(substring.indexOf(vehiclePictureFolder.getPhoneNumber()) + vehiclePictureFolder.getPhoneNumber().length(), substring.length() );
substring=substring1+substring2;
}
if (substring.length()>=2){
vehiclePictureFolder.setDriverName(substring);
}
}else {
vehiclePictureFolder.setDriverName(substring);
}
}
return vehiclePictureFolder;
}
/*@Test
public void test1(){ //System.out.println(
System.out.println( VehiclePictureFolderUtils.getVehiclePictureFolder("2-皖D39239F-王柴油-13955463796"));
// String a=" 济钢集团/济钢城市矿产科技有限公司/再生资源事业部 ";
// System.out.println(StringUtil.indexOf(a, "/", 6));
}*/
public static String getValue(Cell cell) {
if (cell.getCellType() == CellType.BOOLEAN) {
return String.valueOf(cell.getBooleanCellValue());
} else if (cell.getCellType() == CellType.NUMERIC) {
//20180622,支持日期格式
if(HSSFDateUtil.isCellDateFormatted(cell)){
Date d = (Date) cell.getDateCellValue();
DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//HH:mm:ss
return df2.format(d);
}
//数字
else{
//使用DecimalFormat对double进行了格式化随后使用format方法获得的String就是你想要的值了。
DecimalFormat df = new DecimalFormat("0");
return String.valueOf(df.format(cell.getNumericCellValue()));
}
} else {
return String.valueOf(cell.getStringCellValue());
}
}
public static String getCharStr(String str){
StringBuffer stringBuffer = new StringBuffer();
char[] bytes = str.toCharArray();
for (int i = 0; i < bytes.length; i++) {
char aByte = bytes[i];
boolean isNumber=false;
switch (aByte){
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
isNumber=true;
break;
default:
isNumber=false;
break;
}
if (isNumber){
stringBuffer.append(aByte);
}else {
break;
}
}
return stringBuffer.toString();
}
}

@ -35,6 +35,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.util.Base64Util;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
@ -43,6 +44,8 @@ import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
@ -1334,4 +1337,242 @@ public class VoucherController {
}
@PostMapping("/Uploader")
public ActionResult Uploader(HttpServletRequest httpServletRequest, @RequestParam("businessType") String businessType, @RequestParam("documentType") String documentType) throws Exception {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String date = simpleDateFormat.format(new Date());
List<MultipartFile> list = UpUtil.getFileAll();
MultipartFile file = list.get(0);
if (file.getOriginalFilename().endsWith(".zip")) {
String s = UUID.randomUUID().toString();
cn.hutool.core.io.FileUtil.del(new File(configValueUtil.getTemporaryFilePath() + "unzip\\" + s + "\\"));
String filePath = configValueUtil.getTemporaryFilePath() + "unzip\\" + s + "\\";
//上传文件
File temporaryFile = new File(filePath);
if (!temporaryFile.exists()) {
temporaryFile.mkdirs();
}
InputStream inputStream = file.getInputStream();
File gbk = cn.hutool.core.util.ZipUtil.unzip(inputStream, temporaryFile, Charset.forName("GBK"));
List<Object> resultList = null;
System.out.println(gbk.listFiles());
try {
resultList = FileCopy.getInfoAndUpFile(gbk.listFiles(), httpServletRequest);
} catch (Exception e) {
log.info("loadProperties IOException:" + e.getMessage());
return ActionResult.fail("上传文件不符合导入规则或文件夹里面有错误文件");
}
inputStream.close();
DownloadVO vo = DownloadVO.builder().build();
Optional<List<Object>> userOptional = Optional.ofNullable(resultList);
userOptional.ifPresent(o -> vo.setName(String.valueOf(o.get(0))));
return ActionResult.success(vo);
} else {
return ActionResult.fail("选择文件不符合导入");
}
}
/**
*
*
* @return
*/
@Operation(summary = "模板下载")
@GetMapping("/TemplateDownload")
public ActionResult<DownloadVO> TemplateDownload(){
DownloadVO vo = DownloadVO.builder().build();
UserInfo userInfo = userProvider.get();
Map<String, Object> dataMap = new HashMap<>();
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("凭证编号" ,"voucherCode"));
dataMap.put("voucherCode", "系统自动生成");
entitys.add(new ExcelExportEntity("凭证类型" ,"voucherType"));
entitys.add(new ExcelExportEntity("制单时间" ,"preparationTime"));
dataMap.put("preparationTime", "例: yyyy-MM-dd");
entitys.add(new ExcelExportEntity("磅单编号" ,"poundCode"));
entitys.add(new ExcelExportEntity("车牌号" ,"vehicleName"));
entitys.add(new ExcelExportEntity("发货单位" ,"supplierName"));
entitys.add(new ExcelExportEntity("收货单位" ,"customerName"));
entitys.add(new ExcelExportEntity("运输方式" ,"modeTransport"));
entitys.add(new ExcelExportEntity("承运方式" ,"transportationMethod"));
entitys.add(new ExcelExportEntity("承运商" ,"carrier"));
entitys.add(new ExcelExportEntity("起运地" ,"placeDispatch"));
dataMap.put("placeDispatch", "例:福建省/莆田市/城厢区");
entitys.add(new ExcelExportEntity("到达地" ,"destination"));
dataMap.put("destination", "例:福建省/莆田市/城厢区");
entitys.add(new ExcelExportEntity("运费" ,"freight"));
entitys.add(new ExcelExportEntity("关联单据号" ,"associatedDocumentNo"));
entitys.add(new ExcelExportEntity("单据类型" ,"documentType"));
entitys.add(new ExcelExportEntity("凭证状态" ,"voucherStatus"));
//tableField111子表对象
ExcelExportEntity tableField111ExcelEntity = new ExcelExportEntity("","tableField111");
List<ExcelExportEntity> tableField111ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField111ChildData = new HashMap<>();
List<Map<String, Object>> tableField111ChildDataList = new ArrayList<>();
tableField111ExcelEntityList.add(new ExcelExportEntity("规格" ,"spec"));
tableField111ExcelEntityList.add(new ExcelExportEntity("单位" ,"unit"));
tableField111ExcelEntityList.add(new ExcelExportEntity("毛重" ,"grossWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("皮重" ,"tareWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("扣重" ,"buckleWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("净重" ,"netWeight"));
tableField111ExcelEntityList.add(new ExcelExportEntity("备注" ,"remark"));
tableField111ExcelEntityList.add(new ExcelExportEntity("打印时间" ,"printTime"));
tableField111ChildData.put("printTime", "例: yyyy-MM-dd");
tableField111ChildDataList.add(tableField111ChildData);
dataMap.put("tableField111",tableField111ChildDataList);
tableField111ExcelEntity.setList(tableField111ExcelEntityList);
entitys.add(tableField111ExcelEntity);
//tableField140子表对象
ExcelExportEntity tableField140ExcelEntity = new ExcelExportEntity("","tableField140");
List<ExcelExportEntity> tableField140ExcelEntityList = new ArrayList<>();
Map<String, Object> tableField140ChildData = new HashMap<>();
List<Map<String, Object>> tableField140ChildDataList = new ArrayList<>();
tableField140ExcelEntityList.add(new ExcelExportEntity("驾驶员名称" ,"driverName"));
tableField140ExcelEntityList.add(new ExcelExportEntity("联系电话" ,"telephone"));
tableField140ExcelEntityList.add(new ExcelExportEntity("承运商" ,"carrier"));
tableField140ChildDataList.add(tableField140ChildData);
dataMap.put("tableField140",tableField140ChildDataList);
tableField140ExcelEntity.setList(tableField140ExcelEntityList);
entitys.add(tableField140ExcelEntity);
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
ExportParams exportParams = new ExportParams(null, "凭证单模板");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
if (entitys.size()>0){
if (list.size()==0){
list.add(new HashMap<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(VoucherConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
list = VisualUtils.complexHeaderDataHandel(list, complexHeaderList);
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "凭证单模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
vo.setName(fileInfo.getFilename());
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName);
} catch (Exception e) {
log.error("模板信息导出Excel错误:{}", e.getMessage());
e.printStackTrace();
}
return ActionResult.success(vo);
}
/**
*
*
* @return
*/
@Operation(summary = "导入预览" )
@GetMapping("/ImportPreview")
public ActionResult<Map<String, Object>> ImportPreview(String fileName) throws Exception {
fileName = "6642d1dc64a4fc5279e1560b.xls";
Map<String, Object> headAndDataMap = new HashMap<>(2);
String filePath = FileUploadUtils.getLocalBasePath() + configValueUtil.getWebAnnexFilePath();
FileUploadUtils.downLocal(configValueUtil.getTemporaryFilePath(), filePath, fileName);
File temporary = new File(XSSEscape.escapePath(filePath + fileName));
int headerRowIndex = 1;
ImportParams params = new ImportParams();
params.setTitleRows(0);
params.setHeadRows(headerRowIndex);
params.setNeedVerify(true);
try {
List<VoucherExcelVO222> excelDataList = ExcelImportUtil.importExcel(temporary, VoucherExcelVO222.class, params);
//List<VoucherExcelVO222> excelDataList = ExcelUtil.importExcel(temporary, 2, 1, VoucherExcelVO222.class);
// 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>();
columns.add(new ExcelImFieldModel("businessType","业务类型"));
columns.add(new ExcelImFieldModel("documentType","单据类型"));
//columns.add(new ExcelImFieldModel("voucherCode","凭证编号"));
columns.add(new ExcelImFieldModel("voucherType","凭证类型"));
columns.add(new ExcelImFieldModel("voucherSource","凭证来源"));
columns.add(new ExcelImFieldModel("voucherStatus","凭证状态"));
columns.add(new ExcelImFieldModel("poundlistTime","磅单时间"));
columns.add(new ExcelImFieldModel("preparationTime","制单时间"));
columns.add(new ExcelImFieldModel("poundCode","磅单编号"));
columns.add(new ExcelImFieldModel("vehicleName","车牌号"));
columns.add(new ExcelImFieldModel("supplierName","发货单位"));
columns.add(new ExcelImFieldModel("customerName","收货单位"));
columns.add(new ExcelImFieldModel("modeTransport","运输方式"));
columns.add(new ExcelImFieldModel("transportationMethod","承运方式"));
columns.add(new ExcelImFieldModel("carrier","承运商"));
columns.add(new ExcelImFieldModel("placeDispatch","起运地"));
columns.add(new ExcelImFieldModel("destination","到达地"));
columns.add(new ExcelImFieldModel("freight","运费"));
columns.add(new ExcelImFieldModel("associatedDocumentNo","关联单据号"));
columns.add(new ExcelImFieldModel("voucherStatus","凭证状态"));
//tableField111子表对象
List<ExcelImFieldModel> tableField111columns = new ArrayList<>();
tableField111columns.add(new ExcelImFieldModel("spec" ,"规格"));
tableField111columns.add(new ExcelImFieldModel("unit" ,"单位"));
tableField111columns.add(new ExcelImFieldModel("grossWeight" ,"毛重"));
tableField111columns.add(new ExcelImFieldModel("tareWeight" ,"皮重"));
tableField111columns.add(new ExcelImFieldModel("buckleWeight" ,"扣重"));
tableField111columns.add(new ExcelImFieldModel("netWeight" ,"净重"));
tableField111columns.add(new ExcelImFieldModel("remark" ,"备注"));
tableField111columns.add(new ExcelImFieldModel("printTime" ,"打印时间"));
columns.add(new ExcelImFieldModel("tableField111","",tableField111columns));
//tableField140子表对象
List<ExcelImFieldModel> tableField140columns = new ArrayList<>();
tableField140columns.add(new ExcelImFieldModel("driverName" ,"驾驶员名称"));
tableField140columns.add(new ExcelImFieldModel("telephone" ,"联系电话"));
tableField140columns.add(new ExcelImFieldModel("carrier" ,"承运商"));
columns.add(new ExcelImFieldModel("tableField140","",tableField140columns));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){
e.printStackTrace();
return ActionResult.fail("表头名称不可更改,表头行不能删除");
}
return ActionResult.success(headAndDataMap);
}
/**
*
*
* @return
*/
@Operation(summary = "导入数据" )
@PostMapping("/ImportData")
public ActionResult<ExcelImportModel> ImportData(@RequestBody VisualImportModel visualImportModel) throws Exception {
List<Map<String, Object>> listData=new ArrayList<>();
for(Map<String, Object> map : visualImportModel.getList()){
listData.add(map);
}
ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel();
uniqueModel.setDbLinkId(VoucherConstant.DBLINKID);
uniqueModel.setUpdate(Objects.equals("2", "2"));
uniqueModel.setFlowId(visualImportModel.getFlowId()); ExcelImportModel excelImportModel = generaterSwapUtil.importData(VoucherConstant.getFormData(),listData,uniqueModel,
VoucherConstant.TABLEFIELDKEY,VoucherConstant.getTableList());
List<ImportDataModel> importDataModel = uniqueModel.getImportDataModel();
for (ImportDataModel model : importDataModel) {
String id = model.getId();
Map<String, Object> result = model.getResultData();
if(StringUtil.isNotEmpty(id)){
update(id, JsonUtil.getJsonToBean(result,VoucherForm.class), true);
}else {
create(RandomUtil.uuId(), JsonUtil.getJsonToBean(result,VoucherForm.class));
}
}
return ActionResult.success(excelImportModel);
}
}

@ -0,0 +1,23 @@
package jnpf.model.voucher;
import lombok.Data;
/**
* @Author: WangChuang
* @Date: 3/4/2023 1:50
* @Description //注释: 车辆图片的文件夹获取的信息
* @Version 1.0
*/
@Data
public class VehiclePictureFolder {
/**序号 **/
private String serialNumber;
/**车牌号**/
private String carNumber;
/**司机名字**/
private String driverName;
/**手机号**/
private String phoneNumber;
}

@ -0,0 +1,22 @@
package jnpf.model.voucher;
import lombok.Data;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* Voucher
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-05-10
*/
@Data
public class VoucherExcelErrorVO extends VoucherExcelVO{
@Excel(name = "异常原因",orderNum = "999")
@JSONField(name = "errorsInfo")
private String errorsInfo;
}

@ -0,0 +1,115 @@
package jnpf.model.voucher;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* Voucher
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-05-10
*/
@Data
public class VoucherExcelVO{
/** 凭证编号 **/
@JSONField(name = "voucherCode")
@Excel(name = "凭证编号" )
private String voucherCode;
/** 凭证类型 **/
@JSONField(name = "voucherType")
@Excel(name = "凭证类型")
private String voucherType;
/** 制单时间 **/
@JSONField(name = "preparationTime")
@Excel(name = "制单时间" )
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private String preparationTime;
/** 磅单编号 **/
@JSONField(name = "poundCode")
@Excel(name = "磅单编号" )
private String poundCode;
/** 车牌号 **/
@JSONField(name = "vehicleName")
@Excel(name = "车牌号" )
private String vehicleName;
/** 发货单位 **/
@JSONField(name = "supplierName")
@Excel(name = "发货单位" )
private String supplierName;
/** 收货单位 **/
@JSONField(name = "customerName")
@Excel(name = "收货单位" )
private String customerName;
/** 运输方式 **/
@JSONField(name = "modeTransport")
@Excel(name = "运输方式" )
private String modeTransport;
/** 承运方式 **/
@JSONField(name = "transportationMethod")
@Excel(name = "承运方式" )
private String transportationMethod;
/** 承运商 **/
@JSONField(name = "carrier")
@Excel(name = "承运商" )
private String carrier;
/** 起运地 **/
@JSONField(name = "placeDispatch")
@Excel(name = "起运地" )
private String placeDispatch;
/** 到达地 **/
@JSONField(name = "destination")
@Excel(name = "到达地" )
private String destination;
/** 运费 **/
@JSONField(name = "freight")
@Excel(name = "运费" )
private String freight;
/** 关联单据号 **/
@JSONField(name = "associatedDocumentNo")
@Excel(name = "关联单据号" )
private String associatedDocumentNo;
/** 单据类型 **/
@JSONField(name = "documentType")
@Excel(name = "单据类型")
private String documentType;
/** 凭证状态 **/
@JSONField(name = "voucherStatus")
@Excel(name = "凭证状态" )
private String voucherStatus;
@JsonProperty("tableField111")
@ExcelCollection(name="",orderNum = "8")
private List<VoucherproductExcelVO> tableField111;
@JsonProperty("tableField140")
@ExcelCollection(name="",orderNum = "3")
private List<VouchervehicleExcelVO> tableField140;
}

@ -0,0 +1,27 @@
package jnpf.model.voucher;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import java.util.List;
/**
*
* Voucher
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-05-10
*/
@Data
public class VoucherExcelVO222 {
/** 凭证类型 **/
@Excel(name = "凭证类型")
private String voucherType;
/** 单据类型 **/
@Excel(name = "单据类型")
private String documentType;
}

@ -0,0 +1,66 @@
package jnpf.model.voucher;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* Voucher
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-05-10
*/
@Data
public class VoucherproductExcelVO{
/** 规格 **/
@JSONField(name = "spec")
@Excel(name = "规格",orderNum = "1", isImportField = "true" )
private String spec;
/** 单位 **/
@JSONField(name = "unit")
@Excel(name = "单位",orderNum = "1", isImportField = "true" )
private String unit;
/** 毛重 **/
@JSONField(name = "grossWeight")
@Excel(name = "毛重",orderNum = "1", isImportField = "true" )
private String grossWeight;
/** 皮重 **/
@JSONField(name = "tareWeight")
@Excel(name = "皮重",orderNum = "1", isImportField = "true" )
private String tareWeight;
/** 扣重 **/
@JSONField(name = "buckleWeight")
@Excel(name = "扣重",orderNum = "1", isImportField = "true" )
private String buckleWeight;
/** 净重 **/
@JSONField(name = "netWeight")
@Excel(name = "净重",orderNum = "1", isImportField = "true" )
private String netWeight;
/** 备注 **/
@JSONField(name = "remark")
@Excel(name = "备注",orderNum = "1", isImportField = "true" )
private String remark;
/** 打印时间 **/
@JSONField(name = "printTime")
@Excel(name = "打印时间",orderNum = "1", isImportField = "true" )
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private String printTime;
}

@ -0,0 +1,40 @@
package jnpf.model.voucher;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* Voucher
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-05-10
*/
@Data
public class VouchervehicleExcelVO{
/** 驾驶员名称 **/
@JSONField(name = "driverName")
@Excel(name = "驾驶员名称",orderNum = "1", isImportField = "true" )
private String driverName;
/** 联系电话 **/
@JSONField(name = "telephone")
@Excel(name = "联系电话",orderNum = "1", isImportField = "true" )
private String telephone;
/** 承运商 **/
@JSONField(name = "carrier")
@Excel(name = "承运商",orderNum = "1", isImportField = "true" )
private String carrier;
}

@ -16,8 +16,8 @@
<p class="tip">文件后缀名必须是xls或xlsx文件大小不超过500KB最多支持导入1000条数据</p>
<el-upload :action="actionUrl" :headers="{ Authorization: $store.getters.token}"
:on-success="handleSuccess" :on-remove="handleRemove" :before-remove="beforeRemove"
:on-change="handleChange" :file-list="fileList" accept=".xls,.xlsx"
:before-upload="beforeUpload" class="upload-area">
:on-change="handleChange" :file-list="fileList" accept=".xls,.xlsx,.zip"
:before-upload="beforeUpload" class="upload-area" :data="uploadObjs">
<el-button type="text">上传文件</el-button>
</el-upload>
</div>
@ -164,6 +164,10 @@ export default {
snum: 0,
fnum: 0
},
uploadObjs: {
businessType: '',
documentType: ''
},
modelId: "",
url: '',
actionUrl: '',
@ -174,7 +178,13 @@ export default {
}
},
methods: {
init(modelId, url, enableFlow, flowList) {
init(modelId, url, enableFlow, flowList, businessType, documentType) {
if(businessType && businessType != ''){
this.uploadObjs.businessType = businessType
}
if(documentType && documentType != ''){
this.uploadObjs.documentType = documentType
}
this.active = 1
this.fileList = []
this.fileName = ''
@ -187,8 +197,8 @@ export default {
this.url = url ? url : `visualdev/OnlineDev/${this.modelId}`
},
beforeUpload(file) {
let isRightSize = file.size / 1024 < 500
if (!isRightSize) this.$message.error(`文件大小不能超过500KB`)
let isRightSize = file.size / 1024 / 1024 < 100
if (!isRightSize) this.$message.error(`文件大小不能超过100MB`)
return isRightSize
},
handleRemove(file, fileList) {
@ -331,4 +341,4 @@ export default {
.import-main-overflow {
overflow: unset;
}
</style>
</style>

@ -26,7 +26,7 @@
<JNPF-table v-loading="listLoading" :data="list" hasC @selection-change="handleSelectionChange" :border="false">
<el-table-column prop="documentNo" label="单据编号" align="center" sortable width="200" fixed="left">
</el-table-column>
<el-table-column prop="warehousingStorageTypeName" label="业务类型" align="center" sortable width="200" fixed="left">
<el-table-column prop="warehousingStorageType" label="业务类型" align="center" sortable width="200" fixed="left">
</el-table-column>
<el-table-column prop="warehouseName" label="入库仓库" align="center" width="150">
</el-table-column>

@ -436,7 +436,6 @@ export default {
deliveryFlag = false;
}
});
debugger
if (!stateFlag) {
this.$message({
type: 'error',
@ -820,7 +819,7 @@ export default {
handelUpload() {
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("", "scm/Voucher")
this.$refs.UploadBox.init("", "scm/Voucher", undefined, undefined, "采购", "收货凭证")
})
},
handleSelectionChange(val) {

@ -87,13 +87,13 @@
<el-table-column prop="businessCode" label="关联单号" align="center" width="200">
</el-table-column>
<el-table-column prop="warehouseId" label="出库仓库" align="center" width="150">
<el-table-column prop="warehouseId" label="出库仓库" align="center" width="200">
</el-table-column>
<el-table-column prop="salesNo" label="关联销售单号" align="center" width="200">
</el-table-column>
<el-table-column prop="receivedQuantity" label="实际出库数量" align="center" width="150">
<el-table-column prop="outNumber" label="实际出库数量" align="center" width="150">
</el-table-column>
<el-table-column prop="creatorTime" label="创建时间" align="center" width="150">

Loading…
Cancel
Save