haoyahui
2023-11-27 0ec6c7ee0b8236cbc6f49a8cc0e466099a09e08d
admin-web/src/views/stock/procure/purchaseOrder/index.vue
@@ -120,7 +120,7 @@
import edit from './edit';
import detail from './detail';
import { getBaseUrl } from '@/utils/base';
import listPage from '../../../mixins/listPage'
import listPage from '../../../mixins/listPage';
export default {
  name: 'index',
@@ -140,12 +140,25 @@
          placeholder: '请输入',
          defaultValue: '',
        },
        // {
        //   type: 'text',
        //   dataIndex: 'goodsTemplateName',
        //   label: '物品名称',
        //   placeholder: '可模糊搜索',
        //   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',
@@ -219,6 +232,9 @@
      },
    };
  },
  created(){
    this.fetchData()
  },
  methods: {
    fetchData() {
      this.loading = true;
@@ -249,17 +265,29 @@
    },
    // 入库
    handleIncome(row) {
      this.$confirm(`您确定 单号:${row.businessFormCode}  入库吗?`, '采购入库').then(() => {
        procureIncome({ id: row.id })
          .then((res) => {
            this.$message.success('入库成功!');
            this.search();
          })
          .catch(() => {});
      this.$confirm(`您确定 单号:${row.businessFormCode}  入库吗?`, '采购入库', {
        beforeClose: (action, instance, done) => {
          if (action == 'confirm') {
            instance.confirmButtonLoading = true;
            instance.confirmButtonText = '执行中...';
            procureIncome({ id: row.id })
              .then((res) => {
                this.$message.success('入库成功!');
                done();
                instance.confirmButtonLoading = false;
                this.search();
              })
              .catch(() => {
                done();
              });
          } else {
            done();
          }
        },
      });
    },
    del(row) {
      this.$modal.confirm('是否确认删除入库单号为"' + row.businessFormCode + '"的数据吗?').then( () => {
      this.$modal.confirm('是否确认删除入库单号为"' + row.businessFormCode + '"的数据吗?').then(() => {
        procureDel({ id: row.id })
          .then((res) => {
            this.$message.success('删除成功!');
@@ -275,9 +303,6 @@
      }
      if (this.filterFrom.incomeTimeEnd) {
        this.filterFrom.incomeTimeEnd = this.filterFrom.incomeTimeEnd.replace(/\-/g, '');
      }
      if (this.filterFrom.agencyId && this.filterFrom.agencyId.length) {
        this.filterFrom.agencyId = this.filterFrom.agencyId[this.filterFrom.agencyId.length - 1];
      }
      this.search(1);
    },