ソースを参照

撤销出入库修改

wengyuwen 4 年 前
コミット
cac20b2a51

+ 1 - 1
src/api/purchaseIssue/index.js

@@ -128,7 +128,7 @@ export function revoke(data) {
 //大撤销
 export function revokeBill(data) {
   return request({
-    url: '/anpin/project/withdrawById',
+    url: '/anpin/stockControl/withdrawById',
     method: 'post',
     data:data
   })

+ 16 - 0
src/api/warehouse/inStock.js

@@ -181,3 +181,19 @@ export function listQuery(query) {
     params:query
   })
 }
+//大撤销
+export function revokeBill(data) {
+  return request({
+    url: '/anpin/stockControl/withdrawById',
+    method: 'post',
+    data:data
+  })
+}
+// 查询当前登录用户信息
+export function queryUserVal(data) {
+  return request({
+    url: '/system/user/queryUserVal',
+    method: 'post',
+    data:data
+  })
+}

+ 16 - 0
src/api/warehouse/outStock.js

@@ -140,3 +140,19 @@ export function detailStock(query) {
     params: query
   })
 }
+//大撤销
+export function revokeBill(data) {
+  return request({
+    url: '/anpin/stockControl/withdrawById',
+    method: 'post',
+    data:data
+  })
+}
+// 查询当前登录用户信息
+export function queryUserVal(data) {
+  return request({
+    url: '/system/user/queryUserVal',
+    method: 'post',
+    data:data
+  })
+}

+ 21 - 11
src/components/Pagination/index.vue

@@ -1,15 +1,14 @@
 <template>
   <div :class="{'hidden':hidden}" class="pagination-container">
 
-<!--    <el-input-->
-<!--      v-model="pageSize"-->
-<!--      style="-->
-<!--      width: 160px;-->
-<!--      float: right;-->
-<!--"-->
-<!--      @input="input"-->
-<!--      @change="handleSizeChange"-->
-<!--    ></el-input>-->
+    <el-input
+      v-model="list.pageSize"
+      style="
+      width: 160px;
+      float: right;
+"
+      @change="input"
+    ></el-input>
     <el-pagination
       style="margin-right: 200px"
       :background="background"
@@ -22,7 +21,6 @@
       @size-change="handleSizeChange"
       @current-change="handleCurrentChange"
     >
-
     </el-pagination>
   </div>
 </template>
@@ -68,6 +66,13 @@ export default {
       default: false
     }
   },
+  data(){
+    return{
+      list:{
+        pageSize:'',
+      }
+    }
+  },
   computed: {
     currentPage: {
       get() {
@@ -88,7 +93,12 @@ export default {
   },
   methods: {
     input(){
-      // Number
+      if(this.list.pageSize != 0){
+        this.pageSize = Number(this.list.pageSize)
+      }else {
+        this.list.pageSize = ''
+      }
+      this.handleSizeChange()
     },
     handleSizeChange(val) {
       this.$emit('pagination', { page: this.currentPage, limit: val })

+ 1 - 1
src/views/purchaseIssue/index.vue

@@ -46,7 +46,7 @@
         :page.sync="formDataList.pageNum"
         :limit.sync="formDataList.pageSize"
         @pagination="feedback('搜索')"
-        :page-sizes="[100,200,500,1000]"
+        :page-sizes="[10,100,200,500,1000]"
       />
       </div>
     </div>

+ 1 - 1
src/views/purchaseRequest/index.vue

@@ -43,7 +43,7 @@
         :total="total"
         :page.sync="formDataList.pageNum"
         :limit.sync="formDataList.pageSize"
-        :page-sizes="[100,200,500,1000]"
+        :page-sizes="[10,100,200,500,1000]"
         @pagination="feedback('搜索')"
       />
       </div>

+ 1 - 1
src/views/reportAnalysis/inoutStatistics.vue

@@ -40,7 +40,7 @@
       :total="total"
       :page.sync="formDataList.pageNum"
       :limit.sync="formDataList.pageSize"
-      :page-sizes="[100,200,500,1000]"
+      :page-sizes="[10,100,200,500,1000]"
       @pagination="getList"
     />
     </div>

+ 1 - 0
src/views/reportAnalysis/inventoryAccount.vue

@@ -29,6 +29,7 @@
       :total="total"
       :page.sync="formDataList.pageNum"
       :limit.sync="formDataList.pageSize"
+      :page-sizes="[10,100,200,500,1000]"
       @pagination="getList"
     />
     <!--    <el-pagination-->

+ 1 - 1
src/views/reportAnalysis/monthEndClosing.vue

@@ -115,7 +115,7 @@
       :total="total"
       :page.sync="form.pageNum"
       :limit.sync="form.pageSize"
-      :page-sizes="[50,100, 200, 500, 1000]"
+      :page-sizes="[10,100, 200, 500, 1000]"
       @pagination="methodYear"
     />
   </div>

+ 20 - 2
src/views/reportAnalysis/profitGeneralLedger.vue

@@ -79,6 +79,23 @@
               />
             </el-select>
           </el-form-item>
+            <el-form-item label="状态" prop="fBillstatus">
+              <el-select
+                v-model="queryParams.fBillstatus"
+                placeholder="请选择状态"
+                clearable
+                style="width: 200px"
+                size="small"
+                @keyup.enter.native="handleQuery"
+              >
+                <el-option
+                  v-for="item in statusOption"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                />
+              </el-select>
+            </el-form-item>
           </el-row>
         </div>
       </el-collapse-transition>
@@ -203,7 +220,7 @@
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
-      :page-sizes="[50,100, 200, 500, 1000]"
+      :page-sizes="[10,100,200,500,1000]"
       @pagination="getList"
     />
     </div>
@@ -222,6 +239,7 @@ export default {
   components: {draggable},
   data() {
     return {
+      statusOption:[{label:'全部',value:''},{label:'暂存',value:'2'},{label:'审核中',value:'5'},{label:'审核通过',value:'6'},],
       rules:{
         annual: [{ required: true, message: " ", trigger: "blur" }],
         mothStar: [{ required: true, message: " ", trigger: "blur" }],
@@ -321,7 +339,7 @@ export default {
   },
   methods: {
     changeMonth(){
-      if(this.queryParams.mothEnd && this.queryParams.mothStar && this.queryParams.mothEnd <= this.queryParams.mothStar){
+      if(this.queryParams.mothEnd && this.queryParams.mothStar && this.queryParams.mothEnd < this.queryParams.mothStar){
         console.log("111")
         this.$message.error("结束月不能小于开始月,请重新选择")
         this.queryParams.mothEnd = ''

+ 15 - 23
src/views/reportAnalysis/salesStatistics.vue

@@ -31,7 +31,7 @@
         :total="total"
         :page.sync="formDataList.pageNum"
         :limit.sync="formDataList.pageSize"
-        :page-sizes="[100,200,500,1000]"
+        :page-sizes="[10,100,200,500,1000]"
         @pagination="getList"
       />
 
@@ -216,7 +216,7 @@ export default {
           name: '是否按照日期分组',
           inputType: 1,
           width: 200,
-          labelSize: '80',
+          labelSize: '140',
           rules: [{ required: false, message: ' ' }]
         },
       ]
@@ -279,6 +279,7 @@ export default {
         if (list == 'S'){
           this.$set(this.$refs.avatar.form,'groupDate',1)
         }
+        this.$refs.avatar.form = this.formDataList
       })
     },
     //修改
@@ -291,22 +292,6 @@ export default {
     buttonList(row){
       console.log(row)
       switch (row.name){
-        case'全部':
-          this.formDataList.fBillstatus = ''
-          this.getList()
-          break
-        case'暂存':
-          this.formDataList.fBillstatus = 2
-          this.getList()
-          break
-        case'审核中':
-          this.formDataList.fBillstatus = 5
-          this.getList()
-          break
-        case'审核通过':
-          this.formDataList.fBillstatus = 6
-          this.getList()
-          break
         case '导出':
           const queryParams = this.formDataList;
           this.$confirm("是否确认导出所有销售出库数据项?", "警告", {
@@ -338,23 +323,30 @@ export default {
           this.inDex = 4
         }
       } else if (res == '搜索') {
-        this.$refs.avatar.submitForm()
+        this.formDataList = this.$refs.avatar.form
+        this.$refs.avatar.submitForm(1)
       } else if (res == '重置') {
+        let list ={
+          pageNum:this.formDataList.pageNum,
+          pageSize:this.formDataList.pageSize
+        }
         this.$refs.avatar.form = {}
-        this.$refs.avatar.submitForm()
+        this.$refs.avatar.form = this.formDataList = list
+        console.log(this.formDataList,this.$refs.avatar.form)
+        this.$refs.avatar.submitForm(2)
       }
     },
     //点击刷新会调用此方法
     getList() {
       console.log('到我了2')
+      console.log(this.formDataList)
       queryData(this.formDataList).then(res=>{
         this.tableData = res.rows
         this.total = res.total
       })
+      console.log(this.formDataList.pageSize)
     },
-    submitForm() {
-      console.log(this.$refs.avatar.form)
-      this.formDataList = this.$refs.avatar.form
+    submitForm(res) {
       this.getList()
     },
     returnToForm(row) {

+ 54 - 2
src/views/warehouse/inStock/index.vue

@@ -37,7 +37,7 @@
         :page.sync="queryParms.pageNum"
         :limit.sync="queryParms.pageSize"
         @pagination="getList"
-        :page-sizes="[100,200,500,1000]"
+        :page-sizes="[10,100,200,500,1000]"
       />
       </div>
     </div>
@@ -153,13 +153,14 @@ import MainForm from '@/combination/MainForm'
 import { listInStock, addSave, getSave, getArea,
   getustomer,getEntry, getwarehouse, getGoodName,
   canBedelet, delRows, getWarehousekeeper, addWarehous,
-  deletMain, delFee, copyNew, listQuery} from '@/api/warehouse/inStock'
+  deletMain, delFee, copyNew, listQuery,revokeBill, queryUserVal} from '@/api/warehouse/inStock'
 import Cookies from 'js-cookie'
 import { getliable } from '@/api/project'
 export default {
   name: 'inStock',
   data(){
     return{
+      lander:'',
       copyeId:'',
       hasPermi:{
         lookup:['anpin:stockControl:query'],
@@ -859,6 +860,10 @@ export default {
     }
   },
   created() {
+    //获取登陆人
+    queryUserVal().then((response) => {
+      this.lander = response.user.userName
+    })
     let data = {
       tableName: this.queryList.tableName,
       userId: Cookies.get("userName"),
@@ -1167,6 +1172,16 @@ export default {
             this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
           }
           this.detailButton = this.$options.data().detailButton
+          if(this.lander == this.detailForm.createBy && this.detailForm.fBillstatus == 6){
+            console.log(this.detailForm.createBy)
+            this.detailButton.push({
+              type: 'danger',
+              size: 'mini',
+              icon: 'el-icon-edit-outline',
+              name: '撤销入库',
+              disabled: false
+            })
+          }
           for(let li in this.detailButton){
             if(this.detailForm.fBillstatus == '6'){
               if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
@@ -1251,6 +1266,18 @@ export default {
             }
           })
         }
+        // if(){
+        //   let data = {
+        //     fId: this.$refs.avatar.form.fId
+        //   }
+        //   revokeBill(data).then(res => {
+        //     if (res.code == 200) {
+        //       this.$message.success('撤销成功')
+        //       this.getList()
+        //       this.pageDisplay = true
+        //     }
+        //   })
+        // }
         this.MainTable = true
         this.inDex = this.detailOption.length
       })
@@ -1578,6 +1605,18 @@ export default {
                   this.detailButton[li].disabled = false
                 }
               }
+              this.detailButton = this.$options.data().detailButton
+              if(this.lander == this.detailForm.createBy && this.detailForm.fBillstatus == 6){
+                console.log(this.detailForm.createBy)
+                this.detailButton.push({
+                  type: 'danger',
+                  size: 'mini',
+                  icon: 'el-icon-edit-outline',
+                  name: '撤销入库',
+                  disabled: false
+                })
+              }
+
             })
 
           }
@@ -1599,6 +1638,19 @@ export default {
             })
           }
           break
+        case '撤销入库':
+          let data = {
+            fId:this.detailForm.fId,
+            fBilltype:'RK'
+          }
+          revokeBill(data).then(res=>{
+            if(res.code == 200){
+              this.$message.success("撤销成功")
+              this.getList()
+              this.MainTable = false
+            }
+          })
+          break
         case '复制新增':
             let formDate = {
               fBilltype:'RK',

+ 41 - 2
src/views/warehouse/outStock/index.vue

@@ -37,7 +37,7 @@
         :page.sync="queryParms.pageNum"
         :limit.sync="queryParms.pageSize"
         @pagination="getList"
-        :page-sizes="[100,200,500,1000]"
+        :page-sizes="[10,100,200,500,1000]"
       />
       </div>
     </div>
@@ -153,13 +153,15 @@ import MainForm from '@/combination/MainForm'
 import { listInStock, addSave, getSave, getArea,
   getustomer,getEntry, getwarehouse, getGoodName,
   canBedelet, delRows, getWarehousekeeper, addWarehous,
-  deletMain, delFee, copyNew, listQuery} from '@/api/warehouse/inStock'
+  deletMain, delFee, copyNew, listQuery,revokeBill,
+  queryUserVal} from '@/api/warehouse/inStock'
 import Cookies from 'js-cookie'
 import { getliable } from '@/api/project'
 export default {
   name: 'inStock',
   data(){
     return{
+      lander:'',
       copyeId:'',
       hasPermi:{
         lookup:['anpin:stockControl:query'],
@@ -854,6 +856,10 @@ export default {
     }
   },
   created() {
+    //获取登陆人
+    queryUserVal().then((response) => {
+      this.lander = response.user.userName
+    })
     let data = {
       tableName: this.queryList.tableName,
       userId: Cookies.get("userName"),
@@ -1159,6 +1165,15 @@ export default {
             this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
           }
           this.detailButton = this.$options.data().detailButton
+          if(this.lander == this.detailForm.createBy && this.detailForm.fBillstatus == 6){
+            this.detailButton.push({
+              type: 'danger',
+              size: 'mini',
+              icon: 'el-icon-edit-outline',
+              name: '撤销出库',
+              disabled: false
+            })
+          }
           for(let li in this.detailButton){
             if(this.detailForm.fBillstatus == '6'){
               if(this.detailButton[li].name == '录入明细' || this.detailButton[li].name == '保存' ||
@@ -1570,10 +1585,34 @@ export default {
                   this.detailButton[li].disabled = false
                 }
               }
+              this.detailButton = this.$options.data().detailButton
+              if(this.lander == this.detailForm.createBy && this.detailForm.fBillstatus == 6){
+                console.log(this.detailForm.createBy)
+                this.detailButton.push({
+                  type: 'danger',
+                  size: 'mini',
+                  icon: 'el-icon-edit-outline',
+                  name: '撤销出库',
+                  disabled: false
+                })
+              }
             })
 
           }
           break
+        case '撤销出库':
+          let data = {
+            fId:this.detailForm.fId,
+            fBilltype:'CK'
+          }
+          revokeBill(data).then(res=>{
+            if(res.code == 200){
+              this.$message.success("撤销成功")
+              this.getList()
+              this.MainTable = false
+            }
+          })
+          break
         case '刷新':
           if(this.detailForm.fId){
             getSave(this.detailForm.fId).then(res=>{