|
@@ -12,64 +12,64 @@
|
|
|
<div class="center">
|
|
|
|
|
|
<div>
|
|
|
- <ws-form label-position="left" label-width="140px"><div style='margin:30px 0 30px;'>基本信息</div>
|
|
|
- <ws-form-item label="用途" span="1" prop="contractNo" class="readonly">
|
|
|
- <el-radio-group v-model="deptBudgetList.purpose">
|
|
|
- <el-radio :label="1">合同费用</el-radio>
|
|
|
- <el-radio :label="2">库点费用</el-radio>
|
|
|
- <el-radio :label="3">经营性费用</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item v-if='deptBudgetList.purpose==1||deptBudgetList.purpose==2' label="类型" span="1" prop="contractNo" class="readonly">
|
|
|
- <el-radio-group v-model="deptBudgetList.type">
|
|
|
- <el-radio :label="1">粮款</el-radio>
|
|
|
- <el-radio :label="2">非粮款</el-radio>
|
|
|
- <el-radio v-if='deptBudgetList.purpose==1' :label="3">保证金</el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item v-if='deptBudgetList.purpose==1' label="合同编号" span="1" prop="contractNo" class="readonly">
|
|
|
- <ws-select v-model="deptBudgetList.contractNo" placeholder="" class="typeselect" @change="selectcontent"
|
|
|
- :value="searchType">
|
|
|
- <ws-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
|
|
|
- style="color: #8890b1" />
|
|
|
- </ws-select>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item v-if='deptBudgetList.purpose==2' label="仓库名称" span="1" prop="contractNo" class="readonly">
|
|
|
- <ws-select v-model="deptBudgetList.warehouse" placeholder="" class="typeselect" @change="selectwarehouse"
|
|
|
- :value="searchType">
|
|
|
- <ws-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
|
|
|
- style="color: #8890b1" />
|
|
|
- </ws-select>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item label="费用名称" span="1" prop="settlementMethod">
|
|
|
- <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="deptBudgetList.expenseName"></el-input>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item label="金额(元)" span="1" prop="contractNo" class="readonly">
|
|
|
- <el-input placeholder="输入请款金额" class="input_css" v-model="deptBudgetList.money"></el-input>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item label="备注" span="1" prop="settlementMethod">
|
|
|
+ <el-form label-position="left"><div style='margin:30px 0 30px;'>基本信息</div>
|
|
|
+ <el-form-item label-width='100px' label="用途" span="1" prop="purpose" class="readonly">
|
|
|
+ <ws-select v-model="deptBudgetList.purpose" placeholder="" class="typeselect" >
|
|
|
+ <ws-option label="合同费用" value="合同费用"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ <ws-option label="库点费用" value="库点费用"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ <ws-option label="经营性费用" value="经营性费用"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </ws-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="类型" span="1" prop="contractNo" class="readonly">
|
|
|
+ <ws-select v-model="deptBudgetList.type" placeholder="" class="typeselect" >
|
|
|
+ <ws-option label="粮款" value="粮款" style="color: #8890b1" />
|
|
|
+ <ws-option label="非粮款" value="非粮款" style="color: #8890b1" />
|
|
|
+ <ws-option label="保证金" value="保证金" style="color: #8890b1" />
|
|
|
+ </ws-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="合同费用"' label="合同编号" span="1" prop="contractNo" class="readonly">
|
|
|
+ <el-select v-model="deptBudgetList.contractNo" placeholder="选择合同" class="typeselect" @change="selectcontract">
|
|
|
+ <el-option v-for="item in contractList" :key="item.contractNo" :label="item.contractNo" :value="item.contractNo"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' v-if='deptBudgetList.purpose=="库点费用"' label="仓库名称" span="1" prop="contractNo" class="readonly">
|
|
|
+ <el-select v-model="deptBudgetList.warehouseName" placeholder="选择仓库" class="typeselect" @change="selectwarehouse">
|
|
|
+ <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
|
|
|
+ <el-input class='input50 input_css' placeholder="输入费用名称,1-15个字" v-model="deptBudgetList.expenseName"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
|
|
|
+ <el-input class='input50 input_css' placeholder="输入请款金额" v-model="deptBudgetList.amountMoney"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
|
|
|
<el-input
|
|
|
type="textarea"
|
|
|
- :rows="2"
|
|
|
+ :rows="5"
|
|
|
placeholder="选填,不超过50个字"
|
|
|
v-model="deptBudgetList.remark">
|
|
|
</el-input>
|
|
|
- </ws-form-item>
|
|
|
- <ws-form-item label="附件">
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label-width='100px' label="附件">
|
|
|
<el-upload ref='uploadfiles' :file-list='dataList' action="https://www.zthymaoyi.com/upload/admin" list-type="picture-card"
|
|
|
:on-success="handlefujian" :on-remove="handleRemove" class="photo2">
|
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
|
- </ws-form-item>
|
|
|
- </ws-form>
|
|
|
- <div v-if='deptBudgetList.type==2'>费用分配</div>
|
|
|
- <div v-if='deptBudgetList.type==2' style='margin-bottom:10px;'>
|
|
|
- <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @change="modeselect"
|
|
|
- :value="searchType">
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' class='expensetitle'>费用分配</div>
|
|
|
+ <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"' style='margin:0 auto 10px;width:90%;'>
|
|
|
+ <ws-select v-model="mode" placeholder="费用分配方式" @change="modeselect">
|
|
|
<ws-option v-for="item in modeList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
style="color: #8890b1" />
|
|
|
</ws-select>
|
|
|
- <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
|
|
|
+ <!-- <ws-select v-if='deptBudgetList.purpose==1' v-model="ware" placeholder="费用分配仓库" class="typeselect" @change="selectwareType"
|
|
|
:value="searchType">
|
|
|
<ws-option v-for="item in wareList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
style="color: #8890b1" />
|
|
@@ -83,48 +83,57 @@
|
|
|
:value="searchType">
|
|
|
<ws-option v-for="item in datesList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
style="color: #8890b1" />
|
|
|
- </ws-select>
|
|
|
- <ws-select v-model="moneys" placeholder="费用分配金额" class="typeselect" @change="selecttaskType"
|
|
|
- :value="searchType">
|
|
|
+ </ws-select> -->
|
|
|
+ <ws-select :disabled='disabled' v-model="moneys" placeholder="费用分配金额">
|
|
|
<ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
style="color: #8890b1" />
|
|
|
</ws-select>
|
|
|
- 合计分配:{{amount}}元
|
|
|
+ <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>
|
|
|
</div>
|
|
|
- <el-table v-if='deptBudgetList.type==2' :data="feeDetailsDistributions" style="width: 80%;margin:0 auto;">
|
|
|
- <el-table-column prop="date" label="所属" min-width="110">
|
|
|
+ <el-table v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
|
|
|
<template slot-scope="scope">
|
|
|
- <ws-select v-if='deptBudgetList.purpose==2' v-model="scope.row.belonging" placeholder="选择仓库或合同" class="typeselect" @change="selectware"
|
|
|
- :value="searchType">
|
|
|
- <ws-option v-for="item in warecontractList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
- style="color: #8890b1" />
|
|
|
- </ws-select>
|
|
|
- <ws-select v-if='deptBudgetList.purpose==1' v-model="scope.row.belonging" placeholder="选择仓库" class="typeselect" @change="selectware"
|
|
|
- :value="searchType">
|
|
|
- <ws-option v-for="item in warehouseList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
- style="color: #8890b1" />
|
|
|
- </ws-select>
|
|
|
+ <ws-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.row)})">
|
|
|
+ <ws-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </ws-select>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="日期">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <ws-select v-model="scope.row.receiptDocDate" placeholder="选择日期" @change="((value)=>{selecttime(value, scope.row)})">
|
|
|
+ <ws-option v-for="item in datelist" :key="item.time" :label="item.time" :value="item.time"
|
|
|
+ style="color: #8890b1" />
|
|
|
+ </ws-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="date" label="日期">
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
|
|
|
<template slot-scope="scope">
|
|
|
- <ws-date-picker v-model="scope.row.proDate" type="date" placeholder="请选择日期"
|
|
|
- value-format="yyyy-MM-dd" />
|
|
|
+ <el-date-picker @change="receiptDocDatechange" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
|
|
|
+ value-format="yyyy-MM-dd" ></el-date-picker>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="date" label="货名">
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
|
|
|
<template slot-scope="scope">
|
|
|
- <ws-select v-model="scope.row.goodsName" placeholder="选择货名" class="typeselect" @change="goodsNameselect"
|
|
|
- :value="searchType">
|
|
|
- <ws-option v-for="item in goodsList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
+ <ws-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row)})">
|
|
|
+ <ws-option v-for="item in goodsourcelist" :key="item.id" :label="item.goodsSource" :value="item.id"
|
|
|
style="color: #8890b1" />
|
|
|
</ws-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="date" label="库存(吨)"></el-table-column>
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货名">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.goodsName?scope.row.goodsName:'自动获取'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="inWarehouseWeight" label="入库量(吨)">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.inWarehouseWeight?scope.row.inWarehouseWeight:'自动获取'}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="date" label="分配金额(元)">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.money"></el-input>
|
|
|
+ <el-input placeholder="输入费用名称,1-15个字" class="input_css" v-model="scope.row.distributionMoney"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="address" label="操作" width="200">
|
|
@@ -143,7 +152,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import {setexpense,getcontract} from '@/model/profitable/index'
|
|
|
+ import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder} from '@/model/profitable/index'
|
|
|
export default {
|
|
|
components: {},
|
|
|
data() {
|
|
@@ -154,25 +163,28 @@
|
|
|
count: 2000,
|
|
|
}],
|
|
|
mode:'全部分配',
|
|
|
- ware:'指定仓库',
|
|
|
- dates:'固定日期',
|
|
|
moneys:'按重量自动分配',
|
|
|
- goods:'全部货品',
|
|
|
- amount:0,
|
|
|
+ dataList:[],
|
|
|
goodsList:[],
|
|
|
+ disabled:false,
|
|
|
warecontractList:[],
|
|
|
- feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
|
|
|
- deptBudgetList:{purpose:1,type:1},
|
|
|
+ dateRange: this.disabledDate(),
|
|
|
+ feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}],
|
|
|
+ deptBudgetList:{purpose:"合同费用",type:'粮款'},
|
|
|
makeWordData: {},
|
|
|
warehouseList:[],
|
|
|
contractList:[],
|
|
|
choosablewareList:[],
|
|
|
paymentScreenshot:[],
|
|
|
+ goodsourcelist:[],
|
|
|
+ signingDate:'',
|
|
|
+ datelist:[],
|
|
|
modeList:[{key:1,value:'全部分配'},{key:2,value:'部分分配'},{key:3,value:'暂不分配'}],
|
|
|
wareList:[{key:1,value:'指定仓库'},{key:2,value:'全部仓库'}],
|
|
|
datesList:[{key:1,value:'固定日期'},{key:2,value:'指定日期'}],
|
|
|
moneysList:[{key:1,value:'按重量自动分配'},{key:2,value:'指定分配金额'}],
|
|
|
goodsList:[{key:1,value:'全部货品'},{key:2,value:'指定货品'}],
|
|
|
+
|
|
|
valueData: [{
|
|
|
date: 10
|
|
|
},
|
|
@@ -189,50 +201,359 @@
|
|
|
// this.initCharts()
|
|
|
// this.getPassYearFormatDate()
|
|
|
this.getList()
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 计算属性的 getter
|
|
|
+ amount: function () {
|
|
|
+ // `this` 指向 vm 实例
|
|
|
+ var num=0
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if(this.feeDetailsDistributions[i].distributionMoney){
|
|
|
+ num+=Number(this.feeDetailsDistributions[i].distributionMoney)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return num
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
- selectwarehouse(){
|
|
|
-
|
|
|
+ selectwarehouse(e){
|
|
|
+ },
|
|
|
+ disabledDate() {
|
|
|
+ let that = this
|
|
|
+ return {
|
|
|
+ disabledDate(time) {
|
|
|
+ var firstDay = new Date(new Date(that.signingDate).getTime());
|
|
|
+ var lastDay = new Date(new Date().getTime());
|
|
|
+ lastDay.setFullYear(lastDay.getFullYear() + 1);
|
|
|
+ firstDay = that.timeFun(firstDay) //转格式 yyyy-MM-dd
|
|
|
+ lastDay = that.timeFun(lastDay) //转格式 yyyy-MM-dd
|
|
|
+ return time.getTime() < new Date(firstDay).getTime()
|
|
|
+ ||
|
|
|
+ time.getTime() > new Date(lastDay).getTime()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ timeFun(unixtimestamp) {
|
|
|
+ var unixtimestamp = new Date(unixtimestamp);
|
|
|
+ var year = 1900 + unixtimestamp.getYear();
|
|
|
+ var month = "0" + (unixtimestamp.getMonth() + 1);
|
|
|
+ var date = "0" + unixtimestamp.getDate();
|
|
|
+ return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2,date.length)
|
|
|
},
|
|
|
- selectwareType(e){
|
|
|
- if(e=='全部仓库'){
|
|
|
- for (let i = 0; i < this.choosablewareList.length; i++) {
|
|
|
- this.feeDetailsDistributions.push(this.choosablewareList[i])
|
|
|
+ selectware(e,item){
|
|
|
+ this.datelist=[]
|
|
|
+ getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
|
|
|
+ .then(response => {
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
+ this.datelist.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectgoodsSource(e,item){
|
|
|
+ var weight=0
|
|
|
+ console.log(e)
|
|
|
+ var money=0
|
|
|
+ if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if(this.feeDetailsDistributions[i].orderId==e){
|
|
|
+ this.feeDetailsDistributions[i].orderId=''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: '请输入金额之后进行操作',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.goodsourcelist.length; i++) {
|
|
|
+ if(this.goodsourcelist[i].id==e){
|
|
|
+ item.goodsSource=this.goodsourcelist[i].goodsSource
|
|
|
+ item.inWarehouseWeight=this.goodsourcelist[i].weight
|
|
|
+ item.goodsName=this.goodsourcelist[i].goodsName
|
|
|
+ item.goodsNameKey=this.goodsourcelist[i].goodsNameKey
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.moneys=='按重量自动分配'){
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ weight+=this.feeDetailsDistributions[i].inWarehouseWeight
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
|
+ if(i=this.feeDetailsDistributions.length-1&&i!=0){
|
|
|
+ console.log(i)
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
|
|
|
+ }else{
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
|
+ money+=this.feeDetailsDistributions[i].distributionMoney
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- selectproductType(){
|
|
|
- if(e=='全部产品'){
|
|
|
-
|
|
|
+ selecttime(e,item){
|
|
|
+ var weight=0
|
|
|
+ var money=0
|
|
|
+ if(!this.deptBudgetList.amountMoney&&this.moneys=='按重量自动分配'){
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if(this.feeDetailsDistributions[i].receiptDocDate==e){
|
|
|
+ this.feeDetailsDistributions[i].receiptDocDate=''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$message({
|
|
|
+ message: '请输入金额之后进行操作',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.datelist.length; i++) {
|
|
|
+ if(this.datelist[i].time==e){
|
|
|
+ item.orderId=this.datelist[i].id
|
|
|
+ item.inWarehouseWeight=this.datelist[i].weight
|
|
|
+ }
|
|
|
}
|
|
|
+ if(this.moneys=='按重量自动分配'){
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ weight+=this.feeDetailsDistributions[i].inWarehouseWeight
|
|
|
+ }
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ // console.log(weight,this.feeDetailsDistributions[i].inWarehouseWeight)
|
|
|
+ if(i=this.feeDetailsDistributions.length-1&&i!=0){
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney=this.deptBudgetList.amountMoney-money
|
|
|
+ }else{
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
|
+ money+=this.feeDetailsDistributions[i].distributionMoney
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log(this.feeDetailsDistributions)
|
|
|
+ },
|
|
|
+ receiptDocDatechange(e){
|
|
|
+ this.goodsourcelist=[]
|
|
|
+ getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
|
|
|
+ .then(response => {
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
+ this.goodsourcelist.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
selectcontent(e){
|
|
|
|
|
|
+ },
|
|
|
+ selectcontract(e){
|
|
|
+ console.log(e)
|
|
|
+ for (let i = 0; i < this.contractList.length; i++) {
|
|
|
+ console.log(this.contractList[i])
|
|
|
+ if(this.contractList[i].contractNo==e){
|
|
|
+ this.signingDate=this.contractList[i].signingDate
|
|
|
+ // this.disabledDate()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ returnsales(){
|
|
|
+ this.$router.go(-1)
|
|
|
},
|
|
|
handlefujian(file) {
|
|
|
// console.log(file)
|
|
|
this.paymentScreenshot.push(file.url)
|
|
|
// this.dialogVisible = true
|
|
|
},
|
|
|
+ handleRemove(file) {
|
|
|
+ // console.log(file)
|
|
|
+ for (let i = 0; i < this.paymentScreenshot.length; i++) {
|
|
|
+ if(this.paymentScreenshot[i]==response.url){
|
|
|
+ this.paymentScreenshot.splice(i, 1)
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取当前年月日
|
|
|
+ getdate() {
|
|
|
+ var date = new Date()
|
|
|
+ var year = date.getFullYear() //获取完整的年份(4位)
|
|
|
+ var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
|
|
|
+ var datetime = date.getDate() //获取当前日(1-31)
|
|
|
+ var hour = date.getHours()
|
|
|
+ var minutes = date.getMinutes()
|
|
|
+ var seconds = date.getSeconds()
|
|
|
+ if (mouth < 10) {
|
|
|
+ mouth = '0' + mouth
|
|
|
+ }
|
|
|
+ if (datetime < 10) {
|
|
|
+ datetime = '0' + datetime
|
|
|
+ }
|
|
|
+ if (hour < 10) {
|
|
|
+ hour = '0' + hour
|
|
|
+ }
|
|
|
+ if (minutes < 10) {
|
|
|
+ minutes = '0' + minutes
|
|
|
+ }
|
|
|
+ if (seconds < 10) {
|
|
|
+ seconds = '0' + seconds
|
|
|
+ }
|
|
|
+ return year + '' + mouth + datetime + hour + minutes + seconds
|
|
|
+ },
|
|
|
+ MathRand() {
|
|
|
+ var Num = ''
|
|
|
+ for (var i = 0; i < 4; i++) {
|
|
|
+ Num += Math.floor(Math.random() * 10)
|
|
|
+ }
|
|
|
+ return Num
|
|
|
+ },
|
|
|
submit(){
|
|
|
- if(!this.deptBudgetList.contractNo&&this.deptBudgetList.purpose==1){
|
|
|
+ this.deptBudgetList.compId=localStorage.getItem('ws-pf_compId')
|
|
|
+ this.deptBudgetList.agent=localStorage.getItem('ws-pf_staffName')
|
|
|
+ if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'){
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if(!this.feeDetailsDistributions[i].distributionMoney){
|
|
|
+ this.$message({
|
|
|
+ message: '分配金额不能为空!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.feeDetailsDistributions[i].distributionMoney<0){
|
|
|
+ this.$message({
|
|
|
+ message: '分配金额应大于0!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if((String(this.feeDetailsDistributions[i].distributionMoney).indexOf('.') != -1 &&
|
|
|
+ String(this.feeDetailsDistributions[i].distributionMoney).length -
|
|
|
+ (String(this.feeDetailsDistributions[i].distributionMoney).indexOf('.') + 1) >
|
|
|
+ 2)){
|
|
|
+ this.$message({
|
|
|
+ message: '分配金额最多保留两位小数!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.deptBudgetList.totalDistribution=this.amount
|
|
|
+ if(this.deptBudgetList.purpose=='合同费用'){
|
|
|
+ this.deptBudgetList.expensesPurpose=1
|
|
|
+ this.deptBudgetList.costNo='HTF'+this.getdate()+this.MathRand()
|
|
|
+ }else if(this.deptBudgetList.purpose=='库点费用'){
|
|
|
+ this.deptBudgetList.expensesPurpose=3
|
|
|
+ this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
|
+ this.deptBudgetList.costNo='KDF'+this.getdate()+this.MathRand()
|
|
|
+ }else if(this.deptBudgetList.purpose=='经营性费用'){
|
|
|
+ this.deptBudgetList.expensesPurpose=5
|
|
|
+ this.deptBudgetList.costNo='JYF'+this.getdate()+this.MathRand()
|
|
|
+ }
|
|
|
+ if(this.deptBudgetList.expensesPurpose==1){
|
|
|
+ if(this.deptBudgetList.type=='粮款'){
|
|
|
+ this.deptBudgetList.costType=1
|
|
|
+ this.deptBudgetList.expenseAllocationInfoList=[]
|
|
|
+ }else if(this.deptBudgetList.type=='非粮款'){
|
|
|
+ this.deptBudgetList.costType=3
|
|
|
+ this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
|
+ }else if(this.deptBudgetList.type=='保证金'){
|
|
|
+ this.deptBudgetList.expensesPurpose=5
|
|
|
+ this.deptBudgetList.expenseAllocationInfoList=[]
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.deptBudgetList.expensesPurpose==1){
|
|
|
+ var data=[]
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if(data.length==0){
|
|
|
+ data.push(this.feeDetailsDistributions[i])
|
|
|
+ }else{
|
|
|
+ var repetition=data.filter((item,index)=>{
|
|
|
+ return this.feeDetailsDistributions[i].orderId==item.orderId&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
|
+ })
|
|
|
+ if(repetition.length==0){
|
|
|
+ data.push(this.feeDetailsDistributions[i])
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '货源重复!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // for (let q = 0; q < data.length; q++) {
|
|
|
+ // if(data[q].warehouseName==this.feeDetailsDistributions[i].warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==data[q].receiptDocDate){
|
|
|
+ // this.$message({
|
|
|
+ // message: '请不要选择一样的入库单!',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.deptBudgetList.expensesPurpose==3){
|
|
|
+ var data=[]
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
+ if(data.length==0){
|
|
|
+ data.push(this.feeDetailsDistributions[i])
|
|
|
+ }else{
|
|
|
+ var repetition=data.filter((item,index)=>{
|
|
|
+ return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
|
|
|
+ })
|
|
|
+ if(repetition.length==0){
|
|
|
+ data.push(this.feeDetailsDistributions[i])
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '货源重复!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // for (let q = 0; q < data.length; q++) {
|
|
|
+ // if(data[q].warehouseName==this.feeDetailsDistributions[i].warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==data[q].receiptDocDate){
|
|
|
+ // this.$message({
|
|
|
+ // message: '请不要选择一样的入库单!',
|
|
|
+ // type: 'warning',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.deptBudgetList.expensesType=2
|
|
|
+ if(!this.deptBudgetList.contractNo&&this.deptBudgetList.expensesPurpose==1){
|
|
|
this.$message({
|
|
|
message: '合同编号不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
+ return
|
|
|
}
|
|
|
- if(!this.deptBudgetList.warehouse&&this.deptBudgetList.purpose==2){
|
|
|
+ if(!this.deptBudgetList.warehouse&&this.deptBudgetList.expensesPurpose==3){
|
|
|
this.$message({
|
|
|
message: '仓库名称不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='全部分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='全部分配'){
|
|
|
+ if(this.amount!=this.deptBudgetList.amountMoney){
|
|
|
+ this.$message({
|
|
|
+ message: '请款金额与分配金额不相等!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(this.deptBudgetList.expensesPurpose==1&&this.deptBudgetList.costType==3&&this.mode=='部分分配'||this.deptBudgetList.expensesPurpose==3&&this.mode=='部分分配'){
|
|
|
+ if(this.amount>this.deptBudgetList.amountMoney){
|
|
|
+ this.$message({
|
|
|
+ message: '分配金额不可超过请款金额!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
if(!this.deptBudgetList.expenseName){
|
|
|
this.$message({
|
|
|
message: '费用名称不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
+ return
|
|
|
}
|
|
|
if(this.deptBudgetList.expenseName.length<1||this.deptBudgetList.expenseName.length>15){
|
|
|
this.$message({
|
|
@@ -240,20 +561,45 @@
|
|
|
type: 'warning',
|
|
|
})
|
|
|
}
|
|
|
- if(!this.deptBudgetList.money){
|
|
|
+ if(!this.deptBudgetList.amountMoney){
|
|
|
this.$message({
|
|
|
message: '金额不能为空!',
|
|
|
type: 'warning',
|
|
|
})
|
|
|
+ return
|
|
|
}
|
|
|
- this.deptBudgetList.applUrl=this.paymentScreenshot.toString()
|
|
|
- setexpense(this.deptBudgetList).toPromise()
|
|
|
- .then(response => {})
|
|
|
+ if(this.deptBudgetList.amountMoney<0.01||this.deptBudgetList.amountMoney>100000000){
|
|
|
+ this.$message({
|
|
|
+ message: '金额输入错误!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
|
|
|
+ this.$confirm('确定提交请款信息', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ addexenseinfo(this.deptBudgetList).toPromise()
|
|
|
+ .then(response => {
|
|
|
+ this.$message({
|
|
|
+ message: '提交成功!',
|
|
|
+ type: 'success',
|
|
|
+ })
|
|
|
+ this.$router.go(-1)
|
|
|
+ })
|
|
|
+ })
|
|
|
},
|
|
|
modeselect(e){
|
|
|
- console.log(e)
|
|
|
- },selectware(e){
|
|
|
- console.log(e)
|
|
|
+ if(e=='全部分配'){
|
|
|
+ this.moneys='按重量自动分配'
|
|
|
+ this.disabled=false
|
|
|
+ }else if(e=='部分分配'){
|
|
|
+ this.moneys='指定分配金额'
|
|
|
+ this.disabled=true
|
|
|
+ }
|
|
|
},
|
|
|
goodsNameselect(e){
|
|
|
console.log(e)
|
|
@@ -264,10 +610,14 @@
|
|
|
dellist(row){
|
|
|
if(this.feeDetailsDistributions.length>1){
|
|
|
this.feeDetailsDistributions.splice(row.index,1)
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '至少保留一条!',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
getList() {
|
|
|
- console.log(1222)
|
|
|
getcontract({
|
|
|
compId:localStorage.getItem('ws-pf_compId'),
|
|
|
})
|
|
@@ -275,162 +625,22 @@
|
|
|
.then((response) => {
|
|
|
this.contractList=response
|
|
|
})
|
|
|
+ getwarehouse({
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
+ warehouseType:1
|
|
|
+ })
|
|
|
+ .toPromise()
|
|
|
+ .then((response) => {
|
|
|
+ this.warehouseList=response
|
|
|
+ })
|
|
|
|
|
|
},
|
|
|
detail(){
|
|
|
this.$router.push({name:'contractprofitsdetails'})
|
|
|
},
|
|
|
- getPassYearFormatDate() {
|
|
|
- var nowDate = new Date()
|
|
|
- var _date = new Date()
|
|
|
- nowDate.setTime(nowDate.getTime() - 24 * 60 * 60 * 1000 * 30)
|
|
|
- var year = nowDate.getFullYear()
|
|
|
- var year1 = _date.getFullYear()
|
|
|
- var month = nowDate.getMonth() + 1
|
|
|
- var month1 = _date.getMonth() + 1
|
|
|
- var strDate = nowDate.getDate()
|
|
|
- var strDate1 = _date.getDate()
|
|
|
- if (month >= 1 && month <= 9) {
|
|
|
- month = '0' + month
|
|
|
- }
|
|
|
- if (month1 >= 1 && month1 <= 9) {
|
|
|
- month1 = '0' + month1
|
|
|
- }
|
|
|
-
|
|
|
- if (strDate >= 0 && strDate <= 9) {
|
|
|
- strDate = '0' + strDate
|
|
|
- }
|
|
|
- if (strDate1 >= 0 && strDate1 <= 9) {
|
|
|
- strDate1 = '0' + strDate1
|
|
|
- }
|
|
|
- this.startDate = year + '-' + month + '-' + strDate
|
|
|
- this.endDate = year1 + '-' + month1 + '-' + strDate1
|
|
|
- this.value = [this.startDate, this.endDate]
|
|
|
- },
|
|
|
pickerOptions() {
|
|
|
|
|
|
},
|
|
|
- initCharts() {
|
|
|
- let app = this;
|
|
|
- let myChart7 = app.$echarts.init(this.$refs.myEchart7);
|
|
|
- var option;
|
|
|
- option = {
|
|
|
- // title: {
|
|
|
- // text: 'Rainfall vs Evaporation',
|
|
|
- // subtext: 'Fake Data'
|
|
|
- // },
|
|
|
- tooltip: {
|
|
|
- trigger: 'axis'
|
|
|
- },
|
|
|
- legend: {
|
|
|
- data: ['支出', '收入']
|
|
|
- },
|
|
|
- toolbox: {
|
|
|
- show: true,
|
|
|
- feature: {
|
|
|
- dataView: {
|
|
|
- show: false,
|
|
|
- readOnly: false
|
|
|
- },
|
|
|
- magicType: {
|
|
|
- show: false,
|
|
|
- type: ['line', 'bar']
|
|
|
- },
|
|
|
- restore: {
|
|
|
- show: false
|
|
|
- },
|
|
|
- saveAsImage: {
|
|
|
- show: false
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- calculable: true,
|
|
|
- xAxis: [{
|
|
|
- name: '种类',
|
|
|
- type: 'category',
|
|
|
- // prettier-ignore
|
|
|
- data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct']
|
|
|
- }],
|
|
|
- yAxis: [{
|
|
|
- name: '储量(吨)',
|
|
|
- type: 'value'
|
|
|
- }],
|
|
|
- series: [{
|
|
|
- name: '支出',
|
|
|
- type: 'bar',
|
|
|
- right: 0,
|
|
|
- // label: {
|
|
|
- // show: true,
|
|
|
- // position: 'inside'
|
|
|
- // },
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- precision: 1,
|
|
|
- position: 'top',
|
|
|
- valueAnimation: true,
|
|
|
- fontFamily: 'monospace'
|
|
|
- },
|
|
|
- data: [
|
|
|
- 6.0, 60.9, 90.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0
|
|
|
- ],
|
|
|
- color: ['#5878E8 '],
|
|
|
- formatter: '{value} 元',
|
|
|
-
|
|
|
- },
|
|
|
- {
|
|
|
- name: '收入',
|
|
|
- type: 'bar',
|
|
|
- right: 20,
|
|
|
- label: {
|
|
|
- show: true,
|
|
|
- precision: 1,
|
|
|
- position: 'top',
|
|
|
- valueAnimation: true,
|
|
|
- fontFamily: 'monospace'
|
|
|
- },
|
|
|
- data: [
|
|
|
- 102.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8
|
|
|
- ],
|
|
|
- color: ['#FF9F24'],
|
|
|
- formatter: '{value} 元',
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- myChart7.setOption(option)
|
|
|
- },
|
|
|
- getData(count) {
|
|
|
- // prettier-ignore
|
|
|
- const nameList = [
|
|
|
- '支出', '收入'
|
|
|
- ];
|
|
|
- const legendData = [];
|
|
|
- const seriesData = [];
|
|
|
- for (var i = 0; i < count; i++) {
|
|
|
- var name = nameList[i]
|
|
|
- // Math.random() > 0.65 ? makeWord(4, 1) + '·' + makeWord(3, 0) : makeWord(2, 1);
|
|
|
- legendData.push(name);
|
|
|
- seriesData.push({
|
|
|
- name: name,
|
|
|
- value: Math.round(Math.random() * 100000)
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- return {
|
|
|
- legendData: legendData,
|
|
|
- seriesData: seriesData
|
|
|
- };
|
|
|
-
|
|
|
- // function makeWord(max, min) {
|
|
|
- // debugger
|
|
|
- // const nameLen = Math.ceil(Math.random() * max + min);
|
|
|
- // const name = [];
|
|
|
- // for (var i = 0; i < nameLen; i++) {
|
|
|
- // name.push(nameList[Math.round(Math.random() * nameList.length - 1)]);
|
|
|
- // }
|
|
|
- // return name.join('');
|
|
|
- // }
|
|
|
-
|
|
|
- }
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
@@ -447,7 +657,15 @@
|
|
|
margin-top: 10px;
|
|
|
overflow:scroll;
|
|
|
}
|
|
|
-
|
|
|
+ .expensetitle{
|
|
|
+ margin:0 auto 10px;width:90%;border-top:1px solid #D8DCE6;padding-top:30px;
|
|
|
+ }
|
|
|
+ /deep/.input50>.el-input__inner{
|
|
|
+ width:50%;
|
|
|
+ }
|
|
|
+ /deep/.typeselect.el-select{
|
|
|
+ width:50%;
|
|
|
+ }
|
|
|
.row_top {
|
|
|
// background: #F6F7FC;
|
|
|
border-radius: 4px;
|
|
@@ -511,8 +729,15 @@
|
|
|
/deep/.el-form{
|
|
|
width:90%;
|
|
|
margin:0 auto;
|
|
|
+ .el-form-item__label{
|
|
|
+ color:#8890B1;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
/deep/.el-form-item {
|
|
|
width: 50%;
|
|
|
}
|
|
|
+.add,.del{
|
|
|
+ width:25px;height:25px;
|
|
|
+}
|
|
|
</style>
|