Browse Source

出入库统计修改

wengyuwen 4 years ago
parent
commit
d7bbf49f1b

+ 28 - 0
src/api/reportAnalysis/inoutStatistics.js

@@ -0,0 +1,28 @@
+import request from '@/utils/request'
+
+// 查询数据主列表
+export function queryData(query) {
+return request({
+url: '/anpin/stockControl/selectTWarehouseInorOut',
+method: 'get',
+params: query
+})
+}
+// 查询供应商开票单位付款单位
+export function company(query) {
+  return request({
+    url: '/basicdata/corps/getCorpName',
+    method: 'post',
+    data: {
+      fTypeid:query
+    }
+  })
+}
+// 查询品名数据
+export function productName(query) {
+  return request({
+    url: '/basicdata/fees/list',
+    method: 'get',
+    params:query
+  })
+}

+ 0 - 1
src/api/reportAnalysis/inoutStatistics.js.vue

@@ -1 +0,0 @@
-

+ 4 - 1
src/combination/formComponent.vue

@@ -11,7 +11,7 @@
         <el-input v-model="form[item.label]" :onkeyup="item.onabort" :disabled="item.disabled" v-if="item.inputType == 2" :style="{ width: item.width + 'px' }" size="small" :placeholder="'请输入'+item.name"></el-input>
         <span v-if="item.inputType == 1">
           <el-select clearable v-model="form[item.label]" :disabled="item.disabled" :style="{ width: item.width + 'px' }" filterable slot="prepend" @change="change(item.label,dataList[item.label],form[item.label])" placeholder="请选择">
-            <el-option v-for="(item,index) in dataList[item.label]" :key="index" :label="item.label" :value="item.value"></el-option>
+            <el-option v-for="(li,index) in dataList[item.label]" :key="index" :label="li.label" :value="li.value"></el-option>
           </el-select>
         </span>
         <el-input
@@ -66,6 +66,9 @@ export default {
       number:'',
     };
   },
+  created() {
+    console.log(this.dataList)
+  },
   methods: {
     returnToForm(){
       this.$emit('returnToForm', this.form)

+ 3 - 1
src/store/modules/user.js

@@ -49,7 +49,8 @@ const user = {
     // 获取用户信息
     GetInfo({ commit, state }) {
       return new Promise((resolve, reject) => {
-        getInfo().then(res => {
+        getInfo(state.token).then(res => {
+          console.log(res)
           const user = res.user
           const avatar = user.avatar == "" ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar;
           if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
@@ -64,6 +65,7 @@ const user = {
           Cookies.set("userType",res.user.userType)
           Cookies.set("userName",res.user.userName)
           Cookies.set("sysType",res.user.userSystem)
+          console.log(Cookies.get('sysType'))
         }).catch(error => {
           reject(error)
         })

+ 24 - 23
src/views/finance/contrast/index.vue

@@ -476,23 +476,23 @@
             :disabled="notChange"
           />
         </el-form-item>
-<!--        <el-form-item label="业务类型" prop="fSystemType">-->
-<!--          <el-select-->
-<!--            v-model="queryParams.fSystemType"-->
-<!--            placeholder="请选择业务类型"-->
-<!--            size="small"-->
-<!--            disabled-->
-<!--            style="width: 200px"-->
-<!--          >-->
-<!--            <el-option-->
-<!--              v-for="item in typeoptions"-->
-<!--              :key="item.value"-->
-<!--              :label="item.label"-->
-<!--              :value="item.value"-->
-<!--            >-->
-<!--            </el-option>-->
-<!--          </el-select>-->
-<!--        </el-form-item>-->
+        <el-form-item label="业务类型" prop="fSystemType">
+          <el-select
+            v-model="queryParams.fSystemType"
+            placeholder="请选择业务类型"
+            size="small"
+            disabled
+            style="width: 200px"
+          >
+            <el-option
+              v-for="item in typeoptions"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
         <div style="width: 100%; display: flex; justify-content: space-between">
           <div style="display: flex">
             <el-button icon="el-icon-arrow-left" type="danger" v-if="cancelButton === true" size="mini" @click="cancel"
@@ -1892,6 +1892,7 @@ export default {
     ApprovalComments,
   },
   created() {
+    console.log(Cookies.get('sysType'))
     this.setRowList = this.tableDate;
     this.getRowList = this.tableDate;
     this.setRowList2 = this.tableDate2;
@@ -2387,7 +2388,7 @@ export default {
             let formDate = new window.FormData();
             formDate.append("tFee", JSON.stringify(this.queryParams));
             formDate.append("tFeeDo", JSON.stringify(this.DzfeeList));
-            if (Cookies.get("sysType") == 1) {
+            if (Cookies.get("sysType") == 1 ||  !Cookies.get("sysType")) {
               Cfee(formDate).then((response) => {
                 this.open = false;
                 this.msgSuccess("操作成功");
@@ -2792,7 +2793,7 @@ export default {
         // this.feeList = response.rows;
         this.options = response.data;
       });
-      if (Cookies.get("sysType") == 1) {
+      if (Cookies.get("sysType") == 1 ||  !Cookies.get("sysType")) {
         listFee(this.tablefilter).then((response) => {
           this.contrastList = response.rows;
           this.total = response.total;
@@ -2989,7 +2990,7 @@ export default {
     check(row, res) {
       this.doNot = true;
       this.notChange = true;
-      if (Cookies.get("sysType") == 1) {
+      if (Cookies.get("sysType") == 1 ||  !Cookies.get("sysType")) {
         getFee(row.fId).then((response) => {
           this.Operator = response.data.tFee.createBy;
           if (response.data.feeDoList != 0) {
@@ -3346,7 +3347,7 @@ export default {
         fCorpid: "", //结算单位ID
       };
       const fId = row.fId || this.ids;
-      if (Cookies.get("sysType") == 1) {
+      if (Cookies.get("sysType") == 1 ||  !Cookies.get("sysType")) {
         getFee(fId).then((response) => {
           this.Operator = response.data.tFee.createBy;
           if (response.data.feeDoList != 0) {
@@ -3548,7 +3549,7 @@ export default {
     handleDelete(row) {
       const fIds = row.fId || this.ids;
       let tips = "";
-      if (Cookies.get("sysType") == 1) {
+      if (Cookies.get("sysType") == 1 ||  !Cookies.get("sysType")) {
         detailFee(fIds).then((res) => {
           switch (res.msg) {
             case "0": {
@@ -3623,7 +3624,7 @@ export default {
         type: "warning",
       })
         .then(function () {
-          if (Cookies.get("sysType") == 1) {
+          if (Cookies.get("sysType") == 1 ||  !Cookies.get("sysType")) {
             return delFee(fIds);
           } else if (Cookies.get("sysType") == 2) {
             return delFleet(fIds);

+ 109 - 43
src/views/reportAnalysis/inoutStatistics.vue

@@ -24,21 +24,29 @@
       :queryList="queryList"
       :setRowList="setRowList"
     />
-    <el-pagination
-      style="float: right;margin-top: 10px"
-      @size-change="handleSizeChange"
-      @current-change="handleCurrentChange"
-      :page-sizes="[10, 20, 30, 50]"
-      :page-size="this.formDataList.pageSize"
-      background
-      layout="sizes, prev, pager, next"
-      :total="total">
-    </el-pagination>
+<!--    <el-pagination-->
+<!--      style="float: right;margin-top: 10px"-->
+<!--      @size-change="handleSizeChange"-->
+<!--      @current-change="handleCurrentChange"-->
+<!--      :page-sizes="[10, 20, 30, 50]"-->
+<!--      :page-size="this.formDataList.pageSize"-->
+<!--      background-->
+<!--      layout="sizes, prev, pager, next"-->
+<!--      :total="total">-->
+<!--    </el-pagination>-->
+    <pagination
+      v-show="total > 0"
+      :total="total"
+      :page.sync="formDataList.pageNum"
+      :limit.sync="formDataList.pageSize"
+      @pagination="getList"
+    />
   </div>
 </template>
 
 <script>
 import { select } from '@/api/system/set'
+import{ queryData, company, productName} from '@/api/reportAnalysis/inoutStatistics'
 import Cookies from 'js-cookie'
 
 export default {
@@ -47,7 +55,10 @@ export default {
     return{
       tatolLabel:['数量'],
       dataList:{
-        fCorpid:[]
+        fBilltype:[{ label: '出库',value:'CK'},{ label: '入库',value:'RK'}],
+        fFeeType:[],
+        fFeeid:[],
+        fCorpid:[],
       },
       tableData:[],
       setRowList:[],
@@ -85,7 +96,7 @@ export default {
           onabort: ''
         },{
           surface: '2',
-          label: 'fBillno',
+          label: 'fBsdate',
           name: '进货时间',
           checked: 0,
           width: 100,
@@ -93,14 +104,14 @@ export default {
         },
         {
           surface: '3',
-          label: 'fBillno',
+          label: 'fFeetype',
           name: '货物类别',
           checked: 0,
           width: 100,
           onabort: ''
         },{
           surface: '4',
-          label: 'fBillno',
+          label: 'feeName',
           name: '产品名称',
           checked: 0,
           width: 100,
@@ -108,7 +119,7 @@ export default {
         },
         {
           surface: '5',
-          label: 'fBillno',
+          label: 'fCurrencyName',
           name: '规格',
           checked: 0,
           width: 100,
@@ -116,7 +127,7 @@ export default {
         },
         {
           surface: '6',
-          label: 'fBillno',
+          label: 'fQty',
           name: '数量',
           checked: 0,
           width: 100,
@@ -124,7 +135,7 @@ export default {
         },
         {
           surface: '7',
-          label: 'fBillno',
+          label: 'corpName',
           name: '供货商',
           checked: 0,
           width: 100,
@@ -132,7 +143,7 @@ export default {
         },
         {
           surface: '8',
-          label: 'fBillno',
+          label: 'fManage',
           name: '供货人',
           checked: 0,
           width: 100,
@@ -140,7 +151,7 @@ export default {
         },
         {
           surface: '9',
-          label: 'fBillno',
+          label: 'fTel',
           name: '联系电话',
           checked: 0,
           width: 100,
@@ -148,63 +159,70 @@ export default {
         },
         {
           surface: '10',
-          label: 'fBillno',
-          name: '生产日期或批号',
+          label: 'tProductdate',
+          name: '生产日期',
+          checked: 0,
+          width: 100,
+          onabort: ''
+        },{
+          surface: '11',
+          label: 'fLotno',
+          name: '批号',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '11',
-          label: 'fBillno',
+          surface: '12',
+          label: 'quality',
           name: '保质期限',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '12',
-          label: 'fBillno',
+          surface: '13',
+          label: 'fStoreEnvName',
           name: '保存条件',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '13',
-          label: 'fBillno',
+          surface: '14',
+          label: 'fIsfillesName',
           name: '索证索票',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '14',
-          label: 'fBillno',
+          surface: '15',
+          label: 'purchaseName',
           name: '采购人',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '15',
-          label: 'fBillno',
+          surface: '16',
+          label: 'checkoutName',
           name: '感官',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '16',
-          label: 'fBillno',
+          surface: '17',
+          label: 'checkoutName',
           name: '数量',
           checked: 0,
           width: 100,
           onabort: ''
         },
         {
-          surface: '17',
-          label: 'fBillno',
+          surface: '18',
+          label: 'checkName',
           name: '验收人',
           checked: 0,
           width: 100,
@@ -214,7 +232,7 @@ export default {
       formOption:[
         {
           span: 6,
-          label: 'fBillno',
+          label: 'fCorpid',
           name: '供应商',
           inputType: 1,
           width: 200,
@@ -223,7 +241,7 @@ export default {
         },
         {
           span: 6,
-          label: 'fBillno',
+          label: 'fFeeType',
           name: '物资类别',
           inputType: 1,
           width: 200,
@@ -232,32 +250,70 @@ export default {
         },
         {
           span: 6,
-          label: 'fBillno',
+          label: 'fFeeid',
           name: '产品名称',
-          inputType: 2,
+          inputType: 1,
           width: 200,
           labelSize: '80',
           rules: [{ required: false, message: ' ' }]
         },
         {
           span: 6,
-          label: 'fBillno',
-          name: '进货时间',
-          inputType: 3,
+          label: 'fBilltype',
+          name: '统计类型',
+          inputType: 1,
           width: 200,
           labelSize: '80',
           rules: [{ required: false, message: ' ' }]
+        },
+        {
+          span: 6,
+          label: 'cLoadDate',
+          name: '入出库期间',
+          inputType: 3,
+          width: 240,
+          labelSize: '82',
+          rules: [{ required: false, message: ' ' }]
         }
       ]
     }
   },
   created() {
     this.queryList.columnList = this.listStyle
+    this.getDicts("data_cost_attribute").then((response) => {
+      for(let item in response.data){
+        this.dataList.fFeeType.push({
+          value: response.data[item].dictValue,
+          label:response.data[item].dictLabel
+        })
+      }
+    });
+    company(1).then(res => {
+      for (let item in res.data) {
+        this.dataList.fCorpid.push({
+          label: res.data[item].fName,
+          value: res.data[item].fId
+        })
+      }
+      console.log(this.dataList)
+    })
+    productName().then(res => {
+      console.log(res)
+      if (res.code === 200) {
+        for (let item in res.rows) {
+          this.dataList.fFeeid.push({
+            label: res.rows[item].fName,
+            value: res.rows[item].fId,
+          })
+        }
+      }
+    })
     let data = {
       tableName: this.queryList.tableName,
       userId: Cookies.get('userName')
     }
     this.getRow(data)
+    this.getList()
   },
   methods:{
     getRow(data,list) {
@@ -311,10 +367,20 @@ export default {
     //点击刷新会调用此方法
     getList() {
       console.log('到我了2')
+      // this.feedback('重置')
+      this.query(this.formDataList)
+    },
+    //查询主页列数据
+    query(data) {
+      queryData(data).then(res => {
+        this.tableData = res.rows
+        this.total = res.total
+        console.log(this.total)
+      })
     },
     submitForm() {
-      console.log(this.$refs.avatar.form)
       this.formDataList = this.$refs.avatar.form
+      this.query(this.formDataList)
     },
     returnToForm(row) {
       console.log(row, 111)

+ 21 - 8
src/views/warehouse/inStock/index.vue

@@ -147,6 +147,7 @@ export default {
   name: 'inStock',
   data(){
     return{
+      copyeId:'',
       hasPermi:{
         lookup:['anpin:stockControl:query'],
         disappear:['anpin:stockControl:remove']
@@ -1077,12 +1078,14 @@ export default {
       }
     },
     //查看
-    viewMethod(scope){
+    viewMethod(scope,res){
       this.detailList.columnList = this.detailStyle
       let fId = ''
       if(scope){
          fId = scope.row.fId
-      }else{
+      }else if(res){
+        fId = this.copyeId
+      } else{
          fId = this.ids
       }
       getSave(fId).then(res=>{
@@ -1405,8 +1408,12 @@ export default {
             fId:this.selection[0].fId
           }
           copyNew(formDate).then(res=>{
-            this.$message.success("操作成功")
-            this.getList()
+            if(res.code == 200) {
+              this.$message.success("操作成功")
+              this.copyeId = res.data
+              this.getList()
+              this.viewMethod(null,1)
+            }
           })
           break
         case '打印':
@@ -1439,11 +1446,17 @@ export default {
       this.getList()
     },
     //点击刷新会调用此方法
-    getList(){
+    getList(res){
       this.queryParms.fBilltype = 'RK'
-      listInStock(this.queryParms).then(res=>{
-        this.tableData = res.rows
-        this.total = res.total
+      listInStock(this.queryParms).then(response=>{
+        this.tableData = response.rows
+        this.total = response.total
+        if(res == 1){
+          this.copyeId = this.tableData[0].fId
+          this.viewMethod(null,1)
+        }
+        console.log("333")
+        console.log(this.tableData[0].fId)
       })
     },
   }

+ 50 - 45
src/views/warehouse/outStock/index.vue

@@ -147,6 +147,7 @@ export default {
   name: 'inStock',
   data(){
     return{
+      copyId:'',
       setRowList:[],
       hasPermi:{
         lookup:['anpin:stockControl:query'],
@@ -1073,63 +1074,65 @@ export default {
       }
     },
     //查看
-    viewMethod(scope){
+    viewMethod(scope,res){
       this.detailList.columnList = this.detailStyle
       let fId = ''
       if(scope){
         fId = scope.row.fId
-      }else{
+      }else if(res){
+        fId = this.copyId
+      } else{
         fId = this.ids
       }
-      getSave(fId).then(res=>{
-        if(res.code == 200){
-          if(res.data.warehouseBills){
-            this.detailForm = res.data.warehouseBills
-            this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
-          }
-          if(res.data.tWarehousebillsfees){
-            this.detailData = res.data.tWarehousebillsfees
-            for(let li in this.detailData){
-              this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
-              this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
-            }
-          }
-        }
-        for(let li in this.detailStyle){
-          this.detailStyle[li].disabled = true
-        }
-        for(let item in this.detailOption){
-          this.detailOption[item].disabled = true
-        }
-        for(let li in this.detailButton){
-          if(this.detailForm.fBillstatus == '6'){
-            if(this.detailButton[li].name == '返回列表'){
-              this.detailButton[li].disabled = false
-            }else {
-              this.detailButton[li].disabled = true
+        getSave(fId).then(res=>{
+          if(res.code == 200){
+            if(res.data.warehouseBills){
+              this.detailForm = res.data.warehouseBills
+              this.$set(this.detailForm,'fStorekeeper',JSON.parse(this.detailForm.fStorekeeper))
             }
-          } else {
-            if(this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '修改'){
-              this.detailButton[li].disabled = false
-            }else{
-              this.detailButton[li].disabled = true
+            if(res.data.tWarehousebillsfees){
+              this.detailData = res.data.tWarehousebillsfees
+              for(let li in this.detailData){
+                this.$set(this.detailData[li],'fFeeunitid',JSON.stringify(this.detailData[li].fFeeunitid))
+                this.$set(this.detailData[li],'fStltypeid',JSON.stringify(this.detailData[li].fStltypeid))
+              }
             }
           }
-        }
-        getArea(this.detailForm.fWarehouseid).then(res=>{
-          if(res.code == 200){
-            this.listData.fWarehouseid = []
-            for(let item in res.data){
-              this.listData.fWarehouseid.push({
-                label:res.data[item].fWarehouseInformation,
-                value:res.data[item].id
-              })
+          for(let li in this.detailStyle){
+            this.detailStyle[li].disabled = true
+          }
+          for(let item in this.detailOption){
+            this.detailOption[item].disabled = true
+          }
+          for(let li in this.detailButton){
+            if(this.detailForm.fBillstatus == '6'){
+              if(this.detailButton[li].name == '返回列表'){
+                this.detailButton[li].disabled = false
+              }else {
+                this.detailButton[li].disabled = true
+              }
+            } else {
+              if(this.detailButton[li].name == '返回列表' || this.detailButton[li].name == '修改'){
+                this.detailButton[li].disabled = false
+              }else{
+                this.detailButton[li].disabled = true
+              }
             }
           }
+          getArea(this.detailForm.fWarehouseid).then(res=>{
+            if(res.code == 200){
+              this.listData.fWarehouseid = []
+              for(let item in res.data){
+                this.listData.fWarehouseid.push({
+                  label:res.data[item].fWarehouseInformation,
+                  value:res.data[item].id
+                })
+              }
+            }
+          })
+          this.MainTable = true
+          this.inDex = this.detailOption.length
         })
-        this.MainTable = true
-        this.inDex = this.detailOption.length
-      })
     },
     //修改
     modification(scope){
@@ -1402,7 +1405,9 @@ export default {
           }
           copyNew(formDate).then(res=>{
             this.$message.success("操作成功")
+            this.copyId = res.data
             this.getList()
+            this.viewMethod(null,1)
           })
           break
         case '打印':