haoyahui
2023-11-22 9834dbff448908d2008d8c52a2544aad00c099b1
admin-web/src/views/stock/scrap/itemScrapping/index.vue
@@ -21,9 +21,7 @@
                        <div class="card-header-left">
                          <span>报废单号:</span>
                          <span class="value">{{ item.businessFormCode }}</span>
                          <div class="states" :class="item.states == 1 ? '' : 'states-success'">
                            {{ item.states == 1 ? '待报废' : '已报废' }}
                          </div>
                        </div>
                        <div class="card-header-right">
                          <el-button site="form" type="success" size="mini" @click="handleExport(item)"
@@ -35,15 +33,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.agencyName }}</div>
                        <div class="box"><span class="span-two">操作人:</span>{{ item.operatorName }}</div>
                        <div class="box">
                          <span class="span-two">报废时间:</span>{{ item.procureTime | formatTime }}
                          <span class="span-two">报废时间:</span>{{ item.dealTime | 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.goodTemplateInfo" :key="index" class="item">
                          <div class="name">{{ just.goodsName }}</div>
                          <div class="value-box">
                            <div class="value-box-item">
                              <span class="label">数量:</span>
@@ -86,20 +84,14 @@
      @close="detailSetting.show = false"
      ref="detailRef"
    ></detail>
    <my-import
      :import-setting="importSetting"
      :dialog-show="importSetting.dialogShow"
      :dialog-title="importSetting.dialogTitle"
    />
  </div>
</template>
<script>
import { procureList, procureDel, procureIncome } from '@/api/stock/procure/purchaseOrder';
import { scrappedList,  } from '@/api/stock/scrap';
import { getTree } from '@/api/baseSetting/finsystenant';
import MyButton from '@/components/myButton/myButton';
import SettingIplatform from '@/utils/settingIplatform';
import myImport from '@/views/components/myImport';
import edit from './edit';
import detail from './detail';
import { getBaseUrl } from '@/utils/base';
@@ -107,7 +99,7 @@
export default {
  name: 'index',
  components: { MyButton, myImport, edit, detail },
  components: { MyButton, edit, detail },
  data() {
    return {
      loading: false,
@@ -123,11 +115,17 @@
          defaultValue: '',
        },
        {
          type: 'text',
          dataIndex: 'goodsTemplateName',
          type: 'select',
          dataIndex: 'goodsTemplateId',
          label: '物品名称',
          placeholder: '可模糊搜索',
          placeholder: '请输入',
          defaultValue: '',
          options: [],
          optionsConfig: {
            label: 'goodsName',
            value: 'id',
            url: SettingIplatform.apiBaseURL + '/pc/base/goods/template/query/goodsTemplate',
          },
        },
        {
          type: 'cascader',
@@ -159,24 +157,6 @@
        userName: null,
        userPhone: null,
        states: null,
      },
      // 导入
      importSetting: {
        dialogTitle: '导入',
        dialogShow: false,
        fileSettings: {
          data: {},
          uploadUrl: getBaseUrl() + '/pc/fin/sys/tenant/import', // 上传地址
          accept: '.xls', // 格式
          type: 'text', // 回显形式
          loading: false, // 导入效果
        },
        /* 模板下载 */
        templateSettings: {
          templateName: '导入模板.xls', // 名称
          templateUrl: SettingIplatform.apiBaseURL + '/pc/fin/sys/tenant/getImportTemplate', // 下载地址
        },
        onSuccess: null,
      },
      editSetting: {
        title: '',
@@ -211,7 +191,7 @@
  methods: {
    fetchData() {
      this.loading = true;
      procureList({
      scrappedList({
        pageNum: this.pageNum,
        pageSize: this.pageSize,
        ...this.filterFrom,
@@ -245,38 +225,10 @@
      this.editSetting.title = '新增';
      this.editSetting.show = true;
    },
    // 编辑
    handleEdit(row) {
      this.editSetting.id = row.id;
      this.editSetting.info = null;
      this.editSetting.title = '编辑';
      this.editSetting.show = true;
    },
    // 详情
    handleDetail(row) {
      this.detailSetting.id = row.id;
      this.detailSetting.show = true;
    },
    // 报废
    handleIncome(row) {
      this.$confirm(`您确定 单号:${row.businessFormCode}  报废吗?`, '报废报废').then(() => {
        procureIncome({ id: row.id })
          .then((res) => {
            this.$message.success('报废成功!');
            this.search();
          })
          .catch(() => {});
      });
    },
    del(row) {
      this.$modal.confirm('是否确认删除报废单号为"' + row.businessFormCode + '"的数据吗?').then(() => {
        procureDel({ id: row.id })
          .then((res) => {
            this.$message.success('删除成功!');
            this.search();
          })
          .catch(() => {});
      });
    },
    // 分页
    handleSizeChange(pageSize) {
@@ -306,9 +258,6 @@
      }
      if (this.filterFrom.incomeTimeEnd) {
        this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
      }
      if (this.filterFrom.agencyId.length) {
        this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
      }
      this.search(1);
    },