|
|
@@ -6,17 +6,8 @@
|
|
|
<view class="module-com">
|
|
|
<view class="commodity-view">
|
|
|
<view class="commodity-list">
|
|
|
- <view
|
|
|
- class="commodity-item"
|
|
|
- v-for="(item, index) in selectList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <image
|
|
|
- class="item-icon"
|
|
|
- :src="item.itemCover || item.cover"
|
|
|
- alt="商品图"
|
|
|
- />
|
|
|
-
|
|
|
+ <view class="commodity-item" v-for="(item, index) in selectList" :key="index">
|
|
|
+ <image class="item-icon" :src="item.itemCover || item.cover" alt="商品图" />
|
|
|
<view class="item-info">
|
|
|
<view class="info-line">
|
|
|
<text class="item-name">{{ item.itemName }}</text>
|
|
|
@@ -29,7 +20,7 @@
|
|
|
</text>
|
|
|
</view>
|
|
|
<view class="info-line">
|
|
|
- <text class="item-type">b级</text>
|
|
|
+ <text class="item-type"></text>
|
|
|
<text class="item-count">
|
|
|
<text >{{`${item.bigCount}`}}</text>
|
|
|
<text >/</text>
|
|
|
@@ -52,113 +43,93 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <!-- <view class="prompt-text">注: 请先关注公众号,绑定后可以在移动端自动登录</view> -->
|
|
|
-
|
|
|
<view class="module-com input-line-wrap">
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="true" @tap="showCustomer = true">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<view class="tui-title ">供应商</view>
|
|
|
- <text :style="!supplier.name?'color:#cccccc':''">
|
|
|
- {{ supplier.name || "请选择" }}
|
|
|
- </text>
|
|
|
- </tui-list-cell>
|
|
|
- <!-- <tui-list-cell class="line-cell" :hover="false">
|
|
|
- <view class="tui-title "></view>
|
|
|
-
|
|
|
- <view class="tag-list">
|
|
|
- <view class="tag-item">
|
|
|
- 盛丰
|
|
|
- </view>
|
|
|
- <view class="tag-item">
|
|
|
- 盛丰
|
|
|
- </view>
|
|
|
- <view class="tag-item">
|
|
|
- 盛丰
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- </tui-list-cell> -->
|
|
|
- </view>
|
|
|
- <view class="module-com input-line-wrap">
|
|
|
-
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
- <view class="tui-title ">包装重量</view>
|
|
|
- <input type="digit" :disabled="!canIEdit" v-model="form.packWeight" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="公斤"/>
|
|
|
+ <text>{{ option.ghsName }}</text>
|
|
|
</tui-list-cell>
|
|
|
- <tui-list-cell class="line-cell" :hover="false">
|
|
|
- <view class="tui-title ">总重量</view>
|
|
|
- <view>{{totalWeight}}</view>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
+ <view class="tui-title ">入库日期</view>
|
|
|
+ <AppDatePicker v-if="canIEdit" :dateVal="form.entryTime" :placeholder="'请选择日期'"/>
|
|
|
+ <view v-else>{{ form.entryTime || "请选择日期" }}</view>
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">打包费</view>
|
|
|
- <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.packingCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
|
|
|
+ <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.packingCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写"/>
|
|
|
</tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title">运费支付</view>
|
|
|
+ <button @click="changeYfPayWay(1)" class="admin-button-com mini-btn" :class="form.yfPayWay == 1 ? 'blue' : 'default'">寄付</button>
|
|
|
+ <button @click="changeYfPayWay(2)" class="admin-button-com mini-btn" :class="form.yfPayWay == 2 ? 'blue' : 'default'" style="margin-left:20rpx;">到付</button>
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
+
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">短途运费</view>
|
|
|
- <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.shortCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
|
|
|
+ <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.shortCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写"/>
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">长途运费</view>
|
|
|
- <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.longCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
|
|
|
+ <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.longCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写"/>
|
|
|
</tui-list-cell>
|
|
|
+
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">提货费</view>
|
|
|
- <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.pickCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
|
|
|
+ <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.pickCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写"/>
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">本地运费</view>
|
|
|
- <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.localCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
|
|
|
- </tui-list-cell>
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
- <view class="tui-title ">入库日期</view>
|
|
|
- <AppDatePicker v-if="canIEdit" :dateVal="form.entryTime" :placeholder="'请选择日期'"/>
|
|
|
- <view v-else>{{ form.entryTime || "请选择日期" }}</view>
|
|
|
+ <input type="digit" @input="inputFn" :disabled="!canIEdit" v-model="form.localCharge" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写"/>
|
|
|
</tui-list-cell>
|
|
|
+ </view>
|
|
|
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title ">总金额</view>
|
|
|
<view>{{totalPrice}}</view>
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
- <view class="tui-title ">实付金额</view>
|
|
|
- <input style="border: 1px solid #eee;color: #3385FF;width: calc(100%);height:70rpx;" type="digit" :disabled="!canIEdit" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写,留空没有费用"/>
|
|
|
+ <view class="tui-title ">应付金额</view>
|
|
|
+ <input style="border: 1px solid #eee;color: #3385FF;width: calc(100%);height:70rpx;" type="digit" :disabled="!canIEdit" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="phcolor" class="tui-input" name="floor" placeholder="请填写"/>
|
|
|
</tui-list-cell>
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
- <view class="tui-title ">报损减免</view>
|
|
|
+ <view class="tui-title ">减免</view>
|
|
|
<view>{{(totalPrice - modifyPrice).toFixed(2) }}</view>
|
|
|
</tui-list-cell>
|
|
|
-
|
|
|
- <tui-list-cell class="line-cell remark-wrap" :hover="false">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title ">总运费</view>
|
|
|
+ <view>{{totalFreight}}</view>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title ">每公斤运费</view>
|
|
|
+ <view>{{perKgFreight}}</view>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title">备注</view>
|
|
|
<view class="tui-input">
|
|
|
- <textarea
|
|
|
- :disabled="!canIEdit"
|
|
|
- v-model="form.introduction"
|
|
|
- class="tui-textarea remark"
|
|
|
- placeholder-class="phcolor"
|
|
|
- placeholder="请输入备注"
|
|
|
- />
|
|
|
+ <input type="text" v-model="form.remark" placeholder-class="phcolor" style="width:430rpx;" class="tui-input" placeholder="这里写备注"/>
|
|
|
</view>
|
|
|
</tui-list-cell>
|
|
|
</view>
|
|
|
+
|
|
|
</form>
|
|
|
</view>
|
|
|
<view class="under-bar">
|
|
|
<view class="price-view">
|
|
|
- <text class="price-title">实付金额</text>
|
|
|
+ <text class="price-title">应付金额</text>
|
|
|
<text class="price-number">
|
|
|
- <!--¥ <text class="large">{{ Number(allPrice) + Number(form.packingCharge) + Number(form.shortCharge) + Number(form.longCharge) + Number(form.pickCharge) + Number(form.localCharge) }}</text>-->
|
|
|
¥ <text class="large">{{ modifyPrice }}</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
- <button class="admin-button-com blue middle" v-if="canIEdit" @click="formSubmit">
|
|
|
- 确认
|
|
|
- </button>
|
|
|
+ <button class="admin-button-com blue middle" v-if="canIEdit" @click="formSubmit">确认</button>
|
|
|
</view>
|
|
|
|
|
|
- <!-- 选择客户 -->
|
|
|
- <AppSupplierSel
|
|
|
- :show.sync="showCustomer"
|
|
|
- @change="changeCustomerFn"
|
|
|
- />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -169,14 +140,9 @@ import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
import AppCustomerSel from "@/components/app-customer-sel";
|
|
|
const form = require("@/utils/formValidation.js");
|
|
|
import productMins from "@/mixins/product";
|
|
|
-import {
|
|
|
- getPurchaseDetailApi,
|
|
|
- createPurchaseOrderApi
|
|
|
-} from "@/api/purchase/index";
|
|
|
+import {getPurchaseDetailApi,createPurchaseOrderApi} from "@/api/purchase/index";
|
|
|
import { PURCHASE_ORDER_STATUS } from "@/utils/declare";
|
|
|
-
|
|
|
import AppDatePicker from "@/components/app-date-picker";
|
|
|
-import AppSupplierSel from "@/components/app-supplier-sel";
|
|
|
|
|
|
export default {
|
|
|
// 采购详情
|
|
|
@@ -184,8 +150,7 @@ export default {
|
|
|
TuiListCell,
|
|
|
AppAvatarModule,
|
|
|
AppCustomerSel,
|
|
|
- AppDatePicker,
|
|
|
- AppSupplierSel
|
|
|
+ AppDatePicker
|
|
|
},
|
|
|
mixins: [productMins],
|
|
|
data() {
|
|
|
@@ -195,23 +160,26 @@ export default {
|
|
|
pageType: "purchase",
|
|
|
supplier:'',
|
|
|
form: {
|
|
|
- packingCharge: "", //打包费
|
|
|
+ packingCharge: "",
|
|
|
shortCharge: "",
|
|
|
longCharge: "",
|
|
|
pickCharge: "",
|
|
|
localCharge: "",
|
|
|
- packWeight: "",
|
|
|
-
|
|
|
entryTime: "",
|
|
|
- ghsId: null
|
|
|
+ ghsId: null,
|
|
|
+ yfPayWay:1,
|
|
|
+ remark:"",
|
|
|
},
|
|
|
showCustomer: false,
|
|
|
detailsInfo: {},
|
|
|
totalPrice:0,
|
|
|
- modifyPrice:0
|
|
|
+ modifyPrice:0,
|
|
|
+ totalFreight:0,
|
|
|
+ perKgFreight:0,
|
|
|
};
|
|
|
},
|
|
|
- onLoad() {
|
|
|
+ onLoad(option) {
|
|
|
+ this.form.ghsId = option.ghsId
|
|
|
this.initData();
|
|
|
},
|
|
|
onShow(){
|
|
|
@@ -253,13 +221,6 @@ export default {
|
|
|
let calcWeight = realityWeight.toFixed(2);
|
|
|
return calcWeight
|
|
|
},
|
|
|
- totalWeight(){
|
|
|
- let totalWeight = this.selectAllRealityWeight
|
|
|
- if(Number(this.form.packWeight) > 0){
|
|
|
- totalWeight = (Number(this.form.packWeight) + Number(totalWeight)).toFixed(2)
|
|
|
- }
|
|
|
- return totalWeight
|
|
|
- },
|
|
|
canIEdit() {
|
|
|
const { orderSn } = this.option || {};
|
|
|
if (!orderSn || this.detailsInfo.status == PURCHASE_ORDER_STATUS.CONFIRM) {
|
|
|
@@ -269,29 +230,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ changeYfPayWay(index){
|
|
|
+ this.form.yfPayWay = index
|
|
|
+ this.inputFn()
|
|
|
+ },
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
init() {
|
|
|
this._getDet();
|
|
|
},
|
|
|
inputFn(e) {
|
|
|
let price = Number(this.selectAllPrice);
|
|
|
+ //打包费
|
|
|
if(Number(this.form.packingCharge) > 0){
|
|
|
price = Number(price) + Number(this.form.packingCharge)
|
|
|
}
|
|
|
- if(Number(this.form.shortCharge) > 0){
|
|
|
- price = Number(price) + Number(this.form.shortCharge)
|
|
|
- }
|
|
|
- if(Number(this.form.longCharge) > 0){
|
|
|
- price = Number(price) + Number(this.form.longCharge)
|
|
|
- }
|
|
|
- if(Number(this.form.pickCharge) > 0){
|
|
|
- price = Number(price) + Number(this.form.pickCharge)
|
|
|
- }
|
|
|
- if(Number(this.form.localCharge) > 0){
|
|
|
- price = Number(price) + Number(this.form.localCharge)
|
|
|
+ //到付的,长途和短途运费不能算在要结帐的订单金额里。寄付的则要算。
|
|
|
+ if(this.form.yfPayWay == 1){
|
|
|
+ //短途运费
|
|
|
+ if(Number(this.form.shortCharge) > 0){
|
|
|
+ price = Number(price) + Number(this.form.shortCharge)
|
|
|
+ }
|
|
|
+ //长途运费
|
|
|
+ if(Number(this.form.longCharge) > 0){
|
|
|
+ price = Number(price) + Number(this.form.longCharge)
|
|
|
+ }
|
|
|
}
|
|
|
this.totalPrice = price.toFixed(2);
|
|
|
this.modifyPrice = price.toFixed(2);
|
|
|
+
|
|
|
+ let packingCharge = Number(this.form.packingCharge) > 0 ? Number(this.form.packingCharge) : 0
|
|
|
+ let longCharge = Number(this.form.longCharge) > 0 ? Number(this.form.longCharge) : 0
|
|
|
+ let shortCharge = Number(this.form.shortCharge) > 0 ? Number(this.form.shortCharge) : 0
|
|
|
+ let localCharge = Number(this.form.localCharge) > 0 ? Number(this.form.localCharge) : 0
|
|
|
+ let pickCharge = Number(this.form.pickCharge) > 0 ? Number(this.form.pickCharge) : 0
|
|
|
+ this.totalFreight = (packingCharge+longCharge+shortCharge+localCharge+pickCharge).toFixed(2)
|
|
|
+ this.perKgFreight = (this.totalFreight / this.selectAllRealityWeight).toFixed(2)
|
|
|
},
|
|
|
_getDet() {
|
|
|
let data = uni.getStorageSync("modifyShopB");
|
|
|
@@ -323,13 +296,10 @@ export default {
|
|
|
});
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
}
|
|
|
-
|
|
|
if (!this.getMerchantInfo) {
|
|
|
await this.initMerchantInfo();
|
|
|
}
|
|
|
- console.log(66666, this.getMerchantInfo);
|
|
|
} catch (error) {
|
|
|
- console.log(4444, error);
|
|
|
}
|
|
|
},
|
|
|
|
|
|
@@ -381,8 +351,6 @@ export default {
|
|
|
success: function (res) {
|
|
|
if (res.confirm) {
|
|
|
self.confirmFn();
|
|
|
- // this.confirmFn();
|
|
|
-
|
|
|
} else if (res.cancel) {
|
|
|
console.log('用户点击取消');
|
|
|
}
|
|
|
@@ -391,10 +359,6 @@ export default {
|
|
|
},
|
|
|
// 表单验证
|
|
|
formSubmit(e) {
|
|
|
-
|
|
|
- if(this.supplier==''){
|
|
|
- uni.showToast({title:'请选择供应商',icon:'none'});return;
|
|
|
- }
|
|
|
// 表单规则
|
|
|
let rules = [
|
|
|
{
|