张田田 před 4 měsíci
rodič
revize
99b29ed39c
1 změnil soubory, kde provedl 176 přidání a 226 odebrání
  1. 176 226
      src/service/AddItems.vue

+ 176 - 226
src/service/AddItems.vue

@@ -40,13 +40,13 @@ const { loading: branchLoading } = useRequest(branchMethod).onSuccess(({ data })
   const to = (data?: any[]): any[] => {
     return Array.isArray(data)
       ? data.map((item) => {
-          return {
-            ...item,
-            value: item.id,
-            key: item.id.toString(),
-            children: to(item.children),
-          };
-        })
+        return {
+          ...item,
+          value: item.id,
+          key: item.id.toString(),
+          children: to(item.children),
+        };
+      })
       : [];
   };
   branch.value = to(data);
@@ -321,15 +321,15 @@ function doSubmit() {
 
   // 购买链接与跳转类型联动校验
   if (form.addType === 'itemsList') {
-   
+
     // 有购买链接则必须选择跳转类型
     const hasBuyUrl = !!(form.attrEighth && String(form.attrEighth).trim());
     if (hasBuyUrl && !form.attrNinth) {
       message.error('请选择跳转类型');
       return;
     }
-     // 如果选择了小程序码类型,类型是小程序码  小程序码必填 链接可填
-     if (form.attrNinth === 'miniprogram' && miniProgramCodeList.value.length === 0) {
+    // 如果选择了小程序码类型,类型是小程序码  小程序码必填 链接可填
+    if (form.attrNinth === 'miniprogram' && miniProgramCodeList.value.length === 0) {
       message.error('请上传小程序码');
       return;
     }
@@ -419,7 +419,7 @@ onMounted(async () => {
     if (res.isForInfer === 'Y') checked.push('2');
     checkedList.value = checked.length > 0 ? checked : ['1', '2'];
     Object.assign(form, res);
-     suggestedFrequencyUnit.value = res.convertUnit; // 建议频率使用单位
+    suggestedFrequencyUnit.value = res.convertUnit; // 建议频率使用单位
     form.cpMedicines = (res.cpMedicines ?? []).map((item: any) => ({
       name: item.name || item.herbName || item.medicineName || '',
       dosage: item.dosage,
@@ -434,36 +434,36 @@ onMounted(async () => {
 
     fileList.value = res.photo
       ? [
-          {
-            uid: '-1',
-            name: 'image.png',
-            status: 'done',
-            url: res.photo,
-            thumbUrl: res.photo,
-          },
-        ]
+        {
+          uid: '-1',
+          name: 'image.png',
+          status: 'done',
+          url: res.photo,
+          thumbUrl: res.photo,
+        },
+      ]
       : [];
     optionsList.value = res.itemImgFirst
       ? [
-          {
-            uid: '-1',
-            name: 'image.png',
-            status: 'done',
-            url: res.itemImgFirst,
-            thumbUrl: res.itemImgFirst,
-          },
-        ]
+        {
+          uid: '-1',
+          name: 'image.png',
+          status: 'done',
+          url: res.itemImgFirst,
+          thumbUrl: res.itemImgFirst,
+        },
+      ]
       : [];
     miniProgramCodeList.value = res.attrTen
       ? [
-          {
-            uid: '-1',
-            name: 'image.png',
-            status: 'done',
-            url: res.attrTen,
-            thumbUrl: res.attrTen,
-          },
-        ]
+        {
+          uid: '-1',
+          name: 'image.png',
+          status: 'done',
+          url: res.attrTen,
+          thumbUrl: res.attrTen,
+        },
+      ]
       : [];
     // 处理视频数据
     if (res.itemVideoFirst) {
@@ -728,7 +728,7 @@ watch(
       // 一口价模式:建议频率单位与一口价单位保持一致
       if (form.cpFixedPricingRule?.convertUnit) {
         suggestedFrequencyUnit.value = form.cpFixedPricingRule.convertUnit;
-      }else{
+      } else {
         suggestedFrequencyUnit.value = '';
       }
     } else if (val === '1') {
@@ -868,17 +868,8 @@ function handleDerivation() {
         <a-input v-model:value="form.name" placeholder="请输入" />
       </a-form-item>
       <a-form-item label="方案类型:" name="conditioningProgramType" style="width: 100%" required>
-        <vxe-select
-          v-model="form.conditioningProgramType"
-          :options="typeOptions"
-          placeholder="请选择方案类型"
-          clearable
-          filterable
-          transfer
-          empty-text="暂无数据"
-          @focus="handleSelectClick"
-          style="width: 100%"
-        />
+        <vxe-select v-model="form.conditioningProgramType" :options="typeOptions" placeholder="请选择方案类型" clearable
+          filterable transfer empty-text="暂无数据" @focus="handleSelectClick" style="width: 100%" />
       </a-form-item>
       <a-form-item label="项目应用:" required v-if="form.addType === 'itemsList'">
         <a-checkbox-group v-model:value="checkedList">
@@ -897,7 +888,7 @@ function handleDerivation() {
       <a-form-item label="计价规则:" name="pricingType" :required="checkedList.includes('1')">
         <a-radio-group v-model:value="form.pricingType">
           <a-radio value="0">一口价</a-radio>
-          <a-radio value="1">按穴位/经络/部位</a-radio>
+          <a-radio value="1" v-if="!checkedList.includes('2')">按穴位/经络/部位</a-radio>
         </a-radio-group>
       </a-form-item>
       <div class="price-row" v-if="form.pricingType === '0' && form.cpFixedPricingRule">
@@ -909,101 +900,69 @@ function handleDerivation() {
         <a-input v-model:value="form.cpFixedPricingRule.pricingUnit" placeholder="请输入" style="width: 100px" />
 
         <span style="margin-left: 32px">相当于</span>
-        <a-input v-model:value="form.cpFixedPricingRule.convertDose" placeholder="请输入" style="width: 100px; margin-left: 8px" />
-        <vxe-select v-model="form.cpFixedPricingRule.convertUnit" :options="unitOptions" placeholder="请选择" clearable transfer style="width: 100px; margin-left: 8px" />
+        <a-input v-model:value="form.cpFixedPricingRule.convertDose" placeholder="请输入"
+          style="width: 100px; margin-left: 8px" />
+        <vxe-select v-model="form.cpFixedPricingRule.convertUnit" :options="unitOptions" placeholder="请选择" clearable
+          transfer style="width: 100px; margin-left: 8px" />
 
         <span style="color: #aaa; margin-left: 8px">(使用单位)</span>
       </div>
-      <a-form-item label="建议频率:" v-if="form.addType === 'itemsList' || form.addType === 'system'" required>
-        <div class="suggested-frequency-row">
-          <span>每</span>
-          <a-input v-model:value="form.frequencyType" placeholder="请输入" style="width: 100px; margin: 0 8px" />
-          <span>天</span>
-          <a-input v-model:value="form.frequencyMeasure" placeholder="请输入" style="width: 100px; margin: 0 8px" />
-          <vxe-select
-            v-model="suggestedFrequencyUnit"
-            :options="unitOptions"
-            placeholder="请选择"
-            :clearable="form.pricingType !== '0'"
-            transfer
-            style="width: 100px; margin-left: 8px"
-          />
-        </div>
-      </a-form-item>
-      <a-form-item
-        label="服务所需时间:"
-        v-if="(form.addType === 'itemsList' || form.addType === 'system') && showServiceRequiredTime"
-        required
-      >
-        <a-input v-model:value="form.offlineDuration" placeholder="请输入" style="width: 200px" />
-        <span style="margin-left: 8px">分钟</span>
-      </a-form-item>
       <div v-if="form.pricingType === '1'" class="per-rule">
         <div class="price-row">
           <span>计价1:</span>
-          <span class="flex items-center"
-            >当"穴位/经络/部位" ≤
-            <a-input
-              placeholder="请输入"
-              class="w-20 ml-2 mr-2"
-              v-model:value="form.cpDynamicPricingRule[0].min"
-              @change="() => (form.cpDynamicPricingRule[1].max = form.cpDynamicPricingRule[0].min)"
-            />个时,</span
-          >
-          <vxe-select
-            v-model="form.cpDynamicPricingRule[0].priceType"
-            :options="[
-              { label: '单价', value: 0, priceType: 0 },
-              { label: '一口价', value: 1, priceType: 1 },
-            ]"
-            placeholder="请选择"
-            clearable
-            transfer
-            style="width: 100px; margin: 0 4px"
-          />
+          <span class="flex items-center">当"穴位/经络/部位" ≤
+            <a-input placeholder="请输入" class="w-20 ml-2 mr-2" v-model:value="form.cpDynamicPricingRule[0].min"
+              @change="() => (form.cpDynamicPricingRule[1].max = form.cpDynamicPricingRule[0].min)" />个时,</span>
+          <vxe-select v-model="form.cpDynamicPricingRule[0].priceType" :options="[
+            { label: '单价', value: 0, priceType: 0 },
+            { label: '一口价', value: 1, priceType: 1 },
+          ]" placeholder="请选择" clearable transfer style="width: 100px; margin: 0 4px" />
           <span>=</span>
-          <a-input v-model:value="form.cpDynamicPricingRule[0].price" style="width: 80px; margin: 0 4px" placeholder="请输入" />
+          <a-input v-model:value="form.cpDynamicPricingRule[0].price" style="width: 80px; margin: 0 4px"
+            placeholder="请输入" />
           <span>元</span>
         </div>
         <div class="price-row">
           <span>计价2:</span>
-          <span class="flex items-center"
-            >当"穴位/经络/部位" &gt; <a-input placeholder="请输入" class="w-20 ml-2 mr-2" v-model:value="form.cpDynamicPricingRule[1].max" disabled />个时,</span
-          >
-          <vxe-select
-            v-model="form.cpDynamicPricingRule[1].priceType"
-            :options="[
-              { label: '单价', value: 0, priceType: 0 },
-              { label: '一口价', value: 1, priceType: 1 },
-            ]"
-            placeholder="请选择"
-            clearable
-            transfer
-            style="width: 100px; margin: 0 4px"
-          />
+          <span class="flex items-center">当"穴位/经络/部位" &gt; <a-input placeholder="请输入" class="w-20 ml-2 mr-2"
+              v-model:value="form.cpDynamicPricingRule[1].max" disabled />个时,</span>
+          <vxe-select v-model="form.cpDynamicPricingRule[1].priceType" :options="[
+            { label: '单价', value: 0, priceType: 0 },
+            { label: '一口价', value: 1, priceType: 1 },
+          ]" placeholder="请选择" clearable transfer style="width: 100px; margin: 0 4px" />
           <span>=</span>
-          <a-input v-model:value="form.cpDynamicPricingRule[1].price" style="width: 80px; margin: 0 4px" placeholder="请输入" />
+          <a-input v-model:value="form.cpDynamicPricingRule[1].price" style="width: 80px; margin: 0 4px"
+            placeholder="请输入" />
           <span>元</span>
         </div>
       </div>
+      <a-form-item label="建议频率:" v-if="form.addType === 'itemsList' || form.addType === 'system'" required>
+        <div class="suggested-frequency-row">
+          <span>每</span>
+          <a-input v-model:value="form.frequencyType" placeholder="请输入" style="width: 100px; margin: 0 8px" />
+          <span>天</span>
+          <a-input v-model:value="form.frequencyMeasure" placeholder="请输入" style="width: 100px; margin: 0 8px" />
+          <vxe-select v-model="suggestedFrequencyUnit" :options="unitOptions" placeholder="请选择"
+            :clearable="form.pricingType !== '0'" transfer style="width: 100px; margin-left: 8px" />
+        </div>
+      </a-form-item>
+      <a-form-item label="服务所需时间:"
+        v-if="(form.addType === 'itemsList' || form.addType === 'system') && showServiceRequiredTime" required>
+        <a-input v-model:value="form.offlineDuration" placeholder="请输入" style="width: 200px" />
+        <span style="margin-left: 8px">分钟</span>
+      </a-form-item>
+
 
       <a-form-item label="组成:">
         <div class="herb-list">
           <template v-for="(herb, idx) in form.cpMedicines" :key="herb.id">
             <div class="herb-item">
-              <button class="herb-remove" v-if="form?.cpMedicines?.length > 1" @click="removeHerb(idx)" type="button">×</button>
+              <button class="herb-remove" v-if="form?.cpMedicines?.length > 1" @click="removeHerb(idx)"
+                type="button">×</button>
               <!-- <RemoteSelect :load="cpMedicinesMethod" key-prop="name" v-model:value="herb.name" /> -->
-              <SearchableSelect
-                v-model="herb.name"
-                :options="herbList"
-                placeholder="请选择"
-                value-key="name"
-                label-key="name"
-                key-key="id"
-                :fetch-options="cpMedicinesMethod"
-                style="width: 150px"
-                :allow-custom-input="true"
-              />
+              <SearchableSelect v-model="herb.name" :options="herbList" placeholder="请选择" value-key="name"
+                label-key="name" key-key="id" :fetch-options="cpMedicinesMethod" style="width: 150px"
+                :allow-custom-input="true" />
               <a-input v-model:value="herb.dosage" class="herb-dosage" placeholder="剂量" />
               <span>g</span>
             </div>
@@ -1012,12 +971,8 @@ function handleDerivation() {
         </div>
       </a-form-item>
       <a-form-item label="特色:" v-if="form.addType === 'itemsList'">
-        <textarea
-          v-model="form.attrFirst"
-          placeholder="请输入"
-          rows="3"
-          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit"
-        />
+        <textarea v-model="form.attrFirst" placeholder="请输入" rows="3"
+          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit" />
       </a-form-item>
       <a-form-item label="功效:">
         <a-input v-model:value="form.effect" placeholder="请输入" />
@@ -1029,17 +984,14 @@ function handleDerivation() {
         <a-input v-model:value="form.attrFourth" placeholder="请输入" />
       </a-form-item>
       <a-form-item label="操作方法:" v-if="form.addType === 'itemsList'">
-        <textarea
-          v-model="form.attrFifth"
-          placeholder="请输入"
-          rows="3"
-          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit"
-        />
+        <textarea v-model="form.attrFifth" placeholder="请输入" rows="3"
+          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit" />
       </a-form-item>
 
       <div class="image-row">
         <a-form-item label="操作图片:" class="image-form-item" v-if="form.addType === 'itemsList'">
-          <a-upload :showUploadList="uploadProps" v-model:file-list="optionsList" list-type="picture-card" @preview="handlePreview" :maxCount="1" :customRequest="customUpload">
+          <a-upload :showUploadList="uploadProps" v-model:file-list="optionsList" list-type="picture-card"
+            @preview="handlePreview" :maxCount="1" :customRequest="customUpload">
             <div v-if="optionsList.length < 1">
               <PlusOutlined />
               <div style="margin-top: 8px">上传</div>
@@ -1047,7 +999,8 @@ function handleDerivation() {
           </a-upload>
         </a-form-item>
         <a-form-item label="商品图片:" class="image-form-item" name="photo" required>
-          <a-upload :showUploadList="uploadProps" v-model:file-list="fileList" list-type="picture-card" @preview="handlePreview" :maxCount="1" :customRequest="customUpload">
+          <a-upload :showUploadList="uploadProps" v-model:file-list="fileList" list-type="picture-card"
+            @preview="handlePreview" :maxCount="1" :customRequest="customUpload">
             <div v-if="fileList.length < 1">
               <PlusOutlined />
               <div style="margin-top: 8px">上传</div>
@@ -1058,16 +1011,9 @@ function handleDerivation() {
       <a-form-item label="操作视频:" class="image-form-item" v-if="form.addType === 'itemsList'">
         <div class="video-upload-wrapper">
           <div class="video-upload-container">
-            <a-upload
-              :showUploadList="false"
-              :custom-request="customVideoRequest"
-              :max-count="1"
-              :multiple="false"
-              :before-upload="beforeVideoUpload"
-              @change="handleVideoChange"
-              :file-list="videoFileList"
-              accept="video/mp4,video/avi,video/mov,video/webm"
-            >
+            <a-upload :showUploadList="false" :custom-request="customVideoRequest" :max-count="1" :multiple="false"
+              :before-upload="beforeVideoUpload" @change="handleVideoChange" :file-list="videoFileList"
+              accept="video/mp4,video/avi,video/mov,video/webm">
               <div v-if="!form.itemVideoFirst && !uploading" class="video-upload-btn">
                 <PlusOutlined />
                 <div style="margin-top: 8px">上传视频</div>
@@ -1087,17 +1033,13 @@ function handleDerivation() {
                 <div class="video-thumbnail">
                   <video :src="form.itemVideoFirst" preload="metadata" class="video-preview" />
                   <div class="video-overlay">
-                    <a-button
-                      type="primary"
-                      size="small"
-                      @click.stop="
-                        handleVideoPreview({
-                          uid: 'video-preview',
-                          name: '操作视频',
-                          url: form.itemVideoFirst,
-                        })
-                      "
-                    >
+                    <a-button type="primary" size="small" @click.stop="
+                      handleVideoPreview({
+                        uid: 'video-preview',
+                        name: '操作视频',
+                        url: form.itemVideoFirst,
+                      })
+                      ">
                       预览
                     </a-button>
                     <a-button danger size="small" @click.stop="removeVideo"> 删除 </a-button>
@@ -1113,20 +1055,12 @@ function handleDerivation() {
         </div>
       </a-form-item>
       <a-form-item label="疗程说明:" v-if="form.addType === 'itemsList'">
-        <textarea
-          v-model="form.attrSixth"
-          placeholder="请输入"
-          rows="3"
-          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit"
-        />
+        <textarea v-model="form.attrSixth" placeholder="请输入" rows="3"
+          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit" />
       </a-form-item>
       <a-form-item label="使用注意:" v-if="form.addType === 'itemsList'">
-        <textarea
-          v-model="form.attrSeventh"
-          placeholder="请输入"
-          rows="3"
-          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit"
-        />
+        <textarea v-model="form.attrSeventh" placeholder="请输入" rows="3"
+          style="width: 100%; padding: 8px; border: 1px solid #d9d9d9; border-radius: 4px; resize: vertical; font-family: inherit" />
       </a-form-item>
       <a-form-item label="推导逻辑:" v-if="form.addType === 'itemsList'" :required="checkedList.includes('2')">
         <button @click="handleDerivation" v-if="!hasDerivationLogic || isDerivationEmpty">编辑</button>
@@ -1140,23 +1074,37 @@ function handleDerivation() {
               <span class="derivation-label">年龄限制:</span>
               <span class="derivation-content">{{ derivationData.cpPatientMatchRule.age }}</span>
             </div>
-            <div v-if="derivationData.cpPatientMatchRule.diagnoseDiseaseNames && derivationData.cpPatientMatchRule.diagnoseDiseaseNames.length > 0" class="derivation-item">
+            <div
+              v-if="derivationData.cpPatientMatchRule.diagnoseDiseaseNames && derivationData.cpPatientMatchRule.diagnoseDiseaseNames.length > 0"
+              class="derivation-item">
               <span class="derivation-label">专病:</span>
-              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.diagnoseDiseaseNames.join('、') }}</span>
+              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.diagnoseDiseaseNames.join('、')
+                }}</span>
             </div>
-            <div v-if="derivationData.cpPatientMatchRule.diagnoseSyndromeNames && derivationData.cpPatientMatchRule.diagnoseSyndromeNames.length > 0" class="derivation-item">
+            <div
+              v-if="derivationData.cpPatientMatchRule.diagnoseSyndromeNames && derivationData.cpPatientMatchRule.diagnoseSyndromeNames.length > 0"
+              class="derivation-item">
               <span class="derivation-label">证型:</span>
-              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.diagnoseSyndromeNames.join('、') }}</span>
+              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.diagnoseSyndromeNames.join('、')
+                }}</span>
             </div>
-            <div v-if="derivationData.cpPatientMatchRule.constitutionGroupNames && derivationData.cpPatientMatchRule.constitutionGroupNames.length > 0" class="derivation-item">
+            <div
+              v-if="derivationData.cpPatientMatchRule.constitutionGroupNames && derivationData.cpPatientMatchRule.constitutionGroupNames.length > 0"
+              class="derivation-item">
               <span class="derivation-label">体质:</span>
-              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.constitutionGroupNames.join('、') }}</span>
+              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.constitutionGroupNames.join('、')
+                }}</span>
             </div>
-            <div v-if="derivationData.cpPatientMatchRule.willillStateNames && derivationData.cpPatientMatchRule.willillStateNames.length > 0" class="derivation-item">
+            <div
+              v-if="derivationData.cpPatientMatchRule.willillStateNames && derivationData.cpPatientMatchRule.willillStateNames.length > 0"
+              class="derivation-item">
               <span class="derivation-label">欲病状态:</span>
-              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.willillStateNames.join('、') }}</span>
+              <span class="derivation-content">{{ derivationData.cpPatientMatchRule.willillStateNames.join('、')
+                }}</span>
             </div>
-            <div v-if="derivationData.cpPatientMatchRule.tabooCrowds && derivationData.cpPatientMatchRule.tabooCrowds.length > 0" class="derivation-item">
+            <div
+              v-if="derivationData.cpPatientMatchRule.tabooCrowds && derivationData.cpPatientMatchRule.tabooCrowds.length > 0"
+              class="derivation-item">
               <span class="derivation-label">禁忌人群:</span>
               <span class="derivation-content">{{ derivationData.cpPatientMatchRule.tabooCrowds.join('、') }}</span>
             </div>
@@ -1165,22 +1113,17 @@ function handleDerivation() {
       </a-form-item>
       <!-- 跳转类型 -->
       <a-form-item label="跳转类型:" v-if="form.addType === 'itemsList'" style="width: 100%">
-        <Vxe-select v-model="form.attrNinth" :options="jumpTypeOptions" placeholder="请选择" clearable transfer style="width: 100%" />
+        <Vxe-select v-model="form.attrNinth" :options="jumpTypeOptions" placeholder="请选择" clearable transfer
+          style="width: 100%" />
       </a-form-item>
       <!-- 购买链接 -->
       <a-form-item label="购买链接:" v-if="form.addType === 'itemsList' && showBuyLink">
         <a-input v-model:value="form.attrEighth" placeholder="请输入" />
       </a-form-item>
-      <a-form-item label="小程序码:" class="image-form-item" 
-      v-if="form.addType === 'itemsList' && showMiniProgramCode" :required="isMiniProgramCodeType">
-        <a-upload
-          :showUploadList="uploadProps"
-          v-model:file-list="miniProgramCodeList"
-          list-type="picture-card"
-          @preview="handlePreview"
-          :maxCount="1"
-          :customRequest="customUpload"
-        >
+      <a-form-item label="小程序码:" class="image-form-item" v-if="form.addType === 'itemsList' && showMiniProgramCode"
+        :required="isMiniProgramCodeType">
+        <a-upload :showUploadList="uploadProps" v-model:file-list="miniProgramCodeList" list-type="picture-card"
+          @preview="handlePreview" :maxCount="1" :customRequest="customUpload">
           <div v-if="miniProgramCodeList.length < 1">
             <PlusOutlined />
             <div style="margin-top: 8px">上传</div>
@@ -1189,35 +1132,17 @@ function handleDerivation() {
       </a-form-item>
       <!-- 机构名称 -->
       <a-form-item label="机构名称:" v-if="form?.addType === 'itemsList'" required name="institutionId">
-        <a-tree-select
-          :disabled="form.addType === 'itemsList' && !!form.sourceId"
-          v-model:value="form.institutionId"
-          style="width: 100%"
-          :dropdownStyle="{ maxHeight: '400px', overflow: 'auto', zIndex: 4000 }"
-          :dropdownMatchSelectWidth="false"
-          :getPopupContainer="getSafePopupContainer"
-          placeholder="请选择"
-          allow-clear
-          tree-default-expand-all
-          :tree-data="branch"
-          :loading="branchLoading"
-          @change="onInstitutionChange"
-        ></a-tree-select>
+        <a-tree-select :disabled="form.addType === 'itemsList' && !!form.sourceId" v-model:value="form.institutionId"
+          style="width: 100%" :dropdownStyle="{ maxHeight: '400px', overflow: 'auto', zIndex: 4000 }"
+          :dropdownMatchSelectWidth="false" :getPopupContainer="getSafePopupContainer" placeholder="请选择" allow-clear
+          tree-default-expand-all :tree-data="branch" :loading="branchLoading"
+          @change="onInstitutionChange"></a-tree-select>
       </a-form-item>
       <a-form-item label="供应商:" name="conditioningProgramSupplierId" :rules="supplierRules" style="width: 100%">
-        <a-select
-          v-model:value="form.conditioningProgramSupplierId"
-          :options="supplierOptions"
-          placeholder="请选择"
-          allow-clear
-          show-search
-          :getPopupContainer="getSafePopupContainer"
-          :dropdownMatchSelectWidth="false"
-          :dropdownStyle="{ zIndex: 5000 }"
-          style="width: 100%"
-          @change="getConditioningProgramSupplier"
-          not-found-content="暂无数据"
-        />
+        <a-select v-model:value="form.conditioningProgramSupplierId" :options="supplierOptions" placeholder="请选择"
+          allow-clear show-search :getPopupContainer="getSafePopupContainer" :dropdownMatchSelectWidth="false"
+          :dropdownStyle="{ zIndex: 5000 }" style="width: 100%" @change="getConditioningProgramSupplier"
+          not-found-content="暂无数据" />
       </a-form-item>
       <a-form-item label="配送:" name="isDelivery" v-if="showDelivery" :required="form.sellType === '1'">
         <a-checkbox-group v-model:value="deliverArr" @change="deliveryChange">
@@ -1231,16 +1156,12 @@ function handleDerivation() {
           <a-radio value="1">停用</a-radio>
         </a-radio-group>
       </a-form-item>
-      <a-image
-        :width="200"
-        :style="{ display: 'none' }"
-        :preview="{
-          visible,
-          onVisibleChange: setVisible,
-        }"
-        :src="previewImg"
-      />
-      <video :src="videoUrl" controls v-if="videoUrl" style="width: 100%; max-width: 500px; border-radius: 6px" preload="metadata" />
+      <a-image :width="200" :style="{ display: 'none' }" :preview="{
+        visible,
+        onVisibleChange: setVisible,
+      }" :src="previewImg" />
+      <video :src="videoUrl" controls v-if="videoUrl" style="width: 100%; max-width: 500px; border-radius: 6px"
+        preload="metadata" />
       <div class="form-actions-center">
         <a-button @click="cancel">取消</a-button>
         <a-button type="primary" style="background: #faad14; border: none" @click="doSubmit">确定</a-button>
@@ -1258,28 +1179,34 @@ function handleDerivation() {
   flex-direction: column;
   /* max-height: 80vh; */
 }
+
 .per-rule {
   margin-bottom: 16px;
 }
+
 .price-row {
   display: flex;
   align-items: center;
   margin-bottom: 15px;
 }
+
 .suggested-frequency-row {
   display: flex;
   align-items: center;
 }
+
 .label {
   font-weight: 500;
   color: #222;
   margin-right: 8px;
 }
+
 .herb-list {
   display: flex;
   align-items: center;
   flex-wrap: wrap;
 }
+
 .herb-item {
   position: relative;
   display: flex;
@@ -1288,11 +1215,13 @@ function handleDerivation() {
   margin-bottom: 8px;
   padding-left: 16px;
 }
+
 .herb-dosage {
   width: 70px;
   font-size: 14px;
   margin-right: 10px;
 }
+
 .herb-remove {
   position: absolute;
   left: 0;
@@ -1310,6 +1239,7 @@ function handleDerivation() {
   align-items: center;
   justify-content: center;
 }
+
 .form-actions-center {
   display: flex;
   justify-content: center;
@@ -1325,9 +1255,11 @@ function handleDerivation() {
   flex-direction: column;
   overflow: auto;
 }
+
 .slider-section {
   margin-bottom: 16px;
 }
+
 .slider-labels {
   display: flex;
   justify-content: space-between;
@@ -1337,10 +1269,12 @@ function handleDerivation() {
   font-weight: 500;
   color: #222;
 }
+
 .slider-row {
   display: flex;
   align-items: center;
 }
+
 .slider-desc {
   color: #222;
   white-space: nowrap;
@@ -1349,11 +1283,13 @@ function handleDerivation() {
   align-items: center;
   justify-content: center;
 }
+
 .slider-value {
   margin-left: 16px;
   color: #faad14;
   font-weight: bold;
 }
+
 .upload-btn {
   display: flex;
   flex-direction: column;
@@ -1367,51 +1303,61 @@ function handleDerivation() {
   transition: border-color 0.3s;
   width: 100px;
 }
+
 .upload-btn:hover {
   border-color: #1890ff;
   background: #f0f7ff;
 }
+
 .upload-btn .anticon {
   font-size: 16px;
   color: #1890ff;
 }
+
 .upload-btn .upload-text {
   margin-top: 8px;
   color: #666;
   font-size: 15px;
 }
+
 .video-preview {
   border-radius: 6px;
   background: #000;
   width: 120px !important;
   height: 100px !important;
 }
+
 .video-preview video {
   border-radius: 6px;
   background: #000;
   width: 120px;
   height: 100px;
 }
+
 .video-preview .ant-btn-link {
   padding: 0;
   font-size: 14px;
   color: #ff4d4f;
 }
+
 .image-row {
   display: flex;
   gap: 32px;
   align-items: flex-start;
   margin-bottom: 16px;
 }
+
 .image-form-item {
   flex: 1;
   margin-bottom: 0 !important;
 }
+
 .image-form-item .ant-upload-picture-card-wrapper {
   display: flex;
   flex-direction: column;
   align-items: flex-start;
 }
+
 .derivation-item {
   display: flex;
   align-items: center;
@@ -1422,6 +1368,7 @@ function handleDerivation() {
   border-radius: 4px;
   border: 1px solid #e8e8e8;
 }
+
 .derivation-label {
   font-weight: 500;
   color: #222;
@@ -1429,18 +1376,21 @@ function handleDerivation() {
   white-space: nowrap;
   font-size: 13px;
 }
+
 .derivation-content {
   color: #555;
   font-size: 13px;
   flex: 1;
   word-break: break-all;
 }
+
 .derivation-container {
   display: flex;
   flex-wrap: wrap;
   gap: 16px;
   align-items: flex-start;
 }
+
 .video-upload-wrapper {
   display: flex;
   align-items: flex-start;