licp
2024-04-25 903701080f23eea451841250e6b54541aabd6452
src/views/plan/customerorder/index.vue
@@ -18,7 +18,7 @@
            @command="documentHandle"
            style="margin-left: 10px"
          >
            <el-button>
            <el-button style="padding: 9px 14px;">
              工艺文件<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
@@ -38,7 +38,7 @@
            @command="handleCommitCommand"
            style="margin-left: 10px"
          >
            <el-button>
            <el-button style="padding: 9px 14px;">
              审核状态改变<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
@@ -52,11 +52,23 @@
            </el-dropdown-menu>
          </el-dropdown>
          <el-button
            style="margin-left: 10px"
            style="margin-left: 10px;padding: 9px 14px;"
            type="primary"
            @click="() => (exportDialogVisible = true)"
            >导出台账</el-button
          >
          <el-button
            style="margin-left: 10px;padding: 9px 14px;"
            type="primary"
            @click="handleCheck"
            >审核</el-button
          >
          <!-- <el-button
            style="margin-left: 10px"
            type="primary"
            @click="() => ($refs.technology.init())"
            >编写技术交底单</el-button
          > -->
        </template>
      </ttable>
      <!-- 弹窗, 日期选择 -->
@@ -347,6 +359,7 @@
        ></el-table-column>
      </el-table>
    </el-dialog>
    <technology-form ref="technology"></technology-form>
  </div>
</template>
@@ -358,6 +371,7 @@
} from '@/api/plan/customerOrderInterrelated'
import ConfirmPullCustomerorder from './confirm-pull-customerorder'
import TableForm from './customerorder-form'
import TechnologyForm from './technology-form.vue'
import TableFormDEesc from './customerorder-form-desc'
import SampleTableForm from './sample-customerorder-form'
import { mapGetters } from 'vuex'
@@ -400,6 +414,7 @@
      interrelatedOrderId: null,
      interrelatedOrderData: [],
      showInterrelatedOrderDialog: false,
      technologyDialog:true,
      uniqueStateArr: [],
      dataForm: {
        selectTime: null,
@@ -586,7 +601,7 @@
            sort: true,
            isTrue: true,
            isSearch: true,
            searchInfoType: 'text',
            searchInfoType: 'date',
            formatter: this.formatDutyDate,
          },
          {
@@ -788,19 +803,19 @@
          //   size: 'small',
          //   fun: this.packageExportHandle
          // },
          {
            text: '审核',
            type: 'text',
            size: 'small',
            fun: this.checkHandOrder,
            showFun: (row) => {
              return row.sourceId === '1'
            },
            show: {
              val: [false],
              key: 'isPass',
            },
          },
        //   {
        //     text: '审核',
        //     type: 'text',
        //     size: 'small',
        //     fun: this.checkHandOrder,
        //     showFun: (row) => {
        //       return row.sourceId === '1'
        //     },
        //     show: {
        //       val: [false],
        //       key: 'isPass',
        //     },
        //   },
          {
            text: '已关联订单',
            type: 'text',
@@ -963,6 +978,7 @@
    SalesPartBatchDialog,
    TableFormDEesc,
    CustomerorderReturnDialog,
    TechnologyForm,
  },
  computed: {
    ...mapGetters(['permissions']),
@@ -1001,6 +1017,7 @@
  created() {
    // this.getManufactureAttrs()
    this.getTitles()
    if (this.permissions.plan_customerorder_add) {
    this.table.toolbar.push({
      text: '新增销售订单',
      type: 'primary',
@@ -1008,6 +1025,7 @@
      disabled: false,
      permitArr: [],
    })
    }
    if (this.permissions.customerorder_from_otc) {
      this.table.toolbar.push({
        text: '获取销售订单',
@@ -1036,20 +1054,25 @@
        permitArr: [],
      })
    }
    this.table.toolbar.push({
        text: '下载工艺文件',
        disabled: false,
        type: 'primary',
        fun: this.downloadWord,
        permitArr: ['03plan','04planed'],
    })
    this.table.toolbar.push({
        text: '下载排产单',
        disabled: false,
        type: 'primary',
        permitArr: [],
        fun: this.downloadProductionScheduling,
    })
    if(this.permissions.plan_download_process_file){
        this.table.toolbar.push({
            text: '下载工艺文件',
            disabled: false,
            type: 'primary',
            fun: this.downloadWord,
            permitArr: ['03plan','04planed'],
        })
    }
    if(this.permissions.plan_download_product_file){
        this.table.toolbar.push({
            text: '下载排产单',
            disabled: false,
            type: 'primary',
            permitArr: [],
            fun: this.downloadProductionScheduling,
        })
    }
    if(this.permissions.plan_relevance_order){
    this.table.toolbar.push({
      text: '关联订单',
      disabled: false,
@@ -1057,6 +1080,7 @@
      fun: this.interrelatedOrderFun,
      permitArr: [],
    })
    }
    if (this.permissions.customerorder_create_masterplan) {
      this.table.toolbar.push({
        text: '主生产计划',
@@ -1181,8 +1205,9 @@
      this.getData()
    },
    getData() {
      this.$refs.customerOrderTable.getDataList()
    async getData() {
      await this.$refs.customerOrderTable.getDataList()
      this.$refs.customerOrderTable.toggleRowExpansion()
    },
    // 获取数据列表去除已完成状态的
    handleDataList(command) {
@@ -1926,6 +1951,40 @@
        this.$message.error('请先选择日期')
      }
    },
    handleCheck(){
        if (this.multipleSelection.length > 0) {
            for(let i=0 ;i<this.multipleSelection.length;i++){
                if(this.multipleSelection[i].sourceId==0){
                    this.$message.error('请选择手动输入的销售订单')
                    return;
                }
                if(this.multipleSelection[i].isPass){
                    this.$message.error('请选择未审核通过的销售订单')
                    return;
                }
            }
            this.$confirm('确认审核通过选中的销售订单吗?', '提示', {
                confirmButtonText: '通过',
                cancelButtonText: '取消',
                type: 'warning',
            })
                .then(() => {
                checkHanderOrder(this.multipleSelection)
                    .then((res) => {
                    if (res.status === 200) {
                        this.$message.success('审核通过')
                        this.getData()
                    }
                    })
                    .catch((error) => {
                    console.error(error)
                    })
                })
                .catch(() => {})
        } else {
            this.$message.error('请选择至少一条销售订单')
        }
    }
  },
}
</script>