Procházet zdrojové kódy

修改是否属于成本

shish před 2 roky
rodič
revize
9142b1e4ee

+ 1 - 1
ghsApp/src/admin/billing/index2.vue

@@ -90,7 +90,7 @@
 						<button class="admin-button-com mini-btn" @click="customData.userPrice=0.01;customData.bigCount=1" style="position:absolute;top:200upx;right:33upx;">赠送</button>
 					</view>
 					<view class="num_bx">
-						<input style="width: 280upx;height:30upx;font-size:24upx;" v-model="customData.remark" type="text" placeholder="备注" />
+						<input style="width: 280upx;height:40upx;font-size:25upx;" v-model="customData.remark" type="text" placeholder="备注" />
 					</view>
 				</view>
 			</template>

+ 22 - 4
ghsApp/src/admin/item/detail.vue

@@ -222,7 +222,6 @@
 
           <tui-list-cell class="line-cell" :hover="false">
             <view class="tui-title">库存类型</view>
-
             <radio-group class="tui-input" @change="virtualStockChange">
             <label class="list" for="realLink">
               <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>
             </label>
           </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>
 
       </view>
@@ -310,7 +317,7 @@ import { getAllItemClass } from "@/api/item-class";
 import { applyAuth } from '@/api/item';
 import { delCpItem,addCpItem } from '@/api/cp'
 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 { wastage } from "@/api/order";
 import { mapGetters } from "vuex"
@@ -379,7 +386,9 @@ export default {
       printLabelShow:false,
       backCpInfo:{cpId:0,cpName:'',needUpdate:0},      wasteNum:'',
       wasteShow:false,
-      wasteFocus:false    };
+      wasteFocus:false,
+      belongCost:0
+    };
   },
 	computed:{
 		...mapGetters(["getLoginInfo","getDictionariesInfo"])
@@ -687,6 +696,15 @@ export default {
     virtualStockChange(e){
       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){
       this.form.frontHide = e.detail.value ? 1 : 0;
     },
@@ -787,7 +805,7 @@ export default {
         )[0];
         this.productData = res.data
         this.cost = res.data.cost ? res.data.cost : 0
-
+        this.belongCost = res.data.belongCost ? res.data.belongCost : 0
       })
     },
     imgUploadSuccess(res) {

+ 4 - 0
ghsApp/src/api/product/index.js

@@ -130,4 +130,8 @@ export const allProduct = async data => {
 //下载条形码
 export const generateBarcodeTable = data => {
 	return https.get("/product/generate-barcode-table", data);
+};
+
+export const changeBelongCost = data => {
+	return https.get("/product/change-belong-cost", data);
 };