spring
5 天以前 76d8eff2cfc1a428a948fe6f57f0ff93b2e3a444
Merge branch 'dev_衡阳_鹏创电子' of http://114.132.189.42:9002/r/product-inventory-management into dev_衡阳_鹏创电子
已添加1个文件
已修改1个文件
479 ■■■■■ 文件已修改
src/views/productionManagement/workOrder/components/CopperPrintingForm.vue 443 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/components/CopperPrintingForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,443 @@
<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: "CopperPrintingForm"
});
const props = defineProps({
  isShow: {
    type: Boolean,
    required: true
  },
  isEdit: {
    type: Boolean,
    default: false
  },
  detailData: {
    type: Object,
    default: () => ({}),
  },
  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, // ä½œä¸šå‘˜
  otherData: {
    dryingTemperature: '', // çƒ˜å¹²æ¸©åº¦
    startTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), // å¼€å§‹æ—¶é—´
    endTime: dayjs().format('YYYY-MM-DD HH:mm:ss'), // ç»“束时间
    userId: undefined, // ä½œä¸šå‘˜
    userName: undefined, // ä½œä¸šå‘˜
    underlyingCopperPaste: undefined, // åº•层铜浆
    underlyingCopperPastePrintingQuantity: undefined, // åº•层铜浆印刷次数
    underlyingCopperPasteMachineNumber: undefined, // åº•层铜浆机台号
    underlyingCopperPasteSilkScreenFamilyNumber: undefined, // åº•层铜浆丝网族号
    underlyingCopperPasteNumberOfEyes: undefined, // åº•层铜浆目数
    underlyingCopperPasteUserId: undefined, // åº•层铜浆作业员
    underlyingCopperPasteUserName: undefined, // åº•层铜浆作业员
    underlyingCopperPasteDryingTemperature: undefined, // åº•层铜浆烘干温度
    surfaceCopperPaste: undefined, // è¡¨å±‚铜浆
    surfaceCopperPastePrintingQuantity: undefined, // è¡¨å±‚铜浆印刷次数
    surfaceCopperPasteMachineNumber: undefined, // è¡¨å±‚铜浆机台号
    surfaceCopperPasteSilkScreenFamilyNumber: undefined, // è¡¨å±‚铜浆丝网族号
    surfaceCopperPasteNumberOfEyes: undefined, // è¡¨å±‚铜浆目数
    surfaceCopperPasteUserId: undefined, // è¡¨å±‚铜浆作业员
    surfaceCopperPasteUserName: undefined, // è¡¨å±‚铜浆作业员
    surfaceCopperPasteDryingTemperature: undefined, // è¡¨å±‚铜浆烘干温度,
    steelBurningDate: undefined, // çƒ§é’¢æ—¥æœŸ
    copperFiringTime: undefined, // çƒ§é“œè¿›ç‚‰æ—¶é—´
    steelFiringTime: undefined, // çƒ§é’¢å‡ºç‚‰æ—¶é—´
    weight: undefined, // é‡é‡ï¼ˆkg/pos)
    copperSmeltingTemperatureProfile: undefined, // çƒ§é“œæ¸©åº¦æ›²çº¿
    remark: 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 = (userId: any, reportType: string) => {
  if (userId) {
    const selectedUser = userOptions.value.find(user => user.userId === userId);
    switch (reportType) {
      case 'userId':
        formData.otherData.userName = selectedUser.userName;
        break;
      case 'underlyingCopperPasteUserId':
        formData.otherData.underlyingCopperPasteUserName = selectedUser.userName;
        break;
      case 'surfaceCopperPasteUserId':
        formData.otherData.surfaceCopperPasteUserName = selectedUser.userName;
        break;
    }
  } else {
    switch (reportType) {
      case 'userId':
        formData.otherData.userName = "";
        break;
      case 'underlyingCopperPasteUserId':
        formData.otherData.underlyingCopperPasteUserName = "";
        break;
      case 'surfaceCopperPasteUserId':
        formData.otherData.surfaceCopperPasteUserName = "";
        break;
    }
  }
};
const handleReport = () => {
  if (!formData.otherData.userId && !formData.otherData.surfaceCopperPasteUserId && !formData.otherData.underlyingCopperPasteUserId) {
    ElMessage.error('请选择作业员')
    return;
  }
  if (!formData.quantity || formData.quantity <= 0) {
    ElMessage.error('请输入生产数量')
    return;
  }
  formData.userId = formData.otherData.surfaceCopperPasteUserId || formData.otherData.underlyingCopperPasteUserId;
  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.detailData.otherData || '{}');
    formData.quantity = props.detailData.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="印铜报工"
             width="90%">
    <el-form :model="formData">
      <table class="report-table">
        <tbody>
        <tr>
          <td class="tip" colspan="4">瓷片清洗后放置时间超过72H,重新烘片后才能印刷并填写本栏</td>
          <td class="label" colspan="3">烘干温度</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.dryingTemperature" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.dryingTemperature) }}</span>
          </td>
          <td class="label">开始时间</td>
          <td colspan="2">
            <el-date-picker
                v-if="props.isEdit"
                v-model="formData.otherData.startTime"
                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.startTime) }}</span>
          </td>
          <td class="label"  colspan="3">结束时间</td>
          <td colspan="2">
            <el-date-picker
                v-if="props.isEdit"
                v-model="formData.otherData.endTime"
                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.endTime) }}</span>
          </td>
          <td class="label" colspan="2">作业员</td>
          <td  colspan="2">
            <el-select v-model="formData.otherData.userId"
                       v-if="props.isEdit"
                       style="width: 100%"
                       placeholder="请选择作业员"
                       clearable
                       filterable
                       @change="handleUserChange($event, 'userId')">
              <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.otherData.userName || formData.otherData.userId) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">底层铜浆</td>
          <td>
            <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPaste" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPaste) }}</span>
          </td>
          <td class="label">印刷次数</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPastePrintingQuantity" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPastePrintingQuantity) }}</span>
          </td>
          <td class="label">机台号</td>
          <td>
            <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteMachineNumber" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteMachineNumber) }}</span>
          </td>
          <td class="label">丝网族号</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteSilkScreenFamilyNumber" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteSilkScreenFamilyNumber) }}</span>
          </td>
          <td class="label">目数</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteNumberOfEyes" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteNumberOfEyes) }}</span>
          </td>
          <td class="label">作业员</td>
          <td colspan="2">
            <el-select v-model="formData.otherData.underlyingCopperPasteUserId"
                       v-if="props.isEdit"
                       style="width: 100%"
                       placeholder="请选择作业员"
                       clearable
                       filterable
                       @change="handleUserChange($event, 'underlyingCopperPasteUserId')">
              <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.otherData.underlyingCopperPasteUserName || formData.otherData.underlyingCopperPasteUserId) }}</span>
          </td>
          <td class="label" colspan="2">烘干温度</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.underlyingCopperPasteDryingTemperature" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.underlyingCopperPasteDryingTemperature) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">表层铜浆</td>
          <td>
            <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPaste" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPaste) }}</span>
          </td>
          <td class="label">印刷次数</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPastePrintingQuantity" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPastePrintingQuantity) }}</span>
          </td>
          <td class="label">机台号</td>
          <td>
            <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteMachineNumber" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteMachineNumber) }}</span>
          </td>
          <td class="label">丝网族号</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteSilkScreenFamilyNumber" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteSilkScreenFamilyNumber) }}</span>
          </td>
          <td class="label">目数</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteNumberOfEyes" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteNumberOfEyes) }}</span>
          </td>
          <td class="label">作业员</td>
          <td colspan="2">
            <el-select v-model="formData.otherData.surfaceCopperPasteUserId"
                       v-if="props.isEdit"
                       style="width: 100%"
                       placeholder="请选择作业员"
                       clearable
                       filterable
                       @change="handleUserChange($event, 'surfaceCopperPasteUserId')">
              <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.otherData.surfaceCopperPasteUserName || formData.otherData.surfaceCopperPasteUserId) }}</span>
          </td>
          <td class="label" colspan="2">烘干温度</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.surfaceCopperPasteDryingTemperature" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.surfaceCopperPasteDryingTemperature) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">烧钢日期</td>
          <td colspan="2">
            <el-date-picker
                v-if="props.isEdit"
                v-model="formData.otherData.steelBurningDate"
                type="date"
                value-format="YYYY-MM-DD"
                format="YYYY-MM-DD"
                placeholder="请选择"
                style="width: 100%"
            />
            <span v-else class="view-value">{{ displayValue(formData.otherData.steelBurningDate) }}</span>
          </td>
          <td class="label" colspan="3">烧铜进炉时间</td>
          <td colspan="2">
            <el-date-picker
                v-if="props.isEdit"
                v-model="formData.otherData.copperFiringTime"
                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.copperFiringTime) }}</span>
          </td>
          <td class="label">烧钢出炉时间</td>
          <td colspan="2">
            <el-date-picker
                v-if="props.isEdit"
                v-model="formData.otherData.steelFiringTime"
                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.steelFiringTime) }}</span>
          </td>
          <td class="label" colspan="3">烧铜产出激</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.quantity" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.quantity) }}</span>
          </td>
          <td class="label" colspan="2">重量(kg/pos)</td>
          <td colspan="2">
            <el-input v-if="props.isEdit" v-model="formData.otherData.weight" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.weight) }}</span>
          </td>
        </tr>
        <tr>
          <td class="label" colspan="2">烧铜温度曲线</td>
          <td colspan="7">
            <el-input
                v-if="props.isEdit"
                v-model="formData.otherData.copperSmeltingTemperatureProfile"
                type="textarea"
                :rows="3"
                placeholder="请输入"
            />
            <span v-else class="view-value">{{ displayValue(formData.otherData.copperSmeltingTemperatureProfile) }}</span>
          </td>
          <td class="label">备注</td>
          <td colspan="11">
            <el-input v-if="props.isEdit" v-model="formData.otherData.remark" type="textarea" :rows="3" placeholder="请输入"/>
            <span v-else class="view-value">{{ displayValue(formData.otherData.remark) }}</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
@@ -14,7 +14,8 @@
        </div>
        <div class="search-item">
          <el-button type="primary"
                     @click="handleQuery">搜索</el-button>
                     @click="handleQuery">搜索
          </el-button>
        </div>
      </div>
    </div>
@@ -26,7 +27,9 @@
                :tableLoading="tableLoading"
                @pagination="pagination">
                <template #completionStatus="{ row }">
                  <el-progress :percentage="toProgressPercentage(row?.completionStatus)" :color="progressColor(toProgressPercentage(row?.completionStatus))" :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''" />
          <el-progress :percentage="toProgressPercentage(row?.completionStatus)"
                       :color="progressColor(toProgressPercentage(row?.completionStatus))"
                       :status="toProgressPercentage(row?.completionStatus) >= 100 ? 'success' : ''"/>
                </template>
              </PIMTable>
    </div>
@@ -161,7 +164,8 @@
      margin-bottom: 40px;">
        <el-button type="primary"
                   style="margin-top: 20px;"
                   @click="printTransferCard">打印流转卡</el-button>
                   @click="printTransferCard">打印流转卡
        </el-button>
      </div>
    </el-dialog>
    <el-dialog v-model="reportDialogVisible"
@@ -217,6 +221,12 @@
      </template>
    </el-dialog>
    <FilesDia ref="workOrderFilesRef" />
    <CopperPrintingForm
        v-if="copperPrintingFormVisible"
        v-model:isShow="copperPrintingFormVisible"
        :isEdit="true"
        :row="currentReportRowData"
        @refreshData="getList"/>
  </div>
</template>
@@ -234,9 +244,11 @@
  import QRCode from "qrcode";
  import { getCurrentInstance, reactive, toRefs } from "vue";
  import FilesDia from "./components/filesDia.vue";
  const { proxy } = getCurrentInstance();
  const { priority_type } = proxy.useDict("priority_type");
const CopperPrintingForm = defineAsyncComponent(() => import("./components/CopperPrintingForm.vue"));
  const tableColumn = ref([
    {
      label: "优先级",
@@ -332,6 +344,7 @@
          name: "编辑",
          clickFun: row => {
            handleEdit(row);
          handleEdit(row);
          },
        },
        {
@@ -361,6 +374,7 @@
  const qrCodeUrl = ref("");
  const qrRowData = ref(null);
  const editDialogVisible = ref(false);
const copperPrintingFormVisible = ref(false);
  const transferCardVisible = ref(false);
  const transferCardData = ref([]);
  const transferCardQrUrl = ref("");
@@ -611,6 +625,10 @@
  const showReportDialog = row => {
    currentReportRowData.value = row;
  if (row.processName === '印铜') {
    copperPrintingFormVisible.value = true
    return
  }
    reportForm.planQuantity = row.planQuantity;
    reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
    reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
@@ -744,10 +762,12 @@
<style scoped lang="scss">
  .search_form {
    margin-bottom: 20px;
    .search-row {
      display: flex;
      gap: 20px;
      align-items: center;
      .search-item {
        display: flex;
        align-items: center;
@@ -767,26 +787,32 @@
    display: flex;
    gap: 20px;
    height: 350px;
    .transfer-card-info {
      flex: 1;
      overflow: auto;
      .info-group {
        width: 50%;
        float: left;
      }
      .info-item {
        display: flex;
        margin-bottom: 15px;
        .info-label {
          width: 120px;
          font-weight: bold;
          margin-right: 20px;
        }
        .info-value {
          flex: 1;
        }
      }
    }
    .transfer-card-qr {
      width: 240px;
      display: flex;
@@ -845,20 +871,24 @@
    }
    .transfer-card-info {
      flex: 1;
      .info-group {
        width: 100%;
        float: none;
        margin-bottom: 20px;
      }
      .info-item {
        display: flex;
        margin-bottom: 10px;
        .info-label {
          width: 100px;
          font-weight: bold;
          margin-right: 15px;
          white-space: nowrap;
        }
        .info-value {
          flex: 1;
          word-break: break-word;