zhangyuewww 4 years ago
parent
commit
beb83532e5

+ 2 - 1
unimall-admin/src/api/trade.js

@@ -93,13 +93,14 @@ export function freezeOrActivtion(id, status, contractNo, packing, basis, priceC
     }
   })
 }
-export function finish(id, status) {
+export function finish(id, allCount, status) {
   return request({
     method: 'post',
     params: {
       _gp: 'admin.trade',
       _mt: 'finish',
       id: id,
+      allCount: allCount,
       status: status
     }
   })

+ 2 - 2
unimall-admin/src/views/buy/buy.vue

@@ -131,12 +131,12 @@
         <el-form-item label="基差(元/吨)" prop="basis">
           <el-input v-model="dataForm.basis" />
         </el-form-item>
-        <el-form-item label="大袋基差(元/吨)" prop="basisBig">
+        <!-- <el-form-item label="大袋基差(元/吨)" prop="basisBig">
           <el-input v-model="dataForm.basisBig" />
         </el-form-item>
         <el-form-item label="小袋基差(元/吨)" prop="basisSmall">
           <el-input v-model="dataForm.basisSmall" />
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item label="水分(%)<=" prop="waterContent">
           <el-input v-model="dataForm.waterContent" />
         </el-form-item>

+ 53 - 24
unimall-admin/src/views/trade/trade.vue

@@ -82,6 +82,7 @@
       <el-table-column align="center" width="70px" label="交易数量" prop="count" />
       <el-table-column align="center" width="90px" label="可平仓数量" prop="closeFlat" />
       <el-table-column align="center" width="70px" label="平仓数量" prop="flatTotal" />
+      <el-table-column align="center" width="70px" label="执行数量" prop="allCount" />
       <el-table-column align="center" label="客户信息" width="80px">
         <template slot-scope="scope">
           <el-image-viewer
@@ -117,7 +118,7 @@
           <!-- <el-button v-permission="['trade:trade:edit']" v-else-if=" scope.row.status == 1" type="danger" size="small" @click="freezeOrActivationBtn(scope.row,'2')">完成</el-button> -->
           <!-- <el-button v-permission="['trade:trade:edit']" v-if=" scope.row.status == 1" type="success" size="small" @click="handleUpdate(scope.row)">更新节点</el-button> -->
           <el-button v-permission="['trade:trade:deal']" v-if=" scope.row.status == 2" type="success" size="small" @click="handleDeal(scope.row)">成交</el-button>
-          <el-button v-permission="['trade:trade:modify']" v-if=" scope.row.status >= 2" type="success" size="small" @click="handleModify(scope.row)" >解冻保证金</el-button>
+          <el-button v-permission="['trade:trade:modify']" v-if=" scope.row.status >= 2&&scope.row.bond!=0" type="success" size="small" @click="handleModify(scope.row)" >解冻保证金</el-button>
           <el-button v-permission="['trade:trade:modify']" v-if=" scope.row.depositNotPaid>0" type="success" size="small" @click="handlesupply(scope.row)" >补充保证金</el-button>
           <el-button v-permission="['trade:trade:finish']" v-if=" scope.row.status==3" type="success" size="small" @click="handlefinish(scope.row)" >完成</el-button>
           <el-button v-permission="['trade:trade:flat']" v-if=" scope.row.status == 3" type="success" size="small" @click="handleFlat(scope.row)" >平仓</el-button>
@@ -310,6 +311,28 @@
         <el-button :loading="submiting" type="primary" @click="flatData">确定</el-button>
       </div>
     </el-dialog>
+    <!-- 完成对话框 -->
+    <el-dialog
+      :visible.sync="finishVisible"
+      title="完成">
+      <el-form
+        ref="finishForm"
+        :rules="rulesfinish"
+        :model="finishForm"
+        status-icon
+        label-position="left"
+        label-width="150px"
+        style="width: 600px; margin-left:150px;"
+      >
+        <el-form-item style="margin-top:30px" label="实际执行数量" prop ="allCount">
+          <el-input v-model="finishForm.allCount"/>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="finishVisible = false">取消</el-button>
+        <el-button :loading="submiting" type="primary" @click="finishData(finishForm)">确定</el-button>
+      </div>
+    </el-dialog>
     <!--客户信息对话框 -->
     <el-dialog
       :visible.sync="informationFormVisible"
@@ -513,10 +536,10 @@ export default {
       depositNotPaid: '',
       usedDeposit: '',
       flatForm: {
-
       },
       informationForm: {
-
+      },
+      finishForm: {
       },
       uploadPath,
       readonly: true,
@@ -534,6 +557,7 @@ export default {
       priceVisible: false,
       modifyVisible: false,
       flatVisible: false,
+      finishVisible: false,
       informationFormVisible: false,
       rules: {
 
@@ -547,6 +571,9 @@ export default {
         flatTotal: [{ required: true, message: '平仓吨数不能为空', trigger: 'blur' }],
         flatBasis: [{ required: true, message: '平仓基差不能为空', trigger: 'blur' }]
       },
+      rulesfinish: {
+        allCount: [{ required: true, message: '实际执行数量不能为空', trigger: 'blur' }]
+      },
       tradeStatusMap: [],
       contractListImg: [],
       srcList: []
@@ -926,30 +953,32 @@ export default {
       }
     },
     handlefinish(row) {
-      this.$confirm('确认完成,是否继续?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        finish(row.id, 4).then(() => {
-          this.submiting = false
-          this.$notify.success({
-            title: '成功',
-            message: '完成成功'
-          })
-          this.getList()
-        })
-          .catch(response => {
-            this.$notify.error({
-              title: '失败',
-              message: response.data.errmsg
-            })
+      this.finishForm.id=row.id
+      this.finishVisible=true
+    },
+    finishData(row) {
+      this.$refs['finishForm'].validate(valid => {
+        if (valid) {
+          console.log(row)
+          this.submiting = true
+          finish(row.id, row.allCount, 4).then(() => {
+            this.finishVisible = false
             this.submiting = false
+            this.$notify.success({
+              title: '成功',
+              message: '完成成功'
+            })
+            this.getList()
           })
+            .catch(response => {
+              this.$notify.error({
+                title: '失败',
+                message: response.data.errmsg
+              })
+              this.submiting = false
+            })
+        }
       })
-        .catch(response => {
-          return false
-        })
     },
     flatData() {
       this.$refs['flatForm'].validate(valid => {

+ 7 - 2
unimall-app/pageA/pages/account.vue

@@ -30,7 +30,7 @@
 				<view class="c-row b-b">
 					<text class="tit">净重(自动计算)</text>
 					<view class="con-list">
-						<text>{{netWeight}}</text>
+						<text>{{numFilter(netWeight)}}</text>
 					</view>
 				</view>
 				<view class="cu-bar bg-white">
@@ -85,7 +85,7 @@
 				poundImg:'',
 				grossWeight:'',
 				skinWeight:'',
-				netWeight:'',
+				netWeight:0,
 				carNo:'',
 				checkType:'',
 				deduction:'',
@@ -114,6 +114,11 @@
 			
 		},
 		methods: {
+			numFilter (value) {
+				// 截取当前数据到小数点后两位
+				let realVal = parseFloat(value).toFixed(2)
+				return realVal
+			},
 			DateChange(e) {
 				this.issuance = e.detail.value
 			},

+ 41 - 0
unimall-app/pageA/pages/deliver_goods.vue

@@ -34,6 +34,12 @@
 						<view class="th">扣款(元/吨)</view>
 						<view class="td">{{item.remarks}}</view>
 					</view>
+					<view v-if="contractType =='销售合同'&&item.poundImg " class='flex justify-between'>
+						<view class="poundtital">到货磅单</view>
+							<view class="grid col-2 grid-square bg-img" v-if="item.poundImg != ''" @tap="ViewImage" :data-url="item.poundImg">
+							 <image class='poundimg' :src="item.poundImg" mode="aspectFit"></image>
+						</view>
+					</view>
 					<view v-if="item.taskStatus==4 && contractType =='销售合同'" class="padding flex flex-direction">
 						<button class="cu-btn bg-orange margin-tb-sm" @click="commit">确认卸货</button>
 					</view>
@@ -132,6 +138,31 @@
 		},
 
 		methods: {
+			ViewImage(e) {
+				var img = [];
+				img = e.currentTarget.dataset.url.split(' ')
+				uni.previewImage({
+					current:0,
+					urls: img
+				});
+			},
+			ChooseImage() {
+				uni.chooseImage({
+					count: 1, //默认9
+					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
+					sourceType: ['album','camera'], //从相册选择
+					success: (res) => {
+						//上传图片
+						//图片路径可自行修改
+						uploadImage(res.tempFilePaths[0], 'carNoImg/',
+							result => {
+								this.poundImg = result
+								uni.hideLoading();
+							}
+						)
+					}
+				});
+			},
 			btnDown(e){
 				this.unitPrice=e.detail.value
 			},
@@ -225,6 +256,16 @@
 </script>
 
 <style scoped>
+	.grid.grid-square {
+	    height: 100px;
+	}
+	.poundimg{
+		    width: 100px;
+		    height: 100px;
+	}
+	.poundtital{
+		line-height: 100px;
+	}
 	.cardwrap{
 		/* background: rgba(255,255,255,0.3); */
 		background: #fff;

+ 1 - 1
unimall-app/pageA/product/detail.vue

@@ -150,7 +150,7 @@
 					</view>
 				</view>
 				<view v-if='goods.goodsName=="大豆"' class="c-row b-b">
-					<text class="tit">蛋白(%){{'<='}} </text>
+					<text class="tit">蛋白(%){{'>='}} </text>
 					<view class="con-list">
 						<text>{{goods.protein}}</text>
 					</view>

+ 1 - 1
unimall-app/pageA/product/detail_buy.vue

@@ -134,7 +134,7 @@
 					</view>
 				</view>
 				<view v-if='goods.goodsName=="大豆"' class="c-row b-b">
-					<text class="tit">蛋白(%){{'<='}} </text>
+					<text class="tit">蛋白(%){{'>='}} </text>
 					<view class="con-list">
 						<text>{{goods.protein}}</text>
 					</view>

+ 8 - 4
unimall-app/pages/user/task.vue

@@ -211,12 +211,16 @@
 					{{paymentaudit.carNos}}
 				</view>
 				<view v-if="paymentaudit.buy >0" class="cu-form-group">
-					<view  class="title">挂单价</view>
+					<view  class="title">成交价</view>
 					{{paymentaudit.unitPrice - paymentaudit.unitPrice1}}
 				</view>
 				<view v-if="paymentaudit.buy >0" class="cu-form-group">
 					<view  class="title">平仓价</view>
-					{{paymentaudit.unitPrice}}
+					{{paymentaudit.unitPrice-paymentaudit.basis}}
+				</view>
+				<view v-if="paymentaudit.basis" class="cu-form-group">
+					<view  class="title">平仓基差</view>
+					{{paymentaudit.basis}}
 				</view>
 				<view v-if="paymentaudit.unitPrice1" class="cu-form-group">
 					<view  class="title">付款单价</view>
@@ -241,12 +245,12 @@
 					{{paymentaudit.contractNo}}
 				</view>
 				<view class="cu-form-group">
-					<view  class="title">挂单价</view>
+					<view  class="title">成交价</view>
 					{{paymentaudit.unitPrice}}
 				</view>
 				<view v-if="paymentaudit.buy >0" class="cu-form-group">
 					<view  class="title">平仓价</view>
-					{{paymentaudit.unitPrice + paymentaudit.unitPrice1}}
+					{{paymentaudit.unitPrice + paymentaudit.unitPrice1-paymentaudit.basis}}
 				</view>
 				<view v-if="paymentaudit.buy" class="cu-form-group">
 					<view  class="title">平仓吨数</view>