zxz 2 years ago
parent
commit
b08f1c5900

+ 5 - 2
src/model/profitable/index.js

@@ -54,7 +54,8 @@ import {
   API_SPONSOR_WITHDRAW,
   API_GET_WAREHOUSINGORDER_LIST,
   API_POST_EXPORTFILE,
-  API_GET_CONSTNO
+  API_GET_CONSTNO,
+  API_IMPORT_FIXED,
 } from '@/api/V2/profitable'
 //收支明细列表
 export const getInOutDetailed = appRx.get(API_GET_INOUTDETAILED, errorCatcher, errorHandle, filter)
@@ -164,4 +165,6 @@ export const getwarehousingorderList = appRx.get(API_GET_WAREHOUSINGORDER_LIST,e
 // 导出费用明细信息
 export const exportFile = appRx.post(API_POST_EXPORTFILE)
   //费用编号
-  export const getcostNo = appRx.get(API_GET_CONSTNO,errorCatcher, errorHandle, filter)
+  export const getcostNo = appRx.get(API_GET_CONSTNO,errorCatcher, errorHandle, filter)
+	// 导入
+  export const importFixed = appRx.post(API_IMPORT_FIXED, errorCatcher, errorHandle, filter)

+ 251 - 66
src/views/profitable/cashout.vue

@@ -96,7 +96,7 @@
           </el-form-item>
         </el-form>
         <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.flag!="是"' class='expensetitle'>费用分配</div>
-        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.flag!="是"' style='margin:0  auto 10px;width:90%;'>
+        <div v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"||deptBudgetList.purpose=="库点费用"&&deptBudgetList.flag!="是"' style='margin:0  auto 10px;width:90%;display: flex;'>
             <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" />
@@ -120,7 +120,20 @@
           <ws-option v-for="item in moneysList" :key="item.value" :label="item.value" :value="item.value"
             style="color: #8890b1" />
         </ws-select>
-        <span v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
+        <div style='width:30%;' v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>
+            <el-date-picker v-model="value2" type="daterange" align="right" unlink-panels range-separator="至"
+              start-placeholder="开始日期" value-format='yyyy-MM-dd' end-placeholder="结束日期" :picker-options="pickerOptions"
+              @change="dateChange">
+            </el-date-picker>
+        </div>
+        <ws-select v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"' :disabled='disabled' v-model="orderId" placeholder="全部客户" 
+            @change='sourceChange'>
+            <ws-option key="全部客户" label="全部客户" value="" style="color: #8890b1" />
+            <ws-option v-for="item in customerList" :key="item.id" :label="item.goodsSource" :value="item.id"
+              style="color: #8890b1" />
+        </ws-select>
+        <el-button @click="queren" v-if='deptBudgetList.purpose == "库点费用" && deptBudgetList.flag == "否" &&mode != "暂不分配"'>确认</el-button>
+        <span style="margin-top:5px" v-if='mode!="暂不分配"'>合计分配:{{amount}}元</span>  
         </div>
         <el-table ref="tableref" v-if='deptBudgetList.purpose=="合同费用"&&deptBudgetList.type=="非粮款"&&mode!="暂不分配"||deptBudgetList.purpose=="库点费用"&&mode!="暂不分配"&&deptBudgetList.flag!="是"' :data="feeDetailsDistributions" style="width: 90%;margin:0 auto;">
           <el-table-column v-if='deptBudgetList.purpose=="合同费用"' prop="date" label="仓库名称" min-width="110">
@@ -154,7 +167,11 @@
           <el-table-column v-if='deptBudgetList.purpose=="库点费用"||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-select v-if="scope.row.orderId &&confirmFlag==0" 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>
+                <el-select v-else v-model="scope.row.goodsSource" 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>
@@ -192,16 +209,31 @@
 </template>
 <script>
   import WsUpload from '@/components/WsUpload'
-  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,getexpensecount,getpayeeinfo} from '@/model/profitable/index'
+  import {setexpense,getcontract,getwarehouse,addexenseinfo,getwarehousingorder,getexpensecount,getpayeeinfo,getwarehousingorderList} from '@/model/profitable/index'
   export default {
     components: {
       WsUpload,
     },
     data() {
       return {
+        customerList: [],
+        goodsSource: '',
+        value2: '',
+        endDate: '',
+        startDate: '',
+        baseId: '',
+        currentPage: 1,
+        pageSize: 10,
+        searchType: '',
+        searchKeyWord: '',
+        goodsName: '',
+        //是否按时间筛选标识,1是
+        confirmFlag: 0,
+        datas: [],
+        orderId: '',
         value: [],
         profitList: [{
-          name: "玉米",
+          name: '玉米',
           count: 2000,
         }],
         mode:'全部分配',
@@ -213,7 +245,7 @@
         warecontractList:[],
         dateRange: this.disabledDate(),
         feeDetailsDistributions:[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}],
-        deptBudgetList:{purpose:"合同费用",type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',},
+        deptBudgetList:{purpose:'合同费用',type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',},
         makeWordData: {},
         warehouseList:[],
         contractList:[],
@@ -243,7 +275,7 @@
 
     },
     activated() {
-      
+      this.value2 = this.getNowTime()
       getexpensecount({compId:localStorage.getItem('ws-pf_compId')}).toPromise()
           .then(response => {
             // this.Num=response
@@ -270,33 +302,59 @@
       }
     },
     methods: {
+      sourceChange(e) {
+      if (e == '') {
+        this.goodsSource = '全部客户'
+        this.selectOrderList()
+      } else {
+        for (let i = 0; i < this.customerList.length; i++) {
+          if (this.customerList[i].id == e) {
+            this.goodsSource = this.customerList[i].goodsSource
+            this.orderId = this.customerList[i].id
+            this.selectOrderList()
+          }
+        }
+      }
+    },
+      getNowTime() {
+      const start = new Date(new Date().getTime() - 3600 * 1000 * 24)
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0] //默认开始时间1天前
+      const end = new Date(new Date().getTime())
+        .toISOString()
+        .replace('T', ' ')
+        .split('.')[0]//默认结束时间今天
+      // console.log([start.split(' '), end])
+      return [start.split(' ')[0], end.split(' ')[0]]
+    },
       Previewf(file) {
       console.log(file);
       // window.open(file.response)
       if (file) {
-        const addTypeArray = file.name.split(".");
+        const addTypeArray = file.name.split('.');
         const addType = addTypeArray[addTypeArray.length - 1];
         console.log(addType);
-        if (addType === "pdf") {
+        if (addType === 'pdf') {
           let routeData = this.$router.resolve({
-            path: "/insurancePdf",
+            path: '/insurancePdf',
             query: { url: file.response, showBack: false },
           });
-          window.open(routeData.href, "_blank");
+          window.open(routeData.href, '_blank');
         }
         //".rar, .zip, .doc, .docx, .xls, .txt, .pdf, .jpg,  .png, .jpeg,"
-        else if (addType === "doc" || addType === "docx" || addType === "xls") {
+        else if (addType === 'doc' || addType === 'docx' || addType === 'xls') {
           window.open(
-            "http://view.officeapps.live.com/op/view.aspx?src=" + file.response
+            'http://view.officeapps.live.com/op/view.aspx?src=' + file.response
           );
-        } else if (addType === "txt") {
+        } else if (addType === 'txt') {
           window.open(file.response);
-        } else if (["png", "jpg", "jpeg"].includes(addType)) {
+        } else if (['png', 'jpg', 'jpeg'].includes(addType)) {
           window.open(file.response);
-        } else if (addType === "rar" || addType === "zip") {
+        } else if (addType === 'rar' || addType === 'zip') {
           this.$message({
-            message: "该文件类型暂不支持预览",
-            type: "warning",
+            message: '该文件类型暂不支持预览',
+            type: 'warning',
           });
            return false;
         }
@@ -328,9 +386,9 @@
       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)      
+        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)      
       },
       selectware(e,index){
         var arr=[]
@@ -345,40 +403,49 @@
             this.$set(this.goodsourcelist,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=''
-            }
+      selectgoodsSource(e, item, index) {
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+      if (!this.deptBudgetList.amountMoney && this.moneys == '按重量自动分配') {
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (this.feeDetailsDistributions[i].orderId && 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
-            }
+        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
+          this.feeDetailsDistributions[index].orderId = this.goodsourcelist[index][i].id
         }
-        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
-          }
+      }
+      if (this.moneys == '按重量自动分配') {
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
         }
-      },
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.amountMoney - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+        }
+      }
+    },
       selecttime(e,item,index){
         var weight=0
         var money=0
@@ -426,6 +493,96 @@
              this.$set(this.goodsourcelist,index,JSON.parse(JSON.stringify(arr)))
           })
       },
+      queren() {
+      if (!this.deptBudgetList.amountMoney && this.moneys == '按重量自动分配') {
+        this.$message({
+          message: '请输入金额之后进行操作',
+          type: 'warning',
+        })
+        return
+      }
+      this.confirmFlag = 1
+      this.selectOrderList()
+    },
+    dateChange(e) {
+      this.value2 = e
+    },
+    selectOrderList() {
+      var arr = []
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+      this.startDate = this.value2[0]
+      this.endDate = this.value2[1]
+      if(!this.deptBudgetList.warehouseId){
+        this.$message({
+          message: '请选择仓库之后进行操作',
+          type: 'warning',
+        })
+        return
+      }
+      getwarehousingorderList({
+        compId: localStorage.getItem('ws-pf_compId'),
+        startDate: this.startDate,
+        endDate: this.endDate,
+        baseId: this.deptBudgetList.warehouseId,
+        currentPage: this.currentPage,
+        pageSize: this.pageSize,
+        searchType: this.searchType,
+        searchKeyWord: this.searchKeyWord,
+        goodsName: this.goodsName,
+        goodsSource: this.goodsSource == '全部客户' ? '' : this.goodsSource
+      })
+        .toPromise()
+        .then((response) => {
+          this.datas = []
+          if (this.goodsSource && this.goodsSource != '全部客户') {
+            for (let i = 0; i < response.records.length; i++) {
+              this.datas.push(response.records[i])
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource, id: this.datas[z].id, weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+          } else {
+            for (let i = 0; i < response.records.length; i++) {
+              for (let j = 0; j < response.records[i].warehousingOrderList.length; j++) {
+                this.datas.push(response.records[i].warehousingOrderList[j])
+              }
+            }
+            for (let z = 0; z < this.datas.length; z++) {
+              arr.push({ receiptDocDate: this.datas[z].issuingTime, goodsSource: this.datas[z].goodsSource,orderId:this.datas[z].id, id: this.datas[z].id, weight: this.datas[z].inWarehouseWeight, goodsName: this.datas[z].goodsName, goodsNameKey: this.datas[z].goodsNameKey })
+            }
+            this.feeDetailsDistributions = arr
+
+            //获取客户
+            this.customerList = this.unique(arr)
+          }
+          for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+            this.feeDetailsDistributions[i].inWarehouseWeight = this.feeDetailsDistributions[i].weight
+            weight += Number(this.feeDetailsDistributions[i].inWarehouseWeight)
+          }
+          if (this.moneys == '按重量自动分配') {
+            for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+              if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.amountMoney - moneyDiff
+              }
+              // this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+            }
+          }
+        })
+    },
+    unique(arr) {
+      const res = new Map();
+      return arr.filter((arr) => !res.has(arr.goodsSource) && res.set(arr.goodsSource, 1));
+    },
       selectcontent(e){
 
       },
@@ -436,7 +593,7 @@
             this.signingDate=this.contractList[i].signingDate
             getpayeeinfo({compId:localStorage.getItem('ws-pf_compId'),contractNo:e}).toPromise()
               .then((response1) => {
-                this.deptBudgetList.payee=response1.customerType=="企业客户"?response1.compName:response1.customerName
+                this.deptBudgetList.payee=response1.customerType=='企业客户'?response1.compName:response1.customerName
                 this.deptBudgetList.accountNumber=response1.bankCard
                 this.deptBudgetList.bank=response1.bankDeposit
                 this.deptBudgetList.bankBranch=response1.bankDepositBranch
@@ -519,7 +676,7 @@
           })
           return
         }
-        if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'&&this.deptBudgetList.flag!="是"){
+        if(this.deptBudgetList.purpose=='合同费用'&&this.deptBudgetList.type=='非粮款'||this.deptBudgetList.purpose=='库点费用'&&this.deptBudgetList.flag!='是'){
           for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
             // if(!this.feeDetailsDistributions[i].goodsSource){
             //   this.$message({
@@ -528,7 +685,7 @@
             //   })
             //   return
             // }
-            if(!this.feeDetailsDistributions[i].distributionMoney&&this.mode!="暂不分配"){
+            if(!this.feeDetailsDistributions[i].distributionMoney&&this.mode!='暂不分配'){
               this.$message({
                 message: '分配金额不能为空!',
                 type: 'warning',
@@ -568,7 +725,7 @@
             this.deptBudgetList.expenseAllocationInfoList=[]
           }else{
             this.deptBudgetList.storageFeeFlag=0
-            if(this.mode=="暂不分配"){
+            if(this.mode=='暂不分配'){
             this.deptBudgetList.expenseAllocationInfoList=[]
             }else{
               this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
@@ -586,7 +743,7 @@
             this.deptBudgetList.expenseAllocationInfoList=[]
           }else if(this.deptBudgetList.type=='非粮款'){
             this.deptBudgetList.costType=3
-            if(this.mode!="暂不分配"){
+            if(this.mode!='暂不分配'){
               this.deptBudgetList.expenseAllocationInfoList=this.feeDetailsDistributions
             }
           }else if(this.deptBudgetList.type=='保证金'){
@@ -632,6 +789,7 @@
             }else{
               var repetition=data.filter((item,index)=>{
                 return this.feeDetailsDistributions[i].warehouseName==item.warehouseName&&this.feeDetailsDistributions[i].receiptDocDate==item.receiptDocDate
+                && this.feeDetailsDistributions[i].goodsSource == item.goodsSource
               })
               if(repetition.length==0){
                 data.push(this.feeDetailsDistributions[i])
@@ -737,7 +895,7 @@
             })
             }
             this.mode='全部分配'
-            this.deptBudgetList={purpose:"合同费用",type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',}
+            this.deptBudgetList={purpose:'合同费用',type:'粮款',flag:'否',payee:'',accountNumber:'',bank:'',bankBranch:'',wareExpenseType:'杂费',}
             this.feeDetailsDistributions=[{receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',goodsName:'',goodsSource:'',index:0}]
             this.paymentScreenshot=[]
             this.$refs.upload.clearFiles()
@@ -760,16 +918,43 @@
       addlist(){
         this.feeDetailsDistributions.push({receiptDocDate:'',inWarehouseWeight:0,distributionMoney:0,warehouseName:'',time:0,id:0,weight:0,goodsName:'',goodsSource:'',index:0,   goodsNameKey: null,index:this.feeDetailsDistributions.length})
       },
-      dellist(row){
-        if(this.feeDetailsDistributions.length>1){
-          this.feeDetailsDistributions.splice(row.index,1)
-        }else{
-          this.$message({
-            message: '至少保留一条!',
-            type: 'warning',
-          })
+      dellist(row) {
+      var weight = 0
+      var money = 0
+      var moneyDiff = 0
+      if (this.feeDetailsDistributions.length > 1) {
+        for (let i = 0; i < this.feeDetailsDistributions.length; i++) {
+          if (this.feeDetailsDistributions[i]) {
+            if (this.feeDetailsDistributions[i] == row) {
+              this.feeDetailsDistributions.splice(i, 1)
+              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++) {
+                  if (i != this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = Math.round((this.feeDetailsDistributions[i].inWarehouseWeight / weight) * this.deptBudgetList.amountMoney)
+                if (this.feeDetailsDistributions[i].distributionMoney) {
+                  moneyDiff += Number(this.feeDetailsDistributions[i].distributionMoney)
+                }
+              }
+              if (i == this.feeDetailsDistributions.length - 1) {
+                this.feeDetailsDistributions[i].distributionMoney = this.deptBudgetList.amountMoney - moneyDiff
+              }
+              money = this.feeDetailsDistributions[i].distributionMoney + moneyDiff
+
+                }
+              }
+            }
+          }
         }
-      },
+      } else {
+        this.$message({
+          message: '至少保留一条!',
+          type: 'warning',
+        })
+      }
+    },
       getList() {
         getcontract({
         compId:localStorage.getItem('ws-pf_compId'),

+ 39 - 1
src/views/purchasingManagement/procurementPlanAdd.vue

@@ -154,6 +154,19 @@
           </el-form-item>
         </el-form>
       </div>
+      <!--备注信息-->
+      <div class="center1">
+        <div class="small-title">
+          <h3>备注信息</h3>
+        </div>
+        <el-form style="display: block;" ref="dataList" :model="dataList" label-width="140px">
+          <el-form-item label="备注" span="1" prop="remark">
+            <el-input v-model="dataList.remark" maxlength="3000" class="typeselect" placeholder="请输入备注" />
+          </el-form-item>
+          <ws-upload  ref="upload" :comp-id="compId" :appendix-ids="dataList.addressUrl" :size-limit="size"
+            @onChange="onChangeAddressUrl" accept=".jpg, .jpeg, .png" />
+        </el-form>
+      </div>
     </div>
     <!-- 提交 -->
     <div style="text-align: right; padding: 10px" class="center">
@@ -281,7 +294,8 @@
           priceType: '定价采购',
           priceTypeKey: 2,
           packingType: '散装',
-          packingTypeKey: 1
+          packingTypeKey: 1,
+          addressUrl:'',
         },
         historyList: [],
         pickerBeginDateBefore: {
@@ -297,6 +311,17 @@
     },
     mounted() {},
     methods: {
+      onChangeAddressUrl() {
+        this.$refs.upload
+          .handleSaveBill()
+          .then(async response => {
+            this.dataList.addressUrl = response
+          })
+          .catch(res => {
+            EventBus.$emit('error', (JSON.parse(res) || {}).message)
+            this.$refs.upload.clearFiles()
+          })
+      },
       //返回按钮
       revert() {
         this.$router.go(-1)
@@ -788,6 +813,19 @@
                   .toPromise()
                   .then(response => {
                     this.$message.success('添加成功');
+                    this.dataList = {
+                      taskTypeKey: '1',
+                      goodsName: '玉米',
+                      goodsNameKey: 1,
+                      salePlanType: '现货',
+                      salePlanTypeKey: 2,
+                      priceType: '定价销售',
+                      priceTypeKey: 2,
+                      packingType: '散装',
+                      packingTypeKey: 1,
+                      addressUrl: '',
+                      selectedOptions:''
+                    },
                     (this.outputYear = ''),
                     this.$router.push({
                       path: 'procurementPlanList'

+ 47 - 7
src/views/salesManagement/salesPlanAdd.vue

@@ -73,8 +73,8 @@
             <span class="unchangeable">*</span>
           </ws-form-item>
           <ws-form-item label="出货库所在地区" span="1" prop="sendArea">
-            <el-cascader :options="options_" v-model="selectedOptions" clearable class="typeselect"
-              placeholder="请选择出货库所在地区" @change="handleChange" style="width: 200%" />
+            <el-cascader :options="options_" v-model="selectedOptions" clearable class="typeselect" placeholder="请选择出货库所在地区"
+              @change="handleChange" style="width: 200%" />
             <span class="unchangeable">*</span>
           </ws-form-item>
           <ws-form-item label="运费承担方" span="1" prop="freightPayer">
@@ -142,14 +142,12 @@
           </el-form-item>
           <ws-form-item label="粒型" span="1" prop="grain">
             <ws-select v-model="dataList.grain" placeholder class="typeselect" @change="selectgrain">
-              <ws-option v-for="item in grainList" :key="item.constKey" :label="item.constValue"
-                :value="item.constValue" />
+              <ws-option v-for="item in grainList" :key="item.constKey" :label="item.constValue" :value="item.constValue" />
             </ws-select>
           </ws-form-item>
           <ws-form-item label="品级" span="1" prop="grade">
             <ws-select v-model="dataList.grade" placeholder class="typeselect" @change="selectgrade">
-              <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
-                :value="item.constValue" />
+              <ws-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue" :value="item.constValue" />
             </ws-select>
           </ws-form-item>
           <ws-form-item label="产地" span="1" prop="unitPrice">
@@ -162,6 +160,19 @@
           </el-form-item>
         </el-form>
       </div>
+      <!--备注信息-->
+      <div class="center1">
+        <div class="small-title">
+          <h3>备注信息</h3>
+        </div>
+        <el-form style="display: block;" ref="dataList" :model="dataList" label-width="140px">
+          <el-form-item label="备注" span="1" prop="remark">
+            <el-input v-model="dataList.remark" maxlength="3000" class="typeselect" placeholder="请输入备注" />
+          </el-form-item>
+          <ws-upload ref="upload" :comp-id="compId" :appendix-ids="dataList.addressUrl" :size-limit="size"
+            @onChange="onChangeAddressUrl" accept=".jpg, .jpeg, .png" />
+        </el-form>
+      </div>
     </div>
     <!-- 提交 -->
     <div style="text-align: right; padding: 10px" class="center">
@@ -212,6 +223,7 @@
         //弹出框
         dialogViewSpareMoney: false,
         dialogApproveFormVisible: false,
+        dialogVisible: false,
         // 是否显示
         showType: true,
         // 年
@@ -288,6 +300,7 @@
           priceTypeKey: 2,
           packingType: '散装',
           packingTypeKey: 1,
+          addressUrl:'',
         },
         historyList: [],
         pickerBeginDateBefore: {
@@ -303,6 +316,17 @@
     },
     mounted() {},
     methods: {
+      onChangeAddressUrl() {
+        this.$refs.upload
+          .handleSaveBill()
+          .then(async response => {
+            this.dataList.addressUrl = response
+          })
+          .catch(res => {
+            EventBus.$emit('error', (JSON.parse(res) || {}).message)
+            this.$refs.upload.clearFiles()
+          })
+      },
       //返回按钮
       revert() {
         this.$router.go(-1)
@@ -811,6 +835,19 @@
                   .toPromise()
                   .then((response) => {
                     this.$message.success('添加成功');
+                    this.dataList = {
+                      taskTypeKey: '1',
+                      goodsName: '玉米',
+                      goodsNameKey: 1,
+                      salePlanType: '现货',
+                      salePlanTypeKey: 2,
+                      priceType: '定价销售',
+                      priceTypeKey: 2,
+                      packingType: '散装',
+                      packingTypeKey: 1,
+                      addressUrl: '',
+                      selectedOptions:''
+                    },
                     (this.outputYear = ''),
                     this.$router.push({
                       path: 'salesPlanList'
@@ -1150,7 +1187,10 @@
     width: 400px;
     height: 20px;
   }
-
+  .addressUrl {
+    margin: 0px 10px;
+    border-radius: 3px;
+  }
   //*号
   .unchangeable {
     position: absolute;