瀏覽代碼

资金账户管理

lilei 3 年之前
父節點
當前提交
11ee07c2e9

+ 22 - 0
src/api/purchaseReturn.js

@@ -132,3 +132,25 @@ export const purchaseReturnFinishBill = (params) => {
     method: 'post'
   })
 }
+
+// 采购退货不同步
+// 新增
+export const purchaseReturnSaveByNoSync = (params) => {
+  return axios({
+    url: '/purchaseReturn/saveByNoSync',
+    data: params,
+    method: 'post'
+  })
+}
+
+// 分页列表
+export const purchaseReturnQueryNoSyncPage = (params) => {
+  const url = `/purchaseReturn/queryNoSyncPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 37 - 1
src/config/router.config.js

@@ -1175,7 +1175,43 @@ export const asyncRouterMap = [
                 }
               }
             ]
-          }
+          },
+          {
+            path: '/financialManagement/fundAccountManagement',
+            redirect: '/financialManagement/fundAccountManagement/list',
+            name: 'fundAccountManagement',
+            component: BlankLayout,
+            meta: {
+              title: '资金账户管理',
+              icon: 'file-protect',
+              // permission: 'M_fundAccountList'
+            },
+            hideChildrenInMenu: true,
+            children: [
+              {
+                path: 'list',
+                name: 'fundAccountList',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/fundAccountManagement/list.vue'),
+                meta: {
+                  title: '资金账户列表',
+                  icon: 'file-protect',
+                  hidden: true,
+                  // permission: 'M_fundAccountList'
+                }
+              },
+              {
+                path: 'detail/:sn',
+                name: 'fundAccountDetail',
+                component: () => import(/* webpackChunkName: "financialManagement" */ '@/views/financialManagement/fundAccountManagement/detail.vue'),
+                meta: {
+                  title: '资金明细',
+                  icon: 'file-protect',
+                  hidden: true,
+                  // permission: 'M_fundAccount_detail'
+                }
+              }
+            ]
+          },
         ]
       },
       // 调拨管理

+ 188 - 0
src/views/financialManagement/fundAccountManagement/addModal.vue

@@ -0,0 +1,188 @@
+<template>
+  <a-modal
+    centered
+    class="purchaseOrder-basicInfo-modal"
+    :footer="null"
+    :maskClosable="false"
+    title="新增采购单"
+    v-model="isShow"
+    @cancel="isShow=false"
+    :width="800">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <a-form-model
+        id="purchaseOrder-basicInfo-form"
+        ref="ruleForm"
+        :model="form"
+        :rules="rules"
+        :label-col="formItemLayout.labelCol"
+        :wrapper-col="formItemLayout.wrapperCol" >
+        <a-form-model-item label="供应商" prop="purchaseTargetSn">
+          <a-radio-group
+            name="radioGroup"
+            v-model="form.purchaseTargetSn"
+            @change="tragetTypeChange"
+            v-if="purchaseTragetType.length"
+            id="purchaseOrder-basicInfo-purchaseTargetSn" >
+            <a-radio v-for="item in purchaseTragetType" :key="item.purchaseTargetSn" :value="item.purchaseTargetSn" class="radio-s">{{ item.purchaseTargetName }}</a-radio>
+          </a-radio-group>
+          <span v-else>没有可选择的供应商</span>
+        </a-form-model-item>
+        <a-form-model-item label="是否抓单" prop="grabFlag">
+          <v-select
+            code="FLAG"
+            showType="radio"
+            id="purchaseOrder-grabFlag"
+            v-model="form.grabFlag"
+            allowClear
+            placeholder="请选择"></v-select>
+        </a-form-model-item>
+        <a-form-model-item :wrapper-col="{ span: 12, offset: 6 }" style="text-align: center;">
+          <a-button type="primary" :loading="confirmLoading" @click="handleSubmit" id="chooseCustom-btn-submit">保存</a-button>
+          <a-button @click="isShow=false" style="margin-left: 15px" id="chooseCustom-btn-back">取消</a-button>
+        </a-form-model-item>
+      </a-form-model>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { VSelect } from '@/components'
+import { purchaseTargetList } from '@/api/purchase'
+import { purchaseReturnSaveByNoSync } from '@/api/purchaseReturn'
+export default {
+  name: 'BasicInfoModal',
+  components: { VSelect },
+  mixins: [commonMixin],
+  props: {
+    openModal: { //  弹框显示状态
+      type: Boolean,
+      default: false
+    }
+  },
+  data () {
+    return {
+      spinning: false,
+      confirmLoading: false,
+      isShow: this.openModal, //  是否打开弹框
+      settleStyleList: [], // 支付方式
+      formItemLayout: {
+        labelCol: { span: 4 },
+        wrapperCol: { span: 18 }
+      },
+      form: {
+        purchaseTargetType: '', // 供应商
+        purchaseTargetSn: undefined,
+        purchaseTargetName: '',
+        grabFlag: '1'
+      },
+      rules: {
+        purchaseTargetSn: [
+          { required: true, message: '请选择供应商', trigger: 'change' }
+        ],
+        grabFlag: [
+          { required: true, message: '请选择抓单类型', trigger: 'change' }
+        ]
+      },
+      purchaseTragetType: []
+    }
+  },
+  methods: {
+    resetForm () {
+      this.$refs.ruleForm.resetFields()
+      this.form.purchaseTargetType = ''
+      this.form.purchaseTargetSn = undefined
+      this.form.purchaseTargetName = ''
+    },
+    // 供应商change
+    tragetTypeChange (e) {
+      const val = e.target.value
+      const ind = this.purchaseTragetType.findIndex(item => item.purchaseTargetSn == val)
+      if (ind != -1) {
+        this.form.purchaseTargetType = this.purchaseTragetType[ind].purchaseTargetType
+        this.form.purchaseTargetName = this.purchaseTragetType[ind].purchaseTargetName
+      }
+    },
+    //  保存
+    handleSubmit (e) {
+      e.preventDefault()
+      const _this = this
+      this.$refs.ruleForm.validate(valid => {
+        if (valid) {
+          _this.spinning = true
+          purchaseReturnSaveByNoSync(_this.form).then(res => {
+            if (res.status == 200) {
+              _this.isShow = false
+              _this.$emit('ok', res.data)
+              _this.spinning = false
+              _this.$message.info(res.message)
+            } else {
+              _this.spinning = false
+            }
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    // 编辑信息
+    setData (data) {
+      this.form = JSON.parse(JSON.stringify(data))
+    },
+    getParentDealer () {
+      const zb = this.$hasPermissions('B_PR_outSnycZB')
+      const sj = this.$hasPermissions('B_PR_outSnycSJ')
+      let params = {}
+      // 只能向上级退货
+      if (sj) {
+        params.purchaseTargetType = 'DEALER_UP'
+      }
+      // 只能向总部退货
+      if (zb) {
+        params.purchaseTargetType = 'SUPPLIER_SYS'
+      }
+      // 总部和上级都可以
+      if (sj && zb) {
+        params = {}
+      }
+      purchaseTargetList(params).then(res => {
+        if (res.status == 200 && res.data[0]) {
+          this.purchaseTragetType = res.data
+        } else {
+          this.purchaseTragetType = []
+        }
+      })
+    }
+  },
+  watch: {
+    //  父页面传过来的弹框状态
+    openModal (newValue, oldValue) {
+      this.isShow = newValue
+    },
+    //  重定义的弹框状态
+    isShow (newValue, oldValue) {
+      if (!newValue) {
+        this.$emit('close')
+        this.resetForm()
+      } else {
+        this.getParentDealer()
+      }
+    }
+  }
+}
+</script>
+
+<style lang="less">
+  .purchaseOrder-basicInfo-modal{
+    .ant-modal-body {
+      padding: 40px 40px 24px;
+    }
+    .radio-s{
+      margin-bottom: 8px;
+    }
+    .btn-cont {
+      text-align: center;
+      margin: 35px 0 10px;
+    }
+  }
+</style>

+ 8 - 0
src/views/financialManagement/fundAccountManagement/detail.vue

@@ -0,0 +1,8 @@
+<template>
+</template>
+
+<script>
+</script>
+
+<style>
+</style>

+ 262 - 0
src/views/financialManagement/fundAccountManagement/list.vue

@@ -0,0 +1,262 @@
+<template>
+  <a-card size="small" :bordered="false" class="funAccountList-wrap">
+    <a-spin :spinning="spinning" tip="Loading...">
+      <!-- 搜索条件 -->
+      <div ref="tableSearch" class="funAccountList-page-search-wrapper">
+        <div>
+          资金账户功能:<a-radio-group
+            v-model="enableFundAccount"
+            :options="[
+              { label: '启用', value: '1' },
+              { label: '禁用', value: '0' },
+            ]"
+            @change="onChange2" />
+        </div>
+        <div>
+          开启资金账户功能后,在进行财务收款和付款时,需要从下面列表选择一个账户。
+        </div>
+      </div>
+      <!-- 操作按钮 -->
+      <div class="table-operator">
+        <a-button id="funAccountList-add" type="primary" class="button-error" @click="handleEdit()">新增</a-button>
+      </div>
+      <!-- 列表 -->
+      <s-table
+        class="sTable fixPagination"
+        ref="table"
+        :style="{ height: tableHeight+84.5+'px' }"
+        size="small"
+        :rowKey="(record) => record.id"
+        :columns="columns"
+        :data="loadData"
+        :scroll="{ y: tableHeight }"
+        :defaultLoadData="false"
+        bordered>
+        <!-- 费用类别 -->
+        <template slot="expensesType" slot-scope="text, record">
+          {{ record.expensesTypeName1 }} <span v-if="record.expensesTypeName2">>{{ record.expensesTypeName2 }}</span> <span v-if="record.expensesTypeName3">>{{ record.expensesTypeName3 }}</span>
+        </template>
+        <!-- 费用单号 -->
+        <template slot="accountExpensesNo" slot-scope="text, record">
+          <span :class="$hasPermissions('B_expenseDetail')?'active':'common'" @click="handleDetail(record)">{{ text }}</span>
+        </template>
+        <!-- 审核 -->
+        <template slot="audit" slot-scope="text, record">
+          <stateIcon :title="record.stateDictValue" :state="record.state == 'AUDIT_PASS'?'1':'2'"></stateIcon>
+        </template>
+        <!-- 操作 -->
+        <template slot="action" slot-scope="text, record">
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseAudit')"
+            class="button-primary"
+            @click="handleAudit(record)"
+            id="expenseManagement-audit-btn">审核</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseEdit')"
+            class="button-primary"
+            @click="handleEdit(record)"
+            id="expenseManagement-edit-btn">编辑</a-button>
+          <a-button
+            size="small"
+            type="link"
+            v-if="record.state == 'WAIT_AUDIT' && $hasPermissions('B_expenseDel')"
+            class="button-error"
+            @click="handleDel(record)"
+            id="expenseManagement-del-btn">删除</a-button>
+          <span v-if="record.state != 'WAIT_AUDIT'||( !$hasPermissions('B_expenseAudit')&& !$hasPermissions('B_expenseEdit') && !$hasPermissions('B_expenseDel'))">--</span>
+        </template>
+      </s-table>
+    </a-spin>
+    <!-- 详情 -->
+    <addModal :openModal="openModal" :itemId="itemId" @close="closeDetail" />
+  </a-card>
+</template>
+
+<script>
+import { commonMixin } from '@/utils/mixin'
+import { STable, VSelect } from '@/components'
+import rangeDate from '@/views/common/rangeDate.vue'
+import { settleExpenseQuery, delExpense, auditExpense } from '@/api/settleExpense'
+import addModal from './addModal.vue'
+import stateIcon from '@/views/common/stateIcon'
+export default {
+  name: 'ExpenseManagementList',
+  components: { STable, VSelect, addModal, rangeDate, stateIcon },
+  mixins: [commonMixin],
+  data () {
+    return {
+      spinning: false,
+      tableHeight: 0,
+      disabled: false, //  查询、重置按钮是否可操作
+      advanced: true, //  高级搜索 展开/关闭
+      enableFundAccount: '1',
+      // 查询参数
+      queryParam: {},
+      // 表头
+      columns: [
+        { title: '序号', dataIndex: 'no', width: '5%', align: 'center' },
+        { title: '账户类型', dataIndex: 'accountExpensesNo', width: '20%', align: 'center', scopedSlots: { customRender: 'accountExpensesNo' } },
+        { title: '账户名称', dataIndex: 'createDate', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
+        { title: '账户号码', scopedSlots: { customRender: 'expensesType' }, width: '20%', align: 'center' },
+        { title: '收入金额', dataIndex: 'settleAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '支出金额', dataIndex: 'settleAmount', width: '10%', align: 'center', customRender: function (text) { return ((text || text == 0) ? ('¥' + text) : '--') } },
+        { title: '启用', scopedSlots: { customRender: 'enable' }, width: '3%', align: 'center' },
+        { title: '审核', scopedSlots: { customRender: 'audit' }, width: '3%', align: 'center' },
+        { title: '操作', scopedSlots: { customRender: 'action' }, width: '15%', align: 'center' }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.disabled = true
+        this.spinning = true
+        return settleExpenseQuery(Object.assign(parameter, this.queryParam)).then(res => {
+          let data
+          if (res.status == 200) {
+            data = res.data
+            const no = (data.pageNo - 1) * data.pageSize
+            for (var i = 0; i < data.list.length; i++) {
+              data.list[i].no = no + i + 1
+            }
+            this.disabled = false
+          }
+          this.spinning = false
+          return data
+        })
+      },
+      openModal: false, //  查看详情  弹框
+      itemId: '' //  当前id
+    }
+  },
+  methods: {
+    closeDetail () {
+      this.openModal = false
+      this.itemId = null
+    },
+    //  新增/编辑
+    handleEdit (row) {
+    },
+    //  资金明细
+    handleDetail (row) {
+    },
+    //  审核
+    handleAudit (row) {
+      const _this = this
+      this.$confirm({
+        title: '提示',
+        content: '确定要审核吗?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          auditExpense({
+            id: row.id
+          }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  删除
+    handleDel (row) {
+      const _this = this
+      _this.itemId = row.id
+      _this.$confirm({
+        title: '提示',
+        content: '删除后原数据不可恢复,是否删除?',
+        centered: true,
+        onOk () {
+          _this.spinning = true
+          delExpense({ id: _this.itemId }).then(res => {
+            if (res.status == 200) {
+              _this.$message.success(res.message)
+              _this.$refs.table.refresh()
+              _this.spinning = false
+            } else {
+              _this.spinning = false
+            }
+          })
+        }
+      })
+    },
+    //  重置
+    resetSearchForm () {
+      this.$refs.table.refresh(true)
+    },
+    pageInit () {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    setTableH () {
+      const tableSearchH = this.$refs.tableSearch.offsetHeight
+      this.tableHeight = window.innerHeight - tableSearchH - 270
+    }
+  },
+  watch: {
+    advanced (newValue, oldValue) {
+      const _this = this
+      this.$nextTick(() => { // 页面渲染完成后的回调
+        _this.setTableH()
+      })
+    },
+    '$store.state.app.winHeight' (newValue, oldValue) { //  窗口变更时,需同时更改表格高度
+      this.setTableH()
+    }
+  },
+  mounted () {
+    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
+      this.pageInit()
+      this.resetSearchForm()
+    }
+  },
+  activated () {
+    // 如果是新页签打开,则重置当前页面
+    if (this.$store.state.app.isNewTab) {
+      this.pageInit()
+      this.resetSearchForm()
+    }
+    // 仅刷新列表,不重置页面
+    if (this.$store.state.app.updateList) {
+      this.pageInit()
+      this.$refs.table.refresh()
+    }
+  },
+  beforeRouteEnter (to, from, next) {
+    next(vm => {})
+  }
+}
+</script>
+<style lang="less">
+  .funAccountList-wrap{
+    .funAccountList-page-search-wrapper{
+      padding: 0 10px 10px 10px;
+      border-bottom: 1px solid #eee;
+      margin-bottom: 15px;
+      > div{
+        padding: 5px 0;
+        &:last-child{
+          color: #999;
+        }
+      }
+    }
+    .sTable{
+      margin-top: 10px;
+    }
+	.active{
+		color: #ed1c24;
+		cursor: pointer;
+	}
+	.common{
+		color: rgba(0, 0, 0);
+	}
+  }
+</style>

+ 2 - 2
src/views/purchasingManagement/purchaseReturnOutSync/basicInfoModal.vue

@@ -49,7 +49,7 @@
 import { commonMixin } from '@/utils/mixin'
 import { VSelect } from '@/components'
 import { purchaseTargetList } from '@/api/purchase'
-import { purchaseReturnSave } from '@/api/purchaseReturn'
+import { purchaseReturnSaveByNoSync } from '@/api/purchaseReturn'
 export default {
   name: 'BasicInfoModal',
   components: { VSelect },
@@ -110,7 +110,7 @@ export default {
       this.$refs.ruleForm.validate(valid => {
         if (valid) {
           _this.spinning = true
-          purchaseReturnSave(_this.form).then(res => {
+          purchaseReturnSaveByNoSync(_this.form).then(res => {
             if (res.status == 200) {
               _this.isShow = false
               _this.$emit('ok', res.data)