Forráskód Böngészése

修改盘点成本

lilei 1 éve
szülő
commit
845aeae64c

+ 2 - 0
config/api.js

@@ -49,6 +49,8 @@ export const checkWarehouseQueryList = (params, config = {}) => http.post(`/chec
 export const checkWarehouseDetailStockList = (params, config = {}) => http.post(`/checkWarehouse/queryStockPage/${params.pageNo}/${params.pageSize}`, params, config)
 // 库存盘点详情添加产品
 export const checkWarehouseDetailSave = (params, config = {}) => http.post('/checkWarehouse/detail/saveByPda', params, config)
+// 修改盘点单明细成本
+export const checkWarehouseModifyCost = (params, config = {}) => http.post('/checkWarehouse/detail/modifyCost', params, config)
 // 库存盘点详情删除产品
 export const checkWarehouseDetailDel = (params, config = {}) => http.post('/checkWarehouse/detail/delete', params, config)
 //  库存盘点  详情  列表  分页

+ 15 - 4
pages/stockPan/index.vue

@@ -50,7 +50,8 @@
 			</view>
 			<view v-if="curProduct">
 				<view>盘点数量:<input class="uni-input" v-model="curProduct.checkQty" :min="0" @blur="updateCurr" type="digit"/></view>
-				<view>成本:<input class="uni-input" v-model="curProduct.showCost" :min="0" @blur="updateCost" type="digit"/></view>
+				<view v-if="curProduct.checkProfitLossQty>0||(curProduct.stockQty==curProduct.checkQty)">成本:{{curProduct.cost||'--'}}</view>
+				<view v-else>成本:<input class="uni-input" v-model="curProduct.cost" :min="0" @blur="updateCost" type="digit"/></view>
 				<view>库存:{{curProduct.stockQty}}</view>
 			</view>
 			<view v-if="countData" style="justify-content: flex-start;flex-wrap: wrap;">
@@ -96,6 +97,7 @@
 		checkWarehouseDetailList, 
 		checkWarehouseDetailCount,
 		checkWarehouseDetailSave,
+		checkWarehouseModifyCost,
 		checkWarehouseDetailDel,
 		checkWarehouseSubmit} from '@/config/api.js'
 	export default {
@@ -164,7 +166,16 @@
 			},
 			// 修改成本
 			updateCost(){
-				
+				checkWarehouseModifyCost({
+					id: this.curProduct.id,
+					checkWarehouseSn: this.checkWarehouseSn,
+					cost: this.curProduct.cost
+				}).then(res => {
+					if(res.status == 200){
+						uni.$u.toast(res.message)
+						this.pageInit()
+					}
+				})
 			},
 			// 加减数量
 			addQty(type){
@@ -212,10 +223,9 @@
 				}
 				console.log(params)
 				checkWarehouseDetailStockList(params).then(res => {
-					console.log(res)
 					if(res.status == 200){
 						const curProduct = res.data && res.data.list[0] || null
-						console.log(curProduct)
+						console.log(curProduct,'curProduct')
 						if(curProduct){
 							// 添加产品
 							this.addDetailProduct(curProduct, false)
@@ -231,6 +241,7 @@
 				const params = isEdit ? row : {
 					checkWarehouseSn: this.checkWarehouseSn,
 					checkCost: row.putCost,
+					cost: row.lastStockCost,
 					productSn: row.productSn,
 					productCode: row.productCode,
 					productOrigCode: row.productOrigCode || undefined,

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
unpackage/dist/dev/app-plus/app-service.js


+ 64 - 36
unpackage/dist/dev/app-plus/app-view.js

@@ -11627,14 +11627,42 @@ var render = function () {
                     ],
                     1
                   ),
-                  _c("uni-view", { attrs: { _i: 30 } }, [
-                    _vm._v("库存数量:" + _vm._$g(30, "t0-0")),
+                  _vm._$g(30, "i")
+                    ? _c("uni-view", { attrs: { _i: 30 } }, [
+                        _vm._v("成本:" + _vm._$g(30, "t0-0")),
+                      ])
+                    : _c(
+                        "uni-view",
+                        { attrs: { _i: 31 } },
+                        [
+                          _vm._v("成本:"),
+                          _c("v-uni-input", {
+                            staticClass: _vm._$g(32, "sc"),
+                            attrs: { min: 0, type: "digit", _i: 32 },
+                            on: {
+                              blur: function ($event) {
+                                return _vm.$handleViewEvent($event)
+                              },
+                            },
+                            model: {
+                              value: _vm._$g(32, "v-model"),
+                              callback: function ($$v) {
+                                _vm.$handleVModelEvent(32, $$v)
+                              },
+                              expression: "curProduct.cost",
+                            },
+                          }),
+                        ],
+                        1
+                      ),
+                  _c("uni-view", { attrs: { _i: 33 } }, [
+                    _vm._v("库存:" + _vm._$g(33, "t0-0")),
                   ]),
                 ],
                 1
               )
             : _vm._e(),
-          _vm._$g(31, "i")
+          _vm._$g(34, "i")
             ? _c(
                 "uni-view",
                 {
@@ -11642,24 +11670,24 @@ var render = function () {
                     "justify-content": "flex-start",
                     "flex-wrap": "wrap",
                   },
-                  attrs: { _i: 31 },
+                  attrs: { _i: 34 },
                 },
                 [
-                  _c("uni-view", { attrs: { _i: 32 } }, [
-                    _vm._v("共" + _vm._$g(32, "t0-0") + "款"),
+                  _c("uni-view", { attrs: { _i: 35 } }, [
+                    _vm._v("共" + _vm._$g(35, "t0-0") + "款"),
                   ]),
-                  _c("uni-view", { attrs: { _i: 33 } }, [
-                    _vm._v("总数量:" + _vm._$g(33, "t0-0")),
+                  _c("uni-view", { attrs: { _i: 36 } }, [
+                    _vm._v("总数量:" + _vm._$g(36, "t0-0")),
                   ]),
                   _c(
                     "uni-view",
-                    { attrs: { _i: 34 } },
+                    { attrs: { _i: 37 } },
                     [
                       _vm._v("盈亏数量:"),
                       _c(
                         "span",
-                        { style: _vm._$g(35, "s"), attrs: { _i: 35 } },
-                        [_vm._v(_vm._$g(35, "t0-0"))]
+                        { style: _vm._$g(38, "s"), attrs: { _i: 38 } },
+                        [_vm._v(_vm._$g(38, "t0-0"))]
                       ),
                     ],
                     1
@@ -11673,29 +11701,29 @@ var render = function () {
       ),
       _c(
         "uni-view",
-        { staticClass: _vm._$g(36, "sc"), attrs: { _i: 36 } },
+        { staticClass: _vm._$g(39, "sc"), attrs: { _i: 39 } },
         [
           _c(
             "uni-table",
-            { staticStyle: { width: "100%" }, attrs: { _i: 37 } },
+            { staticStyle: { width: "100%" }, attrs: { _i: 40 } },
             [
               _c(
                 "uni-tr",
-                { attrs: { _i: 38 } },
+                { attrs: { _i: 41 } },
                 [
-                  _c("uni-td", { attrs: { _i: 39 } }, [_vm._v("产品编码")]),
-                  _c("uni-td", { attrs: { _i: 40 } }, [_vm._v("库存")]),
-                  _c("uni-td", { attrs: { _i: 41 } }, [_vm._v("盘点数量")]),
-                  _c("uni-td", { attrs: { _i: 42 } }, [_vm._v("盈亏数量")]),
+                  _c("uni-td", { attrs: { _i: 42 } }, [_vm._v("产品编码")]),
+                  _c("uni-td", { attrs: { _i: 43 } }, [_vm._v("库存")]),
+                  _c("uni-td", { attrs: { _i: 44 } }, [_vm._v("盘点数量")]),
+                  _c("uni-td", { attrs: { _i: 45 } }, [_vm._v("盈亏数量")]),
                 ],
                 1
               ),
-              _vm._l(_vm._$g(43, "f"), function (item, $10, $20, $30) {
+              _vm._l(_vm._$g(46, "f"), function (item, $10, $20, $30) {
                 return _c(
                   "uni-tr",
                   {
                     key: item,
-                    attrs: { _i: "43-" + $30 },
+                    attrs: { _i: "46-" + $30 },
                     on: {
                       click: function ($event) {
                         return _vm.$handleViewEvent($event)
@@ -11703,26 +11731,26 @@ var render = function () {
                     },
                   },
                   [
-                    _c("uni-td", { attrs: { _i: "44-" + $30 } }, [
-                      _vm._v(_vm._$g("44-" + $30, "t0-0")),
+                    _c("uni-td", { attrs: { _i: "47-" + $30 } }, [
+                      _vm._v(_vm._$g("47-" + $30, "t0-0")),
                     ]),
-                    _c("uni-td", { attrs: { _i: "45-" + $30 } }, [
-                      _vm._v(_vm._$g("45-" + $30, "t0-0")),
+                    _c("uni-td", { attrs: { _i: "48-" + $30 } }, [
+                      _vm._v(_vm._$g("48-" + $30, "t0-0")),
                     ]),
-                    _c("uni-td", { attrs: { _i: "46-" + $30 } }, [
-                      _vm._v(_vm._$g("46-" + $30, "t0-0")),
+                    _c("uni-td", { attrs: { _i: "49-" + $30 } }, [
+                      _vm._v(_vm._$g("49-" + $30, "t0-0")),
                     ]),
                     _c(
                       "uni-td",
-                      { attrs: { _i: "47-" + $30 } },
+                      { attrs: { _i: "50-" + $30 } },
                       [
                         _c(
                           "span",
                           {
-                            style: _vm._$g("48-" + $30, "s"),
-                            attrs: { _i: "48-" + $30 },
+                            style: _vm._$g("51-" + $30, "s"),
+                            attrs: { _i: "51-" + $30 },
                           },
-                          [_vm._v(_vm._$g("48-" + $30, "t0-0"))]
+                          [_vm._v(_vm._$g("51-" + $30, "t0-0"))]
                         ),
                       ],
                       1
@@ -11739,12 +11767,12 @@ var render = function () {
       ),
       _c(
         "uni-view",
-        { staticClass: _vm._$g(49, "sc"), attrs: { _i: 49 } },
+        { staticClass: _vm._$g(52, "sc"), attrs: { _i: 52 } },
         [
           _c(
             "v-uni-button",
             {
-              attrs: { size: "mini", type: "warn", _i: 50 },
+              attrs: { size: "mini", type: "warn", _i: 53 },
               on: {
                 click: function ($event) {
                   return _vm.$handleViewEvent($event)
@@ -11754,7 +11782,7 @@ var render = function () {
             [
               _c(
                 "v-uni-text",
-                { staticClass: _vm._$g(51, "sc"), attrs: { _i: 51 } },
+                { staticClass: _vm._$g(54, "sc"), attrs: { _i: 54 } },
                 [_vm._v("减")]
               ),
             ],
@@ -11763,7 +11791,7 @@ var render = function () {
           _c(
             "v-uni-button",
             {
-              attrs: { size: "mini", type: "primary", _i: 52 },
+              attrs: { size: "mini", type: "primary", _i: 55 },
               on: {
                 click: function ($event) {
                   return _vm.$handleViewEvent($event)
@@ -11773,7 +11801,7 @@ var render = function () {
             [
               _c(
                 "v-uni-text",
-                { staticClass: _vm._$g(53, "sc"), attrs: { _i: 53 } },
+                { staticClass: _vm._$g(56, "sc"), attrs: { _i: 56 } },
                 [_vm._v("加")]
               ),
             ],
@@ -11783,7 +11811,7 @@ var render = function () {
         1
       ),
       _c("scanCode", {
-        attrs: { _i: 54 },
+        attrs: { _i: 57 },
         on: {
           onKeyDown: function ($event) {
             return _vm.$handleViewEvent($event)

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott