pengwei
2025-03-20 2591e298a3fd1332ad0ca33059f6ba0b7d426f51
ÏîÄ¿´úÂë/client/src/views/tts/TheCurrentJob/Thecurrentjob.vue
@@ -3,18 +3,21 @@
    <div class="content">
      <div class="checkbox">
        <div
          v-if="show == '超级' || show == '机械'"
          :class="['item', isactive == '机械' ? 'isactive' : '']"
          @click="changeactive('机械')"
        >
          æœºæ¢°
        </div>
        <div
          v-if="show == '超级' || show == '电气'"
          :class="['item', isactive == '电气' ? 'isactive' : '']"
          @click="changeactive('电气')"
        >
          ç”µæ°”
        </div>
        <div
          v-if="show == '超级' || show == '地沟'"
          :class="['item', isactive == '地沟' ? 'isactive' : '']"
          @click="changeactive('地沟')"
        >
@@ -59,7 +62,7 @@
            size="small"
          />
        </div>
        <!-- <div class="serch_box">
        <div class="serch_box">
          <div class="serchb">
            <el-select
              v-model="queryForm.selectType"
@@ -80,7 +83,7 @@
            placeholder="请输入关键词搜索"
            style="border-left: 0.06rem solid #e2e2e2"
          />
        </div> -->
        </div>
        <el-button
          @click="handleQuery"
          type="primary"
@@ -201,11 +204,15 @@
            label="派工日期"
            align="center"
          />
          <el-table-column
            prop="finishedtime"
            label="完成日期"
            align="center"
          />
          <el-table-column prop="finishedtime" label="完成日期" align="center">
            <template #default="scope">
              {{
                scope.row.finishedtime != "1900-01-01 00:00:00"
                  ? scope.row.finishedtime
                  : ""
              }}
            </template></el-table-column
          >
          <el-table-column label="操作" align="center">
            <template #default="scope">
              <el-button
@@ -224,7 +231,7 @@
                v-if="scope.row.pustatus == 1"
                size="small"
                type="text"
                @click="router.push('/Startjob')"
                @click="toDetail(scope.row, isactive)"
                >开始作业</el-button
              >
              <el-button
@@ -344,11 +351,15 @@
            label="派工日期"
            align="center"
          />
          <el-table-column
            prop="finishedtime"
            label="完成日期"
            align="center"
          />
          <el-table-column prop="finishedtime" label="完成日期" align="center">
            <template #default="scope">
              {{
                scope.row.finishedtime != "1900-01-01 00:00:00"
                  ? scope.row.finishedtime
                  : ""
              }}
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template #default="scope">
              <el-button
@@ -367,7 +378,7 @@
                v-if="scope.row.pustatus == 1"
                size="small"
                type="text"
                @click="claim(scope.row, 2)"
                @click="toDetail(scope.row, isactive)"
                >开始作业</el-button
              >
              <el-button
@@ -487,11 +498,15 @@
            label="派工日期"
            align="center"
          />
          <el-table-column
            prop="finishedtime"
            label="完成日期"
            align="center"
          />
          <el-table-column prop="finishedtime" label="完成日期" align="center">
            <template #default="scope">
              {{
                scope.row.finishedtime != "1900-01-01 00:00:00"
                  ? scope.row.finishedtime
                  : ""
              }}
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center">
            <template #default="scope">
              <el-button
@@ -510,7 +525,7 @@
                v-if="scope.row.pustatus == 1"
                size="small"
                type="text"
                @click="claim(scope.row, 2)"
                @click="toDetail(scope.row, isactive)"
                >开始作业</el-button
              >
              <el-button
@@ -638,9 +653,7 @@
      <template #footer>
        <div class="dialog-footer" style="text-align: right">
          <el-button @click="claimdialogVisible2 = false">取消</el-button>
          <el-button type="primary" @click="claimdialogVisible = false">
            ç¡®è®¤
          </el-button>
          <el-button type="primary" @click="changeStatus"> ç¡®è®¤ </el-button>
        </div>
      </template>
    </el-dialog>
@@ -685,13 +698,19 @@
  </div>
</template>
<script setup>
import { ref, reactive, onMounted } from "vue";
import { ref, reactive, onMounted, toRef } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { useRouter } from "vue-router";
import { GetPageData, ExportApi } from "@/api/newapi/Thecurrentjob";
import { formatTime } from "@/utils/index.js";
import { GetDetail, ChangeStatus } from "@/api/newapi/Thecurrentjob";
import {
  GetDetail,
  ChangeStatus,
  GetPageData,
  ExportApi,
  GetPageDataNew,
} from "@/api/newapi/Thecurrentjob";
import { GetSleeveandStep } from "@/api/newapi/Process";
import { GetUserInfo } from "@/api/user";
const router = useRouter();
const obj = {
@@ -700,12 +719,7 @@
  selectType: "",
  inputcontent: "",
};
const queryForm = ref({
  selectName: "",
  selectTime: [], // æ—¶é—´èŒƒå›´
  selectType: "",
  inputcontent: "",
});
const queryForm = toRef({ ...obj });
const selectoptions = ref([
  {
    value: "takename",
@@ -718,6 +732,14 @@
  {
    value: "gonzhang",
    label: "检修工长",
  },
  {
    value: "zhijianyuan",
    label: "质检员",
  },
  {
    value: "lijuzouyeyuan",
    label: "力矩作业员",
  },
]);
const tableData = ref([]);
@@ -763,21 +785,16 @@
  queryForm.selectType = value;
  initData();
};
//弹出框
const dialogVisible = ref(false);
//删除方法
const add = () => {
  dialogVisible.value = true;
};
//编辑方法
const Edit = () => {
  dialogVisible.value = true;
};
const claimdata = ref({
  id: "",
  gruops: "",
  creater: JSON.parse(localStorage.getItem("user")).userName,
  createDate: formatTime(new Date()),
});
const TTnum = ref(0);
//页面数
const pageTotal = ref(0);
//确认领取
const claim = (val, num) => {
  claimdata.value.id = val.njtakeid;
@@ -801,13 +818,17 @@
    }
  });
};
//改变状态
const changeStatus = () => {
  console.log(claimdata.value);
  ChangeStatus(claimdata.value).then((res) => {
    ElMessage({
      message: res.msg,
      message: "成功",
      type: "success",
    });
    claimdialogVisible.value = false;
    claimdialogVisible1.value = false;
    claimdialogVisible2.value = false;
    initData();
  });
};
@@ -825,7 +846,7 @@
  page: 1, //当前页面
  rows: 10, //每页显示条数
  order: "desc", //排序方式
  sort: "dispatchtime", //排序字段
  sort: "", //排序字段
  wheres: "", //条件查询
});
@@ -840,8 +861,18 @@
  pageQuery.value.page = val;
  initData();
};
const pageTotal = ref(0);
//数据初始化
const initData = () => {
  let obj = {
    userId: JSON.parse(localStorage.getItem("user")).id,
    group: isactive.value,
  };
  console.log(obj);
  // GetPageDataNew(obj).then((res) => {
  //   tableData.value = res.data;
  //   pageTotal.value = res.data.length;
  // });
  // æŸ¥è¯¢æ¡ä»¶
  const startTime = formatTime(queryForm.value.selectTime[0]);
  const endTime = formatTime(queryForm.value.selectTime[1]);
@@ -854,7 +885,7 @@
    {
      name: queryForm.value.selectType,
      value: queryForm.value.inputcontent,
      displayType: "String",
      displayType: "like",
    },
    {
      name: "pustatus",
@@ -872,7 +903,7 @@
    pageTotal.value = res.total;
  });
};
//打印数据
const printExcel = () => {
  // æŸ¥è¯¢æ¡ä»¶
  const startTime = formatTime(queryForm.value.selectTime[0]);
@@ -906,15 +937,44 @@
  pageQuery.value.page = 1;
  initData();
};
//重置检索事件
const resetQuery = () => {
  queryForm.value = Object.assign({}, obj);
  pageQuery.value.page = 1;
  initData();
};
//重置表单
const resetForm = (formEl) => {
  if (!formEl) return;
  formEl.resetFields();
};
const userInfo = ref("");
//路由跳转
const toDetail = (row, title) => {
  router.push({
    name: "Startjob",
    state: { info: JSON.stringify(row), title: title },
  });
};
const show = ref("");
const getuserinfo = () => {
  GetUserInfo().then((res) => {
    console.log(res);
    show.value = res.data.roleName.substring(0, 2);
    if (show.value != "超级") {
      isactive.value = show.value;
      initData();
    }
  });
};
//数据初始化
onMounted(() => {
  initData();
  getuserinfo();
  userInfo.value = JSON.parse(localStorage.getItem("user")).userName;
});
</script>