石广澎
2023-11-29 b8dc4ccc6ee580b084aa860e64af2d90d1cb5979
feat:
1、首页接口对接
2、部门物品分发
1个文件已添加
19个文件已修改
962 ■■■■■ 已修改文件
admin-web/.gitignore 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/public/static/config.js 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/api/dashboard.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/components/mySearch/SearchItem.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/dashboard/components/LBJETJ.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/dashboard/components/LBSLTJ.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/dashboard/components/XYZC.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/dashboard/index.vue 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/departmentitem/itemdis/disDetails/index.vue 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/departmentitem/itemdis/distribution/detail.vue 125 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/departmentitem/itemdis/distribution/edit.vue 481 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/departmentitem/itemdis/distribution/index.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/departmentitem/itemret/returnNote/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/departmentitem/itemscr/scrapping/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/stock/accessStock/outbound/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/stock/procure/purchaseOrder/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/stock/procure/receiptDetails/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/stock/transfer/transferApplication/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/src/views/stock/transfer/transferissue/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/vue.config.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin-web/.gitignore
@@ -21,3 +21,4 @@
package-lock.json
yarn.lock
/lowConsumWeb/
admin-web/public/static/config.js
@@ -1,21 +1,13 @@
// 请求接口地址 如果没有配置自动获取当前网址路径
const VUE_APP_API_URL = process.env.VUE_APP_BASE_API || `${location.origin}`;
const VUE_APP_WS_URL =
  process.env.VUE_APP_WS_URL || (location.protocol === 'https' ? 'wss' : 'ws') + ':' + location.hostname;
const SettingIplatform = {
  // 服务器地址
  // 服务器地址
  httpUrl: VUE_APP_API_URL,
  // 上传路径
  ftpUrl: 'https://yqzx.jinmingyuan.com/lowConsum',//开发
// 接口请求地址
  apiBaseURL: 'https://yqzx.jinmingyuan.com/lowConsum',//开发
// apiBaseURL: 'https://jmy.jinmingyuan.com/progress',// 测试,
  // socket连接
  wsSocketUrl: VUE_APP_WS_URL,
  debug: true //调试开关  true时会输出请求日志
  // 接口请求地址
  // apiBaseURL: 'http://172.16.20.2:8083/lowConsum',//开发
  apiBaseURL: 'http://172.16.60.155:8083/lowConsum',//开发
  // apiBaseURL: 'https://yqzx.jinmingyuan.com/lowConsum',//开发
  debug: false //调试开关  true时会输出请求日志
};
export default SettingIplatform;
admin-web/src/api/dashboard.js
New file
@@ -0,0 +1,18 @@
import request from '@/utils/request';
// 物品金额数量
export function getGoodsNumPrice(params) {
    return request({
        url: '/pc/warehouse/homeStatistics/getGoodsNumPrice',
        method: 'get',
        params,
    });
}
// 资产增长/报废统计图(数量)
export function getGoodsNumByMonth(params) {
    return request({
        url: '/pc/warehouse/homeStatistics/getGoodsNumByMonth',
        method: 'get',
        params,
    });
}
admin-web/src/components/mySearch/SearchItem.vue
@@ -20,6 +20,7 @@
      :props="item.optionsConfig.props||{ checkStrictly: true,emitPath: false,value: 'id' }"
      :show-all-levels="false"
      filterable
      clearable
      style="width: 150px"
      @change="(v) => this.$emit('change', v)"
    >
admin-web/src/views/dashboard/components/LBJETJ.vue
@@ -13,12 +13,34 @@
import * as dash from "@/api/dashboard/dash";
export default {
  name: 'LBSLTJ',
  name: 'LBJETJ',
  props: {
    activeId: {
      type: String,
      default: '',
    num: {
      type: Object,
      default: {
        aTotalNum: 0,
        aTotalPrice: 0,
        bTotalNum: 0,
        bTotalPrice: 0,
        cTotalNum: 0,
        cTotalPrice: 0,
        tenantId: 0,
        totalNum: 0,
        totalPrice: 0,
        xiaFaNum: 0,
        zhanYouPercent: 0,
      },
    },
  },
  watch:{
    num(){
      this.options.series[0].data = [
        {value: parseFloat(this.num.aTotalPrice), name: 'A类'},
        {value: parseFloat(this.num.bTotalPrice), name: 'B类'},
        {value: parseFloat(this.num.cTotalPrice), name: 'C类'},
      ]
      this.myChart.setOption(this.options);
    }
  },
  data() {
    return {
@@ -31,14 +53,6 @@
  },
  methods: {
    getCenterLine() {
      // getCenterLine({
      //   id: this.activeId,
      //   weekFlag: this.weekFlag,
      //   monthFlag: this.monthFlag,
      //   startDay: this.value2 ? this.value2[0] : null,
      //   endDay: this.value2 ? this.value2[1] : null
      // }).then(res => {
      //   const data = res.data
      var chartDom = document.getElementById('LBJETJ');
      this.myChart = echarts.init(chartDom);
      // 监听屏幕宽度变化:当浏览器发生resize事件的时候,触发echart的resize事件,重绘canvas
@@ -62,7 +76,7 @@
        series: [
          {
            name: 'Access From',
            name: '类别金额统计',
            type: 'pie',
            minAngle: 2, // 最小的扇区角度(0~360),用于防止某个值过小导致扇区太小影响交互
            avoidLabelOverlap: true, // 是否启用防止标签重叠策略
@@ -82,11 +96,9 @@
              }
            },
            data: [
              { value: 100, name: '等级一' },
              { value: 100, name: '等级二' },
              { value: 100, name: '等级三' },
            ]
              {value: parseFloat(this.num.aTotalPrice), name: 'A类'},
              {value: parseFloat(this.num.bTotalPrice), name: 'B类'},
              {value: parseFloat(this.num.cTotalPrice), name: 'C类'},]
          }]
      };
      this.options && this.myChart.setOption(this.options);
admin-web/src/views/dashboard/components/LBSLTJ.vue
@@ -10,15 +10,37 @@
</template>
<script>
import * as echarts from 'echarts';
import * as dash from "@/api/dashboard/dash";
export default {
  name: 'LBSLTJ',
  props: {
    activeId: {
      type: String,
      default: '',
    num: {
      type: Object,
      default: {
        aTotalNum: 0,
        aTotalPrice: 0,
        bTotalNum: 0,
        bTotalPrice: 0,
        cTotalNum: 0,
        cTotalPrice: 0,
        tenantId: 0,
        totalNum: 0,
        totalPrice: 0,
        xiaFaNum: 0,
        zhanYouPercent: 0,
      },
    },
  },
  watch: {
    num() {
      this.options.series[0].data = [
        {value: parseFloat(this.num.aTotalNum), name: 'A类'},
        {value: parseFloat(this.num.bTotalNum), name: 'B类'},
        {value: parseFloat(this.num.cTotalNum), name: 'C类'},
      ]
      this.myChart.setOption(this.options);
    }
  },
  data() {
    return {
@@ -31,14 +53,6 @@
  },
  methods: {
    getCenterLine() {
      // getCenterLine({
      //   id: this.activeId,
      //   weekFlag: this.weekFlag,
      //   monthFlag: this.monthFlag,
      //   startDay: this.value2 ? this.value2[0] : null,
      //   endDay: this.value2 ? this.value2[1] : null
      // }).then(res => {
      //   const data = res.data
      var chartDom = document.getElementById('LBSLTJ');
      this.myChart = echarts.init(chartDom);
      // 监听屏幕宽度变化:当浏览器发生resize事件的时候,触发echart的resize事件,重绘canvas
@@ -46,7 +60,7 @@
        this.changeWidth();
      });
      this.options = {
        color: [ '#1877FF','#5EDEA5','#F7BE12','#55C6E1','#ED653B'],
        color: ['#1877FF', '#5EDEA5', '#F7BE12', '#55C6E1', '#ED653B'],
        tooltip: {
          trigger: 'axis',
          axisPointer: {
@@ -62,7 +76,7 @@
        series: [
          {
            name: 'Access From',
            name: '类别数量统计',
            type: 'pie',
            minAngle: 2, // 最小的扇区角度(0~360),用于防止某个值过小导致扇区太小影响交互
            avoidLabelOverlap: true, // 是否启用防止标签重叠策略
@@ -82,11 +96,9 @@
              }
            },
            data: [
              { value: 100, name: '等级一' },
              { value: 100, name: '等级二' },
              { value: 100, name: '等级三' },
            ]
              {value: parseFloat(this.num.aTotalNum), name: 'A类'},
              {value: parseFloat(this.num.bTotalNum), name: 'B类'},
              {value: parseFloat(this.num.cTotalNum), name: 'C类'},]
          }]
      };
      this.options && this.myChart.setOption(this.options);
@@ -108,6 +120,7 @@
  width: 100%;
  border-radius: 10px;
  border: none;
  .card-title-right {
    display: flex;
    align-items: center;
admin-web/src/views/dashboard/components/XYZC.vue
@@ -9,6 +9,7 @@
  </div>
</template>
<script>
import {getGoodsNumByMonth} from '@/api/dashboard'
import * as echarts from 'echarts';
export default {
@@ -75,7 +76,7 @@
            emphasis: {
              focus: 'series',
            },
            data: [320, 332, 301, 334, 320, 332, 301, 334, 320, 332, 301, 334],
            data: [],
            lineStyle: {
              width: 2, // 外边线宽度
              color: '#5BE1FD'// 外边线颜色
@@ -103,7 +104,7 @@
            emphasis: {
              focus: 'series',
            },
            data: [220, 182, 191, 234, 220, 182, 191, 234, 220, 182, 191, 234],
            data: [],
            lineStyle: {
              width: 2, // 外边线宽度
              color: '#FFD15C'// 外边线颜色
@@ -127,6 +128,17 @@
        ],
      };
      this.options && this.myChart.setOption(this.options);
      getGoodsNumByMonth().then(res=>{
        let xAxis0 = []
        let xAxis1 = []
        res.map(item=>{
          xAxis0.push(item.addTotalNum)
          xAxis1.push(item.reduceTotalNum)
        })
        this.options.series[0].data = xAxis0
        this.options.series[1].data = xAxis1
        this.myChart.setOption(this.options);
      })
    },
    changeWidth() {
      this.myChart.resize();
admin-web/src/views/dashboard/index.vue
@@ -7,24 +7,29 @@
            <span class="font-18 font-bold">待办名称</span>
          </div>
          <div class="f-r f-r-between m-b-10">
            <el-radio-group v-model="waitType" size="medium">
            <el-radio-group v-model="waitType" size="mini">
              <el-radio-button label="1">全部</el-radio-button>
            </el-radio-group>
            <div class="to-more" @click="nav('/stock/transfer/transferissue')">查看更多 ></div>
          </div>
          <el-table :data="waitWorkData" class="top-tb" :show-header="false" size="medium">
            <el-table-column prop="number" align="center"></el-table-column>
            <el-table-column prop="type" align="center" width="100"></el-table-column>
            <el-table-column prop="orgName" align="center" width="100"></el-table-column>
            <el-table-column prop="name" align="center" width="80"></el-table-column>
            <el-table-column prop="createTime" align="center" width="180">
            <el-table-column prop="businessFormCode" align="center" width="130"></el-table-column>
            <el-table-column prop="inWarehouseName" align="center" min-width="130">
              <template slot-scope="{row}">
                <el-tooltip class="item" effect="dark" :content="row.inWarehouseName " placement="top-start">
                  <div class="font-14 color-333" style="width: 100%;white-space:nowrap;text-overflow: ellipsis;overflow: hidden">{{ row.inWarehouseName }}</div>
                </el-tooltip>
              </template>
            </el-table-column>
            <el-table-column prop="operatorName" align="center" width="80"></el-table-column>
            <el-table-column prop="createTime" align="center" width="160">
              <template slot-scope="scope">
                <span class="font-14 color-333">{{ formattTime(scope.row.createTime) }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="date" label="操作" align="center" width="120">
            <el-table-column prop="date" label="操作" fixed="right" align="center" width="80">
              <template slot-scope="scope">
                <el-button @click.native.prevent="aduitThis(scope.row.id)" size="small" type="primary">处理</el-button>
                <el-button @click.native.prevent="aduitThis(scope.row.id)" type="primary">处理</el-button>
              </template>
            </el-table-column>
          </el-table>
@@ -36,7 +41,7 @@
            <span class="font-18 font-bold">预警通知</span>
          </div>
          <div class="f-r f-r-between m-b-10">
            <el-radio-group  size="medium" v-model="earlyWarningType" @change="changeEarlyWarning">
            <el-radio-group size="mini" v-model="earlyWarningType" @change="changeEarlyWarning">
              <el-radio-button label="1">全部</el-radio-button>
              <el-radio-button label="2">缺货(12)</el-radio-button>
              <el-radio-button label="3">超出(3)</el-radio-button>
@@ -70,42 +75,44 @@
    <div class="f-r f-r-between total-list">
      <div class="total-item">
        <div class="font-14 color-666">物品数量</div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">1200</span></div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">{{goodsNumPrice.totalNum}}</span></div>
      </div>
      <div class="total-item">
        <div class="font-14 color-666">资产总金额</div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">120.88</span>万元</div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">{{goodsNumPrice.totalPrice}}</span>万元</div>
      </div>
      <div class="total-item">
        <div class="font-14 color-666">物品占用率</div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">80%</span></div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">{{goodsNumPrice.zhanYouPercent}}%</span></div>
      </div>
      <div class="total-item">
        <div class="font-14 color-666">A类物品数量</div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">120</span></div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">{{goodsNumPrice.aTotalNum}}</span></div>
      </div>
      <div class="total-item">
        <div class="font-14 color-666">B类物品数量</div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">123</span></div>
        <div class="font-14 color-333" style="margin-top:6px;"><span class="total-num">{{goodsNumPrice.bTotalNum}}</span></div>
      </div>
    </div>
  <!-- 类别金额统计/类别数量统计 -->
    <!-- 类别金额统计/类别数量统计 -->
    <el-row :gutter="20">
      <el-col :span="12">
        <LBSLTJ></LBSLTJ>
        <LBSLTJ :num="goodsNumPrice"></LBSLTJ>
      </el-col>
      <el-col :span="12">
        <LBJETJ></LBJETJ>
        <LBJETJ :num="goodsNumPrice"></LBJETJ>
      </el-col>
    </el-row>
  <!--  资产增长/报废统计图(数量)-->
    <!--  资产增长/报废统计图(数量)-->
    <XYZC></XYZC>
  </div>
</template>
<script>
import {getGoodsNumPrice} from '@/api/dashboard'
// 创建Context
import {LongToDateTime} from "@/utils/DateFormatter";
import {transferList} from "@/api/stock/transfer";
const ComponentContext = require.context('./components', false, /\.vue$/i);
let res_components = {};
@@ -119,14 +126,21 @@
  components: {...res_components},
  data() {
    return {
      goodsNumPrice: {
        aTotalNum: 0,
        aTotalPrice: 0,
        bTotalNum: 0,
        bTotalPrice: 0,
        cTotalNum: 0,
        cTotalPrice: 0,
        tenantId: 0,
        totalNum: 0,
        totalPrice: 0,
        xiaFaNum: 0,
        zhanYouPercent: 0,
      },
      waitType: '1',
      waitWorkData: [
        {number: 'SJQ12345', type: '物品申领', orgName: '金融业务部', name: '张三丰', createTime: 20231127150606, id: 1},
        {number: 'SJQ12345', type: '物品申领', orgName: '金融业务部', name: '张三丰', createTime: 20231127150606, id: 2},
        {number: 'SJQ12345', type: '物品申领', orgName: '金融业务部', name: '张三丰', createTime: 20231127150606, id: 3},
        {number: 'SJQ12345', type: '物品申领', orgName: '金融业务部', name: '张三丰', createTime: 20231127150606, id: 4},
        {number: 'SJQ12345', type: '物品申领', orgName: '金融业务部', name: '张三丰', createTime: 20231127150606, id: 5},
      ], // 待办工作
      waitWorkData: [], // 待办工作
      earlyWarningType: '1',
      earlyWarningData: [
        {type: '施乐复印机碳粉', name: '施乐c2201', surplus: 4, createTime: 20231127150606, id: 1},
@@ -137,9 +151,21 @@
    };
  },
  created() {
    this.init()
    getGoodsNumPrice().then(res => {
      this.goodsNumPrice = res
    })
  },
  methods: {
    init(){
      transferList({
        qryType: 0,
        pageNum: 1,
        pageSize: 5,
      }).then((res) => {
        this.waitWorkData = res.datas;
      });
    },
    // 格式化时间
    formattTime(time) {
      return LongToDateTime(time)
@@ -170,8 +196,8 @@
        earlyWarningType: this.earlyWarningType
      }
    },
  //  跳转
    nav(url){
    //  跳转
    nav(url) {
      this.$router.push(url)
    }
  }
@@ -196,9 +222,11 @@
.top-tb {
  width: 100%;
}
>>>.el-table__body{
> > > .el-table__body {
  min-height: 265px;
}
.total-list {
  padding: 15px 0;
}
admin-web/src/views/departmentitem/itemdis/disDetails/index.vue
@@ -10,12 +10,12 @@
          <el-row style="margin-top: 15px">
            <el-col>
              <!--列表-->
              <my-table-v2 ref="myTable" :filter="filterFrom" :table="table" />
              <my-table-v2 ref="myTable" :filter="filterFrom" :table="table"/>
            </el-col>
          </el-row>
          <!--添加/编辑弹窗-->
          <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search" />
          <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show = false" />
          <edit v-if="editSetting.show" :setting="editSetting" @close="editSetting.show = false" @search="search"/>
          <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show = false"/>
        </el-card>
      </el-container>
    </el-container>
@@ -29,11 +29,12 @@
import edit from './edit';
import detail from '../distribution/detail';
import * as finsystenant from '@/api/baseSetting/finsystenant';
import { getBaseUrl } from '@/utils/base';
import {getBaseUrl} from '@/utils/base';
import * as DateFormatter from "@/utils/DateFormatter";
export default {
  name: 'index',
  components: { MyButton, MyTableV2, edit, detail },
  components: {MyButton, MyTableV2, edit, detail},
  data() {
    return {
      // 搜索框
@@ -65,7 +66,7 @@
          dataIndex: 'agencyId',
          label: '机构',
          placeholder: '请选择',
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          optionsConfig: {url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null},
          defaultValue: '',
          options: [],
        },
@@ -120,7 +121,7 @@
      table: {
        showIndex: true, // 是否显示序号
        expand: false, // 是否显示详情数据
        url: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/select/list', // 请求地址
        url: SettingIplatform.apiBaseURL + '/pc/l/wh/form/transfer/department/list', // 请求地址
        // 工具条
        tools: {
          columnsCtrl: {
@@ -136,20 +137,30 @@
        },
        // 列信息
        columns: [
          { title: '单号', field: 'code', align: 'center' },
          { title: '物品名称', field: 'lv', align: 'center' },
          { title: '类别', field: 'lv', align: 'center' },
          { title: '规格型号', field: 'lv', align: 'center' },
          { title: '分发数量', field: 'summary', align: 'left' },
          { title: '所属机构', field: 'summary', align: 'left' },
          { title: '部门', field: 'summary', align: 'left' },
          { title: '分发人', field: 'summary', align: 'left' },
          { title: '操作时间', field: 'summary', align: 'left' },
          {title: '单号', field: 'businessFormCode', align: 'center', width: 130},
          {title: '物品名称', field: 'goodsName', align:  'left', minWidth: 140},
          {
            title: '类别', field: 'type', align: 'center', formatter: (row) => {
              return {value: row.type + '类'};
            },
          },
          {title: '规格型号', field: 'goodsModelName', align: 'left', minWidth: 130},
          {title: '分发数量', field: 'goodsCount', align: 'center'},
          {title: '所属机构', field: 'tenantName', align: 'left', minWidth: 130},
          {title: '部门', field: 'departmentName', align: 'left', minWidth: 130},
          {title: '分发人', field: 'operatorName', align: 'center'},
          {
            title: '操作时间', field: 'createTime', align: 'center',
            width: 160,
            formatter: (row) => {
              return {value: DateFormatter.LongToDateTime(row.createTime)};
            },
          },
        ],
        // 操作信息
        operation: {
          show: true, // 显示操作列
          width: '200', // 列宽
          width: 160, // 列宽
          attr: [
            {
              title: '使用人',
@@ -180,7 +191,8 @@
      },
    };
  },
  created() {},
  created() {
  },
  methods: {
    handleEdit(row) {
      this.editSetting.id = row.id;
admin-web/src/views/departmentitem/itemdis/distribution/detail.vue
@@ -3,35 +3,35 @@
    <el-row :gutter="20">
      <el-col :span="8">
        <span>分发单号:</span>
        <span>SL2023001</span>
        <span>{{detail.businessFormCode}}</span>
      </el-col>
      <el-col :span="8">
        <span>所属机构:</span>
        <span>河南省邮政分公司</span>
        <span>{{detail.outAgencyName}}</span>
      </el-col>
      <el-col :span="8">
        <span>部门:</span>
        <span>金融业务部</span>
        <span>{{detail.inWarehouseName}}</span>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px">
      <el-col :span="8">
        <span>分发人:</span>
        <span>张爱生</span>
        <span>{{detail.outOperatorName}}</span>
      </el-col>
      <el-col :span="8">
        <span>分发时间:</span>
        <span>2023-08-08 10:23:12</span>
        <span>{{detail.createTime|formatTime}}</span>
      </el-col>
      <el-col :span="8">
        <span>领取人:</span>
        <span>王部门</span>
        <span>{{detail.inOperatorName}}</span>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px">
      <el-col :span="8">
        <span>联系电话:</span>
        <span>18500000001</span>
        <span>{{detail.tel}}</span>
      </el-col>
    </el-row>
    <el-row :gutter="20" style="margin-top: 20px">
@@ -42,67 +42,62 @@
        </div>
      </el-col>
    </el-row>
    <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.procureGoods" :key="goodsIndex">
    <div class="goods-card" v-for="(goodsItem, goodsIndex) in detail.formTransferGoods" :key="goodsIndex">
      <el-row :gutter="20">
        <el-col :span="8">
          <span>物品分类:</span>
          <span>{{ goodsItem.baseCategoryName }}</span>
          <span>{{ goodsItem.categoryName }}</span>
        </el-col>
        <el-col :span="8">
          <span>物品名称:</span>
          <span>{{ goodsItem.goodsTemplateName }}</span>
          <span>{{ goodsItem.goodsName }}</span>
        </el-col>
        <el-col :span="8">
          <span>物品类别:</span>
          <span>{{ goodsItem.supplier }}</span>
          <span>{{ goodsItem.type }}类</span>
        </el-col>
      </el-row>
      <div v-if="goodsItem.type===1">
        <el-table :data="goodsItem.models" :stripe="true" style="margin-top: 20px">
          <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center">
            <template slot-scope="scope">
              {{ scope.row.baseGoodsModelsName }}
            </template>
          </el-table-column>
          <el-table-column label="单位" align="center">
            <template slot-scope="scope">
              {{ scope.row.unit }}
            </template>
          </el-table-column>
          <el-table-column prop="price" label="分发数量" align="center">
            <template slot-scope="scope">
              {{ scope.row.price | formatPrice }}
            </template>
          </el-table-column>
          <el-table-column prop="counts" label="使用人" align="center">
            <template slot-scope="scope">
              {{ scope.row.counts }}
            </template>
          </el-table-column>
          <el-table-column prop="counts" label="联系电话" align="center">
            <template slot-scope="scope">
              {{ scope.row.price * scope.row.counts  | formatPrice}}
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div v-else>
        <el-table-column prop="baseGoodsModelsName" label="规格型号" align="center">
          <template slot-scope="scope">
            {{ scope.row.baseGoodsModelsName }}
          </template>
        </el-table-column>
        <el-table-column label="单位" align="center">
          <template slot-scope="scope">
            {{ scope.row.unit }}
          </template>
        </el-table-column>
        <el-table-column prop="price" label="分发数量" align="center">
          <template slot-scope="scope">
            {{ scope.row.price | formatPrice }}
          </template>
        </el-table-column>
      </div>
      <el-form>
        <el-row class="card3" v-for="(mItem, mIndex) in goodsItem.models" :key="mIndex">
          <el-col :span="10">
            <el-form-item label="规格型号:"  style="margin-bottom: 0">
              {{ mItem.baseGoodsModelsName }}
            </el-form-item>
          </el-col>
          <el-col :span="4">
            <el-form-item label="单位:" style="margin-bottom: 0" label-width="80">
              {{mItem.unit}}
            </el-form-item>
          </el-col>
          <!--A类商品 -->
          <el-col :span="24" v-if="goodsItem.type==='A'">
            <el-row v-for="(user, u) in mItem.useInfo">
              <el-col :span="6">
                <el-form-item label="分发数量:" style="margin-bottom: 0" label-width="80">
                  {{user.num}}
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="使用人:" style="margin-bottom: 0" label-width="80">
                  {{user.name}}
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="联系电话:" style="margin-bottom: 0" label-width="80">
                  {{user.tel}}
                </el-form-item>
              </el-col>
            </el-row>
          </el-col>
          <!--BC类商品 -->
          <el-col style="padding: 10px 0" :span="10" v-else>
            <el-form-item label="分发数量:" prop="counts" style="margin-bottom: 0" label-width="80">
              {{mItem.counts}}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </div>
    <div id="uploadPreviewImages" style="display: none">
      <span v-for="(src, index) in fileList" :key="index">
@@ -118,16 +113,22 @@
  </win-lg>
</template>
<script>
import { procureDetail } from '@/api/stock/procure/purchaseOrder';
import { transferDetail } from '@/api/stock/transfer';
import winLg from '@/components/win/win-lg';
import * as DateFormatter from '@/utils/DateFormatter';
import { getDownUrl } from '@/utils/base';
import Viewer from 'viewerjs';
import 'viewerjs/dist/viewer.css';
import de from "element-ui/src/locale/lang/de";
let viewer = null;
export default {
  computed: {
    de() {
      return de
    }
  },
  components: { winLg },
  props: {
    setting: {
@@ -164,7 +165,7 @@
    }
  },
  created() {
    procureDetail({ id: this.setting.id }).then((res) => {
    transferDetail({ id: this.setting.id }).then((res) => {
      this.detail = res;
      this.fileList = this.detail.procureDoc ? JSON.parse(this.detail.procureDoc) : [];
      this.$nextTick(() => {
@@ -225,4 +226,10 @@
</script>
<style lang="scss" scoped>
//@import url(../../../../styles/store.scss);
.card3 {
  padding: 10px;
  margin-top: 10px;
  border-radius: 2px;
  background: #ffffff;
}
</style>
admin-web/src/views/departmentitem/itemdis/distribution/edit.vue
@@ -1,36 +1,37 @@
<template>
  <win-md class="stock-edit" title="物品分发" @close="close" :width="'800px'">
    <el-form class="form" ref="ruleForm" :model="formData" :rules="rules" label-width="120px">
  <win-md class="stock-edit" title="物品分发" @close="close" width="900px">
    <el-form v-loading="loading" class="form" ref="ruleForm" :model="formData" :rules="rules" label-width="120px">
      <div class="main-w">
        <el-row :gutter="24" class="headerHeight">
          <el-col :span="12">
            <el-form-item label="部门" prop="warehouseId">
              <el-select v-model="formData.warehouseId" placeholder="请选择" style="width: 100%">
                <el-option v-for="item in departmentOptions" :key="item.id" :label="item.name" :value="item.id" />
            <el-form-item label="部门" prop="departmentId">
              <el-select ref="department" v-model="formData.departmentId" placeholder="请选择" style="width: 100%">
                <el-option v-for="item in departmentOptions" :key="item.id" :label="item.name" :value="item.id"
                           clearable/>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="领取人" prop="warehouseId">
              <el-input v-model="formData.warehouseId" placeholder="请输入"></el-input>
            <el-form-item label="领取人" prop="operatorName">
              <el-input v-model="formData.operatorName" placeholder="请输入" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24" class="headerHeight">
          <el-col :span="12">
            <el-form-item label="联系电话" prop="buyType">
              <el-input v-model.number="formData.buyType" placeholder="请输入"></el-input>
            <el-form-item label="联系电话" prop="tel">
              <el-input v-model.number="formData.tel" placeholder="请输入" clearable></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="采购时间" prop="procureTime">
            <el-form-item label="领取时间" prop="createTime">
              <el-date-picker
                v-model="formData.procureTime"
                type="datetime"
                value="yyyy-MM-dd HH:mm:ss"
                value-format="yyyyMMddHHmmss"
                placeholder="请选择日期"
                style="width: 100%"
                  v-model="formData.createTime"
                  type="datetime"
                  clearable
                  value-format="yyyyMMddHHmmss"
                  placeholder="请选择日期"
                  style="width: 100%"
              >
              </el-date-picker>
            </el-form-item>
@@ -43,46 +44,49 @@
            </el-form-item>
          </el-col>
        </el-row>
        <div class="goods-card" v-for="(goodsItem, goodsIndex) in formData.procureGoods" :key="goodsIndex">
        <div class="goods-card" v-for="(goodsItem, goodsIndex) in formData.transferGoods" :key="goodsIndex">
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item
                label="物品分类"
                :prop="`procureGoods[${goodsIndex}].baseCategoryIds`"
                :rules="{
                  label="物品分类"
                  :prop="`transferGoods.${goodsIndex}.baseCategoryId`"
                  :rules="{
                  required: true,
                  message: '请选择',
                  message: '请选择物品分类',
                  trigger: 'change',
                }"
              >
                <el-cascader
                  v-model="goodsItem.baseCategoryIds"
                  :options="categoryOptions"
                  :props="{ value: 'id' }"
                  @change="categoryChange($event, goodsIndex)"
                  style="width: 100%"
                    v-model="goodsItem.baseCategoryId"
                    :options="categoryOptions"
                    :props="{ value: 'id',emitPath: false }"
                    :show-all-levels="false"
                    clearable
                    @change="categoryChange($event, goodsIndex)"
                    style="width: 100%"
                ></el-cascader>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item
                label="物品名称"
                :prop="`procureGoods[${goodsIndex}].baseGoodsTemplateId`"
                :rules="rules.baseGoodsTemplateId"
                  label="物品名称"
                  :prop="`transferGoods.${goodsIndex}.baseGoodsTemplateId`"
                  :rules="rules.baseGoodsTemplateId"
              >
                <el-select
                  v-model="goodsItem.baseGoodsTemplateId"
                  placeholder="请先择物品分类"
                  filterable
                  :disabled="!goodsItem.baseCategoryId"
                  style="width: 100%"
                  @change="goodsTemplateChange($event, goodsIndex)"
                    v-model="goodsItem.baseGoodsTemplateId"
                    placeholder="请选择物品"
                    filterable
                    clearable
                    :disabled="!goodsItem.baseCategoryId"
                    style="width: 100%"
                    @change="goodsTemplateChange($event, goodsIndex)"
                >
                  <el-option
                    v-for="item in goodsItem.goodsOptions"
                    :key="item.id"
                    :label="item.goodsName"
                    :value="item.id"
                      v-for="item in goodsItem.goodsOptions"
                      :key="item.id"
                      :label="item.goodsName"
                      :value="item.id"
                  />
                </el-select>
              </el-form-item>
@@ -91,136 +95,154 @@
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item
                label="规格型号"
                :prop="`procureGoods[${goodsIndex}].modelsIds`"
                :rules="{required: true,message: '请选择',trigger: 'change',}">
                  label="规格型号"
                  :prop="`transferGoods.${goodsIndex}.modelsIds`"
                  :rules="{required: true,message: '请选择',trigger: 'change',}">
                <el-select
                  v-model="goodsItem.modelsIds"
                  multiple
                  placeholder="请先择物品名称"
                  :disabled="!goodsItem.baseCategoryId"
                  @change="modelChange($event, goodsIndex)"
                  @remove-tag="modelRemoveTag($event, goodsIndex)"
                  style="width: 100%"
                    v-model="goodsItem.modelsIds"
                    multiple
                    placeholder="请选择物品规格型号"
                    :disabled="!goodsItem.baseCategoryId"
                    @change="modelChange($event, goodsIndex)"
                    @remove-tag="modelRemoveTag($event, goodsIndex)"
                    style="width: 100%"
                >
                  <el-option
                    v-for="item in goodsItem.modelsOptions"
                    :key="item.id"
                    :label="item.modelName"
                    :value="item.id"
                      v-for="item in goodsItem.modelsOptions"
                      :key="item.id"
                      :label="item.modelName"
                      :value="item.id"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="card3" v-for="(mItem, mIndex) in goodsItem.models" :key="mIndex">
            <el-row :gutter="24" type="flex" align="middle" style="height: 50px">
              <el-col :span="8">
                <el-form-item label="规格型号:" prop="baseGoodsModelsId" style="margin-bottom: 0">
                  {{ getGoodsModelsName(mItem.baseGoodsModelsId) }}
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="剩余数量:" prop="baseGoodsModelsId" style="margin-bottom: 0" label-width="80">
                  50
                </el-form-item>
              </el-col>
              <!--A类商品 -->
              <el-col :span="24" v-if="goodsItem.type===1">
                <el-table :data="mItem.clist" :stripe="true" >
                  <el-table-column prop="count" label="分发数量" align="center">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.count"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column prop="count" label="使用人" align="center">
                    <template slot-scope="scope">
                      <el-input v-model="scope.row.user" maxlength="20"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column prop="count" label="联系电话" align="center">
                    <template slot-scope="scope">
                      <el-input v-model.number="scope.row.phone" maxlength="11"></el-input>
                    </template>
                  </el-table-column>
                  <el-table-column align="left" width="60">
                    <template slot-scope="scope">
                      <i
                        v-if="mItem.clist.length > 1"
            <el-col style="padding: 10px 0" :span="10">
              <el-form-item label="规格型号:" style="margin-bottom: 0">
                {{ getGoodsModelsName(mItem.baseGoodsModelsId) }}
              </el-form-item>
            </el-col>
            <el-col style="padding: 10px 0" :span="4">
              <el-form-item label="剩余数量:" style="margin-bottom: 0" label-width="80">
                {{ mItem.worehouseCount }}
              </el-form-item>
            </el-col>
            <!--A类商品 -->
            <el-col :span="24" v-if="goodsItem.classification==='A'">
              <el-table :data="mItem.procureModelUserList" :stripe="true">
                <el-table-column label="分发数量" align="center">
                  <template slot-scope="{$index,row}">
                    <el-form-item
                        :prop="`transferGoods.${goodsIndex}.models.${mIndex}.procureModelUserList.${$index}.goodsNum`"
                        label-width="0"
                    >
                      <el-input v-model="row.goodsNum" style="width: 100%"></el-input>
                    </el-form-item>
                  </template>
                </el-table-column>
                <el-table-column prop="nowUserName" label="使用人" align="center">
                  <template slot-scope="{$index,row}">
                    <el-form-item
                        :prop="`transferGoods.${goodsIndex}.models.${mIndex}.procureModelUserList.${$index}.nowUserName`"
                        label-width="0"
                    >
                      <el-input v-model="row.nowUserName" style="width: 100%"></el-input>
                    </el-form-item>
                  </template>
                </el-table-column>
                <el-table-column prop="nowUserPhone" label="联系电话" align="center">
                  <template slot-scope="{$index,row}">
                    <el-form-item
                        :prop="`transferGoods.${goodsIndex}.models.${mIndex}].procureModelUserList.${$index}.nowUserPhone`"
                        label-width="0"
                    >
                      <el-input v-model="row.nowUserPhone" style="width: 100%"></el-input>
                    </el-form-item>
                  </template>
                </el-table-column>
                <el-table-column align="left" width="60">
                  <template slot-scope="scope">
                    <i
                        v-if="mItem.procureModelUserList.length > 1"
                        class="el-icon-remove-outline"
                        style="color: #f56c6c; font-size: 16px; cursor: pointer"
                        @click="handleDel(goodsIndex, mIndex, scope.$index)"
                      ></i>
                      <i
                        v-if="mItem.clist.length - 1 == scope.$index"
                    ></i>
                    <i
                        v-if="mItem.procureModelUserList.length - 1 == scope.$index"
                        class="el-icon-circle-plus-outline"
                        style="color: #0d997c; font-size: 16px; cursor: pointer"
                        @click="handleAdd(goodsIndex, mIndex, scope.$index)"
                      ></i>
                    </template>
                  </el-table-column>
                </el-table>
              </el-col>
              <!--BC类商品 -->
              <el-col :span="10" v-else>
                <el-form-item label="分发数量:" prop="baseGoodsModelsId" style="margin-bottom: 0" label-width="80">
                  <el-input v-model.number="mItem.count" style="width: 160px;"></el-input>
                </el-form-item>
              </el-col>
            </el-row>
                    ></i>
                  </template>
                </el-table-column>
              </el-table>
            </el-col>
            <!--BC类商品 -->
            <el-col style="padding: 10px 0" :span="10" v-else>
              <el-form-item
                  label="分发数量:"
                  :prop="`transferGoods.${goodsIndex}.models.${mIndex}.counts`"
                  style="margin-bottom: 0" label-width="80">
                <el-input v-model.number="goodsItem.models[mIndex].counts" style="width: 160px;"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="btn-group">
            <el-button
              v-if="formData.procureGoods.length > 1"
              name="移除"
              type="danger"
              plain
              size="mini"
              @click="removeGoods(goodsIndex)"
              >移除</el-button>
                v-if="formData.transferGoods.length > 1"
                name="移除"
                type="danger"
                plain
                size="mini"
                @click="removeGoods(goodsIndex)"
            >移除
            </el-button>
            <el-button
              v-if="formData.procureGoods.length - 1 == goodsIndex"
              name="新增物品"
              type="primary"
              plain
              size="mini"
              @click="addGoods"
              >新增物品</el-button>
                v-if="formData.transferGoods.length - 1 == goodsIndex"
                name="新增物品"
                type="primary"
                plain
                size="mini"
                @click="addGoods"
            >新增物品
            </el-button>
          </div>
        </div>
      </div>
    </el-form>
    <div slot="footer" align="center" class="dialog-footer">
      <my-button name="取消" site="form" @click="close" />
      <my-button name="保存" site="form" @click="handleSubmit" />
      <my-button name="取消" site="form" @click="close"/>
      <my-button name="保存" site="form" @click="handleSubmit"/>
    </div>
  </win-md>
</template>
<script>
import {
  goodsTemplate,
  procureAdd,
  procureEdit,
  selectTenantWarehouse,
  goodsModel,
  procureDetail,
} from '@/api/stock/procure/purchaseOrder';
import { departmentListAll } from '@/api/system/deptment';
import { getTree } from '@/api/foudation/classification';
import {
  transferAdd
} from '@/api/stock/transfer';
import {departmentListAll} from '@/api/system/deptment';
import {getTree} from '@/api/foudation/classification';
import MyButton from '@/components/myButton/myButton';
import winMd from '@/components/win/win-md';
import upload from '@/components/upload/index';
import { getUploadUrl, getDownUrl } from '@/utils/base';
import { findParentIds } from '@/utils/index';
import { mapGetters } from 'vuex';
import {getUploadUrl} from '@/utils/base';
import {mapGetters} from 'vuex';
import * as DateFormatter from '@/utils/DateFormatter';
import {warehouseSelectNumber} from "@/api/baseSetting/finsystenant";
export default {
  components: { MyButton, winMd, upload },
  components: {MyButton, winMd, upload},
  props: {
    setting: {
      type: Object,
      default: () => {},
      default: () => {
      },
    },
  },
  data() {
@@ -230,7 +252,7 @@
      if (!value) {
        return callback(new Error('请选择'));
      }
      let temp = this.formData.procureGoods.filter((v) => v.baseGoodsTemplateId == value);
      let temp = this.formData.transferGoods.filter((v) => v.baseGoodsTemplateId == value);
      if (!temp || temp.length != 1) {
        return callback(new Error('已选过此物品'));
      }
@@ -269,18 +291,20 @@
      categoryOptions: [], // 物品分类列表
      modelList: [], //型号列表
      formData: {
        transferBusinessType: 1, // 单据类型。0仓库调拨;1部门分发;2部门物品回退
        departmentId: '', // 部门id
        departmentName: '', // 部门名称
        operatorName: '', // 领取人
        tel: '', // 联系电话
        createTime: DateFormatter.formatDate(new Date(), 'yyyyMMddhhmmss'), // 分发时间
        procureDoc: '',
        warehouseId: '', // 入库仓库id
        procureTime: DateFormatter.formatDate(new Date()), // 采购时间
        procureGoods: [],
        transferGoods: [],
      },
      goodsItem: {
        baseCategoryIds: '', // 分类编号数组
        baseCategoryId: '', // 分类编号
        classification: '',
        baseGoodsTemplateId: '', // 物品模版编号
        goodsTemplateName: '', // 物品模版名称
        supplier: '', // 供应商
        sort: '', // 显示顺序
        goodsOptions: [], // 物品列表select
        modelsOptions: [], //规格型号select
        models: [], // 物品名称
@@ -288,23 +312,38 @@
      },
      modelsItem: {
        baseGoodsModelsId: '', // 规格型号编号
        syCount: '',
        procureModelUserList: [],
        counts: '',
      },
      clistItem: {
        count: null,
        user: null,
        phone: null,
        goodsNum: null,
        nowUserName: null,
        nowUserPhone: null,
      },
      rules: {
        warehouseId: [{ required: true, message: '请选择', trigger: 'change' }],
        procureTime: [{ required: true, message: '请选择', trigger: 'change' }],
        buyType: [{ required: true, message: '请选择', trigger: 'change' }],
        departmentId: [{required: true, message: '请选择部门', trigger: 'change'}],
        operatorName: [{required: true, message: '请填写领取人', trigger: 'blur'}],
        tel: [{required: true, message: '请填写联系电话', trigger: 'blur'}],
        createTime: [{required: true, message: '请选择分发时间', trigger: 'change'}],
        procureDoc: [{required: true, message: '请上传审批手续', trigger: 'change'}],
        baseCategoryIds: [{required: true, message: '请选择', trigger: 'change'}],
        baseGoodsTemplateId: [{validator: checkGoodsTemplateId, trigger: ['blur', 'change']}],
        modelsIds: [{required: true, message: '请选择', trigger: 'change'}],
        transferGoods:{
          models:{
            counts: [
              { required: true, message: '请输入', trigger: 'change' },
              { type: 'number', message: '数量必须为整数' },
            ],
            procureModelUserList:{
              goodsNum: [ { required: true, message: '请输入', trigger: 'blur' }],
              nowUserName: [ { required: true, message: '请输入', trigger: 'blur' }],
              nowUserPhone: [ { required: true, message: '请输入', trigger: 'blur' }],
            }
          }
        }
        procureDoc: [{ required: true, message: '请上传', trigger: 'change' }],
        baseCategoryIds: [{ required: true, message: '请选择', trigger: 'change' }],
        baseGoodsTemplateId: [{ validator: checkGoodsTemplateId, trigger: ['blur', 'change'] }],
        modelsIds: [{ required: true, message: '请选择', trigger: 'change' }],
        counts: [{ validator: checkCounts, trigger: 'blur' }],
      },
      uploadSettings: {
@@ -334,7 +373,7 @@
      // 获取物品分类列表
      const treeRes = await getTree();
      this.categoryOptions = this.removeEmptyChildren(treeRes);
      if (this.setting.id) {
      /*if (this.setting.id) {
        const detail = await procureDetail({ id: this.setting.id });
        this.formData = Object.assign(this.formData, detail);
        if (this.formData.procureDoc) {
@@ -342,40 +381,38 @@
        }
        this.$set(this.formData, 'buyType', this.formData.buyType.toString());
        this.formData.procureTime = this.formData.procureTime.toString();
        this.formData.procureGoods.map((item, index) => {
          // 根据子集ID拼接物品分类列表
          item.baseCategoryIds = findParentIds(this.categoryOptions, item.baseCategoryId);
        this.formData.transferGoods.map((item, index) => {
          this.$set(
            this.formData.procureGoods[index],
            this.formData.transferGoods[index],
            'modelsIds',
            item.models.map((v) => v.baseGoodsModelsId),
          );
          this.getgoodsTemplate(item.baseCategoryId, index);
          this.getgoodsModel(item.baseGoodsTemplateId, index);
          item.models.forEach((child, childIndex) => {
            this.$set(this.formData.procureGoods[index].models[childIndex], 'priceYuan', child.price / 100);
            this.$set(this.formData.transferGoods[index].models[childIndex], 'priceYuan', child.price / 100);
          });
          return item;
        });
      }
      }*/
    },
    // 获取入库仓库列表
    getdeptmentList() {
      departmentListAll({ agencyId: this.userInfo.tenantId })
        .then((res) => {
          this.departmentOptions = res;
          if (!this.setting.id && res.length) {
            this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem)));
          }
          if (this.departmentOptions.length && !this.formData.warehouseId) {
            // 默认选中第一个仓库
            this.formData.warehouseId = this.departmentOptions[0].id;
          }
        })
        .catch((err) => {
          console.log('err', err);
        });
      departmentListAll({agencyId: this.userInfo.tenantId})
          .then((res) => {
            this.departmentOptions = res;
            if (!this.setting.id && res.length) {
              this.formData.transferGoods.push(JSON.parse(JSON.stringify(this.goodsItem)));
            }
            if (this.departmentOptions.length && !this.formData.warehouseId) {
              // 默认选中第一个仓库
              this.formData.warehouseId = this.departmentOptions[0].id;
            }
          })
          .catch((err) => {
            console.log('err', err);
          });
    },
    removeEmptyChildren(arr) {
@@ -391,9 +428,10 @@
    // 获取物品名称列表
    getgoodsTemplate(id, index) {
      goodsTemplate({ categoryId: id || '' }).then((res) => {
      goodsTemplate({categoryId: id || '', agencyId: this.userInfo.tenantId}).then((res) => {
        if (index || index == 0) {
          this.$set(this.formData.procureGoods[index], 'goodsOptions', res);
          this.$set(this.formData.transferGoods[index], 'goodsOptions', res);
          this.$set(this.formData.transferGoods[index], 'classification', res[0].classification);
        } else {
          this.goodsTemplatelAll = res;
        }
@@ -402,9 +440,9 @@
    // 规格型号
    getgoodsModel(id, index) {
      goodsModel({ goodsTemplatesId: id || '' }).then((res) => {
      goodsModel({goodsTemplatesId: id || '', agencyId: this.userInfo.tenantId}).then((res) => {
        if (index || index == 0) {
          this.$set(this.formData.procureGoods[index], 'modelsOptions', res);
          this.$set(this.formData.transferGoods[index], 'modelsOptions', res);
        } else {
          this.goodsModelAll = res;
        }
@@ -431,60 +469,65 @@
    // 物品分类选择
    categoryChange(e, index) {
      this.formData.procureGoods[index].goodsOptions = [];
      this.formData.procureGoods[index].baseGoodsTemplateId = '';
      this.formData.procureGoods[index].goodsTemplateName = '';
      this.formData.procureGoods[index].modelsOptions = [];
      this.formData.procureGoods[index].modelsIds = [];
      this.formData.procureGoods[index].models = [];
      this.formData.procureGoods[index].baseCategoryId = e[e.length - 1];
      this.formData.transferGoods[index].goodsOptions = [];
      this.formData.transferGoods[index].baseGoodsTemplateId = '';
      this.formData.transferGoods[index].goodsTemplateName = '';
      this.formData.transferGoods[index].modelsOptions = [];
      this.formData.transferGoods[index].modelsIds = [];
      this.formData.transferGoods[index].models = [];
      // 根据选中分类请求物品名称列表
      this.getgoodsTemplate(e[e.length - 1], index);
      this.getgoodsTemplate(e, index);
    },
    // 物品名称列表
    goodsTemplateChange(e, index) {
      this.formData.procureGoods[index].modelsOptions = [];
      this.formData.procureGoods[index].modelsIds = [];
      this.formData.procureGoods[index].models = [];
      this.formData.transferGoods[index].modelsOptions = [];
      this.formData.transferGoods[index].modelsIds = [];
      this.formData.transferGoods[index].models = [];
      this.formData.procureGoods[index].goodsTemplateName = this.getGoodsTemplateName(e);
      this.formData.transferGoods[index].goodsTemplateName = this.getGoodsTemplateName(e);
      // 根据选中物品名称id获取规格型号列表
      this.getgoodsModel(e, index);
    },
    // 规格型号选择
    modelChange(e, index) {
      let arr = [...this.formData.procureGoods[index].models];
    async modelChange(e, index) {
      let arr = [...this.formData.transferGoods[index].models];
      let str = JSON.stringify(arr);
      e.forEach((item) => {
        if (str.indexOf(item) == -1) {
          let clist = [JSON.parse(JSON.stringify(this.clistItem))];
          arr.push({ ...this.modelsItem, baseGoodsModelsId: item, clist });
      for (const item of e) {
        if (str.indexOf(item) === -1) {
          let num = await warehouseSelectNumber({
            baseGoodsModelsId: item,
            warehouseType: 0,
            states: 1,
            agencyId: this.userInfo.tenantId,
          });
          let procureModelUserList = [JSON.parse(JSON.stringify(this.clistItem))];
          arr.push({...this.modelsItem, baseGoodsModelsId: item, procureModelUserList, worehouseCount: num});
          // arr.push({...this.modelsItem, baseGoodsModelsId: item, procureModelUserList});
        }
      });
      this.formData.procureGoods[index].models = arr;
      }
      this.formData.transferGoods[index].models = arr;
    },
    // 规格型号移除
    modelRemoveTag(e, index) {
      let arr = this.formData.procureGoods[index].models;
      let arr = this.formData.transferGoods[index].models;
      let delIndex = arr.findIndex((v) => v.baseGoodsModelsId == e);
      this.formData.procureGoods[index].models.splice(delIndex, 1);
      this.formData.transferGoods[index].models.splice(delIndex, 1);
    },
    //型号分发新增
    handleAdd(goodsIndex, mIndex, cIndex) {
      this.formData.procureGoods[goodsIndex].models[mIndex].clist.push(JSON.parse(JSON.stringify(this.clistItem)));
      this.formData.transferGoods[goodsIndex].models[mIndex].procureModelUserList.push(JSON.parse(JSON.stringify(this.clistItem)));
    },
    handleDel(goodsIndex, mIndex, cIndex) {
      this.formData.procureGoods[goodsIndex].models[mIndex].clist.splice(cIndex, 1);
      this.formData.transferGoods[goodsIndex].models[mIndex].procureModelUserList.splice(cIndex, 1);
    },
    // 价格input监听 转为分
    priceChange(e, goodsIndex, index) {
      this.formData.procureGoods[goodsIndex].models[index].price = e * 100;
      this.formData.transferGoods[goodsIndex].models[index].price = e * 100;
    },
    // 上传
@@ -495,43 +538,46 @@
    // 点击新增物品
    addGoods() {
      this.formData.procureGoods.push(JSON.parse(JSON.stringify(this.goodsItem)));
      this.formData.transferGoods.push(JSON.parse(JSON.stringify(this.goodsItem)));
    },
    // 点击移除
    removeGoods(index) {
      this.formData.procureGoods.splice(index, 1);
      this.formData.transferGoods.splice(index, 1);
    },
    // 提交
    handleSubmit() {
      console.log('formData', this.formData);
      this.$refs['ruleForm'].validate((valid) => {
        if (valid) {
          console.log('formData', this.formData);
          debugger;
          if (!this.setting.id) {
            procureAdd(this.formData)
          this.formData.transferGoods.map(goods => {
            goods.models.map(mod => {
              if (goods.classification === 'A') {
                let counts = 0
                mod.procureModelUserList.map(user => {
                  counts += parseInt(user.goodsNum || '0')
                })
                mod.counts = counts
              }
            })
          })
          this.formData.departmentName = this.$refs.department.selected.currentLabel
          this.formData.outAgencyId = this.userInfo.tenantId
          this.loading = true
          transferAdd(this.formData)
              .then((res) => {
                this.loading = false
                this.$message.success('保存成功!');
                this.close();
                this.$emit('search');
              })
              .catch((err) => {
                this.loading = false
                console.log('create err', err);
                this.$message.error('保存失败');
              });
          } else {
            procureEdit(this.formData)
              .then((res) => {
                this.$message.success('保存成功!');
                this.close();
                this.$emit('search');
              })
              .catch((err) => {
                console.log('edit err', err);
                this.$message.error('保存失败');
              });
          }
        } else {
          this.$message.error('校验未通过,请检查。');
        }
@@ -542,7 +588,7 @@
      this.formData = {
        warehouseId: '', // 入库仓库id
        procureTime: '', // 采购时间
        procureGoods: [],
        transferGoods: [],
      };
      this.$emit('close');
    },
@@ -551,6 +597,7 @@
</script>
<style scoped lang="scss">
@import url(../../../../styles/store.scss);
.card3 {
  border-radius: 2px;
  background: #ffffff;
admin-web/src/views/departmentitem/itemdis/distribution/index.vue
@@ -27,15 +27,15 @@
                        </div>
                      </div>
                      <div class="one-hed">
                        <div class="box"><span class="span-two">部门:</span>{{ item.agencyId }}</div>
                        <div class="box"><span class="span-two">分发人:</span>{{ item.buyerName }}</div>
                        <div class="box"><span class="span-two">部门:</span>{{ item.inWarehouseName }}</div>
                        <div class="box"><span class="span-two">领取人:</span>{{ item.inOperatorName }}</div>
                        <div class="box">
                          <span class="span-two">分发时间:</span>{{ item.procureTime | formatTime }}
                          <span class="span-two">领取时间:</span>{{ item.createTime | formatTime }}
                        </div>
                      </div>
                      <div class="card-end">
                        <div v-for="(just, index) in item.fromProcureTemplateInfoList" :key="index" class="item">
                          <div class="name">{{ just.goodsTemplateName }}</div>
                        <div v-for="(just, index) in item.fromTransferTemplateInfoList" :key="index" class="item">
                          <div class="name">{{ just.goodsName }}</div>
                          <div class="value-box">
                            <div class="value-box-item">
                              <span class="label">数量:</span>
@@ -49,7 +49,7 @@
                  </el-card>
                </el-col>
              </el-row>
              <div class="no-data" v-else>暂无数据</div>
              <el-empty v-else description="暂无数据"></el-empty>
            </div>
            <el-pagination
              :small="false"
@@ -83,7 +83,7 @@
</template>
<script>
import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder';
import { transferList} from '@/api/stock/transfer';
import MyButton from '@/components/myButton/myButton';
import SettingIplatform from '@/utils/settingIplatform';
import myImport from '@/views/components/myImport';
@@ -111,6 +111,15 @@
          defaultValue: '',
        },
        {
          type: 'cascader',
          dataIndex: 'agencyId',
          label: '分发部门',
          placeholder: '请选择',
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          defaultValue: '',
          options: [],
        },
        {
          type: 'select',
          dataIndex: 'goodsTemplateId',
          label: '物品名称',
@@ -124,30 +133,21 @@
          },
        },
        {
          type: 'cascader',
          dataIndex: 'agencyId',
          label: '分发部门',
          placeholder: '请选择',
          optionsConfig: { url: '/pc/fin/sys/tenant/select/tree_fin_tenant', props: null },
          defaultValue: '',
          options: [],
        },
        {
          type: 'text',
          dataIndex: 'createName',
          label: '分发人',
          dataIndex: 'operatorName',
          label: '领取人',
          placeholder: '请输入',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'incomeTimeStart',
          label: '分发时间',
          dataIndex: 'startTime',
          label: '领取时间',
          defaultValue: '',
        },
        {
          type: 'date-picker',
          dataIndex: 'incomeTimeEnd',
          dataIndex: 'endTime',
          label: '至',
          defaultValue: '',
        },
@@ -162,7 +162,8 @@
  methods: {
    fetchData() {
      this.loading = true;
      procureList({
      transferList({
        qryType: 1,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        ...this.filterFrom,
@@ -170,17 +171,10 @@
        this.list = res.datas;
        this.total = res.totalRows;
        this.loading = false;
        console.log(this.list);
      });
    },
    fifterForm(params) {
      this.filterFrom = Object.assign(this.filterFrom, params);
      if (this.filterFrom.incomeTimeStart) {
        this.filterFrom.incomeTimeStart = this.filterFrom.incomeTimeStart.replace(/\-/g, '');
      }
      if (this.filterFrom.incomeTimeEnd) {
        this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
      }
      this.search(1);
    },
  },
admin-web/src/views/departmentitem/itemret/returnNote/index.vue
@@ -49,7 +49,7 @@
                  </el-card>
                </el-col>
              </el-row>
              <div class="no-data" v-else>暂无数据</div>
              <el-empty v-else description="暂无数据"></el-empty>
            </div>
            <el-pagination
              :small="false"
admin-web/src/views/departmentitem/itemscr/scrapping/index.vue
@@ -54,7 +54,7 @@
                  </el-card>
                </el-col>
              </el-row>
              <div class="no-data" v-else>暂无数据</div>
              <el-empty v-else description="暂无数据"></el-empty>
            </div>
            <el-pagination
              :small="false"
admin-web/src/views/stock/accessStock/outbound/index.vue
@@ -55,7 +55,7 @@
                    </el-card>
                  </el-col>
                </el-row>
                <div class="no-data" v-else>暂无数据</div>
                <el-empty v-else description="暂无数据"></el-empty>
              </div>
            </div>
admin-web/src/views/stock/procure/purchaseOrder/index.vue
@@ -75,7 +75,7 @@
                    </el-card>
                  </el-col>
                </el-row>
                <div class="no-data" v-else>暂无数据</div>
                <el-empty v-else description="暂无数据"></el-empty>
              </div>
            </div>
admin-web/src/views/stock/procure/receiptDetails/index.vue
@@ -160,7 +160,7 @@
        // 列信息
        columns: [
          { title: '单号', field: 'businessFormCode', align: 'center', width: 130 },
          { title: '物品名称', field: 'goodsTemplateName', align: 'left', width: 140 },
          { title: '物品名称', field: 'goodsTemplateName', align: 'left', minWidth: 140 },
          { title: '规格型号', field: 'baseGoodsModelsName', align: 'left', width: 130 },
          {
            title: '单价',
admin-web/src/views/stock/transfer/transferApplication/index.vue
@@ -87,7 +87,7 @@
                  </el-card>
                </el-col>
              </el-row>
              <div class="no-data" v-else>暂无数据</div>
              <el-empty v-else description="暂无数据"></el-empty>
            </div>
            <el-pagination
              :small="false"
admin-web/src/views/stock/transfer/transferissue/index.vue
@@ -76,7 +76,7 @@
                  </el-card>
                </el-col>
              </el-row>
              <div class="no-data" v-else>暂无数据</div>
              <el-empty v-else description="暂无数据"></el-empty>
            </div>
            <el-pagination
              :small="false"
@@ -203,6 +203,7 @@
    fetchData() {
      this.loading = true;
      transferList({
        qryType: 0,
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        ...this.filterFrom,
admin-web/vue.config.js
@@ -27,7 +27,7 @@
  transpileDependencies: ['element-ui', 'vuex', 'js-cookie', '@babel', 'resize-detector'],
  publicPath: './',
  // publicPath: '/',
  outputDir: 'psmWeb',
  outputDir: 'lowConsumWeb',
  assetsDir: 'static',
  lintOnSave: process.env.NODE_ENV === 'development',
  productionSourceMap: false,