|
@@ -2,50 +2,59 @@
|
|
|
<view class="container">
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">卖方</view>
|
|
|
- <view class="title">{{seller}}</view>
|
|
|
+
|
|
|
+ <view class="title" @click="liang">{{purchaseOrder.customerName}}></view>
|
|
|
+
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">买方</view>
|
|
|
- <view class="title">{{sellerPhone}}</view>
|
|
|
+ <view class="title">{{purchaseOrder.buyer}}</view>
|
|
|
</view>
|
|
|
<view class="cu-form-group margin-top">
|
|
|
<view class="title">收货地区</view>
|
|
|
- <view class="title">{{sellerPhone}}</view>
|
|
|
+ <view class="title">{{purchaseOrder.receivePrivate}}{{purchaseOrder.receiveCity}}{{purchaseOrder.receiveArea}}</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
<view class="cu-form-group ">
|
|
|
<view class="title">收货库</view>
|
|
|
- <view class="title">{{sellerPhone}}</view>
|
|
|
+ <view class="title">{{purchaseOrder.receivePrivate}}{{purchaseOrder.receiveCity}}{{purchaseOrder.receiveArea}}{{purchaseOrder.receiveWarehouse}}</view>
|
|
|
</picker>
|
|
|
</view>
|
|
|
<view v-if='companyId!=2' class="cu-form-group">
|
|
|
<view class="title">货名</view>
|
|
|
- <input placeholder="请填写" name="input" @input="addressInput"></input>
|
|
|
+ <text>{{purchaseOrder.goodsName}}</text>
|
|
|
+ <!-- <input placeholder="请填写" name="input" @input="addressInput"></input> -->
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">最小成交量(吨)</view>
|
|
|
- <view class="title">{{minSale}}</view>
|
|
|
+ <text>{{purchaseOrder.minimumVolume}}</text>
|
|
|
</view>
|
|
|
- <view v-if="companyId==2" class="cu-form-group">
|
|
|
+ <view v-if="invoiceType !=2" class="cu-form-group">
|
|
|
<view class="title">今日基差(元/吨)</view>
|
|
|
<view class="picker">
|
|
|
- {{invoiceTypeIndex1>-1?invoiceType1[invoiceTypeIndex1]:'请选择'}}
|
|
|
+ <text>{{purchaseOrder.basisPrice}}</text>
|
|
|
+ <!-- {{invoiceTypeIndex1>-1?invoiceType1[invoiceTypeIndex1]:'请选择'}} -->
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
<view v-else class="cu-form-group">
|
|
|
- <view class="title">采购单价(元/吨)</view>
|
|
|
+ <view class="title">采购单价(元/吨)</view>
|
|
|
<view class="picker">
|
|
|
- {{invoiceTypeIndex>-1?invoiceType[invoiceTypeIndex]:'请选择'}}
|
|
|
+ <text>{{purchaseOrder.unitPrice}}</text>
|
|
|
+ <!-- {{invoiceTypeIndex>-1?invoiceType[invoiceTypeIndex]:'请选择'}} -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="cu-form-group margin-top">
|
|
|
<view class="title">发票类型</view>
|
|
|
- <input placeholder="请填写" name="input" @input="countInput"></input>
|
|
|
+ <picker @change="packingChange" :value="packingIndex" :range="invoiceType">
|
|
|
+ <view class="picker">
|
|
|
+ {{packingIndex>-1?invoiceType[packingIndex]:'请选择'}}
|
|
|
+ </view>
|
|
|
+ </picker>
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">出售数量(吨)</view>
|
|
|
- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
|
|
|
+ <input placeholder="请填写出售数量" name="input" @input='packingInput'></input>
|
|
|
</view>
|
|
|
<view class="cu-form-group">
|
|
|
<view class="title">包装方式</view>
|
|
@@ -57,26 +66,28 @@
|
|
|
</view>
|
|
|
<view class="cu-form-group align-start">
|
|
|
<view class="title">袋装备注</view>
|
|
|
- <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaInput" placeholder="请填写包装规格、质量、包装物要求。例:50kg袋装、大粒、彩包"></textarea>
|
|
|
+ <textarea maxlength="-1" :disabled="modalName!=null" @input="textareaInput" placeholder="请填写包装规格、质量、包装物要求。例:50kg袋装、大粒、彩包" ></textarea>
|
|
|
</view>
|
|
|
<view class="cu-form-group align-start">
|
|
|
<view class="title">点价(元/吨)</view>
|
|
|
- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
|
|
|
+ <input placeholder="请填写点价" name="input" @input='packingInput' v-model="purchaseOrder.pointPrice"></input>
|
|
|
</view>
|
|
|
<view class="cu-form-group align-start">
|
|
|
<view class="title">发票费用(元/吨)</view>
|
|
|
- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
|
|
|
+ <input placeholder="请填写发票费用" name="input" @input='packingInput' v-model="purchaseOrder.invoiceFee"></input>
|
|
|
</view>
|
|
|
<view class="cu-form-group align-start">
|
|
|
<view class="title">包装费(元/吨)</view>
|
|
|
- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
|
|
|
+ <input placeholder="请填写包装费" name="input" @input='packingInput' v-model="purchaseOrder.packingFee"></input>
|
|
|
</view>
|
|
|
<view class="cu-form-group align-start">
|
|
|
<view class="title">结算价格</view>
|
|
|
- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput'></input>
|
|
|
+ <text>{{Number(purchaseOrder.pointPrice) + Number(purchaseOrder.invoiceFee) + Number(purchaseOrder.packingFee) + Number(purchaseOrder.basisPrice) }}</text>
|
|
|
+
|
|
|
+ <!-- <input placeholder="请填写 例:袋装XX斤/散装" name="input" @input='packingInput' v-model="purchaseOrder.settlementPrice"></input> -->
|
|
|
</view>
|
|
|
<view class="padding flex flex-direction">
|
|
|
- <button class="cu-btn bg-red margin-tb-sm lg" @click="commit">提交</button>
|
|
|
+ <button class="cu-btn bg-red margin-tb-sm lg" @click="commit()">提交</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -103,16 +114,19 @@
|
|
|
sellerPhone:'',
|
|
|
packingMoney:0,
|
|
|
type:0,
|
|
|
+ modalName:"",
|
|
|
},
|
|
|
+ purchaseOrder: {},
|
|
|
invoiceTypeIndex:0,
|
|
|
invoiceTypeIndex1:0,
|
|
|
acceptTypeIndex:0,
|
|
|
priceTypeIndex:0,
|
|
|
bankNameIndex:0,
|
|
|
packingIndex:0,
|
|
|
- packingType: ['散装', '袋装'],
|
|
|
- invoiceType: ['不开发票', '普通发票', '增值税发票'],
|
|
|
- invoiceType1: ['不开发票','增值税发票'],
|
|
|
+ // packingChange:['散袋(默认)','大袋','小袋'],
|
|
|
+ packingType: ['散袋(默认)','大袋','小袋'],
|
|
|
+ // invoiceType: ['不开发票', '普通发票', '增值税发票'],
|
|
|
+ invoiceType: ['不开发票','增值税发票'],
|
|
|
acceptType: ['第三方检验(国家检验资质)', '交收地库或港出具的检验', '现场看货','其他'],
|
|
|
priceType: ['库内价', '到库价', '到港价'],
|
|
|
priceTypeIndex1:'库内价',
|
|
@@ -150,21 +164,33 @@
|
|
|
};
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
- this.salebuyId = options.id
|
|
|
- this.seller = options.seller
|
|
|
- this.sellerPhone = options.sellerPhone
|
|
|
- this.isFutures = options.isFutures
|
|
|
- this.minSale = options.minSale
|
|
|
- this.companyId=options.companyId
|
|
|
- this.province = options.province
|
|
|
- this.city = options.city
|
|
|
- this.area = options.area
|
|
|
- this.storeName=options.storeName
|
|
|
- this.exsitCount = Math.floor(options.exsitCount * 100) / 100
|
|
|
- this.basis = options.basis
|
|
|
- this.basisBig = options.basisBig
|
|
|
- this.basisSmall = options.basisSmall
|
|
|
- this.unloadingFee = options.unloadingFee
|
|
|
+ // this.salebuyId = options.id
|
|
|
+ // this.seller = options.seller
|
|
|
+ // this.sellerPhone = options.sellerPhone
|
|
|
+ // this.isFutures = options.isFutures
|
|
|
+ // this.minSale = options.minSale
|
|
|
+ // this.companyId=options.companyId
|
|
|
+ // this.province = options.province
|
|
|
+ // this.city = options.city
|
|
|
+ // this.area = options.area
|
|
|
+ // this.storeName=options.storeName
|
|
|
+ // this.exsitCount = Math.floor(options.exsitCount * 100) / 100
|
|
|
+ // this.basis = options.basis
|
|
|
+ // this.basisBig = options.basisBig
|
|
|
+ // this.basisSmall = options.basisSmall
|
|
|
+ // this.unloadingFee = options.unloadingFee
|
|
|
+ this.purchaseOrder.seller = options.seller
|
|
|
+ this.purchaseOrder.goodsName = options.goodsName
|
|
|
+ this.purchaseOrder.receivePrivate = options.receivePrivate
|
|
|
+ this.purchaseOrder.receiveCity = options.receiveCity
|
|
|
+ this.purchaseOrder.receiveArea = options.receiveArea
|
|
|
+ this.purchaseOrder.minimumVolume = options.minimumVolume
|
|
|
+ this.purchaseOrder.buyer = options.buyer
|
|
|
+ this.purchaseOrder.customerName = options.customerName
|
|
|
+ this.purchaseOrder.basisPrice = options.basisPrice
|
|
|
+ this.purchaseOrder.unitPrice = options.unitPrice
|
|
|
+ this.purchaseOrder.receiveWarehouse = options.receiveWarehouse
|
|
|
+
|
|
|
},
|
|
|
onShow() {
|
|
|
var that=this
|
|
@@ -192,6 +218,7 @@
|
|
|
uni.hideLoading()
|
|
|
}
|
|
|
})
|
|
|
+ },
|
|
|
// uni.getLocation({
|
|
|
// type: 'wgs84',
|
|
|
// geocode:true,
|
|
@@ -200,8 +227,24 @@
|
|
|
// console.log('当前位置的纬度:' + res.latitude);
|
|
|
// }
|
|
|
// });
|
|
|
- },
|
|
|
+ // },
|
|
|
methods: {
|
|
|
+ liang(){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pageA/product/Identity_switching'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ commit(){
|
|
|
+ this.$api.doRequest('post','/purchaseOrder/api/insertPurchaseOrder', this.purchaseOrder).then(res => {
|
|
|
+ console.log("成功123")
|
|
|
+ }).catch(res => {
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
InvoiceTypeChange(e) {
|
|
|
this.invoiceTypeIndex = e.detail.value
|
|
|
this.invoice = this.invoiceType[this.invoiceTypeIndex];
|
|
@@ -277,49 +320,45 @@
|
|
|
},
|
|
|
commit(){
|
|
|
const that = this
|
|
|
- if ( that.companyId !=2 && !that.area ) {
|
|
|
- that.$api.msg('请选择省市区');
|
|
|
- return
|
|
|
- }
|
|
|
- if ( that.companyId !=2&& !that.address) {
|
|
|
- that.$api.msg('请填写详细交收地址')
|
|
|
- return
|
|
|
- }
|
|
|
+ // if ( that.companyId !=2&& !that.address) {
|
|
|
+ // that.$api.msg('请填写详细交收地址')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
if (!that.price) {
|
|
|
- that.$api.msg('请选择价格类型')
|
|
|
+ that.$api.msg('请选择出售数量')
|
|
|
return
|
|
|
}
|
|
|
if (!that.invoice) {
|
|
|
that.$api.msg('请选择发票类型')
|
|
|
return
|
|
|
}
|
|
|
- // if(!that.accept&&that.isFutures==0){
|
|
|
- // that.$api.msg('请选择质量验收方式');
|
|
|
- // return
|
|
|
- // }
|
|
|
- if(!that.unitPrice){
|
|
|
- that.$api.msg('请填写协议价格(元/吨)');
|
|
|
- return
|
|
|
- }
|
|
|
- if(!that.count){
|
|
|
- that.$api.msg('请填写购买数量(吨)');
|
|
|
+ if (!that.packingType) {
|
|
|
+ that.$api.msg('请选择包装类型')
|
|
|
return
|
|
|
}
|
|
|
- if(Number(that.count) < Number(that.minSale)){
|
|
|
- that.$api.msg('购买数量不能小于最小成交量');
|
|
|
+ if(!that.pointPrice){
|
|
|
+ that.$api.msg('请填写点价');
|
|
|
return
|
|
|
}
|
|
|
- if(!that.tradeCompanyId){
|
|
|
- that.$api.msg('请选择公司名头');
|
|
|
+ if (!that.invoiceFee) {
|
|
|
+ that.$api.msg('请填写发票费用')
|
|
|
return
|
|
|
}
|
|
|
+ // if(Number(that.count) < Number(that.minSale)){
|
|
|
+ // that.$api.msg('购买数量不能小于最小成交量');
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(!that.tradeCompanyId){
|
|
|
+ // that.$api.msg('请选择公司名头');
|
|
|
+ // return
|
|
|
+ // }
|
|
|
// if(that.count > that.exsitCount){
|
|
|
// that.$api.msg('购买数量大于库存量');
|
|
|
// return
|
|
|
// }
|
|
|
//this.$api.prePage()获取上一页实例,可直接调用上页所有数据和方法,在App.vue定义
|
|
|
|
|
|
- //this.$api.msg(`地址${this.manageType=='edit' ? '修改': '添加'}成功`);
|
|
|
+ // this.$api.msg(`地址${this.manageType=='edit' ? '修改': '添加'}成功`);
|
|
|
that.tradeInfo.salebuyId = that.salebuyId
|
|
|
that.tradeInfo.buyer = that.buyer
|
|
|
that.tradeInfo.buyerPhone = that.buyerPhone
|