huminmin
4 天以前 7ff48284cc634e02abed3a545630e9d680bbf19f
电压分选报工
已添加1个文件
已修改3个文件
380 ■■■■■ 文件已修改
src/views/productionManagement/productionReporting/components/Detail.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/index.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/components/VoltageSortingForm.vue 341 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/components/Detail.vue
@@ -16,6 +16,7 @@
  }
});
const emits = defineEmits(["update:isShow"]);
const visible = computed({
  get: () => props.isShow,
src/views/productionManagement/productionReporting/index.vue
@@ -46,21 +46,9 @@
                :total="page.total">
        <template #productNoSlot="{ row }">
          <el-button
              v-if="row.process ==='印铜' || row.process ==='印银'"
              type="primary"
              link
              @click="openDetail(row)"
          >
            {{ row.productNo }}
          </el-button>
          <el-button
              v-else
              type="primary"
              link
              @click="(row) => {
                currentReportRowData = row
                showDetail = true
              }"
          >
            {{ row.productNo }}
          </el-button>
@@ -154,6 +142,12 @@
        :isEdit="false"
        :row="currentReportRowData"
        @refreshData="getList"/>
    <VoltageSortingForm
        v-if="voltageSortingFormVisible"
        v-model:isShow="voltageSortingFormVisible"
        :isEdit="false"
        :row="currentReportRowData"
        @refreshData="getList"/>
    <Detail
        v-if="showDetail"
        v-model:isShow="showDetail"
@@ -173,6 +167,7 @@
import {productionProductMainListPage} from "@/api/productionManagement/productionProductMain.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import InputModal from "@/views/productionManagement/productionReporting/Input.vue";
import VoltageSortingForm from "@/views/productionManagement/workOrder/components/VoltageSortingForm.vue";
const CopperPrintingForm = defineAsyncComponent(() => import("@/views/productionManagement/workOrder/components/CopperPrintingForm.vue"));
const Detail = defineAsyncComponent(() => import("@/views/productionManagement/productionReporting/components/Detail.vue"));
@@ -434,6 +429,7 @@
// æ‰“开投入模态框
const isShowInput = ref(false);
const copperPrintingFormVisible = ref(false);
const voltageSortingFormVisible = ref(false);
const showDetail = ref(false);
const isShowingId = ref(0);
const showInput = row => {
@@ -457,7 +453,13 @@
};
const openDetail = row => {
  currentReportRowData.value = row;
  if (row.process ==='印铜' || row.process ==='印银') {
  copperPrintingFormVisible.value = true;
  } else if (row.process === '电压分选') {
    voltageSortingFormVisible.value = true;
  } else {
    showDetail.value = true;
  }
};
onMounted(() => {
  getList();
src/views/productionManagement/workOrder/components/VoltageSortingForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,341 @@
<script setup lang="ts">
import {computed, onMounted, reactive, ref} from "vue";
import dayjs from "dayjs";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {ElMessage} from "element-plus";
import {addProductMain} from "@/api/productionManagement/workOrder.js";
defineOptions({
  name: "VoltageSortingForm"
});
const props = defineProps({
  isShow: {
    type: Boolean,
    required: true
  },
  isEdit: {
    type: Boolean,
    default: false
  },
  row: {
    type: Object,
    default: () => ({}),
  }
});
const emits = defineEmits(["update:isShow", "refreshData"]);
const visible = computed({
  get: () => props.isShow,
  set: (value: boolean) => emits("update:isShow", value),
});
const formData = reactive({
  productProcessRouteItemId: undefined,
  workOrderId: undefined,
  planQuantity: undefined,
  reportWork: undefined,
  productMainId: undefined,
  quantity: undefined, // äº§å‡ºæ•°é‡
  userId: undefined, // ä½œä¸šå‘˜
  userName: undefined, // ä½œä¸šå‘˜
  scrapQty: undefined, // ä¸è‰¯æ•°é‡
  otherData: {
    engineException: undefined,// æœ‰æ— å·¥ç¨‹å¼‚常
    specificIssue: undefined,// å…·ä½“不良
    dryingTemperature: '', // çƒ˜å¹²æ¸©åº¦
    scrapingDate: dayjs().format('YYYY-MM-DD HH:mm:ss'), // åˆ®é‡æ—¥æœŸ
    machineNumber: undefined, // æœºå°å·
    receiveQuantity: undefined, // æŽ¥æ”¶æ•°é‡
    voltageSpecs: [], // ç”µåŽ‹è§„æ ¼,
    voltage: [], // ç”µåŽ‹
    quantity: [], // æ•°é‡
    comprehensiveHit: undefined, // ç»¼åˆå‘½ä¸­æœ¬
    userId: undefined, // ä½œä¸šå‘˜
    userName: undefined, // ä½œä¸šå‘˜
    exceptionDealResult: undefined, // å¼‚常处理结果
  }
})
const userOptions = ref([]);
const getUserList = () => {
  userListNoPageByTenantId()
      .then(res => {
        if (res.code === 200) {
          userOptions.value = res.data || [];
        }
      })
      .catch(err => {
        console.error("获取用户列表失败", err);
      });
};
// ç”¨æˆ·é€‰æ‹©å˜åŒ–æ—¶æ›´æ–° userName
const handleUserChange = (value) => {
  if (value) {
    formData.userName = userOptions.value.find(user => user.userId === value).userName;
  }
};
const handleReport = () => {
  if (!formData.userId) {
    ElMessage.error('请选择作业员')
    return;
  }
  if (!formData.quantity || formData.quantity <= 0) {
    ElMessage.error('请输入产出数量')
    return;
  }
  const otherData = JSON.stringify(formData.otherData);
  const submitData = {
    ...formData,
    otherData: otherData
  };
  addProductMain(submitData).then(res => {
    if (res.code === 200) {
      ElMessage({
        message: '报工成功',
        type: 'success',
      })
      emits("refreshData")
      visible.value = false;
    } else {
      ElMessage.error('报工失败')
    }
  });
};
const initData = () => {
  if (!props.isEdit) {
    formData.otherData = JSON.parse(props.row.otherData || '{}');
    formData.quantity = props.row.quantity;
  } else {
    const row = props.row;
    formData.planQuantity = row.planQuantity
    formData.productProcessRouteItemId = row.productProcessRouteItemId
    formData.workOrderId = row.id
    formData.reportWork = row.reportWork
    formData.productMainId = row.productMainId
  }
}
const displayValue = (value: any) => {
  return value === undefined || value === null || value === "" ? "-" : value;
};
onMounted(() => {
  getUserList();
  initData()
})
</script>
<template>
  <el-dialog v-model="visible"
             :title="isEdit? '电压分选报工' : '详情'"
             width="90%">
    <el-form :model="formData">
      <table class="report-table">
        <tbody>
        <tr>
          <td class="tip" colspan="12">电压分选情况</td>
          <td class="label" colspan="2">刮量日期</td>
          <td colspan="2">
            <el-date-picker
                v-if="props.isEdit"
                v-model="formData.otherData.scrapingDate"
                type="datetime"
                value-format="YYYY-MM-DD HH:mm:ss"
                format="YYYY-MM-DD HH:mm:ss"
                placeholder="请选择"
                style="width: 100%"
            />
            <span v-else class="view-value">{{ displayValue(formData.otherData.scrapingDate) }}</span>
          </td>
          <td class="label" colspan="2">机台号</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.machineNumber" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.machineNumber) }}</span>
          </td>
          <td class="label" colspan="3">作业员</td>
        </tr>
        <tr>
          <td class="label" colspan="2">档位</td>
          <td class="label" colspan="2">一档</td>
          <td class="label" colspan="2">二档</td>
          <td class="label" colspan="2">三档</td>
          <td class="label" colspan="2">四档</td>
          <td class="label" colspan="2">五档</td>
          <td class="label" colspan="2">接收数量</td>
          <td colspan="6">
            <el-input-number v-if="props.isEdit" v-model="formData.otherData.receiveQuantity" controls-position="right" style="width: 100%;" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.receiveQuantity) }}</span>
          </td>
          <td rowspan="6" colspan="3">
            <el-select v-model="formData.userId"
                       v-if="props.isEdit"
                       style="width: 100%"
                       placeholder="请选择作业员"
                       clearable
                       filterable
                       @change="handleUserChange">
              <el-option v-for="user in userOptions"
                         :key="user.userId"
                         :label="user.userName"
                         :value="user.userId"/>
            </el-select>
            <span v-else class="view-value">{{ displayValue(formData.userName || formData.userId) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">电压规格</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltageSpecs[0]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltageSpecs[0]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltageSpecs[1]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltageSpecs[1]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltageSpecs[2]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltageSpecs[2]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltageSpecs[3]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltageSpecs[3]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltageSpecs[4]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltageSpecs[4]) }}</span>
          </td>
          <td class="label" colspan="2">产出数量</td>
          <td colspan="6">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.quantity" style="width: 100%;" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.quantity) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">电压</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltage[0]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltage[0]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltage[1]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltage[1]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltage[2]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltage[2]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltage[3]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltage[3]) }}</span>
          </td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.voltage[4]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.voltage[4]) }}</span>
          </td>
          <td class="label" colspan="2">不良数量</td>
          <td colspan="6">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.scrapQty" style="width: 100%;" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.scrapQty) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">数量</td>
          <td colspan="2">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.otherData.quantity[0]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.quantity[0]) }}</span>
          </td>
          <td colspan="2">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.otherData.quantity[1]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.quantity[1]) }}</span>
          </td>
          <td colspan="2">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.otherData.quantity[2]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.quantity[2]) }}</span>
          </td>
          <td colspan="2">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.otherData.quantity[3]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.quantity[3]) }}</span>
          </td>
          <td colspan="2">
            <el-input-number v-if="props.isEdit" controls-position="right" v-model="formData.otherData.quantity[4]" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.quantity[4]) }}</span>
          </td>
          <td class="label" colspan="2">综合命中本</td>
          <td colspan="6">
            <el-input v-if="props.isEdit" v-model="formData.otherData.comprehensiveHit" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.comprehensiveHit) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">有无工程异常</td>
          <td colspan="10">
            <div v-if="props.isEdit" style="display: flex; align-items: center; width: 100%;">
              <el-radio-group v-model="formData.otherData.engineException" style="display: flex; margin-right: 20px;">
                <el-radio value="无">无</el-radio>
                <el-radio value="有">有</el-radio>
              </el-radio-group>
              <div v-if="formData.otherData.engineException === '有'" style="display: flex; align-items: center; flex: 1;">
                <div style="width: 100px;">具体不良:</div>
                <el-input v-model="formData.otherData.specificIssue" placeholder="请输入" style="width: 100%;"/>
              </div>
            </div>
            <span v-else class="view-value">{{ displayValue(formData.otherData.specificIssue) }}</span>
          </td>
          <td class="label" colspan="2">异常处理结果</td>
          <td colspan="6">
            <el-input v-if="props.isEdit" v-model="formData.otherData.exceptionDealResult" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.exceptionDealResult) }}</span>
          </td>
        </tr>
        </tbody>
      </table>
    </el-form>
    <template #footer>
        <span class="dialog-footer">
          <el-button v-if="props.isEdit" type="primary"
                     @click="handleReport">确定</el-button>
          <el-button @click="visible = false">{{ props.isEdit ? "取消" : "关闭" }}</el-button>
        </span>
    </template>
  </el-dialog>
</template>
<style scoped>
.report-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
}
.report-table td {
  border: 1px solid #dcdfe6;
  padding: 6px;
  vertical-align: middle;
}
.report-table .label {
  width: 90px;
  background: #f5f7fa;
  text-align: center;
  font-weight: 500;
}
.report-table .tip {
  text-align: center;
  font-weight: 500;
  line-height: 1.4;
  background: #fafafa;
}
.view-value {
  display: inline-block;
  min-height: 32px;
  line-height: 32px;
}
</style>
src/views/productionManagement/workOrder/index.vue
@@ -227,6 +227,12 @@
        :isEdit="true"
        :row="currentReportRowData"
        @refreshData="getList"/>
    <VoltageSortingForm
        v-if="voltageSortingFormVisible"
        v-model:isShow="voltageSortingFormVisible"
        :isEdit="true"
        :row="currentReportRowData"
        @refreshData="getList"/>
  </div>
</template>
@@ -249,6 +255,7 @@
const {priority_type} = proxy.useDict("priority_type");
const CopperPrintingForm = defineAsyncComponent(() => import("./components/CopperPrintingForm.vue"));
const VoltageSortingForm = defineAsyncComponent(() => import("./components/VoltageSortingForm.vue"));
const tableColumn = ref([
  {
    label: "优先级",
@@ -375,6 +382,7 @@
const qrRowData = ref(null);
const editDialogVisible = ref(false);
const copperPrintingFormVisible = ref(false);
const voltageSortingFormVisible = ref(false);
const transferCardVisible = ref(false);
const transferCardData = ref([]);
const transferCardQrUrl = ref("");
@@ -629,6 +637,10 @@
    copperPrintingFormVisible.value = true
    return
  }
  if (row.processName === '电压分选') {
    voltageSortingFormVisible.value = true
    return;
  }
  reportForm.planQuantity = row.planQuantity;
  reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
  reportForm.productProcessRouteItemId = row.productProcessRouteItemId;