123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500 |
- <template>
- <div class="tenant">
- <div class="content">
- <byTable
- :source="sourceList.data"
- :pagination="sourceList.pagination"
- :tableHeight="tableHeight"
- :config="config"
- :loading="loading"
- highlight-current-row
- :selectConfig="selectConfig"
- :table-events="{}"
- :action-list="[]"
- :onMoreSearch="true"
- @moreSearch="clickMoreSearch"
- @get-list="getList"
- >
- <template #finishStatus="{ item }">
- <div>
- <span
- style="padding: 4px; color: #fff"
- :class="[item.finishStatus == 1 ? 'active' : 'disActive']"
- >
- {{
- proxy.dictValueLabel(item.finishStatus, finishStatusData)
- }}</span
- >
- </div>
- </template>
- </byTable>
- </div>
- <el-dialog
- :title="'高级检索'"
- v-model="dialogVisible"
- width="700"
- v-loading="loading"
- destroy-on-close
- >
- <byForm
- :formConfig="formConfig"
- :formOption="formOption"
- v-model="sourceList.pagination"
- :rules="rules"
- ref="byform"
- >
- </byForm>
- <template #footer>
- <el-button @click="moreSearchReset" size="large">重置</el-button>
- <el-button @click="moreSearchQuery" type="primary" size="large"
- >搜索</el-button
- >
- </template>
- </el-dialog>
- <el-dialog
- :title="'查看工序图纸'"
- v-model="dialogVisibleOne"
- width="700"
- destroy-on-close
- >
- <div>
- <div
- v-for="(item, index) in allData"
- :key="item.id"
- style="margin-bottom: 20px"
- >
- <div style="margin-top: 5px">
- 工序名称:{{ item.productionProcessesName }}
- </div>
- <div style="margin-top: 5px">
- 工序负责人:{{ item.personLiableName }}
- </div>
- <div style="margin-top: 5px">
- 工序图纸:
- <span
- v-for="file in item.fileList"
- :key="file.id"
- style="margin-right: 20px; cursor: pointer; color: #409eff"
- @click="handleOpenFile(file)"
- >{{ file.fileName }}</span
- >
- </div>
- </div>
- </div>
- <template #footer>
- <el-button @click="dialogVisibleOne = false" size="large"
- >取 消</el-button
- >
- </template>
- </el-dialog>
- </div>
- </template>
- <script setup>
- import { ElMessage, ElMessageBox } from "element-plus";
- import byTable from "@/components/byTable/index";
- import byForm from "@/components/byForm/index";
- const { proxy } = getCurrentInstance();
- const loading = ref(false);
- const submitLoading = ref(false);
- const sourceList = ref({
- data: [],
- pagination: {
- total: 3,
- pageNum: 1,
- pageSize: 10,
- keyword: "",
- contractCode: "",
- workOrderCode: "",
- productionPlanCode: "",
- productionTaskCode: "",
- productCode: "",
- productName: "",
- productSn: "",
- dueDate: "",
- productionProcessesName: "",
- personLiableName: "",
- getFinishStatus: "",
- getFinishTime: "",
- },
- });
- const tableHeight = ref(0);
- const getTableHeight = () => {
- tableHeight.value = window.innerHeight - 275;
- };
- getTableHeight();
- const finishStatusData = ref([
- {
- label: "未完成",
- value: "0",
- },
- {
- label: "完成",
- value: "1",
- },
- ]);
- const dialogVisible = ref(false);
- const modalType = ref("add");
- const rules = ref({
- workOrderId: [{ required: true, message: "请选择工单", trigger: "change" }],
- startDate: [
- { required: true, message: "请选择计划开始时间", trigger: "change" },
- ],
- stopDate: [
- { required: true, message: "请选择计划结束时间", trigger: "change" },
- ],
- quantity: [{ required: true, message: "请输入计划数量", trigger: "blur" }],
- });
- const workOrderData = ref([]);
- const workOrderDataOne = ref([]);
- const statusData = ref([
- {
- label: "未开始",
- value: "0",
- },
- {
- label: "进行中",
- value: "1",
- },
- {
- label: "完成",
- value: "2",
- },
- ]);
- const selectConfig = reactive([
- {
- label: "完成状态",
- prop: "getFinishStatus",
- data: finishStatusData.value,
- },
- ]);
- const config = computed(() => {
- return [
- {
- attrs: {
- label: "合同编号",
- prop: "contractCode",
- width: 110,
- },
- },
- {
- attrs: {
- label: "工单编号",
- prop: "workOrderCode",
- width: 110,
- },
- },
- // {
- // attrs: {
- // label: "计划编号",
- // prop: "productionPlanCode",
- // width: 110,
- // },
- // },
- // {
- // attrs: {
- // label: "任务编号",
- // prop: "productionTaskCode",
- // width: 110,
- // },
- // },
- {
- attrs: {
- label: "产品SN",
- prop: "productSn",
- width: 140,
- },
- },
- {
- attrs: {
- label: "产品编号",
- prop: "productCode",
- width: 100,
- },
- },
- {
- attrs: {
- label: "产品名称",
- prop: "productName",
- "min-width": 150,
- },
- },
- {
- attrs: {
- label: "产品规格",
- prop: "productSpec",
- width: 100,
- },
- },
- {
- attrs: {
- label: "任务完成期限",
- prop: "dueDate",
- width: 110,
- },
- },
- {
- attrs: {
- label: "工序名称列表",
- prop: "productionProcessesNames",
- "min-width": 250,
- },
- },
- {
- attrs: {
- label: "当前工序名称",
- prop: "productionProcessesName",
- width: 120,
- },
- },
- {
- attrs: {
- label: "当前工序负责人",
- prop: "personLiableName",
- width: 130,
- },
- },
- {
- attrs: {
- label: "完成状态",
- slot: "finishStatus",
- width: 80,
- align: "center",
- },
- // render(finishStatus) {
- // return proxy.dictValueLabel(finishStatus, finishStatusData.value);
- // },
- },
- {
- attrs: {
- label: "完成时间",
- prop: "finishTime",
- width: 160,
- },
- },
- {
- attrs: {
- label: "操作",
- width: "80",
- align: "center",
- },
- renderHTML(row) {
- return [
- {
- attrs: {
- label: "查看",
- type: "primary",
- text: true,
- },
- el: "button",
- click() {
- getDtl(row);
- },
- },
- ];
- },
- },
- ];
- });
- const formOption = reactive({
- inline: true,
- labelWidth: 100,
- itemWidth: 100,
- rules: [],
- });
- const byform = ref(null);
- const formConfig = computed(() => {
- return [
- {
- type: "input",
- itemType: "text",
- prop: "contractCode",
- label: "合同编号",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "workOrderCode",
- label: "工单编号",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "productionPlanCode",
- label: "计划编号",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "productionTaskCode",
- label: "任务编号",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "productCode",
- label: "产品编号",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "productName",
- label: "产品名称",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "productSn",
- label: "产品Sn",
- itemWidth: 50,
- },
- {
- type: "date",
- itemType: "date",
- prop: "dueDate",
- label: "任务完成期限",
- itemWidth: 50,
- style: {
- width: "100%",
- },
- },
- {
- type: "input",
- itemType: "text",
- prop: "productionProcessesName",
- label: "当前工序名称",
- itemWidth: 50,
- },
- {
- type: "input",
- itemType: "text",
- prop: "personLiableName",
- label: "当前工序负责人",
- itemWidth: 50,
- },
- {
- type: "select",
- prop: "getFinishStatus",
- label: "任务完成状态",
- itemWidth: 50,
- style: {
- width: "100%",
- },
- data: finishStatusData.value,
- },
- {
- type: "date",
- itemType: "date",
- prop: "getFinishTime",
- label: "任务完成时间",
- itemWidth: 50,
- style: {
- width: "100%",
- },
- },
- ];
- });
- const getList = async (req) => {
- sourceList.value.pagination = { ...sourceList.value.pagination, ...req };
- loading.value = true;
- proxy
- .post("/productionTaskDetail/taskProgressPage", sourceList.value.pagination)
- .then((message) => {
- sourceList.value.data = message.rows;
- sourceList.value.pagination.total = message.total;
- setTimeout(() => {
- loading.value = false;
- }, 200);
- });
- };
- getList();
- const clickMoreSearch = () => {
- dialogVisible.value = true;
- };
- const moreSearchQuery = () => {
- dialogVisible.value = false;
- getList();
- };
- const moreSearchReset = () => {
- sourceList.value.pagination = {
- total: 0,
- pageNum: sourceList.value.pagination.pageNum,
- pageSize: sourceList.value.pagination.pageSize,
- keyword: "",
- contractCode: "",
- workOrderCode: "",
- productionPlanCode: "",
- productionTaskCode: "",
- productCode: "",
- productName: "",
- productSn: "",
- dueDate: "",
- productionProcessesName: "",
- personLiableName: "",
- getFinishStatus: "",
- getFinishTime: "",
- };
- moreSearchQuery();
- };
- const dialogVisibleOne = ref(false);
- const allData = ref([]);
- const getDtl = (row) => {
- proxy.post("/productionTaskDetail/detail", { id: row.id }).then((res) => {
- if (
- res.productionTaskDetailRecordList &&
- res.productionTaskDetailRecordList.length > 0
- ) {
- let ids = res.productionTaskDetailRecordList.map((x) => x.id);
- allData.value = res.productionTaskDetailRecordList;
- dialogVisibleOne.value = true;
- proxy
- .post("/fileInfo/getList", { businessIdList: ids })
- .then((fileObj) => {
- for (let i = 0; i < allData.value.length; i++) {
- const e = allData.value[i];
- for (const key in fileObj) {
- if (e.id === key) {
- e.fileList = fileObj[key];
- }
- }
- }
- });
- } else {
- return ElMessage({
- message: "该任务还未开始",
- type: "info",
- });
- }
- });
- };
- const handleOpenFile = (file) => {
- window.open(file.fileUrl, "_blank");
- };
- </script>
- <style lang="scss" scoped>
- .tenant {
- padding: 20px;
- }
- ::v-deep(.el-input-number .el-input__inner) {
- text-align: left;
- }
- .active {
- background: #a6dd82;
- }
- .disActive {
- background: #fa9841;
- }
- </style>
|