CD配唱片
2025-04-25 40156cbae622671684543e0899c381f0b22a4bb4
提交新内容和修正
已修改5个文件
308 ■■■■ 文件已修改
.env.development 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/calendar/index.vue 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/gasPlanning/index.vue 280 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/gasProduceStatics/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/mainPlan/platePlanList/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -10,3 +10,4 @@
# 配合后端服务
# VITE_APP_LOCAL = 'int'
# VITE_APP_LOCAL = 'zhl'
VITE_APP_LOCAL = 'hjy'
src/views/basicData/calendar/index.vue
@@ -102,6 +102,10 @@
              <span v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 工作日;&nbsp;</span>
              <span v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 非工作日;&nbsp;</span>
            </span>
            <!-- <div v-for="(item, index) in JSON.parse(row.content.value).weekdays" :key="index">
              <vxe-tag v-if="item.work==='y'" status="success" class="mart5">{{item.chineseName}}: 工作日;&nbsp;</vxe-tag>
              <vxe-tag v-if="item.work==='n'" status="info" class="mart5">{{item.chineseName}}: 非工作日;&nbsp;</vxe-tag>
            </div> -->
        </div>
        <div v-if="row.type === '2'">
            <div>{{JSON.parse(row.content.value).holidays.startdate}}至{{JSON.parse(row.content.value).holidays.enddate}}</div>
@@ -424,26 +428,26 @@
  {
    title: "日历类型",
    field: "type",
    width: 150,
    width: 200,
    align: "center",
    slots: { default: "status" },
  },
  {
    title: "日历生效时间",
    field: "effectiveDate",
    width: 100,
    width: 200,
    align: "center",
  },
  {
    title: "日历失效时间",
    field: "expiringDate",
    width: 150,
    width: 200,
    align: "center",
  },
  {
    title: "日历内容",
    field: "content",
    width: 200,
    width: 230,
    align: "center",
    slots: { default: "mark" },
  },
@@ -470,7 +474,7 @@
  {
    title: '适用车间',
    field: 'applicableWorkshop',
    width: 150,
    width: 200,
    align: 'center',
    formatter: (({ cellValue, row, column }) => {
     
@@ -488,19 +492,19 @@
  {
    title: "适用工序",
    field: "applicableProcess",
    width: 90,
    width: 200,
    align: "center",
  },
  {
    title: "创建者",
    field: "createBy",
    width: 90,
    width: 200,
    align: "center",
  },
  {
    title: "创建时间",
    field: "createTime",
    width: 90,
    width: 200,
    align: "center",
  },
  { title: '操作', width: 100, fixed:"right", slots: { default: 'buttons' }, align: 'center' }
src/views/mainPlan/gasPlanning/index.vue
@@ -51,11 +51,11 @@
        </HxlhTable> -->
        <vxe-table
          border
          ref="xTable"
          ref="tableRef"
          show-overflow
          :loading="loading"
          :height="height"
          :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
          :edit-config="{ trigger: 'manual', mode: 'row', showStatus: true }"
          :data="routePlanList"
          @cell-click="cellClickEvent"
        >
@@ -69,7 +69,10 @@
            :edit-render="{ }"
          >
            <template #edit="{ row }">
              <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select>
              <vxe-select
                v-model="row.dayProduceType"
                :options="dayProduceTypeOptions"
              ></vxe-select>
            </template>
            <template #default="{ row }">
              <span>{{ formatTypeLabel([row.dayProduceType]) }}</span>
@@ -82,10 +85,7 @@
            :edit-render="{ autoFocus: 'input' }"
          >
            <template #edit="{ row }">
              <el-input-number
                v-model="row.dayProduceNum"
                size="mini"
              />
              <el-input-number v-model="row.dayProduceNum" size="mini" />
            </template>
          </vxe-column>
          <vxe-column
@@ -105,9 +105,7 @@
            :edit-render="{ autoFocus: 'input' }"
          >
            <template #edit="{ row }">
              <el-input-number
                v-model="row.personnelNumber"
              />
              <el-input-number v-model="row.personnelNumber" />
            </template>
          </vxe-column>
          <vxe-column
@@ -117,10 +115,7 @@
            :edit-render="{ autoFocus: 'input' }"
          >
            <template #edit="{ row }">
              <el-input-number
                v-model="row.dayProduceAllNum"
                disabled
              />
              <el-input-number v-model="row.dayProduceAllNum" disabled />
            </template>
          </vxe-column>
          <vxe-column
@@ -153,6 +148,22 @@
              <el-input type="textarea" v-model="row.remark" />
            </template>
          </vxe-column>
          <vxe-column title="操作" width="200" fixed="right">
            <!-- <template #default="{ row }">
                <vxe-button @click="handleSave(row)" :loading="row.loading"
                  >保存</vxe-button
                > -->
            <template #default="{ row }">
              <template v-if="hasEditStatus(row)">
                <el-button @click="saveRowEvent(row)" size="small">保存</el-button>
                <el-button @click="cancelRowEvent()" size="small">取消</el-button>
              </template>
              <template v-else>
                <el-button @click="editRowEvent(row)" size="small">编辑</el-button>
              </template>
            </template>
            <!-- </template> -->
          </vxe-column>
        </vxe-table>
      </div>
    </div>
@@ -169,9 +180,9 @@
        </HxlhTable> -->
         <vxe-table
          border
          ref="xTable"
          ref="tableRef1"
          show-overflow
          :loading="loading"
          :loading="loading2"
          :height="height"
          :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }"
          :data="gasPlanList"
@@ -187,7 +198,10 @@
            :edit-render="{ }"
          >
            <template #edit="{ row }">
              <vxe-select v-model="row.dayProduceType" :options="dayProduceTypeOptions"></vxe-select>
              <vxe-select
                v-model="row.dayProduceType"
                :options="dayProduceTypeOptions"
              ></vxe-select>
            </template>
            <template #default="{ row }">
              <span>{{ formatTypeLabel([row.dayProduceType]) }}</span>
@@ -200,10 +214,7 @@
            :edit-render="{ autoFocus: 'input' }"
          >
            <template #edit="{ row }">
              <el-input-number
                v-model="row.dayProduceNum"
                size="mini"
              />
              <el-input-number v-model="row.dayProduceNum" size="mini" />
            </template>
          </vxe-column>
          <vxe-column
@@ -223,9 +234,7 @@
            :edit-render="{ autoFocus: 'input' }"
          >
            <template #edit="{ row }">
              <el-input-number
                v-model="row.personnelNumber"
              />
              <el-input-number v-model="row.personnelNumber" />
            </template>
          </vxe-column>
          <vxe-column
@@ -235,9 +244,7 @@
            :edit-render="{ autoFocus: 'input' }"
          >
            <template #edit="{ row }">
              <el-input-number
                v-model="row.dayProduceAllNum"
              />
              <el-input-number v-model="row.dayProduceAllNum" />
            </template>
          </vxe-column>
          <vxe-column
@@ -270,10 +277,26 @@
              <el-input type="textarea" v-model="row.remark" />
            </template>
          </vxe-column>
          <vxe-column title="操作" width="200" fixed="right">
            <!-- <template #default="{ row }">
                <el-button @click="handleSave(row)" :loading="row.loading"
                  >保存</el-button
                > -->
            <template #default="{ row }">
              <template v-if="hasEditStatus1(row)">
                <el-button @click="saveRowEvent1(row)" size="small">保存</el-button>
                <el-button @click="cancelRowEvent1()" size="small">取消</el-button>
              </template>
              <template v-else>
                <el-button @click="editRowEvent1(row)" size="small">编辑</el-button>
              </template>
            </template>
            <!-- </template> -->
          </vxe-column>
        </vxe-table>
        <div class="btn_center">
          <el-button type="primary" @click="handleSave">保存</el-button>
        </div>
        <!-- <div class="btn_center">
          <el-button type="primary" @click="handleSave2">保存</el-button>
        </div> -->
      </div>
    </div>
  </div>
@@ -286,11 +309,14 @@
import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning";
const height = ref(document.documentElement.clientHeight - 400 + "px;");
const loading = ref(false);
const loading2 = ref(false);
const data = reactive({
  queryParams: {
    date: "",
  },
});
const tableRef = ref()
const tableRef1 = ref()
const { queryParams } = toRefs(data);
const gasPlanList = ref([]);
const routePlanList = ref([]);
@@ -300,13 +326,17 @@
]);
const formatTypeLabel = (list) => {
  if (list) {
    return list.map(type => {
      const item = dayProduceTypeOptions.value.find(item => item.value === type)
      return item ? item.label : type
    }).join(',')
    return list
      .map((type) => {
        const item = dayProduceTypeOptions.value.find(
          (item) => item.value === type
        );
        return item ? item.label : type;
      })
      .join(",");
  }
  return ''
}
  return "";
};
// 表格配置
// const columns = ref([
//   // {
@@ -378,6 +408,68 @@
//     type: "html",
//   },
// ]);
const hasEditStatus = (row) => {
  const $table = tableRef.value
  if ($table) {
    return $table.isEditByRow(row)
  }
}
const editRowEvent = (row) => {
  const $table = tableRef.value
  if ($table) {
    $table.setEditRow(row)
  }
}
const saveRowEvent = (row) => {
  const $table = tableRef.value
  if ($table) {
    $table.clearEdit().then(() => {
      // loading.value = true
      // setTimeout(() => {
      //   loading.value = false
      //   VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' })
      // }, 300)
      handleSave(row)
    })
  }
}
const cancelRowEvent = () => {
  const $table = tableRef.value
  if ($table) {
    $table.clearEdit()
  }
}
const hasEditStatus1 = (row) => {
  const $table = tableRef1.value
  if ($table) {
    return $table.isEditByRow(row)
  }
}
const editRowEvent1 = (row) => {
  const $table = tableRef1.value
  if ($table) {
    $table.setEditRow(row)
  }
}
const saveRowEvent1 = (row) => {
  const $table = tableRef1.value
  if ($table) {
    $table.clearEdit().then(() => {
      // loading.value = true
      // setTimeout(() => {
      //   loading.value = false
      //   VxeUI.modal.message({ content: `保存成功!name=${row.name}`, status: 'success' })
      // }, 300)
      handleSave2(row)
    })
  }
}
const cancelRowEvent1 = () => {
  const $table = tableRef1.value
  if ($table) {
    $table.clearEdit()
  }
}
async function getRouteList(year, month) {
  const res = await listGasPlan({
    major: "管路",
@@ -395,10 +487,14 @@
      personnelNumber:
        item.personnelNumber == null ? "1" : item.personnelNumber,
      dayProduceAllNum:
        item.dayProduceAllNum == null ? "0" : item.dayProduceNum*item.personnelNumber,
        item.dayProduceAllNum == null
          ? "0"
          : item.dayProduceNum * item.personnelNumber,
      days: item.days == null ? "22" : item.days,
      monthProduceAllNum:
        item.monthProduceAllNum == null ? "0" : item.dayProduceAllNum*item.days,
        item.monthProduceAllNum == null
          ? "0"
          : item.dayProduceAllNum * item.days,
    };
  });
  loading.value = false;
@@ -420,55 +516,109 @@
      personnelNumber:
        item.personnelNumber == null ? "1" : item.personnelNumber,
      dayProduceAllNum:
        item.dayProduceAllNum == null ? "0" : item.dayProduceNum*item.personnelNumber,
        item.dayProduceAllNum == null
          ? "0"
          : item.dayProduceNum * item.personnelNumber,
      days: item.days == null ? "22" : item.days,
      monthProduceAllNum:
        item.monthProduceAllNum == null ? "0" : item.dayProduceAllNum*item.days,
        item.monthProduceAllNum == null
          ? "0"
          : item.dayProduceAllNum * item.days,
    };
  });
  loading.value = false;
  loading2.value = false;
}
function cellClickEvent ({ row, column }){
  console.log(column,row)
  row.dayProduceAllNum = row.dayProduceNum*row.personnelNumber
  row.monthProduceAllNum = row.dayProduceAllNum*row.days
  console.log(column, row);
  row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber;
  row.monthProduceAllNum = row.dayProduceAllNum * row.days;
}
function handleQuery() {
  if(!queryParams.value.date){
    ElMessage({
      message: "请选择年月",
      type: "error",
    });
    return;
  }
  console.log(queryParams.value.date, "scsciciisc");
  const year = queryParams.value.date.split("-")[0];
  const month = parseInt(queryParams.value.date.split("-")[1]);
  getRouteList(year, month);
  getGasList(year, month);
}
async function handleSave() {
function resetQuery() {
  queryParams.value.date = ""
}
async function handleSave(row) {
  const year = queryParams.value.date.split("-")[0];
  const month = parseInt(queryParams.value.date.split("-")[1]);
  gasPlanList.value = gasPlanList.value.map((item)=>{
    return {
      ...item,
      major: "气体",
      year,
      month
    }
  })
  routePlanList.value = routePlanList.value.map((item)=>{
    return {
      ...item,
  console.log(row, "baocun");
  // gasPlanList.value = gasPlanList.value.map((item) => {
  //   return {
  //     ...item,
  //     major: "气体",
  //     year,
  //     month,
  //   };
  // });
  // routePlanList.value = routePlanList.value.map((item) => {
  //   return {
  //     ...item,
  //     major: "管路",
  //     year,
  //     month,
  //   };
  // });
  const res = await getGasPlanSave([
    {
      ...row,
      major: "管路",
      year,
      month
    }
  })
 const res = await getGasPlanSave([
  ...gasPlanList.value,
  ...routePlanList.value
 ])
      month,
    },
  ]);
 ElMessage({
    message: "数据保存成功",
    type: "success",
  });
  handleQuery()
 console.log(res,"akiwjciwj")
  handleQuery();
  console.log(res, "akiwjciwj");
}
async function handleSave2(row) {
  const year = queryParams.value.date.split("-")[0];
  const month = parseInt(queryParams.value.date.split("-")[1]);
  console.log(row, "baocun");
  // gasPlanList.value = gasPlanList.value.map((item) => {
  //   return {
  //     ...item,
  //     major: "气体",
  //     year,
  //     month,
  //   };
  // });
  // routePlanList.value = routePlanList.value.map((item) => {
  //   return {
  //     ...item,
  //     major: "管路",
  //     year,
  //     month,
  //   };
  // });
  const res = await getGasPlanSave([
    {
      ...row,
      major: "气体",
      year,
      month,
    },
  ]);
  ElMessage({
    message: "数据保存成功",
    type: "success",
  });
  handleQuery();
  console.log(res, "akiwjciwj");
}
onMounted(() => {
  // getRouteList();
src/views/mainPlan/gasProduceStatics/index.vue
@@ -29,7 +29,7 @@
            <el-date-picker
              v-model="queryParams.monthRange"
              type="monthrange"
              range-separator="To"
              range-separator="至"
              start-placeholder="选择开始月份"
              end-placeholder="选择结束月份"
            />
src/views/mainPlan/platePlanList/index.vue
@@ -306,6 +306,11 @@
      },
    },
  ]);
  newArray.splice(2,0,{
     title: "焊接件齐套开始时间",
     field:"hanjie_startDate",
     width: 140,
  })
  await nextTick();
  columns.value = [...columns.value, ...newArray];              // 强制组件重新渲染