wangchao %!s(int64=2) %!d(string=hai) anos
pai
achega
82bcf6d154
Modificáronse 1 ficheiros con 92 adicións e 51 borrados
  1. 92 51
      src/views/record/record.vue

+ 92 - 51
src/views/record/record.vue

@@ -75,7 +75,7 @@
         </el-table-column>
         <el-table-column prop="address" label="更多指标" show-overflow-tooltip>
           <template slot-scope="scope">
-            <div style="color:cornflowerblue">查看</div>
+            <div style="color:cornflowerblue" @click="moreInfo(scope.row)">查看</div>
           </template>
         </el-table-column>
         <el-table-column prop="unitPrice" label="单价(元/吨)" width="100">
@@ -83,8 +83,8 @@
         <el-table-column prop="grainFund" label="粮款(元)" show-overflow-tooltip>
         </el-table-column>
         <el-table-column prop="address" label="备注" show-overflow-tooltip>
-          <template slot-scope="scope">
-            <div style="color:cornflowerblue">查看</div>
+          <template slot-scope="scope" v-if="scope.row.remark">
+            <div style="color:cornflowerblue" @click="lookRemark(scope.row.remark)">查看</div>
           </template>
         </el-table-column>
         <el-table-column prop="createDate" label="日期" width="140">
@@ -149,6 +149,34 @@
         </el-form-item>
       </el-form>
     </el-dialog>
+    <el-dialog width="320px" title="备注信息" :visible.sync="isShowRemark" :append-to-body="true" :close="remarkClose">
+      {{ remarkVal }}
+    </el-dialog>
+    <el-dialog width="320px" title="指标信息" :visible.sync="isShowMoreInfo" :append-to-body="true" :close="moreInfoClose">
+      <el-form class="customer" label-position="right" label-width="80px">
+        <el-form-item label="水分">
+          <el-input disabled size="small" v-model="moreInfoObj.waterContent" />
+        </el-form-item>
+        <el-form-item label="杂质">
+          <el-input disabled size="small" v-model="moreInfoObj.impurity" />
+        </el-form-item>
+        <el-form-item label="霉变粒">
+          <el-input disabled size="small" v-model="moreInfoObj.mildewGrain" />
+        </el-form-item>
+        <el-form-item label="不完善粒">
+          <el-input disabled size="small" v-model="moreInfoObj.imperfectGrain" />
+        </el-form-item>
+        <el-form-item label="容重">
+          <el-input disabled size="small" v-model="moreInfoObj.bulkDensity" />
+        </el-form-item>
+        <el-form-item label="热损伤">
+          <el-input disabled size="small" v-model="moreInfoObj.jiaorenli" />
+        </el-form-item>
+        <el-form-item label="蛋白">
+          <el-input disabled size="small" v-model="moreInfoObj.protein" />
+        </el-form-item>
+      </el-form>
+    </el-dialog>
     <el-dialog width="320px" :title="inventoryTitle" :visible.sync="isShowInventory" :append-to-body="true"
       :close="inventoryClose">
       <el-form class="customer" label-position="right" label-width="120px">
@@ -192,8 +220,8 @@
 <script>
 import WsUpload from '@/components/WsUpload'
 import {
-    downloadFile
-  } from '@/utils/batchDown'
+  downloadFile
+} from '@/utils/batchDown'
 import {
   dayjs,
   EventBus
@@ -215,6 +243,10 @@ export default {
   },
   data() {
     return {
+      moreInfoObj:{},
+      isShowMoreInfo:false,
+      remarkVal: '',
+      isShowRemark: false,
       dataObj: {},
       size: 10,
       pSubmitObj: {
@@ -244,7 +276,6 @@ export default {
       multipleSelection: [],
       goodsList: [],
       value: '',
-      value1: '',
       searchKeyWord: '',
       value2: '',
       status: ''
@@ -263,6 +294,21 @@ export default {
 
   },
   methods: {
+    moreInfoClose(){
+      this.isShowMoreInfo = false
+    },
+    //更多指标
+    moreInfo(val) { 
+      this.moreInfoObj = val
+      console.log(this.moreInfoObj)
+      this.isShowMoreInfo = true
+    },
+    // 查看备注
+    lookRemark(val) {
+      this.remarkVal = val
+      this.isShowRemark = true
+    },
+    // 更改已付、未付、已收、未收状态
     changeStatus(val) {
       if (val.status == '已付') {
         val.status = "未付"
@@ -283,6 +329,7 @@ export default {
           }
         })
     },
+    //计算盘盈盘亏货值
     inputVal() {
       if (this.pSubmitObj.netWeight && this.pSubmitObj.unitPrice) {
         this.pSubmitObj.grainFund = this.pSubmitObj.netWeight * this.pSubmitObj.unitPrice
@@ -296,15 +343,6 @@ export default {
       } else {
         this.pSubmitObj.inOutFlag = 2
       }
-      // //查看编号
-      // await selectInOutCount({
-      //   compId: this.compId,
-      //   noFlag: _number,
-      // }).toPromise()
-      //   .then((res) => {
-      //     this.pSubmitObj.noFlag = res
-      //   })
-      // console.log(this.pSubmitObj)
       await speedWarehouseInOutInfoAdd(this.pSubmitObj).toPromise()
         .then((res) => {
           if (res == "ok") {
@@ -313,6 +351,7 @@ export default {
           }
         })
     },
+    // 查看客户
     selectCustomer(val) {
       speedCustomerInfo({
         customerId: val.customerId
@@ -323,6 +362,7 @@ export default {
           this.customerObj = response
         })
     },
+    //搜索
     search(type) {
       switch (type) {
         case 0:
@@ -341,19 +381,17 @@ export default {
       }
       this.getList()
     },
+    //选择货名
     changeGoodsName(val) {
-      console.log(val)
       this.goodsObj = this.goodsList.filter((item) => {
         if (val == item.goodsName) return item
       })[0]
-      console.log(this.goodsObj)
     },
+    //盘盈盘亏选择货名
     changeGoodsName1(val) {
-      console.log(val)
       this.goodsObj1 = this.goodsList.filter((item) => {
         if (val == item.goodsName) return item
       })[0]
-      console.log(this.goodsObj)
     },
     dateFormat(fmt, date) {
       let ret
@@ -387,13 +425,13 @@ export default {
       }
       this.getList()
     },
+    //货名下拉
     getGoodSName() {
       speedGoodsList({
         compId: localStorage.getItem('ws-pf_compId')
       })
         .toPromise()
         .then((response) => {
-          console.log(response)
           this.goodsList = response
           if (this.goodsList.length != 0) {
             this.value = this.goodsList[0].goodsName
@@ -416,7 +454,6 @@ export default {
       })
         .toPromise()
         .then((response) => {
-          console.log(response)
           if (response.records) {
             for (let i = 0; i < response.records.length; i++) {
               response.records[i].addressUrlArray = []
@@ -430,25 +467,25 @@ export default {
         })
     },
     async exportExcel() {
-      if(this.multipleSelection.length==0){
+      if (this.multipleSelection.length == 0) {
         this.$message.error("请勾选导出条目!")
         return
       }
       const {
-          data
-        } = await exportOrder({
-          speedWarehouseInOutInfoList:this.multipleSelection
-        }, {}, {
-          responseType: 'blob',
-        }).toPromise()
-        downloadFile({
-          res: data,
-          fileName: `${
-          this.date.year + (this.date.month ? `-${this.date.month}` : '')
-        }_出入库记录`,
-          type: 'xls',
-        })
+        data
+      } = await exportOrder({
+        speedWarehouseInOutInfoList: this.multipleSelection
+      }, {}, {
+        responseType: 'blob',
+      }).toPromise()
+      downloadFile({
+        res: data,
+        fileName: `${this.date.year + (this.date.month ? `-${this.date.month}` : '')
+          }_出入库记录`,
+        type: 'xls',
+      })
     },
+    // 批量收付款
     batchPay(val) {
       let _flag = ''
       let _text = ""
@@ -456,7 +493,7 @@ export default {
         _text = '收款'
         _flag = 4
         for (let i = 0; i < this.multipleSelection.length; i++) {
-          if (this.multipleSelection[i].status == '已付' || this.multipleSelection[i].status == '未付'||this.multipleSelection[i].status == '已收') {
+          if (this.multipleSelection[i].status == '已付' || this.multipleSelection[i].status == '未付' || this.multipleSelection[i].status == '已收') {
             this.$message.error('存在已付或未付或已收项,请重新勾选!')
             return
           }
@@ -465,7 +502,7 @@ export default {
         _text = '付款'
         _flag = 3
         for (let i = 0; i < this.multipleSelection.length; i++) {
-          if (this.multipleSelection[i].status == '已收' || this.multipleSelection[i].status == '未收'|| this.multipleSelection[i].status == '已付') {
+          if (this.multipleSelection[i].status == '已收' || this.multipleSelection[i].status == '未收' || this.multipleSelection[i].status == '已付') {
             this.$message.error('存在已收或未收或已付项,请重新勾选!')
             return
           }
@@ -478,14 +515,14 @@ export default {
         type: 'warning'
       }).then(() => {
 
-        speedWarehouseInOutInfoEdit({flag:_flag,speedWarehouseInOutInfoList:this.multipleSelection}).toPromise()
-        .then((res) => {debugger
-          if (res == "OK") {
-            this.$message.success('提交成功!')
-            this.isShowInventory = false
-            this.getList()
-          }
-        })
+        speedWarehouseInOutInfoEdit({ flag: _flag, speedWarehouseInOutInfoList: this.multipleSelection }).toPromise()
+          .then((res) => {
+            if (res == "OK") {
+              this.$message.success('提交成功!')
+              this.isShowInventory = false
+              this.getList()
+            }
+          })
 
       }).catch(() => {
         return false
@@ -497,10 +534,17 @@ export default {
         cancelButtonText: '取消',
         type: 'warning'
       }).then(() => {
+        speedWarehouseInOutInfoDel({ id: val.id}).toPromise()
+          .then((res) => {
+              this.$message.success('删除成功!')
+              this.getList()
+          })
+
       }).catch(() => {
         return false
       });
     },
+    // 归零
     zero() {
       this.$confirm('确定将【' + this.goodsObj.goodsName + '】的库存和成本归零?', '提示', {
         confirmButtonText: '确定',
@@ -526,7 +570,6 @@ export default {
     },
     //盘亏盘盈
     handlestatus(type) {
-      console.log(type)
       if (type == 1) {
         this.inventoryTitle = '盘亏'
       } else {
@@ -534,6 +577,9 @@ export default {
       }
       this.isShowInventory = true
     },
+    remarkClose() {
+      this.isShowRemark = false
+    },
     customerclose() {
       this.isShowCustomer = false
     },
@@ -572,16 +618,13 @@ export default {
       this.accessoryTFs = true
       this.dataObj = row
       this.appendixIdss = row.addressUrl
-      console.log(this.appendixIdss)
     },
     handleSizeChange(val) {
-      console.log(`每页 ${val} 条`)
       this.pageSize = val
       // this.getList()
     },
     handleCurrentChange(val) {
       this.currentPage = val
-      console.log(`当前页: ${val}`)
       this.getList()
     },
     toggleSelection(rows) {
@@ -594,9 +637,7 @@ export default {
       }
     },
     handleSelectionChange(val) {
-      debugger
       this.multipleSelection = val;
-      console.log('勾选条目', val)
     },
     lookup() {
       this.getList()