瀏覽代碼

Merge branch 'master' of http://47.100.3.209:3000/gdc/yiliangyiyun-pc

zhongtianhaoyuan 3 年之前
父節點
當前提交
6f93997a54
共有 27 個文件被更改,包括 763 次插入490 次删除
  1. 5 1
      src/api/V2/purchasingManagement/index.js
  2. 2 0
      src/api/V2/statisticalReport/index.js
  3. 7 1
      src/model/purchasingManagement/index.js
  4. 4 2
      src/model/statisticalReport/index.js
  5. 1 3
      src/views/contractManagement/futuresPurchaseContractAdd.vue
  6. 6 7
      src/views/contractManagement/futuresPurchaseContractEdit.vue
  7. 1 1
      src/views/contractManagement/futuresPurchaseContractExamine.vue
  8. 0 2
      src/views/contractManagement/futuresSalesContractAdd.vue
  9. 1 1
      src/views/contractManagement/purchaseContractEdit.vue
  10. 1 1
      src/views/contractManagement/purchaseContractExamine.vue
  11. 2 2
      src/views/customer/customerList.vue
  12. 16 10
      src/views/platformaudit/driverreview.vue
  13. 0 18
      src/views/platformaudit/grainmerchantreview.vue
  14. 2 1
      src/views/platformaudit/saletransactioninformationreview.vue
  15. 2 1
      src/views/platformaudit/transactioninformationreview.vue
  16. 6 7
      src/views/purchasingManagement/procurementPlanAdd.vue
  17. 4 5
      src/views/purchasingManagement/procurementPlanEdit.vue
  18. 1 1
      src/views/purchasingManagement/procurementPlanList.vue
  19. 169 33
      src/views/purchasingManagement/purchaseOrderList.vue
  20. 6 6
      src/views/salesManagement/salesPlanAdd.vue
  21. 4 5
      src/views/salesManagement/salesPlanEdit.vue
  22. 1 1
      src/views/salesManagement/salesPlanList.vue
  23. 29 7
      src/views/salesManagement/salesPlanOrderList.vue
  24. 110 81
      src/views/statisticalReport/purchaseClosingCashierList.vue
  25. 193 96
      src/views/statisticalReport/purchaseReceiptStatisticsList.vue
  26. 86 111
      src/views/statisticalReport/salesClosingCashierList.vue
  27. 104 86
      src/views/statisticalReport/salesDeliveryReportList.vue

+ 5 - 1
src/api/V2/purchasingManagement/index.js

@@ -25,4 +25,8 @@ export const API_POST_EDITSTATUS = '/purchaseOrder/api/editStatus'
 //采购状态,基差,单价修改 
 export const API_POST_PROCUREMENT_EDITSTATUS = '/procurementPlanInfo/api/editStatus'
 // 采购订单删除
-export const API_POST_DELETEPURCHASE = '/purchaseOrder/api/deletePurchaseOrder'
+export const API_POST_DELETEPURCHASE = '/purchaseOrder/api/deletePurchaseOrder'
+// 测试
+export const API_POST_SUBMIT = '/purchaseOrder/api/submitPurchaseOrder'
+// 审核通过不通过接口
+export const API_POST_WORKFLOW_API_HANDLE = `/workflow/api/handle`

+ 2 - 0
src/api/V2/statisticalReport/index.js

@@ -12,6 +12,8 @@ export const API_GET_PURCHASE_IN_CONTRACTNO = '/purchaseReceiptReport/selectCont
 export const API_POST_AMEND_PURCHRECEIPT = '/purchaseReceiptReport/api/editProcurementReceiptReport'
 // 采购入库补货结转
 export const API_POST_REPLANISHENT = '/purchaseReceiptReport/api/replenishment'
+// 采购入库补货结转其他合同
+export const API_GET_SELECTCONTRACTNO = '/purchaseReceiptReport/selectContractNo'
 // 采购入库审核
 export const API_POST_AUDIT = '/purchaseReceiptReport/api/examinePurchaseOrder'
 // 采购入库付款

+ 7 - 1
src/model/purchasingManagement/index.js

@@ -14,7 +14,9 @@ import {
     API_POST_EDITSTATUS,
     API_POST_PROCUREMENT_EDITSTATUS,
     API_POST_DELETEPURCHASE,
-    API_GET_PRICE_PURCHASE
+    API_GET_PRICE_PURCHASE,
+    API_POST_SUBMIT,
+    API_POST_WORKFLOW_API_HANDLE
 } from '@/api/V2/purchasingManagement'
 // import { API_GET_PROCUREMENT_LOOK } from '../../api/V2/purchasingManagement'
 //采购详情列表
@@ -45,3 +47,7 @@ export const procurementEditOther = appRx.post(API_POST_PROCUREMENT_EDITSTATUS,
 export const deletepurchase = appRx.post(API_POST_DELETEPURCHASE, errorCatcher,errorHandle,filter)
 //采购订单平仓查看成交价
 export const getTransactionPriceList = appRx.get(API_GET_PRICE_PURCHASE, errorCatcher,errorHandle,filter)
+//测试
+export const postsubmit = appRx.post(API_POST_SUBMIT, errorCatcher,errorHandle,filter)
+// 审核通过不通过
+export const posthandle = appRx.post(API_POST_WORKFLOW_API_HANDLE, errorCatcher,errorHandle,filter)

+ 4 - 2
src/model/statisticalReport/index.js

@@ -27,8 +27,8 @@ import {
     API_GET_PURCHASE_CONTRACTNO,
     API_GET_PURCHASE_IN_CONTRACTNO,
     API_GET_SELECTORDER,
-    API_GET_SELECTSALEORDER
-
+    API_GET_SELECTSALEORDER,
+    API_GET_SELECTCONTRACTNO
 } from '@/api/V2/statisticalReport'
 //采购入库报表
 export const getpurchreceipt = appRx.get(API_GET_PURCHRECEIPT, errorCatcher, errorHandle, filter)
@@ -44,6 +44,8 @@ export const getpurchaseincontractno = appRx.get(API_GET_PURCHASE_IN_CONTRACTNO,
 export const postamend = appRx.post(API_POST_AMEND_PURCHRECEIPT, errorCatcher, errorHandle, filter)
 //采购入库补货结转
 export const postreplanishent = appRx.post(API_POST_REPLANISHENT, errorCatcher, errorHandle, filter)
+//采购入库补货结转其他合同
+export const getselectctcontractno = appRx.get(API_GET_SELECTCONTRACTNO, errorCatcher, errorHandle, filter)
 //采购入库审核
 export const postaudit = appRx.post(API_POST_AUDIT, errorCatcher, errorHandle, filter)
 //采购入库付款

+ 1 - 3
src/views/contractManagement/futuresPurchaseContractAdd.vue

@@ -74,7 +74,7 @@
           />
         </ws-form-item>
         <!--买方电话-->
-        <ws-form-item label="买方电话" span="1" prop="contractNo">
+        <ws-form-item label="买方电话" span="1" prop="buyerPhone">
           <ws-input
             v-model.number="deptBudgetList.buyerPhone"
             placeholder="请输入买方电话"
@@ -717,8 +717,6 @@ export default {
     this.deptBudgetList.contractProcessInfo.gradeKey = 1
     this.deptBudgetList.contractGoodsInfo.grade = '一等品'
     this.deptBudgetList.contractGoodsInfo.gradeKey = 1
-    this.deptBudgetList.contractGoodsInfo.transgene = '不限'
-    this.deptBudgetList.contractGoodsInfo.gradeKey = 1
     getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
       .toPromise()
       .then((response) => {

+ 6 - 7
src/views/contractManagement/futuresPurchaseContractEdit.vue

@@ -741,6 +741,11 @@ export default {
         .toPromise()
         .then((response) => {
           this.deptBudgetList = response
+          if (this.deptBudgetList.deliverType == 1) {
+            this.deptBudgetList.deliverType1 = '我方自提'
+          } else if (this.deptBudgetList.deliverType == 2) {
+            this.deptBudgetList.deliverType1 = '对方送货'
+          }
           this.selectedOptions = tmp
           var tmp = []
           tmp[0] = TextToCode[response.deliveryProvince].code
@@ -765,12 +770,6 @@ export default {
           tmp1[1] =
             TextToCode[response.contractGoodsInfo.outputPrivate][response.contractGoodsInfo.outputCity].code
           this.selectedOptions1 = tmp1
-          if (this.deptBudgetList.deliverType == 1) {
-            this.deptBudgetList.deliverType1 = '我方自提'
-          } else if (this.deptBudgetList.deliverType == 2) {
-            this.deptBudgetList.deliverType1 = '对方送货'
-          }
-
           if (this.deptBudgetList.addressUrl != null) {
             this.addressUrls = this.deptBudgetList.addressUrl.split(',')
             this.fileList = this.deptBudgetList.addressUrl.split(',')
@@ -1143,7 +1142,7 @@ export default {
         })
         return
       }
-      if (!this.deptBudgetList.warehousingFee) {
+      if (this.deptBudgetList.warehousingFee == undefined || this.deptBudgetList.warehousingFee == null) {
         this.$message({
           message: '请输入入库费!',
           type: 'warning',

+ 1 - 1
src/views/contractManagement/futuresPurchaseContractExamine.vue

@@ -143,7 +143,7 @@
         <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
           {{ deptBudgetList.deliveryDateStart }}
         </ws-form-item>
-        <ws-form-item label="临时仓库负责人" span="1" prop="personCharge">
+        <ws-form-item label="临时仓库负责人" span="1" prop="personCharge" v-if="deptBudgetList.deliverType == 1">
           {{ deptBudgetList.personCharge }}
         </ws-form-item>
         <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">

+ 0 - 2
src/views/contractManagement/futuresSalesContractAdd.vue

@@ -717,8 +717,6 @@ export default {
     this.deptBudgetList.contractProcessInfo.gradeKey = 1
     this.deptBudgetList.contractGoodsInfo.grade = '一等品'
     this.deptBudgetList.contractGoodsInfo.gradeKey = 1
-    this.deptBudgetList.contractGoodsInfo.transgene = '不限'
-    this.deptBudgetList.contractGoodsInfo.gradeKey = 1
     getstaff({ compId: sessionStorage.getItem('ws-pf_compId') })
       .toPromise()
       .then((response) => {

+ 1 - 1
src/views/contractManagement/purchaseContractEdit.vue

@@ -309,7 +309,7 @@
           label="临时仓库负责人"
           span="1"
           prop="packingMethod"
-          v-show="deptBudgetList.deliverType == 1"
+          v-if="deptBudgetList.deliverType == 1"
         >
           <el-select
             v-model="deptBudgetList.personCharge"

+ 1 - 1
src/views/contractManagement/purchaseContractExamine.vue

@@ -140,7 +140,7 @@
         <ws-form-item label="最终实际交易量(吨)" span="1" prop="finalTradingVolume">
           {{ deptBudgetList.finalTradingVolume }}
         </ws-form-item>
-        <ws-form-item label="临时仓库负责人" span="1" prop="personCharge">
+        <ws-form-item label="临时仓库负责人" span="1" prop="personCharge" v-if="deptBudgetList.deliverType == 1">
           {{ deptBudgetList.personCharge }}
         </ws-form-item>
       </ws-info-table>

+ 2 - 2
src/views/customer/customerList.vue

@@ -140,7 +140,7 @@
           </template>
         </el-table-column>
         <el-table-column prop="customerName" label="客户名称">
-          <template scope="scope">
+          <!-- <template scope="scope">
             <span
               v-if="
                 scope.row.customerName == '' || scope.row.customerName == null
@@ -151,7 +151,7 @@
               v-if="scope.row.compName == '' || scope.row.compName == null"
               >{{ scope.row.customerName }}</span
             >
-          </template>
+          </template> -->
         </el-table-column>
         <el-table-column prop="compAddress" label="地址"></el-table-column>
         <el-table-column prop="customerPhone" label="电话"> </el-table-column>

+ 16 - 10
src/views/platformaudit/driverreview.vue

@@ -60,7 +60,7 @@
                 <ws-info-table>
                   <ws-form-item
                     :class="item.accountTypeFlag == 1 ? 'personage' : 'company'"
-                    v-if="item.accountTypeFlag == 1"
+                    v-if="item.accountTypeFlag =='1'"
                     label="收款人"
                     span="1"
                     prop="payeeName"
@@ -70,7 +70,7 @@
                   </ws-form-item>
                   <ws-form-item
                     :class="item.accountTypeFlag == 1 ? 'personage' : 'company'"
-                    v-if="item.accountTypeFlag == 2"
+                    v-else
                     label="企业名称"
                     span="1"
                     prop="compName"
@@ -80,7 +80,7 @@
                   </ws-form-item>
                   <ws-form-item
                     :class="item.accountTypeFlag == 1 ? 'personage' : 'company'"
-                    v-if="item.accountTypeFlag == 1"
+                    v-if="item.accountTypeFlag == '1'"
                     label="身份证"
                     span="1"
                     prop="payeeNumberCard"
@@ -88,13 +88,6 @@
                   >
                     <div style="width: 100%">
                       {{ item.payeeNumberCard }}
-                      <img
-                        width="12"
-                        height="13"
-                        src="../../../public/img/fujian-grey.png"
-                        alt=""
-                        @click="fujian1(item)"
-                      />
                     </div>
                   </ws-form-item>
                   <ws-form-item
@@ -131,6 +124,13 @@
                     prop="bankCard"
                     class="el-car"
                   >
+                   <img
+                        width="12"
+                        height="13"
+                        src="../../../public/img/fujian-grey.png"
+                        alt=""
+                        @click="fujian1(item)"
+                      />
                     <div style="width: 100%">{{ item.bankCard }}</div>
                   </ws-form-item>
                 </ws-info-table>
@@ -539,6 +539,8 @@ export default {
             response.records[i].carNumber =''
             response.records[i].carModel =''
             response.records[i].carLength =''
+             response.records[i].carLoad =''
+              response.records[i].yearManufacture =''
             response.records[i].expandsStatus = false
             if (response.records[i].addressUrl != null) {
               response.records[i].addressUrlArray =
@@ -554,6 +556,10 @@ export default {
               response.records[i].driverCarInfoList[0].carModel
               response.records[i].carLength =
               response.records[i].driverCarInfoList[0].carLength
+              response.records[i].carLoad =
+              response.records[i].driverCarInfoList[0].carLoad
+              response.records[i].yearManufacture =
+              response.records[i].driverCarInfoList[0].yearManufacture
             }
           }
             

+ 0 - 18
src/views/platformaudit/grainmerchantreview.vue

@@ -93,13 +93,6 @@
                 >
                   <div style="width: 100%">
                     {{ props.row.payeeNumberCard }}
-                    <img
-                      width="12"
-                      height="13"
-                      src="../../../public/img/fujian-grey.png"
-                      alt=""
-                      @click="fujian1(props.row)"
-                    />
                   </div>
                 </ws-form-item>
                 <ws-form-item
@@ -574,17 +567,6 @@ export default {
       this.accessoryimages.payeeAddressUrl1=row.payeeAddressUrl.split(',')[1]
       this.accessoryTFs=true
     },
-    fujian1(item) {
-      if (item.cardAddressUrl === null || item.cardAddressUrl === '') {
-        EventBus.$emit(
-          'warning',
-          this.$t('system.noticeCircular.NoInformation')
-        )
-      } else {
-        this.accesscard = true
-      }
-      this.accessurl = item.cardAddressUrl
-    },
     handleExamine(row) {
       this.$router.push({
         name: 'salesContractExamine',

+ 2 - 1
src/views/platformaudit/saletransactioninformationreview.vue

@@ -20,7 +20,7 @@
         </ws-select>
         <ws-input
           v-model="searchKeyWord"
-          placeholder="可按编号、发布企业和发布方查找"
+          placeholder="可按编号、发布方和货名查找"
           clearable
           maxlength="500"
           type="input"
@@ -293,6 +293,7 @@ export default {
           this.searchType = this.searchTypeList[i].type
         }
       }
+      this.currentPage= 1
       this.getList()
     },
     //审核通过

+ 2 - 1
src/views/platformaudit/transactioninformationreview.vue

@@ -20,7 +20,7 @@
         </ws-select>
         <ws-input
           v-model="searchKeyWord"
-          placeholder="可按编号、发布企业和发布方查找"
+          placeholder="可按编号、发布方和货名查找"
           clearable
           maxlength="500"
           type="input"
@@ -293,6 +293,7 @@ export default {
           this.searchType = this.searchTypeList[i].type
         }
       }
+      this.currentPage= 1
       this.getList()
     },
     //审核通过

+ 6 - 7
src/views/purchasingManagement/procurementPlanAdd.vue

@@ -272,7 +272,7 @@
 </template>
 <script>
 import { procurementAdd } from '@/model/purchasingManagement/index'
-import { regionData,provinceAndCityDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
+import { regionData,provinceAndCityData, CodeToText, TextToCode } from 'element-china-area-data'
 import { packList } from '@/model/contarct/index'
 import { getwarehousename } from '@/model/tasksport/index'
 import Pagination from '@/components/Pagination'
@@ -306,7 +306,7 @@ export default {
       // 年
       year: '',
       options_: regionData,
-      options1_:provinceAndCityDataPlus,
+      options1_:provinceAndCityData,
       packingTypeList: '',
       procurementPlanTypeList: '',
       freightPayerList: '',
@@ -515,9 +515,8 @@ export default {
     },
     handleChange1(value) {
       this.selectedOptions1 = value
-      this.dataList.receivePrivate = CodeToText[value[0]]
-      this.dataList.receiveCity = CodeToText[value[1]]
-      this.dataList.receiveArea = CodeToText[value[2]]
+      this.dataList.outputPrivate = CodeToText[value[0]]
+      this.dataList.outputCity = CodeToText[value[1]]
     },
     sendWarehousechange(e) {
       for (let i = 0; i < this.warehouseList.length; i++) {
@@ -734,7 +733,7 @@ export default {
         })
         return
       }
-      if (this.dataList.buyerPhone.length!=11) {
+      if (this.dataList.buyerPhone.length > 15 || this.dataList.buyerPhone.length < 6) {
         this.$message({
           message: '买方电话输入错误!',
           type: 'warning'
@@ -867,7 +866,7 @@ export default {
               // this.dataList.goodsType = 1
               this.dataList.pcFlag = 1
               this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
-              console.log(this.dataList,"查看添加对象")
+              console.log(this.dataList,'查看添加对象')
               procurementAdd(this.dataList)
                 .toPromise()
                 .then(response => {

+ 4 - 5
src/views/purchasingManagement/procurementPlanEdit.vue

@@ -345,7 +345,7 @@ import {
   regionData,
   CodeToText,
   TextToCode,
-  provinceAndCityDataPlus,
+  provinceAndCityData,
 } from 'element-china-area-data'
 import { packList } from '@/model/contarct/index'
 import Pagination from '@/components/Pagination'
@@ -383,7 +383,7 @@ export default {
       showType: true,
       // 年
       year: '',
-      options1_: provinceAndCityDataPlus,
+      options1_: provinceAndCityData,
       options_: regionData,
       packingTypeList: '',
       procurementPlanTypeList: '',
@@ -587,9 +587,8 @@ export default {
     },
     handleChange1(value) {
       this.selectedOptions1 = value
-      this.dataList.receivePrivate = CodeToText[value[0]]
-      this.dataList.receiveCity = CodeToText[value[1]]
-      this.dataList.receiveArea = CodeToText[value[2]]
+      this.dataList.outputPrivate = CodeToText[value[0]]
+      this.dataList.outputCity = CodeToText[value[1]]
     },
     submit() {
       if (this.outputYear) {

+ 1 - 1
src/views/purchasingManagement/procurementPlanList.vue

@@ -12,7 +12,7 @@
       <template slot="right">
         <ws-input
           v-model="searchKeyWord"
-          placeholder="可按采购计划编号和标题查找"
+          placeholder="可按采购计划编号、标题和货名查找"
           clearable
           maxlength="500"
           type="input"

+ 169 - 33
src/views/purchasingManagement/purchaseOrderList.vue

@@ -2,7 +2,7 @@
 <template>
   <div>
     <BaseHeaderLayout :leftSpan="15">
-      <template slot="left"> </template>
+      <template slot="left"></template>
       <template slot="right">
         <ws-select
           v-model="searchTypeText"
@@ -85,9 +85,10 @@
         prop="unitPrice"
         label="单价(元/吨)"
       >
-        <template slot-scope="scope">
+              <template slot-scope="scope">
           {{ scope.row.unitPrice }}
           <i
+            v-if="scope.row.procurementPlanType == '期货'"
             @click="Changepricerecord(scope.row)"
             class="iconfont icon-lishi"
           ></i>
@@ -100,8 +101,44 @@
         width="100"
       >
         <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span
+            v-if="
+              !scope.row.basischange &&
+              scope.row.basis &&
+              scope.row.procurementPlanType == '期货'
+            "
+            >{{ '+'+scope.row.basis }}</span
+          >
+          <input
+            v-if="scope.row.basischange"
+            style="width: 60px"
+            v-model="basis"
+            type="text"
+          />
+          <!--改基差-->
+          <i
+            @click="changebasis(scope.row)"
+            v-if="scope.row.basischange && scope.row.procurementPlanType == '期货'"
+            class="iconfont icon-dui"
+          ></i>
+          <img
+            v-if="
+              !scope.row.basischange &&
+              scope.row.basis &&
+              scope.row.procurementPlanType == '期货'
+            "
+            width="17"
+            height="18"
+            style="vertical-align: text-top; position: relative; top: -1px"
+            src="../../../public/img/edit.png"
+            @click="editbasis(scope.row)"
+            alt=""
+          />
+          <span v-if="!scope.row.basis">-</span>
+        </template>
+        <!-- <template slot-scope="scope">
           <div class="inputChenge">
-            <!-- readonly -->
             <el-input
               v-model="scope.row.basis"
               v-if="scope.row.identification == 'true'"
@@ -125,7 +162,7 @@
             v-if="scope.row.identification == 'true'"
             @click="varietyClick(scope.row)"
           ></i>
-        </template>
+        </template> -->
       </el-table-column>
 
       <el-table-column
@@ -134,25 +171,49 @@
         label="冻结定金(元)"
         width="90"
       >
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.freezingDeposit
+          }}</span>
+        </template>
       </el-table-column>
       <el-table-column
         class="table_td"
         prop="defaultDeposit"
         label="拖欠定金(元)"
         width="100"
-      ></el-table-column>
+      >
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.defaultDeposit
+          }}</span>
+        </template></el-table-column>
       <el-table-column
         width="100"
         class="table_td"
         prop="unloadingCharge"
         label="卸车费(元/吨)"
-      ></el-table-column>
+      >
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.unloadingCharge
+          }}</span>
+        </template></el-table-column>
       <el-table-column
         width="100"
         class="table_td"
         prop="invoiceFee"
         label="发票费(元/吨)"
-      ></el-table-column>
+      >
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.invoiceFee
+          }}</span>
+        </template></el-table-column>
       <el-table-column
         class="table_td"
         prop="transactionsNumber"
@@ -164,15 +225,24 @@
         prop="stockInQuantity"
         label="已入库量(吨)"
         width="90"
-      ></el-table-column>
+      >
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.stockInQuantity
+          }}</span>
+        </template></el-table-column>
       <el-table-column
         class="table_td"
         prop="openPosition"
         label="可平仓量(吨)"
         width="90"
       >
-        <template slot-scope="scope">
-          {{ scope.row.openPosition }}
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.openPosition
+          }}</span>
         </template>
       </el-table-column>
       <el-table-column
@@ -181,9 +251,13 @@
         label="已平仓量(吨)"
         width="90"
       >
-        <template slot-scope="scope">
-          {{ scope.row.closedPosition }}
+      <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.procurementPlanType == '期货'">{{
+            scope.row.closedPosition
+          }}</span>
           <i
+            v-if="scope.row.procurementPlanType == '期货'"
             @click="closedPositionLook(scope.row)"
             class="iconfont icon-lishi"
           ></i>
@@ -195,9 +269,13 @@
         label="已成交量(吨)"
         width="90"
       >
-        <template slot-scope="scope">
-          {{ scope.row.cumulativeTurnover }}
+       <template slot-scope="scope">
+          <span v-if="scope.row.procurementPlanType == '现货'">--</span>
+          <span v-if="scope.row.salePlanprocurementPlanTypeType == '期货'">{{
+            scope.row.cumulativeTurnover
+          }}</span>
           <i
+            v-if="scope.row.procurementPlanType == '期货'"
             @click="transactionRecord(scope.row)"
             class="iconfont icon-lishi"
           ></i>
@@ -212,6 +290,7 @@
       <el-table-column prop="packingType" label="包装方式">
         <template slot-scope="scope">
           <el-popover
+            v-if="scope.row.packingType != '散装'"
             placement="top"
             :width="160"
             trigger="hover"
@@ -225,12 +304,13 @@
             <div>
               <span
                 style="margin-left: 6px"
-                v-if="scope.row.packingType != '散装'"
+                
               >
                 {{ scope.row.baggingNotes }}</span
               >
             </div>
           </el-popover>
+          <span v-else>{{ scope.row.packingType }}</span>
         </template>
       </el-table-column>
 
@@ -281,6 +361,7 @@
               class="record"
               @click="nocomplete1(scope.row)"
               v-else-if="scope.row.procurementPlanType != '现货'&&scope.row.receiptUnpaid != null&&scope.row.receiptUnpaid==0">已结算</div>
+              <div v-else>--</div>
           </template>
           </el-table-column >
       <el-table-column
@@ -297,6 +378,7 @@
               class="record"
               @click="nocomplete(scope.row)"
               v-else-if="scope.row.procurementPlanType != '现货'&&scope.row.closedUnpaid != null&&scope.row.closedUnpaid ==0">已结算</div>
+              <div v-else>--</div>
           </template>
           </el-table-column >
       <el-table-column prop="seller" label="操作" width="310">
@@ -374,7 +456,7 @@
           <!-- 审核 -->
           <!-- "(scope.row.status == '已通过' || scope.row.status == '已成交') && scope.row.procurementPlanType != '现货'" -->
           <div
-            v-if="scope.row.status == '待审核'"
+            v-if="scope.row.status == '待审核'&&scope.row.taskId!=null"
             type="text"
             class="record"
             @click="aduit(scope.row)"
@@ -667,7 +749,7 @@
             class="deal"
           ></el-input>
         </el-form-item>
-        <el-form-item label="发票费用(元/吨)" :label-width="formLabelWidth">
+        <el-form-item v-if='aduitlist.procurementPlanType=="期货"' label="发票费用(元/吨)" :label-width="formLabelWidth">
           <el-input
             v-model="aduitlist.invoiceFee"
             autocomplete="off"
@@ -845,6 +927,8 @@ import {
   aduitcontractno,
   editStatus,
   deletepurchase,
+  postsubmit,
+  posthandle
 } from '@/model/purchasingManagement/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
@@ -971,6 +1055,16 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    handletest(){
+      postsubmit({ id: 'b1df1547e79e4d4aaa92b4ce8793d0a1'})
+          .toPromise()
+          .then((response) => {
+            console.log(111)
+          })
+          .catch((req) => {
+
+          })
+    },
     transaction(e){
       for (let i = 0; i < this.transactionRecordList1.length; i++) {
         if(this.transactionRecordList1[i].key==e){
@@ -1011,6 +1105,21 @@ export default {
           return
         }
       }
+      if (
+        (row.basis&&
+          String(row.basis).indexOf('.') != -1 &&
+          String(row.basis).length -
+            (String(row.basis).indexOf('.') + 1) >
+            2) ||
+        row.basis > 100000 ||
+        row.basis < 0
+      ) {
+        this.$message({
+          message: '基差输入错误',
+          type: 'warning',
+        })
+        return
+      }
       if (!row.basis) {
         this.$message({
           message: '基差不能为空!',
@@ -1026,7 +1135,7 @@ export default {
         .then(() => {
           editStatus({
             flag: 3,
-            basis: row.basis,
+            basis: '-'+row.basis,
             id: row.id,
           })
             .toPromise()
@@ -1104,6 +1213,22 @@ export default {
             this.$message.success('删除订单失败')
           })
       })
+    },
+     //修改基差
+    changebasis(item) {
+      editStatus({ basis: this.basis, id: item.id, flag: 3 })
+        .toPromise()
+        .then((response) => {
+          this.$message.success('修改基差成功')
+          this.getList()
+        })
+        .catch((req) => {
+          this.$message.success('修改基差失败')
+        })
+    },
+    editbasis(item) {
+      this.basis = item.basis
+      item.basischange = true
     },
     closepositionconfirm() {
       this.closePositionList1.compId = sessionStorage.getItem('ws-pf_compId')
@@ -1166,21 +1291,21 @@ export default {
         })
         return
       }
-      if (
-        (this.closePositionList1.closingBasis &&
-          String(this.closePositionList1.closingBasis).indexOf('.') != -1 &&
-          String(this.closePositionList1.closingBasis).length -
-            (String(this.closePositionList1.closingBasis).indexOf('.') + 1) >
-            2) ||
-        this.closePositionList1.closingBasis > 10000 ||
-        this.closePositionList1.closingBasis < 1
-      ) {
-        this.$message({
-          message: '平仓基差输入错误',
-          type: 'warning',
-        })
-        return
-      }
+      // if (
+      //   (this.closePositionList1.closingBasis &&
+      //     String(this.closePositionList1.closingBasis).indexOf('.') != -1 &&
+      //     String(this.closePositionList1.closingBasis).length -
+      //       (String(this.closePositionList1.closingBasis).indexOf('.') + 1) >
+      //       2) ||
+      //   this.closePositionList1.closingBasis > 10000 ||
+      //   this.closePositionList1.closingBasis < 1
+      // ) {
+      //   this.$message({
+      //     message: '平仓基差输入错误',
+      //     type: 'warning',
+      //   })
+      //   return
+      // }
       if (!this.closePositionList1.closePositionDate) {
         this.$message({
           message: '平仓日期不能为空!',
@@ -1312,6 +1437,7 @@ export default {
     aduit(item) {
       this.dialogFormVisible4 = true
       this.aduitlist.id = item.id
+      this.aduitlist.taskId=item.taskId
       this.aduitlist.type = '采购'
       this.$set(this.aduitlist, 'seller', item.seller)
       this.$set(this.aduitlist, 'sellerPhone', item.sellerPhone)
@@ -1413,6 +1539,9 @@ export default {
       this.aduitlist.procurementPlanType = this.aduitlist.procurementPlanType
        if (this.aduitlist.procurementPlanType == '期货') {
            this.aduitlist.freezingDeposit = this.aduitlist.transactionsNumber*this.aduitlist.depositRatio
+           if(this.aduitlist.invoiceFee){
+             this.aduitlist.invoiceFee=-Math.abs(this.aduitlist.invoiceFee)
+           }
        }
       this.dialogFormVisible4 = false
       this.$confirm(`审核通过后,将通知客户订单生效,是否确定通过审核?`, {
@@ -1422,10 +1551,17 @@ export default {
       }).then(() => {
         aduitpurchase(this.aduitlist)
           .toPromise()
+          .then((response) => {
+            posthandle({ taskId: this.aduitlist.taskId,
+            approved: true,
+            auditMind: '34',
+            needReapply: false,})
+             .toPromise()
           .then((response) => {
             this.$message.success('审核成功')
             this.aduitlist = {}
             this.getList()
+            })
           })
       })
     },

+ 6 - 6
src/views/salesManagement/salesPlanAdd.vue

@@ -320,6 +320,7 @@
               type="year"
               align="right"
               unlink-panels
+              value-format='yyyy'
               range-separator="至"
               placeholder="产出年份"
             ></el-date-picker>
@@ -339,7 +340,7 @@
 import { saleAdd } from '@/model/salesManagement/index'
 import {
   regionData,
-  provinceAndCityDataPlus,
+  provinceAndCityData,
   CodeToText,
   TextToCode,
 } from 'element-china-area-data'
@@ -374,7 +375,7 @@ export default {
       // 年
       year: '',
       options_: regionData,
-      options1_: provinceAndCityDataPlus,
+      options1_: provinceAndCityData,
       packingTypeList: '',
       salePlanTypeList: '',
       freightPayerList: '',
@@ -591,9 +592,8 @@ export default {
     },
     handleChange1(value) {
       this.selectedOptions1 = value
-      this.dataList.sendPrivate = CodeToText[value[0]]
-      this.dataList.sendCity = CodeToText[value[1]]
-      this.dataList.sendArea = CodeToText[value[2]]
+      this.dataList.outputPrivate = CodeToText[value[0]]
+      this.dataList.outputCity = CodeToText[value[1]]
     },
     sendWarehousechange(e) {
       for (let i = 0; i < this.warehouseList.length; i++) {
@@ -833,7 +833,7 @@ export default {
         })
         return
       }
-      if (this.dataList.sellerPhone.length != 11) {
+      if (this.dataList.sellerPhone.length > 15 || this.dataList.sellerPhone.length < 6) {
         this.$message({
           message: '卖方电话输入错误!',
           type: 'warning',

+ 4 - 5
src/views/salesManagement/salesPlanEdit.vue

@@ -288,7 +288,7 @@ import {
   saleLook,
   saleEdit,
 } from '@/model/salesManagement/index'
-import { regionData, CodeToText, TextToCode ,provinceAndCityDataPlus} from 'element-china-area-data'
+import { regionData, CodeToText, TextToCode ,provinceAndCityData} from 'element-china-area-data'
 import Pagination from '@/components/Pagination'
 import { packList } from '@/model/contarct/index'
 import { mapActions, mapGetters, mapState } from 'vuex'
@@ -325,7 +325,7 @@ export default {
       showType: true,
       // 年
       year: '',
-      options1_: provinceAndCityDataPlus,
+      options1_: provinceAndCityData,
       options_: regionData,
       contractNoList: [],
       deptBudgetTotal: 0,
@@ -530,9 +530,8 @@ export default {
     },
     handleChange1(value) {
       this.selectedOptions1 = value
-      this.dataList.sendPrivate = CodeToText[value[0]]
-      this.dataList.sendCity = CodeToText[value[1]]
-      this.dataList.sendArea = CodeToText[value[2]]
+      this.dataList.outputPrivate = CodeToText[value[0]]
+      this.dataList.outputCity = CodeToText[value[1]]
     },
     submit() {
       if (this.outputYear) {

+ 1 - 1
src/views/salesManagement/salesPlanList.vue

@@ -9,7 +9,7 @@
       <template slot="right">
         <ws-input
           v-model="searchKeyWord"
-          placeholder="可按销售计划编号和标题查找"
+          placeholder="可按采购计划编号、标题和货名查找"
           clearable
           maxlength="500"
           type="input"

+ 29 - 7
src/views/salesManagement/salesPlanOrderList.vue

@@ -85,7 +85,7 @@
         prop="unitPrice"
         label="单价(元/吨)"
       >
-        <!--改价记录-->
+        <!--改价记录--> 
         <template slot-scope="scope">
           {{ scope.row.unitPrice }}
           <i
@@ -338,6 +338,7 @@
     font-size: 14px;'
               @click="nocomplete1(scope.row)"
               v-else-if="scope.row.procurementPlanType != '现货'&&scope.row.deliveryUnpaid != null&&scope.row.deliveryUnpaid==0">已结算</div>
+              <div v-else>--</div>
           </template></el-table-column>
       <el-table-column
         class="table_td"
@@ -362,6 +363,7 @@
     font-size: 14px;'
               @click="nocomplete(scope.row)"
               v-else-if="scope.row.procurementPlanType != '现货'&&scope.row.closedUnpaid != null&&scope.row.closedUnpaid ==0">已结算</div>
+              <div v-else>--</div>
           </template></el-table-column>
       <el-table-column prop="seller" label="操作" width="360">
         <template slot-scope="scope">
@@ -910,13 +912,16 @@
     </el-dialog>
     <!--改价记录-->
     <el-dialog
-      width="30%"
+      width="10%"
       title="改价记录"
       :visible.sync="dialogFormVisible5"
       :append-to-body="true"
     >
       <div v-for="item in pricechange">
-        <div>{{ item.priceType }}{{ item.price }}</div>
+        <div>{{ item.priceType }}</div>
+        <div class="price">
+          {{ item.price }}
+        </div>
         <div>{{ item.updateDate }}</div>
       </div>
     </el-dialog>
@@ -936,6 +941,9 @@ import {
   deletesale,
   getsalepricelist,
 } from '@/model/salesManagement/index'
+import {
+  posthandle
+} from '@/model/purchasingManagement/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -1362,6 +1370,7 @@ export default {
           this.closePositionList1 = {}
           this.dialogFormVisible2 = false
           this.getList()
+          
         })
         .catch((req) => {
           this.$message.warning('平仓失败')
@@ -1500,6 +1509,7 @@ export default {
     aduit(item) {
       this.dialogFormVisible4 = true
       this.aduitlist.id = item.id
+      this.aduitlist.taskId=item.taskId
       this.aduitlist.type = '销售'
       this.$set(this.aduitlist, 'buyer', item.buyer)
       this.$set(this.aduitlist, 'buyerPhone', item.buyerPhone)
@@ -1604,9 +1614,17 @@ export default {
       }).then(() => {
         aduitsale(this.aduitlist)
           .toPromise()
+          .then((response) => {
+            posthandle({ taskId: this.aduitlist.taskId,
+            approved: true,
+            auditMind: '34',
+            needReapply: false,})
+             .toPromise()
           .then((response) => {
             this.$message.success('审核成功')
+            this.aduitlist = {}
             this.getList()
+            })
           })
       })
     },
@@ -1639,10 +1657,10 @@ export default {
         .then((response) => {
           for (var i = 0; i < response.records.length; i++) {
             response.records[i].basischange = false
-            response.records[i].openPosition =
-              response.records[i].cumulativeTurnover -
-              response.records[i].closedPosition -
-              response.records[i].stockOutQuantity
+            // response.records[i].openPosition =
+            //   response.records[i].cumulativeTurnover -
+            //   response.records[i].closedPosition -
+            //   response.records[i].stockOutQuantity
           }
           this.warehouseList = response
           this.deptCircularPage.currentPage = response.current
@@ -2077,4 +2095,8 @@ hr {
   background-color: #fff;
   height: 50px;
 }
+.price {
+  margin-left: 97px;
+  margin-top: -19px;
+}
 </style>

+ 110 - 81
src/views/statisticalReport/purchaseClosingCashierList.vue

@@ -8,25 +8,16 @@
           <ws-button :type="searchType==2?'primary':''" @click="handlestatus(2)">待结算</ws-button>
           <ws-button :type="searchType==3?'primary':''" @click="handlestatus(3)">已结算</ws-button>
           <ws-button :type="searchType==''?'primary':''" @click="handlestatus('')">全部</ws-button>
-         <ws-button v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.procurementCloseReport.view`
-          " @click="handlepass1()">通过</ws-button>
-          <ws-button v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.procurementCloseReport.view`
-          " @click="handlereject(3)">驳回</ws-button>
-          <ws-button v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.procurementCloseReport.view`
           " @click="handlepass()">通过</ws-button>
-          <ws-button v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.procurementCloseReport.view`
-          " @click="handlereject(2)">驳回</ws-button>
-          <ws-button v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.procurementCloseReport.view`
-          " @click="handleAudit()">审核</ws-button>
-          <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          " @click="handlereject()">驳回</ws-button>
+          <ws-button type="primary" v-hasPermission="
             `report.procurementCloseReport.payment`
           " @click="handlepayment()">付款</ws-button>
-          <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.procurementCloseReport.recive`
           " @click="handlecollect()">收款</ws-button>
         </el-col>
@@ -70,9 +61,10 @@
           border
           :summary-method="getSummaries"
           show-summary
+          
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column :selectable='selectInit' type="selection" width="55"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
           <el-table-column class="table_td" prop="contractNo" label="合同编号"></el-table-column>
           <el-table-column class="table_td" prop="closePositionDate" label="平仓日期"></el-table-column>
@@ -90,7 +82,12 @@
           <el-table-column class="table_td" prop="collectionDate" label="收款日期"></el-table-column>
           <el-table-column class="table_td" prop="customerName" label="客户"></el-table-column>
           <el-table-column class="table_td" prop="warehouseName" label="库点"></el-table-column>
-          <el-table-column prop="status" label="状态"></el-table-column>
+          <el-table-column prop="status" label="状态">
+            <template slot-scope="scope">
+            <span v-if='scope.row.approveStatus!=null'>{{ scope.row.approveStatus }}</span>
+            <span v-else>{{ scope.row.status }}</span>
+          </template>
+          </el-table-column>
         </el-table>
 
         <!-- 页数 -->
@@ -220,6 +217,9 @@ import {
   closepaymoney,
   closecollmoney
 } from '@/model/statisticalReport/index'
+import {
+  posthandle
+} from '@/model/purchasingManagement/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -319,6 +319,18 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    selectInit(row){
+//在这里一定要记得类型匹配的上。
+            if(row.approveStatus==null){
+                return true  
+            }else if(row.approveStatus!=null){    
+              if(row.taskId==null){
+                return false 
+              }else{
+                return true  
+              }
+            }
+        },
     contractchange(e){ 
       this.contractNo=e
       this.getList()
@@ -349,8 +361,41 @@ export default {
         }
       }
     },
+    audit(item,index,status){
+      if(index<this.modification.length){
+        posthandle({ taskId: item.taskId,
+            approved: status,
+            auditMind: '34',
+            needReapply: false,})
+             .toPromise()
+          .then((response) => {
+            this.audit(this.modification[index+1],index+1,status)
+          }).catch((req) => {
+              this.$message.warning(req.message)
+            })
+      }else{
+        if(status){
+          this.$message.success('通过成功')
+          this.getList()
+        }else if(!status){
+            closeaudit({
+            flag: 2,
+            purchaseReceiptReportList: this.modification,
+          })
+            .toPromise()
+            .then((response) => {
+              this.$message.success('驳回成功')
+              this.getList()
+            })
+            .catch((req) => {
+              this.$message.success('驳回失败')
+            })
+        }
+      }
+    },
     //统计审核
     handleAudit(){
+      var that=this
       if(this.modification.length==0){
         this.$message.warning('请选择一条要审核的条目')
       }else{
@@ -359,31 +404,34 @@ export default {
         confirmButtonText: '确定',
         type: 'warning'
       }).then(() => {
-        closeaudit({roleFlag:1,flag:1,purchaseClosingReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('审核成功')
-          this.getList()
-        }).catch
+        // closeaudit({roleFlag:1,flag:1,purchaseClosingReportList:this.modification}).toPromise()
+        // .then(response => {
+        //   this.$message.success('审核成功')
+        //   this.getList()
+        // })
+            that.audit(this.modification[0],0,true,1)
       })
       }
     },
     //驳回
     handlereject(status){
+      var that=this
       if(this.modification.length==0){
         this.$message.warning('请选择要驳回的条目')
       }else{
-        this.$confirm(`驳回后任务将退回到统计,是否确定驳回?`, {
+        this.$confirm(`是否确定驳回?`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning'
       }).then(() => {
-        postaudit({roleFlag:status,flag:2,purchaseClosingReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('驳回成功')
-          this.getList()
-        }).catch(req => {
-          this.$message.success('驳回失败')
-        })
+        // postaudit({roleFlag:status,flag:2,purchaseClosingReportList:this.modification}).toPromise()
+        // .then(response => {
+        //   this.$message.success('驳回成功')
+        //   this.getList()
+        // }).catch(req => {
+        //   this.$message.success('驳回失败')
+        // })
+            that.audit(this.modification[0],0,false)
       })
       }
     },
@@ -448,38 +496,38 @@ export default {
         })
     },
     getList() {
-      if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
-        this.roleFlag=1
-      }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
-        this.roleFlag=2
-      }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
-        this.roleFlag=3
-      }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
-        this.roleFlag=4
-      }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
-        this.roleFlag=''
-      }
+      // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
+      //   this.roleFlag=1
+      // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
+      //   this.roleFlag=2
+      // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
+      //   this.roleFlag=3
+      // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
+      //   this.roleFlag=4
+      // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
+      //   this.roleFlag=''
+      // }
       getclose({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         searchType: this.searchType,
         contractNo:this.contractNo,
-        roleFlag:this.roleFlag
+        // roleFlag:this.roleFlag
       })
         .toPromise()
         .then(response => {
-          for (var i = 0; i < response.records.length; i++) {
-            if((response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity>0){
-              response.records[i].amountIngPayable=(response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity
-            }
-            else{
-              response.records[i].collectionIngPayable=response.records[i].collectionIngPayable+Math.abs((response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity)
-              response.records[i].amountIngPayable=0
-              response.records[i].amountEdPayable=0
-              response.records[i].amountNotPayable=0
-            }
-          }
+          // for (var i = 0; i < response.records.length; i++) {
+          //   if((response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity>0){
+          //     response.records[i].amountIngPayable=(response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity
+          //   }
+          //   else{
+          //     response.records[i].collectionIngPayable=response.records[i].collectionIngPayable+Math.abs((response.records[i].transactionPrice-response.records[i].closeRate+response.records[i].basisPrice)*response.records[i].closingQuantity)
+          //     response.records[i].amountIngPayable=0
+          //     response.records[i].amountEdPayable=0
+          //     response.records[i].amountNotPayable=0
+          //   }
+          // }
           this.warehouseList = response
           this.deptBudgetTotal=response.total
         })
@@ -507,43 +555,24 @@ export default {
     handleDownload(file) {
       console.log(file)
     },
-    //财务通过
     handlepass(){
+      var that=this
       if(this.modification.length==0){
         this.$message.warning('请选择要通过的条目')
       }else{
-        this.$confirm(`审核通过后,任务将发送给决策人,是否确定通过?`, {
+        this.$confirm(`是否确定通过?`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning'
       }).then(() => {
-        postaudit({roleFlag:2,flag:1,purchaseClosingReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('通过成功')
-          this.getList()
-        }).catch(req => {
-          this.$message.success('通过失败')
-        })
-      })
-      }
-    },
-    //决策人通过
-    handlepass1(){
-      if(this.modification.length==0){
-        this.$message.warning('请选择要通过的条目')
-      }else{
-        this.$confirm(`审核通过后,任务将发送给出纳,是否确定通过?`, {
-        cancelButtonText: '取消',
-        confirmButtonText: '确定',
-        type: 'warning'
-      }).then(() => {
-        closeaudit({roleFlag:3,flag:1,purchaseClosingReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('通过成功')
-          this.getList()
-        }).catch(req => {
-          this.$message.success('通过失败')
-        })
+        // postaudit({roleFlag:2,flag:1,purchaseClosingReportList:this.modification}).toPromise()
+        // .then(response => {
+        //   this.$message.success('通过成功')
+        //   this.getList()
+        // }).catch(req => {
+        //   this.$message.success('通过失败')
+        // })
+            that.audit(this.modification[0],0,true)
       })
       }
     },

+ 193 - 96
src/views/statisticalReport/purchaseReceiptStatisticsList.vue

@@ -8,33 +8,24 @@
           <ws-button :type="searchType==2?'primary':''" @click="handlestatus(2)">待结算</ws-button>
           <ws-button :type="searchType==3?'primary':''" @click="handlestatus(3)">已结算</ws-button>
           <ws-button :type="searchType==''?'primary':''" @click="handlestatus('')">全部</ws-button>
-        <ws-button v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary"  v-hasPermission="
-            `report.procurementInReport.view`
-          " @click="handlepass1()">通过</ws-button>
-        <ws-button v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.procurementInReport.view`
-          " @click="handlereject(3)">驳回</ws-button>
-        <ws-button v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+        <ws-button type="primary" v-hasPermission="
             `report.procurementInReport.view`
           " @click="handlepass()">通过</ws-button>
-        <ws-button v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+        <ws-button type="primary" v-hasPermission="
             `report.procurementInReport.view`
-          " @click="handlereject(2)">驳回</ws-button>
-        <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          " @click="handlereject()">驳回</ws-button>
+        <ws-button type="primary" v-hasPermission="
             `report.procurementInReport.payment`
           " @click="handlepayment">付款</ws-button>
-        <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+        <ws-button type="primary" v-hasPermission="
             `report.procurementInReport.draw`
           " @click="handleninvoice">开发票</ws-button>
-        <ws-button v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+        <ws-button type="primary" v-hasPermission="
             `report.procurementInReport.edit`
           " @click="amend()">修改</ws-button>
-        <ws-button v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+        <ws-button type="primary" v-hasPermission="
             `report.procurementInReport.carry`
           " @click="carryover">补货结转</ws-button>
-        <ws-button  v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.procurementInReport.view`
-          " @click="handleAudit()">审核</ws-button>
         </el-col>
         <el-col style='text-align:right;line-height:60px;padding-right:10px;' :span="8">
         <ws-select
@@ -83,9 +74,10 @@
         border
         :summary-method="getSummaries"
         show-summary
+        
         @selection-change="handleSelectionChange"
       >
-        <el-table-column type="selection" width="55"></el-table-column>
+        <el-table-column :selectable='selectInit' type="selection" width="55"></el-table-column>
         <el-table-column type="index" label="序号" width="50"></el-table-column>
         <el-table-column
           class="table_td"
@@ -106,7 +98,9 @@
           class="table_td"
           prop="carNo"
           label="车牌号"
-        ></el-table-column>
+        ><template slot-scope="scope">
+              {{scope.row.carNo}}({{scope.row.tranCarNo}})
+              </template></el-table-column>
         <el-table-column
           class="table_td"
           prop="warehousingDate"
@@ -232,7 +226,13 @@
           </template>
         </el-table-column>
 
-        <el-table-column label="状态" prop="status"></el-table-column>
+        <el-table-column label="状态" prop="status">
+          <template slot-scope="scope">
+            <span v-if='scope.row.approveStatus!=null'>{{ scope.row.approveStatus }}</span>
+            <span v-else>{{ scope.row.status }}</span>
+          </template>
+        </el-table-column>
+        
       </el-table>
 
       <!-- 页数 -->
@@ -418,10 +418,10 @@
       :append-to-body="true"
     >
       <el-form :model="form">
-        <el-button :type="currect ? 'primary' : ''" @click="currect = true"
+        <el-button :type="currect ? 'primary' : ''" @click="cur(0)"
           >本合同</el-button
         >
-        <el-button :type="!currect ? 'primary' : ''" @click="currect = false"
+        <el-button :type="!currect ? 'primary' : ''" @click="cur(1)"
           >其他合同</el-button
         >
         <el-form-item
@@ -430,11 +430,11 @@
           :label-width="formLabelWidth"
         >
           <ws-select
-            v-if="carryovercontractnolist.length > 0"
+            v-if="carryovercontractnolist"
             v-model="carryoverlist.contractNo"
             placeholder="请选择合同"
             clearable
-            @change="contractchange"
+            @change="carryovercontractchange"
             maxlength="500"
             type="input"
           >
@@ -475,7 +475,11 @@ import {
   postpaymoney,
   postopeninvoice,
   postbatchopeninvoice,
+  getselectctcontractno
 } from '@/model/statisticalReport/index'
+import {
+  posthandle
+} from '@/model/purchasingManagement/index'
 import { downloadFile } from '@/utils/batchDown'
 import Pagination from '@/components/Pagination'
 import WsUpload from '@/components/WsUpload'
@@ -603,6 +607,35 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    cur(status){
+      if(status==0){
+        this.currect=true
+      }else{
+        var that=this
+        this.currect=false
+        getselectctcontractno({customerName:this.modification[0].customerName,contractNo:this.modification[0].contractNo}).toPromise()
+            .then((response) => {
+
+              that.carryovercontractnolist=response
+            })
+            .catch((response) => {
+              console.log(response)
+              EventBus.$emit('error', response.message)
+            })
+      }
+    },
+     selectInit(row){
+//在这里一定要记得类型匹配的上。
+            if(row.approveStatus==null){
+                return true  
+            }else if(row.approveStatus!=null){    
+              if(row.taskId==null){
+                return false 
+              }else{
+                return true  
+              }
+            }
+        },
     //付款
     handlepayment() {
       this.amountNotPayable = 0
@@ -803,6 +836,7 @@ export default {
 
     //审核
     handleAudit() {
+      var that=this
       if (this.modification.length == 0) {
         this.$message.warning('请选择一条要审核的条目')
       } else {
@@ -811,69 +845,99 @@ export default {
           confirmButtonText: '确定',
           type: 'warning',
         }).then(() => {
-          postaudit({
-            roleFlag: 1,
+          // postaudit({
+          //   roleFlag: 1,
+          //   purchaseReceiptReportList: this.modification,
+          // })
+          //   .toPromise()
+          //   .then((response) => {
+          //     this.$message.success('审核成功')
+          //     this.getList()
+          //   })
+            that.audit(this.modification[0],0,true)
+          
+        })
+      }
+    },
+    audit(item,index,status){
+      if(index<this.modification.length){
+        posthandle({ taskId: item.taskId,
+            approved: status,
+            auditMind: '34',
+            needReapply: false,})
+             .toPromise()
+          .then((response) => {
+            this.audit(this.modification[index+1],index+1,status)
+          }).catch((req) => {
+              this.$message.warning(req.message)
+            })
+      }else{
+        if(status){
+          this.$message.success('通过成功')
+          this.getList()
+        }else if(!status){
+          if(status1==2){
+            postaudit({
+            flag: 2,
             purchaseReceiptReportList: this.modification,
           })
             .toPromise()
             .then((response) => {
-              this.$message.success('审核成功')
+              this.$message.success('驳回成功')
               this.getList()
-            }).catch
-        })
+            })
+            .catch((req) => {
+              this.$message.success('驳回失败')
+            })
+          }
+        }
+         
+         
       }
     },
     handlereject(status) {
+      var that=this
       if (this.modification.length == 0) {
         this.$message.warning('请选择要驳回的条目')
       } else {
-        this.$confirm(`驳回后任务将退回到统计,是否确定驳回?`, {
+        this.$confirm(`是否确定驳回?`, {
           cancelButtonText: '取消',
           confirmButtonText: '确定',
           type: 'warning',
         }).then(() => {
-          postaudit({
-            roleFlag: status,
-            flag: 2,
-            purchaseReceiptReportList: this.modification,
-          })
-            .toPromise()
-            .then((response) => {
-              this.$message.success('驳回成功')
-              this.getList()
-            })
-            .catch((req) => {
-              this.$message.success('驳回失败')
-            })
+          // postaudit({
+          //   roleFlag: status,
+          //   flag: 2,
+          //   purchaseReceiptReportList: this.modification,
+          // })
+          //   .toPromise()
+          //   .then((response) => {
+          //     this.$message.success('驳回成功')
+          //     this.getList()
+          //   })
+          //   .catch((req) => {
+          //     this.$message.success('驳回失败')
+          //   })
+            that.audit(this.modification[0],0,false)
         })
       }
     },
     handlepass() {
+      var that=this
       if (this.modification.length == 0) {
         this.$message.warning('请选择要通过的条目')
       } else {
-        this.$confirm(`审核通过后,任务将发送给决策人,是否确定通过?`, {
+        this.$confirm(`是否确定通过?`, {
           cancelButtonText: '取消',
           confirmButtonText: '确定',
           type: 'warning',
         }).then(() => {
-          postaudit({
-            roleFlag: 2,
-            flag: 1,
-            purchaseReceiptReportList: this.modification,
-          })
-            .toPromise()
-            .then((response) => {
-              this.$message.success('通过成功')
-              this.getList()
-            })
-            .catch((req) => {
-              this.$message.success('通过失败')
-            })
+            that.audit(this.modification[0],0,true,2)
         })
       }
     },
     handlepass1() {
+      var that=this
       if (this.modification.length == 0) {
         this.$message.warning('请选择要通过的条目')
       } else {
@@ -882,44 +946,67 @@ export default {
           confirmButtonText: '确定',
           type: 'warning',
         }).then(() => {
-          postaudit({
-            roleFlag: 3,
-            flag: 1,
-            purchaseReceiptReportList: this.modification,
-          })
-            .toPromise()
-            .then((response) => {
-              this.$message.success('通过成功')
-              this.getList()
-            })
-            .catch((req) => {
-              this.$message.success('通过失败')
-            })
+          // postaudit({
+          //   roleFlag: 3,
+          //   flag: 1,
+          //   purchaseReceiptReportList: this.modification,
+          // })
+          //   .toPromise()
+          //   .then((response) => {
+          //     this.$message.success('通过成功')
+          //     this.getList()
+          //   })
+          //   .catch((req) => {
+          //     this.$message.success('通过失败')
+          //   })
+            that.audit(this.modification[0],0,true,3)
         })
       }
     },
     carryoverconfirm() {
+      var data={}
+      if(!this.carryoverlist.carryOverWeight){
+        this.$message.warning('结转重量不能为空')
+        return
+      }
+      if(this.carryoverlist.carryOverWeight>this.modification[0].netWeight){
+        this.$message.warning('结转重量不能超过净重')
+        return
+      }
       if (this.currect == true) {
-        postreplanishent({
+        data={
           customerConfirmationStatusFlag:
             this.modification[0].customerConfirmationStatusFlag,
-          purchaseReceiptReport: {
+            id:this.modification[0].id,
+            contractNo:this.modification[0].contractNo,
+            carryOverWeight: this.carryoverlist.carryOverWeight,
+            purchaseReceiptReport: {
             contractNo: this.carryoverlist.contractNo,
             carryOverWeight: this.carryoverlist.carryOverWeight,
-          },
+            },
           amountNotPayable: this.modification[0].amountNotPayable,
-        })
+        }
+      }else{
+        data={
+          customerConfirmationStatusFlag:
+            this.modification[0].customerConfirmationStatusFlag,
+            id:this.modification[0].id,
+            contractNo:this.carryoverlist.contractNo,
+            carryOverWeight: this.carryoverlist.carryOverWeight,
+            purchaseReceiptReport: {
+            contractNo: this.carryoverlist.contractNo,
+            carryOverWeight: this.carryoverlist.carryOverWeight,
+            },
+          amountNotPayable: this.modification[0].amountNotPayable,
+        }
+      }
+      postreplanishent(data)
           .toPromise()
           .then((response) => {
+            this.dialogFormVisible11=false
             this.$message.success('结转成功')
             this.getList()
           })
-      } else {
-        if (this.carryovercontractnolist.length > 0) {
-        } else {
-          this.$message.warning('无可结转的其他合同')
-        }
-      }
     },
     amendconfirm() {
       this.amendlist.id = this.modification[0].id
@@ -947,11 +1034,7 @@ export default {
         this.$message.warning('请选择一条要结转的条目')
       } else {
         this.dialogFormVisible11 = true
-        this.carryovercontractnolist = this.contractNoList.records.filter(
-          (item) => {
-            return this.modification[0].id != item.id
-          }
-        )
+        
       }
     },
     handleSelectionChange(val) {
@@ -974,6 +1057,13 @@ export default {
         })
       this.getList()
     },
+    carryovercontractchange(e) {
+      for (let i = 0; i < this.carryovercontractnolist.length; i++) {
+        if(this.carryovercontractnolist[i].contractNo==e){
+          this.carryoverlist.netWeight=this.carryovercontractnolist[i].netWeight
+        }
+      }
+    },
     updated() {
       this.$nextTick(() => {
         this.$refs.warehouseList.doLayout()
@@ -1042,30 +1132,37 @@ export default {
       })
     },
     getList() {
-      if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
-        this.roleFlag=1
-      }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
-        this.roleFlag=2
-      }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
-        this.roleFlag=3
-      }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
-        this.roleFlag=4
-      }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
-        this.roleFlag=''
-      }
+      // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
+      //   this.roleFlag=1
+      // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
+      //   this.roleFlag=2
+      // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
+      //   this.roleFlag=3
+      // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
+      //   this.roleFlag=4
+      // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
+      //   this.roleFlag=''
+      // }
+      
       getpurchreceipt({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         searchType: this.searchType,
         contractNo: this.contractNo,
-        roleFlag: this.roleFlag,
+        // roleFlag: this.roleFlag,
       })
         .toPromise()
         .then((response) => {
           for (var i = 0; i < response.records.length; i++) {
             response.records[i].identification = 'false'
+            response.records[i].settlementPrice = response.records[i].unitPrice 
+            - Math.abs(response.records[i].basisPrice)
+            - Math.abs(response.records[i].unloadingCharge)
+            - Math.abs(response.records[i].invoiceFee)
+            - Math.abs(response.records[i].deductionAmount)
           }
+          
           this.deptBudgetTotal=response.total
           this.warehouseList = response
         })

+ 86 - 111
src/views/statisticalReport/salesClosingCashierList.vue

@@ -7,25 +7,16 @@
           <ws-button :type="searchType==2?'primary':''" @click="handlestatus(2)">待结算</ws-button>
           <ws-button :type="searchType==3?'primary':''" @click="handlestatus(3)">已结算</ws-button>
           <ws-button :type="searchType==''?'primary':''" @click="handlestatus('')">全部</ws-button>
-          <ws-button v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.saleCloseReport.view`
-          " @click="handleAudit(3,2)">驳回</ws-button>
-          <ws-button v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          " @click="handleAudit(0)">驳回</ws-button>
+          <ws-button type="primary" v-hasPermission="
             `report.saleCloseReport.view`
-          " @click="handleAudit(3,1)">通过</ws-button>
-          <ws-button v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.saleCloseReport.view`
-          " @click="handleAudit(2,2)">驳回</ws-button>
-          <ws-button v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.saleCloseReport.view`
-          " @click="handleAudit(2,1)">通过</ws-button>
-          <ws-button v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.saleCloseReport.view`
-          " @click="handleAudit(1)">审核</ws-button>
-          <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          " @click="handleAudit(1)">通过</ws-button>
+          <ws-button type="primary" v-hasPermission="
             `report.saleCloseReport.payment`
           " @click="payment()">付款</ws-button>
-          <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.saleCloseReport.recive`
           " @click="collection()">收款</ws-button>
            </el-col>
@@ -69,10 +60,11 @@
           @selection-change="handleSelectionChange"
           ref="warehouseList"
           border
+          
           :summary-method="getSummaries"
           show-summary
         >
-          <el-table-column type="selection" :selectable="checkSelectable" width="55"></el-table-column>
+          <el-table-column type="selection" :selectable='selectInit' width="55"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
           <el-table-column class="table_td" prop="contractNo" label="合同编号"></el-table-column>
           <el-table-column class="table_td" prop="closePositionDate" label="平仓日期"></el-table-column>
@@ -120,7 +112,12 @@
           <el-table-column class="table_td" prop="collectionDate" label="收款日期"></el-table-column>
           <el-table-column class="table_td"  prop="customerName"  width='60' label="客户"></el-table-column>
           <el-table-column class="table_td"  prop="warehouseName"  width='60' label="库点"></el-table-column>
-          <el-table-column prop="status" label="状态"></el-table-column>
+          <el-table-column prop="status" label="状态">
+            <template slot-scope="scope">
+            <span v-if='scope.row.approveStatus!=null'>{{ scope.row.approveStatus }}</span>
+            <span v-else>{{ scope.row.status }}</span>
+          </template>
+          </el-table-column>
         </el-table>
 
         <!-- 页数 -->
@@ -316,6 +313,52 @@ export default {
     this.showType = this.isShow
   },
   methods: {
+    selectInit(row){
+//在这里一定要记得类型匹配的上。
+            if(row.approveStatus==null){
+                return true  
+            }else if(row.approveStatus!=null){    
+              if(row.taskId==null){
+                return false 
+              }else{
+                return true  
+              }
+            }
+        },
+        audit(item,index,status){
+      if(index<this.modification.length){
+        posthandle({ taskId: item.taskId,
+            approved: status,
+            auditMind: '34',
+            needReapply: false,})
+             .toPromise()
+          .then((response) => {
+            this.audit(this.modification[index+1],index+1,status)
+          }).catch((req) => {
+              this.$message.warning(req.message)
+            })
+      }else{
+        if(status){
+            this.$message.success('通过成功')
+          this.getList()
+        }else if(!status){
+            postsaleaudit({
+            flag: 2,
+            purchaseReceiptReportList: this.modification,
+          })
+            .toPromise()
+            .then((response) => {
+              this.$message.success('驳回成功')
+              this.getList()
+            })
+            .catch((req) => {
+              this.$message.success('驳回失败')
+            })
+        }
+         
+         
+      }
+    },
     contractchange(e) {
       this.contractNo = e
       this.getList()
@@ -402,15 +445,6 @@ export default {
         })
       })
     },
-    checkSelectable (row) {
-      console.log(row)
-      let mark = 0
-      if(row.status!='全部付款'&&row.status!='全部收款'){
-        return true
-      }else{
-          return false
-      }
-    },
     handlepaymentScreenshot(res,fire){
       this.paymentlist.paymentScreenshot=res.url
     },
@@ -452,93 +486,34 @@ export default {
       }
     },
     handleAudit(status,flag){
-      if(status==1){
+      var that=this
+      if(status==0){
         if(this.multipleSelection.length>0){
-          this.$confirm(`审核通过后,任务将发送给财务,是否确定通过?`, {
+          this.$confirm(`是否确定通过?`, {
             cancelButtonText: '取消',
             confirmButtonText: '确定',
             type: 'warning'
           }).then(() => {
-            postsaleaudit({salesClosingReportList:this.multipleSelection,roleFlag:1,flag:1}).toPromise()
-            .then(response => {
-              this.$message.success('通过成功')
-              this.getList()
-            }) .catch(() => {
-              this.$message.warning('通过失败')
-            })
+            // postsaleaudit({salesClosingReportList:this.multipleSelection,roleFlag:1,flag:1}).toPromise()
+            // .then(response => {
+            //   this.$message.success('通过成功')
+            //   this.getList()
+            // }) .catch(() => {
+            //   this.$message.warning('通过失败')
+            // })
+            that.audit(this.modification[0],0,true)
           })
         }else{
             this.$message.warning('请选择要审核的条目')
         }
-      }else if(status==2&&flag==1){
-        if(this.multipleSelection.length>0){
-          this.$confirm(`审核通过后,任务将发送给决策人,是否确定通过?`, {
-            cancelButtonText: '取消',
-            confirmButtonText: '确定',
-            type: 'warning'
-          }).then(() => {
-            postsaleaudit({salesClosingReportList:this.multipleSelection,roleFlag:2,flag:1}) .toPromise()
-            .then(response => {
-              this.$message.success('通过成功')
-              this.getList()
-            }) .catch(() => {
-              this.$message.warning('通过失败')
-            })
-          })
-        }else{
-            this.$message.warning('请选择要通过的条目')
-        }
-      }else if(status==2&&flag==2){
-        if(this.multipleSelection.length>0){
-          this.$confirm(`驳回后任务将退回到统计,是否确定驳回?`, {
-            cancelButtonText: '取消',
-            confirmButtonText: '确定',
-            type: 'warning'
-          }).then(() => {
-            postsaleaudit({salesClosingReportList:this.multipleSelection,roleFlag:2,flag:2}) .toPromise()
-            .then(response => {
-              this.$message.success('驳回成功')
-              this.getList()
-            }) .catch(() => {
-              this.$message.warning('驳回失败')
-            })
-          })
-        }else{
-            this.$message.warning('请选择要驳回的条目')
-        }
-      }
-      else if(status==3&&flag==1){
-        if(this.multipleSelection.length>0){
-          this.$confirm(`审核通过后,任务将发送给出纳,是否确定通过?`, {
-            cancelButtonText: '取消',
-            confirmButtonText: '确定',
-            type: 'warning'
-          }).then(() => {
-            postsaleaudit({salesClosingReportList:this.multipleSelection,roleFlag:3,flag:1}) .toPromise()
-            .then(response => {
-              this.$message.success('通过成功')
-              this.getList()
-            }) .catch(() => {
-              this.$message.warning('通过失败')
-            })
-          })
-        }else{
-            this.$message.warning('请选择要通过的条目')
-        }
-      }else if(status==3&&flag==2){
+      }else if(status==1){
         if(this.multipleSelection.length>0){
-          this.$confirm(`驳回后任务将退回到统计,是否确定驳回?`, {
+          this.$confirm(`是否确定驳回?`, {
             cancelButtonText: '取消',
             confirmButtonText: '确定',
             type: 'warning'
           }).then(() => {
-            postsaleaudit({salesClosingReportList:this.multipleSelection,roleFlag:2,flag:2}) .toPromise()
-            .then(response => {
-              this.$message.success('驳回成功')
-              this.getList()
-            }) .catch(() => {
-              this.$message.warning('驳回失败')
-            })
+            that.audit(this.modification[0],0,false)
           })
         }else{
             this.$message.warning('请选择要驳回的条目')
@@ -607,24 +582,24 @@ export default {
       })
     },
     getList() {
-      if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
-        this.roleFlag=1
-      }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
-        this.roleFlag=2
-      }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
-        this.roleFlag=3
-      }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
-        this.roleFlag=4
-      }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
-        this.roleFlag=''
-      }
+      // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
+      //   this.roleFlag=1
+      // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
+      //   this.roleFlag=2
+      // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
+      //   this.roleFlag=3
+      // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
+      //   this.roleFlag=4
+      // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
+      //   this.roleFlag=''
+      // }
       getsalelist({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         searchType: this.searchType,
         contractNo:this.contractNo,
-        roleFlag:this.roleFlag
+        // roleFlag:this.roleFlag
       })
         .toPromise()
         .then(response => {

+ 104 - 86
src/views/statisticalReport/salesDeliveryReportList.vue

@@ -8,30 +8,21 @@
           <ws-button :type="searchType==2?'primary':''" @click="handlestatus(2)">待结算</ws-button>
           <ws-button :type="searchType==3?'primary':''" @click="handlestatus(3)">已结算</ws-button>
           <ws-button :type="searchType==''?'primary':''" @click="handlestatus('')">全部</ws-button>
-          <ws-button  v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.saleOutReport.view`
-          " @click="handlepass1()">通过</ws-button>
-          <ws-button  v-if='roleId=="9ad8abb997714ef29068f23c2ad3b125"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.saleOutReport.view`
-          " @click="handlereject(3)">驳回</ws-button>
-          <ws-button  v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.saleOutReport.view`
           " @click="handlepass()">通过</ws-button>
-          <ws-button  v-if='roleId=="cca3cf0ca2814d1e918f5b0a4380fe69"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.saleOutReport.view`
-          " @click="handlereject(2)">驳回</ws-button>
-          <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          " @click="handlereject()">驳回</ws-button>
+          <ws-button type="primary" v-hasPermission="
             `report.saleOutReport.payment`
           " @click="handlecollect()">收款</ws-button>
-          <ws-button v-if='roleId=="3d7b9179552b4c3e9c2d7af43962e2e4"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.saleOutReport.draw`
           " @click="handleninvoice()">开发票</ws-button>
-          <ws-button v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
+          <ws-button type="primary" v-hasPermission="
             `report.saleOutReport.carry`
           " @click="amend()">最终结算价</ws-button>
-          <ws-button v-if='roleId=="4c2d50d8ff2943c1b7a1e947feefe048"||roleId=="4ef070439cd64784bce8844fd3f0f8e1"' type="primary" v-hasPermission="
-            `report.saleOutReport.view`
-          " @click="handleAudit()">审核</ws-button>
           </el-col>
         <el-col style='text-align:right;line-height:60px;padding-right:10px;' :span="8">
           <ws-select
@@ -84,14 +75,19 @@
           border
           :summary-method="getSummaries"
           show-summary
+          
           @selection-change="handleSelectionChange"
         >
-          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column :selectable='selectInit' type="selection" width="55"></el-table-column>
           <el-table-column type="index" label="序号" width="50"></el-table-column>
           <el-table-column class="table_td" prop="contractNo" label="合同编号"></el-table-column>
           <el-table-column class="table_td" prop="goodsName" label="货名"></el-table-column>
           <el-table-column class="table_td" prop="positionNumber" label="仓位号"></el-table-column>
-          <el-table-column class="table_td" prop="carNo" label="车牌号"></el-table-column>
+          <el-table-column class="table_td" prop="carNo" label="车牌号">
+            <template slot-scope="scope">
+              {{scope.row.carNo}}({{scope.row.tranCarNo}})
+              </template>
+          </el-table-column>
           <el-table-column class="table_td" prop="retrievalDate" label="出库日期"></el-table-column>
           <el-table-column width='100' class="table_td" prop="protein" label="蛋白(%)>="></el-table-column>
           <el-table-column width='100' class="table_td" prop="waterContent" label="水分(%)>="></el-table-column>
@@ -119,7 +115,12 @@
               alt=""
             />
           </template></el-table-column>
-          <el-table-column label="状态" prop="status"></el-table-column>
+          <el-table-column label="状态" prop="status">
+            <template slot-scope="scope">
+            <span v-if='scope.row.approveStatus!=null'>{{ scope.row.approveStatus }}</span>
+            <span v-else>{{ scope.row.status }}</span>
+          </template>
+          </el-table-column>
         </el-table>
 
         <!-- 页数 -->
@@ -388,86 +389,98 @@ export default {
     this.getList()
     this.showType = this.isShow
   },
-  computed:{
-    sum:function(){
-        this.amendlist.settlementPrice = Number(
-          this.amendlist.unitPrice )+ Number(this.amendlist.basisPrice )+ Number(this.amendlist.invoiceFee)
-    }
-
-  },
+  // computed:{
+  //   sum:function(){
+  //       this.amendlist.settlementPrice = Number(
+  //         this.amendlist.unitPrice )+ Number(this.amendlist.basisPrice )+ Number(this.amendlist.invoiceFee)
+  //    }
+  // },
   methods: {
-    //审核
-    handleAudit(){
-      if(this.modification.length==0){
-        this.$message.warning('请选择一条要审核的条目')
+    selectInit(row){
+//在这里一定要记得类型匹配的上。
+            if(row.approveStatus==null){
+                return true  
+            }else if(row.approveStatus!=null){    
+              if(row.taskId==null){
+                return false 
+              }else{
+                return true  
+              }
+            }
+        },
+     audit(item,index,status){
+      if(index<this.modification.length){
+        posthandle({ taskId: item.taskId,
+            approved: status,
+            auditMind: '34',
+            needReapply: false,})
+             .toPromise()
+          .then((response) => {
+            this.audit(this.modification[index+1],index+1,status)
+          }).catch((req) => {
+              this.$message.warning(req.message)
+            })
       }else{
-        this.$confirm(`审核通过后,任务将发送给财务,是否确定通过?`, {
-        cancelButtonText: '取消',
-        confirmButtonText: '确定',
-        type: 'warning'
-      }).then(() => {
-        issueapproval({roleFlag:1,salesDeliveryReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('审核成功')
+        if(status){
+          this.$message.success('通过成功')
           this.getList()
-        }).catch
-      })
+        }else if(!status){
+            issueapproval({
+            flag: 2,
+            purchaseReceiptReportList: this.modification,
+          })
+            .toPromise()
+            .then((response) => {
+              this.$message.success('驳回成功')
+              this.getList()
+            })
+            .catch((req) => {
+              this.$message.success('驳回失败')
+            })
+        }
+         
+         
       }
     },
     handlereject(status){
+      var that=this
       if(this.modification.length==0){
         this.$message.warning('请选择要驳回的条目')
       }else{
-        this.$confirm(`驳回后任务将退回到统计,是否确定驳回?`, {
+        this.$confirm(`是否确定驳回?`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning'
       }).then(() => {
-        issueapproval({roleFlag:status,flag:2,salesDeliveryReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('驳回成功')
-          this.getList()
-        }).catch(req => {
-          this.$message.success('驳回失败')
-        })
+        that.audit(this.modification[0],0,false)
+        // issueapproval({roleFlag:status,flag:2,salesDeliveryReportList:this.modification}).toPromise()
+        // .then(response => {
+        //   this.$message.success('驳回成功')
+        //   this.getList()
+        // }).catch(req => {
+        //   this.$message.success('驳回失败')
+        // })
       })
       }
     },
     handlepass(){
+      var that=this
       if(this.modification.length==0){
         this.$message.warning('请选择要通过的条目')
       }else{
-        this.$confirm(`审核通过后,任务将发送给决策人,是否确定通过?`, {
-        cancelButtonText: '取消',
-        confirmButtonText: '确定',
-        type: 'warning'
-      }).then(() => {
-        issueapproval({roleFlag:2,flag:1,salesDeliveryReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('通过成功')
-          this.getList()
-        }).catch(req => {
-          this.$message.success('通过失败')
-        })
-      })
-      }
-    },
-    handlepass1(){
-      if(this.modification.length==0){
-        this.$message.warning('请选择要通过的条目')
-      }else{
-        this.$confirm(`审核通过后,任务将发送给出纳,是否确定通过?`, {
+        this.$confirm(`是否确定通过?`, {
         cancelButtonText: '取消',
         confirmButtonText: '确定',
         type: 'warning'
       }).then(() => {
-        issueapproval({roleFlag:3,flag:1,salesDeliveryReportList:this.modification}).toPromise()
-        .then(response => {
-          this.$message.success('通过成功')
-          this.getList()
-        }).catch(req => {
-          this.$message.success('通过失败')
-        })
+        // issueapproval({roleFlag:2,flag:1,salesDeliveryReportList:this.modification}).toPromise()
+        // .then(response => {
+        //   this.$message.success('通过成功')
+        //   this.getList()
+        // }).catch(req => {
+        //   this.$message.success('通过失败')
+        // })
+        that.audit(this.modification[0],0,false)
       })
       }
     },
@@ -729,27 +742,32 @@ export default {
     },
     //列表
     getList() {
-      if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
-        this.roleFlag=1
-      }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
-        this.roleFlag=2
-      }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
-        this.roleFlag=3
-      }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
-        this.roleFlag=4
-      }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
-        this.roleFlag=''
-      }
+      // if(this.roleId=='4c2d50d8ff2943c1b7a1e947feefe048'){
+      //   this.roleFlag=1
+      // }else if(this.roleId=='cca3cf0ca2814d1e918f5b0a4380fe69'){
+      //   this.roleFlag=2
+      // }else if(this.roleId=='9ad8abb997714ef29068f23c2ad3b125'){
+      //   this.roleFlag=3
+      // }else if(this.roleId=='3d7b9179552b4c3e9c2d7af43962e2e4'){
+      //   this.roleFlag=4
+      // }else if(this.roleId=="4ef070439cd64784bce8844fd3f0f8e1"){
+      //   this.roleFlag=''
+      // }
       salelist({
         compId: sessionStorage.getItem('ws-pf_compId'),
         currentPage: this.currentPage,
         pageSize: this.pageSize,
         searchType: this.searchType,
         contractNo:this.contractNo,
-        roleFlag:this.roleFlag
+        // roleFlag:this.roleFlag
       })
         .toPromise()
         .then(response => {
+          for (var i = 0; i < response.records.length; i++) {
+            response.records[i].settlementPrice = response.records[i].unitPrice 
+            + response.records[i].basisPrice
+            + response.records[i].invoiceFee
+          }
           this.deptBudgetTotal=response.total
           this.warehouseList = response
         })