futian.liu
2023-12-20 854cbc47742ee83eb30062a12b9f3ed7c8ed0941
admin-web/src/views/departmentitem/itemscr/scrapping/index.vue
@@ -10,7 +10,7 @@
          <el-col>
            <!--列表-->
            <div class="table-tool-bar" style="margin-bottom: 15px;">
              <my-button name="新增" @click="handleAdd" site="tools" size="medium" />
              <my-button name="新增" @click="handleAdd" site="tools" size="medium"/>
            </div>
            <div :style="{ 'overflow-y': 'auto', height: 'calc(100vh - 352px)' }" v-loading="loading">
              <el-row v-if="list.length" class="card" :gutter="5">
@@ -23,28 +23,31 @@
                          <span class="value">{{ item.businessFormCode }}</span>
                        </div>
                        <div class="card-header-right">
                            <el-button site="form" type="success" size="mini" @click="handleExport(item)"
                              >导出报废登记单</el-button
                            >
                          <el-button site="form" type="success" size="mini"
                                     @click="handleExport('deptScrappedExport',`部门物品报废登记单-${item.businessFormCode}`,{id:item.id})"
                          >导出报废登记单
                          </el-button
                          >
                          <el-button name="查看详情" site="form" type="info" size="mini" @click="handleDetail(item)"
                            >查看详情</el-button
                          >查看详情
                          </el-button
                          >
                        </div>
                      </div>
                      <div class="one-hed">
                        <div class="box"><span class="span-two">部门:</span>{{ item.agencyName }}</div>
                        <div class="box"><span class="span-two">部门:</span>{{ item.departmentName }}</div>
                        <div class="box"><span class="span-two">操作人:</span>{{ item.operatorName }}</div>
                        <div class="box">
                          <span class="span-two">报废时间:</span>{{ item.dealTime | formatTime }}
                        </div>
                      </div>
                      <div class="card-end">
                        <div v-for="(just, index) in item.formOutputTemplateInfoList" :key="index" class="item">
                          <div class="name">{{ just.goodsName }}</div>
                        <div v-for="(just, index) in item.goods" :key="index" class="item">
                          <div class="name">{{ just.baseGoodsTemplateName }}</div>
                          <div class="value-box">
                            <div class="value-box-item">
                              <span class="label">数量:</span>
                              <span class="value">{{ just.count }}</span>
                              <span class="value">{{ just.totalCount }}</span>
                              <span class="unit">{{ just.unit }}</span>
                            </div>
                          </div>
@@ -57,37 +60,41 @@
              <el-empty v-else description="暂无数据"></el-empty>
            </div>
            <el-pagination
              :small="false"
              :current-page="pageNum"
              :page-sizes="[5, 10, 20, 50, 100, 200, 300, 400, 500]"
              :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper"
              :total="total"
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
                :small="false"
                :current-page="pageNum"
                :page-sizes="[5, 10, 20, 50, 100, 200, 300, 400, 500]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
            />
          </el-col>
        </el-row>
      </el-card>
    </el-container>
    <!--添加/编辑弹窗-->
    <edit v-if="editSetting.show" :setting="editSetting" ref="editRef" @close="editSetting.show=false" @search="refreshData"></edit>
    <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show=false" ref="detailRef"></detail>
    <edit v-if="editSetting.show" :setting="editSetting" ref="editRef" @close="editSetting.show=false"
          @search="refreshData"></edit>
    <detail v-if="detailSetting.show" :setting="detailSetting" @close="detailSetting.show=false"
            ref="detailRef"></detail>
  </div>
</template>
<script>
import {outputList} from '@/api/stock/accessStock';
import MyButton from '@/components/myButton/myButton';
import myImport from '@/views/components/myImport';
import edit from './edit';
import detail from './detail';
import listPage from '../../../mixins/listPage'
import listPage from '@/views/mixins/listPage'
import {getUserDetail} from "@/utils/auth";
import SettingIplatform from "@/utils/settingIplatform";
import {scrappedList} from '@/api/deptGoods/scrap';
export default {
  name: 'index',
  mixins: [listPage],
  components: { MyButton, myImport, edit, detail },
  components: {MyButton, myImport, edit, detail},
  data() {
    return {
      list: [],
@@ -102,23 +109,34 @@
        },
        {
          type: 'select',
          dataIndex: 'businessFormCode',
          dataIndex: 'inAgencyId',
          label: '分发部门',
          placeholder: '请选择',
          optionsConfig: {
            url: `/pc/fin/sys/tenant/department/list/all?tenantId=${getUserDetail().tenantId}`,
            label: 'name',
            value: 'id',
          },
          defaultValue: '',
          options: [],
        },
        {
          type: 'select',
          dataIndex: 'goodsTemplateId',
          label: '物品名称',
          placeholder: '请输入',
          defaultValue: '',
          options:[]
          options: [],
          optionsConfig: {
            label: 'goodsName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + `/pc/base/goods/template/query/goodsTemplate?tenantId=${getUserDetail().tenantId}`,
          },
        },
        {
          type: 'text',
          dataIndex: 'goodsName',
          label: '物品名称',
          placeholder: '可模糊搜索',
          defaultValue: '',
        },
        {
          type: 'text',
          dataIndex: 'createName',
          label: '报废人',
          dataIndex: 'operatorName',
          label: '创建人',
          placeholder: '请输入',
          defaultValue: '',
        },
@@ -137,10 +155,13 @@
      ],
    };
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      this.loading = true;
      outputList({
      scrappedList({
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        ...this.filterFrom,
@@ -148,20 +169,9 @@
        this.list = res.datas;
        this.total = res.totalRows;
        this.loading = false;
      }).catch(()=>{
        this.loading = false;
      });
    },
    fifterForm(params) {
      this.filterFrom = Object.assign(this.filterFrom, params);
      if (this.filterFrom.startTime) {
        this.filterFrom.startTime = this.filterFrom.startTime.replace(/\-/g, '');
      }
      if (this.filterFrom.endTime) {
        this.filterFrom.endTime = this.filterFrom.endTime.replace(/\-/g, '');
      }
      if (this.filterFrom.agencyId&&this.filterFrom.agencyId.length) {
        this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
      }
      this.search(1);
    },
  },
};