gaoluyang
2 天以前 14f694d913698b5e04b09f6e6df789cbd1102937
src/views/productionManagement/productionReporting/index.vue
@@ -4,10 +4,12 @@
         <el-form :model="searchForm" :inline="true">
            <el-form-item label="客户名称:">
               <el-input v-model="searchForm.customerName" placeholder="请输入" clearable prefix-icon="Search"
                              style="width: 200px;"
                              @change="handleQuery" />
            </el-form-item>
            <el-form-item label="项目名称:">
               <el-input v-model="searchForm.projectName" placeholder="请输入" clearable prefix-icon="Search"
                              style="width: 200px;"
                              @change="handleQuery" />
            </el-form-item>
            <el-form-item label="排产日期:">
@@ -17,7 +19,7 @@
            <el-form-item label="状态:">
               <el-select v-model="searchForm.status" placeholder="请选择状态" style="width: 140px" clearable>
                  <el-option label="待生产" :value="1"></el-option>
                  <el-option label="已报工" :value="0"></el-option>
                  <el-option label="已报工" :value="3"></el-option>
                  <el-option label="生产中" :value="2"></el-option>
               </el-select>
            </el-form-item>
@@ -29,6 +31,7 @@
      <div class="table_list">
         <div style="text-align: right" class="mb10">
            <el-button type="primary" @click="openForm('add')">生产报工</el-button>
            <el-button @click="handleOut">导出</el-button>
         </div>
         <PIMTable
            rowKey="id"
@@ -57,7 +60,7 @@
                     type="index"
                     width="60"
                  />
                  <el-table-column label="本次生产数量" prop="finishedNum" align="center">
                  <el-table-column label="本次生产数量" prop="finishedNum" align="center" width="400">
                     <template #default="scope">
                        <el-input-number :step="0.01" :min="0" style="width: 100%"
                                                 v-model="scope.row.finishedNum"
@@ -70,7 +73,7 @@
                     </template>
                  </el-table-column>
<!--                  <el-table-column label="待生产数量" prop="pendingNum" width="240" align="center"></el-table-column>-->
                  <el-table-column label="生产人" prop="schedulingUserId" width="240">
                  <el-table-column label="生产人" prop="schedulingUserId" width="400">
                     <template #default="scope">
                        <el-select
                           v-model="scope.row.schedulingUserId"
@@ -87,7 +90,7 @@
                        </el-select>
                     </template>
                  </el-table-column>
                  <el-table-column label="生产日期" prop="schedulingDate" width="240">
                  <el-table-column label="生产日期" prop="schedulingDate" width="400">
                     <template #default="scope">
                        <el-date-picker
                           v-model="scope.row.schedulingDate"
@@ -109,6 +112,7 @@
                           size="small"
                           @click="changeEditType(scope.row)"
                           v-if="!scope.row.editType"
                           :disabled="scope.row.parentStatus === 3"
                        >编辑</el-button
                        >
                        <el-button
@@ -145,12 +149,9 @@
const data = reactive({
   searchForm: {
      staffName: "",
      entryDate: [
         dayjs().format("YYYY-MM-DD"),
         dayjs().add(1, "day").format("YYYY-MM-DD"),
      ], // 录入日期
      entryDateStart: dayjs().format("YYYY-MM-DD"),
      entryDateEnd: dayjs().add(1, "day").format("YYYY-MM-DD"),
      entryDate: null, // 录入日期
      entryDateStart: undefined,
      entryDateEnd: undefined,
   },
});
const { searchForm } = toRefs(data);
@@ -168,7 +169,7 @@
      prop: "status",
      dataType: "tag",
      formatData: (params) => {
         if (params == 0) {
         if (params == 3) {
            return "已报工";
         } else if (params == 1) {
            return "待生产";
@@ -177,7 +178,7 @@
         }
      },
      formatType: (params) => {
         if (params == 0) {
         if (params == 3) {
            return "success";
         } else if (params == 1) {
            return "primary";
@@ -314,7 +315,8 @@
               if (index > -1) {
                  expandData.value = res.data.map(item => ({
                     ...item,
                     pendingNum: (Number(item.schedulingNum) || 0) - (Number(item.finishedNum) || 0)
                     pendingNum: (Number(item.schedulingNum) || 0) - (Number(item.finishedNum) || 0),
                     parentStatus: row.status // 新增父表状态
                  }));
               }
               expandedRowKeys.value.push(row.id);
@@ -412,7 +414,7 @@
      type: "warning",
   })
      .then(() => {
         proxy.download("/staff/staffJoinLeaveRecord/export", {staffState: 1}, "人员入职.xlsx");
         proxy.download("/salesLedger/work/export", {}, "生产报工.xlsx");
      })
      .catch(() => {
         proxy.$modal.msg("已取消");