广丰卷烟厂数采质量分析系统
zhuguifei
2026-03-06 b12c9e77a6b6a7b410ac421c5a3d68da88823460
ruoyi-plus-soybean/src/views/analy/store-silk/modules/store-silk-operate-drawer.vue
@@ -45,31 +45,26 @@
function createDefaultModel(): Model {
  return {
      id: null,
      materialname: '',
      batchcode: '',
      actualstarttime: null,
      jobinput: null,
      weightloss: null,
      slkrate: null,
      weight: null,
      distimebegin: null,
      distimeend: null,
      siloid: ''
    id: null,
    materialname: '',
    batchcode: '',
    actualstarttime: null,
    jobinput: null,
    weightloss: null,
    slkrate: null,
    weight: null,
    distimebegin: null,
    distimeend: null,
    siloid: ''
  };
}
type RuleKey = Extract<
  keyof Model,
  | 'id'
  | 'materialname'
  | 'batchcode'
>;
type RuleKey = Extract<keyof Model, 'id' | 'materialname' | 'batchcode'>;
const rules: Record<RuleKey, App.Global.FormRule> = {
  id: createRequiredRule('id不能为空'),
  materialname: createRequiredRule('牌号不能为空'),
  batchcode: createRequiredRule('批次号不能为空'),
  batchcode: createRequiredRule('批次号不能为空')
};
function handleUpdateModelWhenEdit() {
@@ -87,16 +82,51 @@
async function handleSubmit() {
  await validate();
  const { id, materialname, batchcode, actualstarttime, jobinput, weightloss, slkrate, weight, distimebegin, distimeend, siloid } = model.value;
  const {
    id,
    materialname,
    batchcode,
    actualstarttime,
    jobinput,
    weightloss,
    slkrate,
    weight,
    distimebegin,
    distimeend,
    siloid
  } = model.value;
  // request
  if (props.operateType === 'add') {
    const { error } = await fetchCreateStoreSilk({ materialname, batchcode, actualstarttime, jobinput, weightloss, slkrate, weight, distimebegin, distimeend, siloid });
    const { error } = await fetchCreateStoreSilk({
      materialname,
      batchcode,
      actualstarttime,
      jobinput,
      weightloss,
      slkrate,
      weight,
      distimebegin,
      distimeend,
      siloid
    });
    if (error) return;
  }
  if (props.operateType === 'edit') {
    const { error } = await fetchUpdateStoreSilk({ id, materialname, batchcode, actualstarttime, jobinput, weightloss, slkrate, weight, distimebegin, distimeend, siloid });
    const { error } = await fetchUpdateStoreSilk({
      id,
      materialname,
      batchcode,
      actualstarttime,
      jobinput,
      weightloss,
      slkrate,
      weight,
      distimebegin,
      distimeend,
      siloid
    });
    if (error) return;
  }
@@ -132,16 +162,16 @@
          />
        </NFormItem>
        <NFormItem label="投料重量" path="jobinput">
          <NInput v-model:value="model.jobinput" placeholder="请输入投料重量" />
          <NInputNumber v-model:value="model.jobinput" placeholder="请输入投料重量" class="w-full" />
        </NFormItem>
        <NFormItem label="损耗重量" path="weightloss">
          <NInput v-model:value="model.weightloss" placeholder="请输入损耗重量" />
          <NInputNumber v-model:value="model.weightloss" placeholder="请输入损耗重量" class="w-full" />
        </NFormItem>
        <NFormItem label="出叶丝率" path="slkrate">
          <NInput v-model:value="model.slkrate" placeholder="请输入出叶丝率" />
          <NInputNumber v-model:value="model.slkrate" placeholder="请输入出叶丝率" class="w-full" />
        </NFormItem>
        <NFormItem label="储丝柜重量" path="weight">
          <NInput v-model:value="model.weight" placeholder="请输入储丝柜重量" />
          <NInputNumber v-model:value="model.weight" placeholder="请输入储丝柜重量" class="w-full" />
        </NFormItem>
        <NFormItem label="储丝柜出料开始时间" path="distimebegin">
          <NDatePicker