|
@@ -0,0 +1,690 @@
|
|
|
|
+//费用分配
|
|
|
|
+<template>
|
|
|
|
+ <div class="container">
|
|
|
|
+ <el-row class="row_top">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <h2 class="bg-left title">费用分配</h2>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12" class="bg-right"><el-button class="bg-bottom" type="primary" size="small" @click="returnsales()"><img width="6" height="10"
|
|
|
|
+ style="vertion-align: bottom; margin-right: 3px" src="../../../public/img/lujing.png" alt="" />返回
|
|
|
|
+ </el-button></el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <div class="center">
|
|
|
|
+
|
|
|
|
+ <div>
|
|
|
|
+ <el-form label-position="left">
|
|
|
|
+ <div style='margin:0 -30px 10px;font-weight:bold'>基本信息</div>
|
|
|
|
+ <el-form-item label-width='100px' label="用途" span="1" prop="expensesPurpose">
|
|
|
|
+ <span v-if='deptBudgetList.expensesPurpose==1'>合同费用</span>
|
|
|
|
+ <span v-if='deptBudgetList.expensesPurpose==3'>库点费用</span>
|
|
|
|
+ <span v-if='deptBudgetList.expensesPurpose==5'>经营性费用</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width='100px' v-if='deptBudgetList.expensesPurpose==1' label="类型" span="1" prop="costType">
|
|
|
|
+ <span v-if='deptBudgetList.costType==1'>粮款</span>
|
|
|
|
+ <span v-if='deptBudgetList.costType==3'>非粮款</span>
|
|
|
|
+ <span v-if='deptBudgetList.costType==5'>保证金</span>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item v-if='deptBudgetList.expensesPurpose==3' label-width='100px' label="仓库名称" span="1" prop="warehouse" class="readonly">
|
|
|
|
+ {{deptBudgetList.warehouseName}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item v-if='deptBudgetList.expensesPurpose==1' label-width='100px' label="合同编号" span="1" prop="contractNo" class="readonly">
|
|
|
|
+ {{deptBudgetList.contractNo}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width='100px' label="费用名称" span="1" prop="settlementMethod">
|
|
|
|
+ {{deptBudgetList.expenseName}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width='100px' label="金额" span="1" prop="contractNo" class="readonly">
|
|
|
|
+ {{deptBudgetList.amountMoney}}
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width='100px' label="备注" span="1" prop="settlementMethod">
|
|
|
|
+ <el-input
|
|
|
|
+ disabled
|
|
|
|
+ type="textarea"
|
|
|
|
+ :rows="5"
|
|
|
|
+ placeholder="选填,不超过50个字"
|
|
|
|
+ v-model="deptBudgetList.remark">
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label-width='100px' label="附件">
|
|
|
|
+ <ws-upload ref="upload" accept=".jpg, .jpeg, .png, .pdf, .doc, .docx, .xls, .xlsx" :comp-id="compId" :appendix-ids="deptBudgetList.addressUrl" :size-limit="size"
|
|
|
|
+ @onChange="onChange"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div style='margin:0 50px 10px;font-weight:bold'>费用分配</div>
|
|
|
|
+ <div style='margin:10px auto;width:90%;'>
|
|
|
|
+ <ws-select v-model="mode" placeholder="费用分配方式" class="typeselect" @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-model="moneys" placeholder="费用分配金额" class="typeselect" >
|
|
|
|
+ <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </ws-select>
|
|
|
|
+ 合计分配:{{amount}}元
|
|
|
|
+ </div>
|
|
|
|
+ <el-table ref="tableref" 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">
|
|
|
|
+ <el-select v-model="scope.row.warehouseName" placeholder="选择仓库" @change="((value)=>{selectware(value, scope.$index)})">
|
|
|
|
+ <el-option v-for="item in warehouseList" :key="item.warehouseName" :label="item.warehouseName" :value="item.warehouseName"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-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,scope.$index)})">
|
|
|
|
+ <ws-option v-for="item in datelist[scope.$index]" :key="item.time" :label="item.time" :value="item.time"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </ws-select>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="日期">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-date-picker @change="((value)=>{receiptDocDatechange(value, scope.$index)})" v-model="scope.row.receiptDocDate" type="date" placeholder="请选择日期"
|
|
|
|
+ value-format="yyyy-MM-dd" ></el-date-picker>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column v-if='deptBudgetList.purpose=="库点费用"' prop="date" label="货源">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <!-- {{scope.row.goodsourcelist}} -->
|
|
|
|
+ <el-select v-model="scope.row.orderId" placeholder="选择货源" @change="((value)=>{selectgoodsSource(value, scope.row,scope.$index)})">
|
|
|
|
+ <el-option v-for="item in goodsourcelist[scope.$index]" :key="item.id" :label="item.goodsSource" :value="item.id"
|
|
|
|
+ style="color: #8890b1" />
|
|
|
|
+ </el-select>
|
|
|
|
+ </template>
|
|
|
|
+ </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.distributionMoney"></el-input>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="address" label="操作" width="200">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <img class='add' @click='addlist()' src="../../../public/img/add.png" alt="">
|
|
|
|
+ <img class='del' @click='dellist(scope.row)' src="../../../public/img/del.png" alt="">
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ </el-table>
|
|
|
|
+ </div>
|
|
|
|
+ <div>
|
|
|
|
+ <div style='margin-top:10px;text-align:right;width:90%;'>
|
|
|
|
+ <el-button class="bg-bottom" type="primary" size="small" @click="reject()">驳回
|
|
|
|
+ </el-button>
|
|
|
|
+ <el-button class="bg-bottom" type="primary" size="small" @click="submit()">通过
|
|
|
|
+ </el-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="驳回"
|
|
|
|
+ :visible.sync="rejectshow"
|
|
|
|
+ width="30%"
|
|
|
|
+ :before-close="handleClose">
|
|
|
|
+ <span>驳回原因</span>
|
|
|
|
+ <div><el-input
|
|
|
|
+ type="textarea"
|
|
|
|
+ :rows="2"
|
|
|
|
+ placeholder="请输入驳回原因"
|
|
|
|
+ v-model="textarea">
|
|
|
|
+</el-input>
|
|
|
|
+</div>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="dialogVisible = false">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="rejectclick">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+ import WsUpload from '@/components/WsUpload'
|
|
|
|
+ import {lookexenseinfo,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,editexenseinfo} from '@/model/profitable/index'
|
|
|
|
+ export default {
|
|
|
|
+ components: {
|
|
|
|
+ WsUpload,
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ value: [],
|
|
|
|
+ profitList: [{
|
|
|
|
+ name: "玉米",
|
|
|
|
+ count: 2000,
|
|
|
|
+ }],
|
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ mode:'全部分配',
|
|
|
|
+ ware:'指定仓库',
|
|
|
|
+ dates:'固定日期',
|
|
|
|
+ moneys:'按重量自动分配',
|
|
|
|
+ goods:'全部货品',
|
|
|
|
+ goodsList:[],
|
|
|
|
+ srcList:[],
|
|
|
|
+ warecontractList:[],
|
|
|
|
+ feeDetailsDistributions:[{proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:0}],
|
|
|
|
+ deptBudgetList:{},
|
|
|
|
+ makeWordData: {},
|
|
|
|
+ warehouseList:[],
|
|
|
|
+ goodsourcelist:[],
|
|
|
|
+ signingDate:'',
|
|
|
|
+ datelist:[],
|
|
|
|
+ disabled:false,
|
|
|
|
+ rejectshow:false,
|
|
|
|
+ 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
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ date: 20
|
|
|
|
+ }
|
|
|
|
+ ], //货值
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ activated() {
|
|
|
|
+ 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: {
|
|
|
|
+
|
|
|
|
+ onChange() {
|
|
|
|
+ this.$refs.upload
|
|
|
|
+ .handleSaveBill()
|
|
|
|
+ .then(async response => {
|
|
|
|
+ this.deptBudgetList.addressUrl = response
|
|
|
|
+ })
|
|
|
|
+ .catch(res => {
|
|
|
|
+ EventBus.$emit('error', (JSON.parse(res) || {}).message)
|
|
|
|
+ this.$refs.upload.clearFiles()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ modeselect(e){
|
|
|
|
+ if(e=='全部分配'){
|
|
|
|
+ this.moneys='按重量自动分配'
|
|
|
|
+ this.disabled=false
|
|
|
|
+ }else if(e=='部分分配'){
|
|
|
|
+ this.moneys='指定分配金额'
|
|
|
|
+ this.disabled=true
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selectware(e,index){
|
|
|
|
+ var arr=[]
|
|
|
|
+ this.datelist=[]
|
|
|
|
+ getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:e}).toPromise()
|
|
|
|
+ .then(response => {
|
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
|
+ arr.push({time:response[i].issuingTime,id:response[i].id,weight:response[i].inWarehouseWeight})
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.datelist,index,JSON.parse(JSON.stringify(arr)))
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ selectgoodsSource(e,item,index){
|
|
|
|
+ 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[index].length; i++) {
|
|
|
|
+ if(this.goodsourcelist[index][i].id==e){
|
|
|
|
+ this.feeDetailsDistributions[index].goodsSource=this.goodsourcelist[index][i].goodsSource
|
|
|
|
+ this.feeDetailsDistributions[index].inWarehouseWeight=this.goodsourcelist[index][i].weight
|
|
|
|
+ this.feeDetailsDistributions[index].goodsName=this.goodsourcelist[index][i].goodsName
|
|
|
|
+ this.feeDetailsDistributions[index].goodsNameKey=this.goodsourcelist[index][i].goodsNameKey
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.moneys=='按重量自动分配'){
|
|
|
|
+ weight = this.feeDetailsDistributions.reduce(function (total, currentValue, currentIndex, arr) {
|
|
|
|
+ return total + currentValue.inWarehouseWeight;
|
|
|
|
+ }, 0)
|
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
+ this.feeDetailsDistributions[i].distributionMoney=Math.round((this.feeDetailsDistributions[i].inWarehouseWeight/weight)*this.deptBudgetList.amountMoney)
|
|
|
|
+ money+=this.feeDetailsDistributions[i].distributionMoney
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ selecttime(e,item,index){
|
|
|
|
+ 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[index].length; i++) {
|
|
|
|
+ // console.log()
|
|
|
|
+ if(this.datelist[index][i].time==e){
|
|
|
|
+ item.orderId=this.datelist[index][i].id
|
|
|
|
+ item.inWarehouseWeight=this.datelist[index][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)
|
|
|
|
+ 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,index){
|
|
|
|
+ var arr=[]
|
|
|
|
+ this.goodsourcelist[index]=[]
|
|
|
|
+ getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:e}).toPromise()
|
|
|
|
+ .then(response => {
|
|
|
|
+ for (let i = 0; i < response.length; i++) {
|
|
|
|
+ arr.push({goodsSource:response[i].goodsSource,id:response[i].id,weight:response[i].inWarehouseWeight,goodsName:response[i].goodsName,goodsNameKey:response[i].goodsNameKey})
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ returnsales(){
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ },
|
|
|
|
+ submit(){
|
|
|
|
+ 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.expenseAllocationInfoList=this.feeDetailsDistributions
|
|
|
|
+ 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
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.mode=='全部分配'){
|
|
|
|
+ if(this.amount!=this.deptBudgetList.amountMoney){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '请款金额与分配金额不相等!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(this.mode=='部分分配'){
|
|
|
|
+ if(this.amount>this.deptBudgetList.amountMoney){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '分配金额不可超过请款金额!',
|
|
|
|
+ type: 'warning',
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // this.deptBudgetList.addressUrl=this.paymentScreenshot.toString()
|
|
|
|
+ this.deptBudgetList.flag=3
|
|
|
|
+ this.$confirm('确定提交分配信息', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ editexenseinfo(this.deptBudgetList).toPromise()
|
|
|
|
+ .then(response => {
|
|
|
|
+ this.pass()
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ pass(){
|
|
|
|
+ this.$confirm('确认通过请款信息?', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ woekflowhandle({
|
|
|
|
+ taskId: this.deptBudgetList.taskId,
|
|
|
|
+ approved:true,
|
|
|
|
+ auditMind: '34',
|
|
|
|
+ needReapply: true,
|
|
|
|
+ }).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '通过成功!',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ }).catch((response) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '通过失败!',
|
|
|
|
+ type: 'error',
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ rejectclick(){
|
|
|
|
+ woekflowhandle({
|
|
|
|
+ taskId: this.deptBudgetList.taskId,
|
|
|
|
+ approved:false,
|
|
|
|
+ auditMind: this.textarea,
|
|
|
|
+ needReapply: true,
|
|
|
|
+ }).toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '驳回成功!',
|
|
|
|
+ type: 'success',
|
|
|
|
+ })
|
|
|
|
+ this.rejectshow=false
|
|
|
|
+ this.$router.go(-1)
|
|
|
|
+ }).catch((response) => {
|
|
|
|
+ this.$message({
|
|
|
|
+ message: '驳回失败!',
|
|
|
|
+ type: 'error',
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ goodsNameselect(e){
|
|
|
|
+ console.log(e)
|
|
|
|
+ },
|
|
|
|
+ addlist(){
|
|
|
|
+ this.feeDetailsDistributions.push({proDate:'',weight:'',money:'',warehouse:'',belonging:'',index:this.feeDetailsDistributions.length})
|
|
|
|
+ },
|
|
|
|
+ dellist(row){
|
|
|
|
+ this.feeDetailsDistributions.splice(row.index,1)
|
|
|
|
+ },
|
|
|
|
+ getList() {
|
|
|
|
+ getcontract({
|
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.contractList=response
|
|
|
|
+ })
|
|
|
|
+ getwarehouse({
|
|
|
|
+ compId:localStorage.getItem('ws-pf_compId'),
|
|
|
|
+ warehouseType:1
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ this.warehouseList=response
|
|
|
|
+ })
|
|
|
|
+ lookexenseinfo({
|
|
|
|
+ id:this.$route.query.id
|
|
|
|
+ })
|
|
|
|
+ .toPromise()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ if(response.costType==1){
|
|
|
|
+ response.type='粮款'
|
|
|
|
+ }else if(response.costType==3){
|
|
|
|
+ response.type='非粮款'
|
|
|
|
+ }else if(response.costType==5){
|
|
|
|
+ response.type='保证金'
|
|
|
|
+ }
|
|
|
|
+ this.deptBudgetList=response
|
|
|
|
+ if(response.addressUrl){
|
|
|
|
+ var arr=[]
|
|
|
|
+ var srcs=response.addressUrl.split(',')
|
|
|
|
+ // this.paymentScreenshot=srcs
|
|
|
|
+ for (let i = 0; i < srcs.length; i++) {
|
|
|
|
+ arr.push(srcs[i])
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ this.srcList=arr
|
|
|
|
+ }
|
|
|
|
+ if(response.expenseAllocationInfoList){
|
|
|
|
+ this.feeDetailsDistributions=response.expenseAllocationInfoList
|
|
|
|
+ var arr=[]
|
|
|
|
+ for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
|
|
|
|
+ if(this.deptBudgetList.expensesPurpose==1){
|
|
|
|
+ this.datelist[i]=[]
|
|
|
|
+ getwarehousingorder({contractNo:this.deptBudgetList.contractNo,warehouseName:this.feeDetailsDistributions[i].warehouseName}).toPromise()
|
|
|
|
+ .then(response1 => {
|
|
|
|
+ for (let i = 0; i < response1.length; i++) {
|
|
|
|
+ arr.push({time:response1[i].issuingTime,id:response1[i].id,weight:response1[i].inWarehouseWeight})
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.datelist,i,JSON.parse(JSON.stringify(arr)))
|
|
|
|
+ console.log(this.feeDetailsDistributions,this.datelist)
|
|
|
|
+ this.feeDetailsDistributions=response.expenseAllocationInfoList
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }else if(this.deptBudgetList.expensesPurpose==3){
|
|
|
|
+ this.goodsourcelist[i]=[]
|
|
|
|
+ getwarehousingorder({warehouseName:this.deptBudgetList.warehouseName,receiptDocDate:this.feeDetailsDistributions[i].receiptDocDate}).toPromise()
|
|
|
|
+ .then(response1 => {
|
|
|
|
+ for (let i = 0; i < response1.length; i++) {
|
|
|
|
+ arr.push({goodsSource:response1[i].goodsSource,id:response1[i].id,weight:response1[i].inWarehouseWeight,goodsName:response1[i].goodsName,goodsNameKey:response1[i].goodsNameKey})
|
|
|
|
+ }
|
|
|
|
+ this.$set(this.goodsourcelist,i,JSON.parse(JSON.stringify(arr)))
|
|
|
|
+ this.feeDetailsDistributions=response.expenseAllocationInfoList
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ 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() {
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+ .container {
|
|
|
|
+ background: #E8ECF6;
|
|
|
|
+ }
|
|
|
|
+.add,.del{
|
|
|
|
+ width:25px;height:25px;
|
|
|
|
+}
|
|
|
|
+ .center {
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+ background: #ffffff;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ overflow:scroll;
|
|
|
|
+ padding-top:30px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .row_top {
|
|
|
|
+ // background: #F6F7FC;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+
|
|
|
|
+ .bg-left {
|
|
|
|
+ padding-left: 30px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .bg-right {
|
|
|
|
+ padding-right: 10px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ height:60px;
|
|
|
|
+ padding-top:15px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title {
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .title::before {
|
|
|
|
+ content: '';
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 5px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ background: #5473e8;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .datascreen {
|
|
|
|
+ // margin-top: 10px;
|
|
|
|
+ width: 500px;
|
|
|
|
+ height: 60px;
|
|
|
|
+ line-height: 60px;
|
|
|
|
+ margin-left: 30px;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .chart_css {
|
|
|
|
+ display: flex;
|
|
|
|
+ height: 410px;
|
|
|
|
+
|
|
|
|
+ .table {
|
|
|
|
+ width: 70%;
|
|
|
|
+ height: 410px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .makeWord_css {
|
|
|
|
+ width: 30%;
|
|
|
|
+ height: 410px;
|
|
|
|
+ margin-left: 30px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .table_css {
|
|
|
|
+
|
|
|
|
+ text-align:center;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ /deep/.el-form{
|
|
|
|
+ width:90%;
|
|
|
|
+ margin:0 auto;
|
|
|
|
+ }
|
|
|
|
+ /deep/.el-form-item {
|
|
|
|
+ width: 50%;
|
|
|
|
+}
|
|
|
|
+</style>
|