已添加1个文件
已修改5个文件
258 ■■■■■ 文件已修改
src/views/inventoryManagement/dispatchLog/Record.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/productionReporting/components/Detail.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/components/ProductionRecordForm.vue 146 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productionManagement/workOrder/index.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/qualityManagement/processInspection/components/formDia.vue 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/Record.vue
@@ -405,7 +405,7 @@
      <div class="print-page">
        <div class="delivery-note">
          <div class="header">
            <div class="company-name">鼎诚瑞实业有限责任公司</div>
            <div class="company-name">湖南鹏创电子有限公司</div>
            <div class="document-title">零售发货单</div>
          </div>
          
src/views/productionManagement/productionReporting/components/Detail.vue
@@ -1,5 +1,5 @@
<script setup lang="ts">
import {computed} from "vue";
import {computed, onMounted} from "vue";
defineOptions({
  name: "ReportingDetail"
@@ -23,6 +23,17 @@
  set: (value: boolean) => emits("update:isShow", value),
});
const otherData = ref([])
const init = () => {
  if (props.row.otherData !== null && props.row.otherData !== '') {
    otherData.value = JSON.parse(props.row.otherData);
  }
};
onMounted(() => {
  init();
})
</script>
<template>
@@ -40,6 +51,12 @@
      <el-descriptions-item label="报废数量">{{ row.quantity || '-' }}</el-descriptions-item>
      <el-descriptions-item label="单位">{{ row.scrapQty || '-' }}</el-descriptions-item>
      <el-descriptions-item label="创建时间">{{ row.createTime || '-' }}</el-descriptions-item>
      <el-descriptions-item
          v-for="item in otherData"
          :label="`${item.parameterItem}`"
      >
        {{ item.value || '-' }}
      </el-descriptions-item>
    </el-descriptions>
    <template #footer>
        <span class="dialog-footer">
src/views/productionManagement/workOrder/components/ProductionRecordForm.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,146 @@
<script setup lang="ts">
import {computed, reactive, ref, watch} from "vue";
import {getDeviceLedger} from "@/api/equipmentManagement/ledger";
defineOptions({
  name: "ProductionRecordForm"
});
const props = defineProps({
  list: {
    type: Array,
    default() {
      return [];
    }
  }
});
const formRef = ref();
const formData = reactive({
  list: [] as any[],
});
const fieldLabel = (item: any) => {
  if (!item.unit || item.unit === "/") {
    return item.parameterItem;
  }
  return `${item.parameterItem}(${item.unit})`;
};
const getType = (item: any) => item.type || "文本格式";
const rules = computed(() => {
  const result: Record<string, any[]> = {};
  formData.list.forEach((item, index) => {
    if (String(item.isRequired) === "1") {
      result[`list.${index}.value`] = [{required: true, message: `请输入${item.parameterItem}`, trigger: "blur"}];
    }
  });
  return result;
});
const deviceOptions = ref([]);
const loadDeviceName = async () => {
  const {data} = await getDeviceLedger();
  deviceOptions.value = data;
};
const initData = () => {
  formData.list = props.list || [];
  formData.list.forEach(item => {
    if (item.value === undefined) {
      item.value = null;
    }
  });
  loadDeviceName()
};
const submitData = async () => {
  const valid = await formRef.value.validate().catch(() => false)
  if (valid) {
    return formData.list
  } else {
    return null
  }
}
watch(
    () => props.list,
    () => {
      initData();
    },
    {immediate: true, deep: true}
);
defineExpose({
  submitData
})
</script>
<template>
  <el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
    <el-form-item
        v-for="(item, index) in formData.list"
        :key="item.id"
        :label="fieldLabel(item)"
        :prop="`list.${index}.value`"
    >
      <el-input-number
          v-if="getType(item) === '数值格式'"
          v-model="item.value"
          :controls="false"
          style="width: 100%"
          placeholder="请输入"
      />
      <el-date-picker
          v-else-if="getType(item) === '时间格式'"
          v-model="item.value"
          type="datetime"
          value-format="YYYY-MM-DD HH:mm:ss"
          format="YYYY-MM-DD HH:mm:ss"
          placeholder="请选择"
          style="width: 100%"
      />
      <el-date-picker
          v-else-if="getType(item) === '日期格式'"
          v-model="item.value"
          type="date"
          value-format="YYYY-MM-DD"
          format="YYYY-MM-DD"
          placeholder="请选择"
          style="width: 100%"
      />
      <el-select
          v-else-if="getType(item) === '是/否选框'"
          v-model="item.value"
          placeholder="请选择"
          clearable
          style="width: 100%"
      >
        <el-option label="是" value="是"/>
        <el-option label="否" value="否"/>
      </el-select>
      <el-select
          v-else-if="getType(item) === '机台选择'"
          v-model="item.value"
          placeholder="请选择"
          clearable
          style="width: 100%"
      >
        <el-option
            v-for="(item, index) in deviceOptions"
            :key="index"
            :label="item.deviceName"
            :value="item.deviceName"
        ></el-option>
      </el-select>
      <el-input
          v-else
          v-model="item.value"
          placeholder="请输入"
          clearable
      />
    </el-form-item>
  </el-form>
</template>
src/views/productionManagement/workOrder/index.vue
@@ -211,6 +211,7 @@
                       :value="user.userId"/>
          </el-select>
        </el-form-item>
        <ProductionRecordForm ref="productionRecordFormRef" :list="processParamList"/>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
@@ -250,12 +251,16 @@
import QRCode from "qrcode";
import {getCurrentInstance, reactive, toRefs} from "vue";
import FilesDia from "./components/filesDia.vue";
import {
  listPage as listProcessParamPage,
} from "@/api/productionManagement/productProcessParameter.js";
const {proxy} = getCurrentInstance();
const {priority_type} = proxy.useDict("priority_type");
const CopperPrintingForm = defineAsyncComponent(() => import("./components/CopperPrintingForm.vue"));
const VoltageSortingForm = defineAsyncComponent(() => import("./components/VoltageSortingForm.vue"));
const ProductionRecordForm = defineAsyncComponent(() => import("./components/ProductionRecordForm.vue"));
const tableColumn = ref([
  {
    label: "优先级",
@@ -401,7 +406,9 @@
  productProcessRouteItemId: "",
  userId: "",
  productMainId: null,
  otherData: {}
});
const productionRecordFormRef = ref();
// æœ¬æ¬¡ç”Ÿäº§æ•°é‡éªŒè¯è§„则
const validateQuantity = (rule, value, callback) => {
@@ -631,7 +638,22 @@
      });
};
const showReportDialog = row => {
const processParamPage = reactive({
  current: 1,
  size: 9999,
  total: 0,
});
const getProcessParamList = async (row) => {
  const params = {
    processId: row.processId,
    ...processParamPage,
  };
  const res = await listProcessParamPage(params)
  return res.data.records
};
const processParamList = ref([])
const showReportDialog = async row => {
  currentReportRowData.value = row;
  if (row.processName === '印铜' || row.processName === '印银') {
    copperPrintingFormVisible.value = true
@@ -641,6 +663,7 @@
    voltageSortingFormVisible.value = true
    return;
  }
  processParamList.value = await getProcessParamList(row)
  reportForm.planQuantity = row.planQuantity;
  reportForm.quantity = row.quantity !== undefined && row.quantity !== null ? row.quantity : null;
  reportForm.productProcessRouteItemId = row.productProcessRouteItemId;
@@ -670,7 +693,9 @@
  workOrderFilesRef.value?.openDialog(row);
};
const handleReport = () => {
const handleReport = async () => {
  const data = await productionRecordFormRef.value.submitData()
  reportForm.otherData = JSON.stringify(data || {});
  reportFormRef.value?.validate((valid) => {
    if (!valid) {
      return false;
src/views/qualityManagement/processInspection/components/formDia.vue
@@ -66,8 +66,35 @@
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不良数量:" prop="defectiveQuantity">
              <el-input-number
                  :step="0.01"
                  :min="0"
                  :max="getMaxDefectiveQuantity()"
                  style="width: 100%"
                  v-model="form.defectiveQuantity"
                  placeholder="请输入"
                  clearable
                  :precision="2"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="不良原因:" prop="defectiveReason">
              <el-select v-model="form.defectiveReason" placeholder="请选择" clearable style="width: 100%">
                <el-option
                  v-for="dict in defective_reason"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="数量:" prop="quantity">
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" clearable :precision="2" :disabled="processQuantityDisabled"/>
              <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="form.quantity" placeholder="请输入" clearable :precision="2" :disabled="operationType !== 'add'"/>
            </el-form-item>
          </el-col>
        </el-row>
@@ -132,7 +159,7 @@
</template>
<script setup>
import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick} from "vue";
import {ref, reactive, toRefs, computed, getCurrentInstance, nextTick, watch} from "vue";
import {getOptions} from "@/api/procurementManagement/procurementLedger.js";
import {modelList, productTreeList} from "@/api/basicData/product.js";
import {qualityInspectAdd, qualityInspectUpdate} from "@/api/qualityManagement/rawMaterialInspection.js";
@@ -140,10 +167,12 @@
import {userListNoPage} from "@/api/system/user.js";
import {qualityInspectParamInfo} from "@/api/qualityManagement/qualityInspectParam.js";
import { list } from "@/api/productionManagement/productionProcess";
import { useDict } from "@/utils/dict.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
// èŽ·å–å­—å…¸æ•°æ®
const { defective_reason } = useDict('defective_reason');
const dialogFormVisible = ref(false);
const operationType = ref('')
@@ -159,6 +188,8 @@
    testStandardId: "",
    unit: "",
    quantity: "",
    defectiveQuantity: "",
    defectiveReason: "",
    checkCompany: "",
    checkResult: "",
  },
@@ -214,6 +245,27 @@
const currentProductId = ref(0);
const testStandardOptions = ref([]); // æŒ‡æ ‡é€‰æ‹©ä¸‹æ‹‰æ¡†æ•°æ®
const modelOptions = ref([]);
// ä¿å­˜åˆå§‹çš„ defectiveQuantity å€¼ï¼ˆç”¨äºŽè®¡ç®—变化量)
const initialDefectiveQuantity = ref(0);
// èŽ·å–ä¸è‰¯æ•°é‡æœ€å¤§å€¼
const getMaxDefectiveQuantity = () => {
  return form.value.quantity || 0;
};
// ç›‘听不良数量变化,自动更新数量
// å½“ defectiveQuantity å¢žåŠ æ—¶ï¼Œquantity å‡å°‘;当 defectiveQuantity å‡å°‘时,quantity å¢žåŠ 
watch(() => form.value.defectiveQuantity, (newVal, oldVal) => {
  const newDefectiveQty = Number(newVal) || 0;
  const oldDefectiveQty = Number(oldVal) || 0;
  const currentQuantity = Number(form.value.quantity) || 0;
  // è®¡ç®—变化量:新值 - æ—§å€¼
  const changeAmount = newDefectiveQty - oldDefectiveQty;
  // quantity åå‘变化
  form.value.quantity = Number((currentQuantity - changeAmount).toFixed(2));
});
// æ‰“开弹框
const openDialog = async (type, row) => {
src/views/salesManagement/salesLedger/index.vue
@@ -481,7 +481,7 @@
                    <div v-for="(item, index) in printData" :key="index" class="print-page">
                        <div class="delivery-note">
                            <div class="header">
                                <div class="company-name">鼎诚瑞实业有限责任公司</div>
                                <div class="company-name">湖南鹏创电子有限公司</div>
                                <div class="document-title">零售发货单</div>
                            </div>
                            
@@ -1670,7 +1670,7 @@
      <div class="print-page">
        <div class="delivery-note">
          <div class="header">
            <div class="company-name">鼎诚瑞实业有限责任公司</div>
            <div class="company-name">湖南鹏创电子有限公司</div>
            <div class="document-title">零售发货单</div>
          </div>