|
@@ -222,7 +222,6 @@
|
|
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
<tui-list-cell class="line-cell" :hover="false">
|
|
|
<view class="tui-title">库存类型</view>
|
|
<view class="tui-title">库存类型</view>
|
|
|
-
|
|
|
|
|
<radio-group class="tui-input" @change="virtualStockChange">
|
|
<radio-group class="tui-input" @change="virtualStockChange">
|
|
|
<label class="list" for="realLink">
|
|
<label class="list" for="realLink">
|
|
|
<radio id="realLink" value="0" :checked="form.virtualStock == 0" style="transform: scale(0.7,0.7);" />
|
|
<radio id="realLink" value="0" :checked="form.virtualStock == 0" style="transform: scale(0.7,0.7);" />
|
|
@@ -233,7 +232,15 @@
|
|
|
<span class="checkbox-text" style="font-size:30upx;">虚拟</span>
|
|
<span class="checkbox-text" style="font-size:30upx;">虚拟</span>
|
|
|
</label>
|
|
</label>
|
|
|
</radio-group>
|
|
</radio-group>
|
|
|
|
|
+ </tui-list-cell>
|
|
|
|
|
|
|
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
|
|
+ <view class="tui-title">卖出后算</view>
|
|
|
|
|
+ <view class="switch_bx">
|
|
|
|
|
+ <switch :checked="belongCost == 0 ? true : false" @change="belongCostChange" style="transform: scale(0.8,0.8)" />
|
|
|
|
|
+ <text v-if="belongCost == 0">收入</text>
|
|
|
|
|
+ <text v-else>成本</text>
|
|
|
|
|
+ </view>
|
|
|
</tui-list-cell>
|
|
</tui-list-cell>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
@@ -310,7 +317,7 @@ import { getAllItemClass } from "@/api/item-class";
|
|
|
import { applyAuth } from '@/api/item';
|
|
import { applyAuth } from '@/api/item';
|
|
|
import { delCpItem,addCpItem } from '@/api/cp'
|
|
import { delCpItem,addCpItem } from '@/api/cp'
|
|
|
import { getAllUnit } from "@/api/unit";
|
|
import { getAllUnit } from "@/api/unit";
|
|
|
-import { addProduct,updateProduct,getProductDetail,py,print,modifyOnStockFn,delStatusUpdate } from "@/api/product";
|
|
|
|
|
|
|
+import { addProduct,updateProduct,getProductDetail,py,print,modifyOnStockFn,delStatusUpdate,changeBelongCost } from "@/api/product";
|
|
|
import { getPtItemDetail } from "@/api/pt-item";
|
|
import { getPtItemDetail } from "@/api/pt-item";
|
|
|
import { wastage } from "@/api/order";
|
|
import { wastage } from "@/api/order";
|
|
|
import { mapGetters } from "vuex"
|
|
import { mapGetters } from "vuex"
|
|
@@ -379,7 +386,9 @@ export default {
|
|
|
printLabelShow:false,
|
|
printLabelShow:false,
|
|
|
backCpInfo:{cpId:0,cpName:'',needUpdate:0}, wasteNum:'',
|
|
backCpInfo:{cpId:0,cpName:'',needUpdate:0}, wasteNum:'',
|
|
|
wasteShow:false,
|
|
wasteShow:false,
|
|
|
- wasteFocus:false };
|
|
|
|
|
|
|
+ wasteFocus:false,
|
|
|
|
|
+ belongCost:0
|
|
|
|
|
+ };
|
|
|
},
|
|
},
|
|
|
computed:{
|
|
computed:{
|
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"])
|
|
...mapGetters(["getLoginInfo","getDictionariesInfo"])
|
|
@@ -687,6 +696,15 @@ export default {
|
|
|
virtualStockChange(e){
|
|
virtualStockChange(e){
|
|
|
this.form.virtualStock = e.detail.value
|
|
this.form.virtualStock = e.detail.value
|
|
|
},
|
|
},
|
|
|
|
|
+ belongCostChange(e){
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ this.belongCost = e.detail.value == true ? 0 : 1
|
|
|
|
|
+ changeBelongCost({id:this.productData.id,belongCost:this.belongCost}).then(res=>{
|
|
|
|
|
+ if(res.code == 1){
|
|
|
|
|
+ that.$msg(res.msg)
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
frontHideChange(e){
|
|
frontHideChange(e){
|
|
|
this.form.frontHide = e.detail.value ? 1 : 0;
|
|
this.form.frontHide = e.detail.value ? 1 : 0;
|
|
|
},
|
|
},
|
|
@@ -787,7 +805,7 @@ export default {
|
|
|
)[0];
|
|
)[0];
|
|
|
this.productData = res.data
|
|
this.productData = res.data
|
|
|
this.cost = res.data.cost ? res.data.cost : 0
|
|
this.cost = res.data.cost ? res.data.cost : 0
|
|
|
-
|
|
|
|
|
|
|
+ this.belongCost = res.data.belongCost ? res.data.belongCost : 0
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
imgUploadSuccess(res) {
|
|
imgUploadSuccess(res) {
|