index.vue 115 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110
  1. <template>
  2. <div class="p-2">
  3. <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
  4. <div v-show="showSearch" class="mb-[10px]">
  5. <el-card shadow="hover">
  6. <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="150px">
  7. <el-form-item label="产品分类" prop="productCategory">
  8. <el-cascader v-model="queryParams.productCategoryList" :options="categoryOptions" :props="{ checkStrictly: true, emitPath: true, value: 'value', label: 'label', children: 'children' }" placeholder="请选择" clearable filterable style="width: 200px" />
  9. </el-form-item>
  10. <el-form-item>
  11. <el-input v-model="queryParams.productName" placeholder="请输入名称/编码" clearable @keyup.enter="handleQuery" style="margin-left: 30px;" />
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
  15. <el-button icon="Refresh" @click="resetQuery">重置</el-button>
  16. </el-form-item>
  17. </el-form>
  18. </el-card>
  19. </div>
  20. </transition>
  21. <el-card shadow="never">
  22. <template #header>
  23. <el-row :gutter="10" class="mb8">
  24. <el-col :span="1.5">
  25. <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['warehouse:nutrition:add']">新增营养产品</el-button>
  26. </el-col>
  27. <!-- <el-col :span="1.5">
  28. <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['warehouse:nutrition:edit']">修改</el-button>
  29. </el-col>
  30. <el-col :span="1.5">
  31. <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['warehouse:nutrition:remove']">删除</el-button>
  32. </el-col> -->
  33. <!-- <el-col :span="1.5">
  34. <el-button type="warning" plain @click="handleImport" v-hasPermi="['system:diseaseLabel:export']">导入</el-button>
  35. </el-col> -->
  36. <el-col :span="1.5">
  37. <el-button type="warning" plain @click="handleExport" v-hasPermi="['warehouse:nutrition:export']">导出</el-button>
  38. </el-col>
  39. <el-col :span="1.5">
  40. <el-button type="warning" plain @click="downLoadTemplate" v-hasPermi="['system:diseaseLabel:export']">下载模板下载</el-button>
  41. </el-col>
  42. <el-col :span="1.5">
  43. <el-button type="warning" plain @click="openBatchSetDialog">批量设置</el-button>
  44. </el-col>
  45. <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
  46. </el-row>
  47. </template>
  48. <el-table v-loading="loading" border :data="nutritionList" @selection-change="handleSelectionChange">
  49. <el-table-column type="selection" width="55" align="center" />
  50. <el-table-column label="产品名称" align="center" prop="productName" />
  51. <el-table-column label="商品编码" align="center" prop="productCode" />
  52. <el-table-column label="产品分类" align="center">
  53. <template #default="{ row }">
  54. {{ getCategoryName(row.productCategory) }}
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="规格" align="center" prop="productSpec">
  58. <template #default="scope">
  59. {{ scope.row.productSpec}}{{ product_spec_unit.find(item => item.value === scope.row.productSpecUnit)?.label || '--' }}/{{ product_package_unit.find(item => item.value === scope.row.packageUnit)?.label || '--' }}
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="剂型/形态" align="center">
  63. <template #default="{ row }">
  64. {{ dosage_form.find(item => item.value === row.dosageForm)?.label || '--' }}
  65. </template>
  66. </el-table-column>
  67. <el-table-column label="许可证临期提醒" align="center" prop="licenseExpiryReminder" width="180">
  68. <template #default="scope">
  69. <span v-if="scope.row.licenseExpiryReminder>0">{{ scope.row.licenseExpiryReminder+"个月"}}</span>
  70. <span v-else>{{ '--'}}</span>
  71. </template>
  72. </el-table-column>
  73. <el-table-column label="保质期临期提醒" align="center" prop="shelfLifeReminder" width="180">
  74. <template #default="scope">
  75. <span>{{ scope.row.shelfLifeReminder }}个月</span>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="上架状态" align="center" prop="putFlag" width="100">
  79. <template #default="{ row }">
  80. {{ put_flag.find(item => item.value === row.putFlag)?.label || row.putFlag }}
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="180">
  84. <template #default="scope">
  85. <el-button v-if="scope.row.putFlag === '1'" link type="danger" @click="handlePutFlag(scope.row, '0')">下架</el-button>
  86. <el-button v-else link type="success" @click="handlePutFlag(scope.row, '1')">上架</el-button>
  87. <el-button link type="primary" @click="handleDetail(scope.row)">详情</el-button>
  88. </template>
  89. </el-table-column>
  90. </el-table>
  91. <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
  92. </el-card>
  93. <!-- 添加或修改营养产品信息对话框 -->
  94. <el-dialog :title="dialog.title" v-model="dialog.visible" width="70%" append-to-body class="nutrition-dialog">
  95. <el-tabs v-model="activeTab">
  96. <el-scrollbar height="calc(70vh - 120px)">
  97. <el-tab-pane label="基本信息" name="basic">
  98. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  99. <el-divider content-position="left">基本信息:</el-divider>
  100. <el-row :gutter="20">
  101. <el-col :span="12">
  102. <el-form-item label="产品名称:" prop="productName">
  103. <el-input v-model="form.productName" placeholder="请输入" />
  104. </el-form-item>
  105. </el-col>
  106. <el-col :span="12">
  107. <el-form-item label="商品资质:" prop="productQualification">
  108. <el-select v-model="form.productQualification" placeholder="请选择" clearable>
  109. <el-option v-for="dict in product_qualification" :key="dict.value" :label="dict.label" :value="dict.value" />
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. </el-row>
  114. <el-row :gutter="20">
  115. <el-col :span="12">
  116. <el-form-item label="院方系统编码:" prop="hospitalSystemCode">
  117. <el-input v-model="form.hospitalSystemCode" placeholder="请输入" />
  118. </el-form-item>
  119. </el-col>
  120. <el-col :span="12">
  121. <el-form-item label="批准文号:" prop="approvalNumber">
  122. <el-input v-model="form.approvalNumber" placeholder="请输入" />
  123. </el-form-item>
  124. </el-col>
  125. </el-row>
  126. <el-row :gutter="20">
  127. <el-col :span="12">
  128. <el-form-item label="商品编码:" prop="productCode">
  129. <el-input v-model="form.productCode" placeholder="请输入" />
  130. </el-form-item>
  131. </el-col>
  132. <el-col :span="12">
  133. <el-form-item label="口味:" prop="taste">
  134. <el-input v-model="form.taste" placeholder="请输入" />
  135. </el-form-item>
  136. </el-col>
  137. </el-row>
  138. <el-row :gutter="20">
  139. <el-col :span="12">
  140. <el-form-item label="产品所属分类:" prop="productCategory">
  141. <el-cascader v-model="form.productCategoryList" :options="categoryOptions" :props="{ checkStrictly: true, emitPath: true, value: 'value', label: 'label', children: 'children' }" placeholder="请选择" clearable filterable style="width: 100%" />
  142. </el-form-item>
  143. </el-col>
  144. <el-col :span="12">
  145. <el-form-item label="剂型/形态:" prop="dosageForm">
  146. <el-select v-model="form.dosageForm" placeholder="请选择" clearable>
  147. <el-option v-for="dict in dosage_form" :key="dict.value" :label="dict.label" :value="dict.value" />
  148. </el-select>
  149. </el-form-item>
  150. </el-col>
  151. </el-row>
  152. <el-row :gutter="20">
  153. <el-col :span="12">
  154. <el-form-item label="生产厂商:" prop="manufacturer">
  155. <el-select v-model="form.manufacturer" placeholder="请选择" clearable>
  156. <el-option v-for="item in productManufacturerList" :key="item.value" :label="item.label" :value="item.value" />
  157. </el-select>
  158. </el-form-item>
  159. </el-col>
  160. <el-col :span="12">
  161. <el-form-item label="供应商:" prop="supplier">
  162. <el-select v-model="form.supplier" placeholder="请选择" clearable>
  163. <el-option v-for="item in productSupplierList" :key="item.value" :label="item.label" :value="item.value" />
  164. </el-select>
  165. </el-form-item>
  166. </el-col>
  167. </el-row>
  168. <el-row :gutter="20">
  169. <el-col :span="12">
  170. <el-form-item label="品牌:" prop="brand">
  171. <el-input v-model="form.brand" placeholder="请输入" />
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="12">
  175. <el-form-item label="产品适用科室:" prop="applicableDepartment">
  176. <el-cascader v-model="form.applicableDepartmentList" :options="deptList" :props="{
  177. multiple: true,checkStrictly: true, // 允许任意层级选择emitPath: false, // 只返回选中节点的 value
  178. value: 'deptId',label: 'deptName',children: 'children'
  179. }" placeholder="请选择" clearable style="width: 100%" />
  180. </el-form-item>
  181. </el-col>
  182. </el-row>
  183. <el-row :gutter="20">
  184. <el-col :span="12">
  185. <el-form-item label="产品所属标签:" prop="productLabelList">
  186. <el-select v-model="form.productLabelList" multiple placeholder="请选择" style="width: 100%;" :disabled="true" @click="diseaseLabelDialogVisible = true" class="custom-label-select" value-key="labelId">
  187. <el-option v-for="item in form.productLabelList" :key="item.labelId" :label="item.labelName" :value="item">
  188. <el-tag type="info" size="small">{{ item.labelName }}</el-tag>
  189. </el-option>
  190. </el-select>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="12">
  194. <el-form-item label="禁忌症所属标签:" prop="contraindicationLabelList">
  195. <el-select v-model="form.contraindicationLabelList" multiple placeholder="请选择" style="width: 100%;" :disabled="true" @mousedown.prevent="contraindicationLabelDialogVisible = true" class="custom-label-select" value-key="labelId">
  196. <el-option v-for="item in form.contraindicationLabelList" :key="item.labelId" :label="item.labelName" :value="item">
  197. <el-tag type="info" size="small">{{ item.labelName }}</el-tag>
  198. </el-option>
  199. </el-select>
  200. </el-form-item>
  201. </el-col>
  202. </el-row>
  203. <el-row :gutter="20">
  204. <el-col :span="12">
  205. <el-form-item label="许可证临期提醒:" prop="licenseExpiryReminder">
  206. <el-input v-model="form.licenseExpiryReminder" placeholder="请输入">
  207. <template #append>个月</template>
  208. </el-input>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="12">
  212. <el-form-item label="保质期临期提醒:" prop="shelfLifeReminder">
  213. <el-input v-model="form.shelfLifeReminder" placeholder="请输入">
  214. <template #append>个月</template>
  215. </el-input>
  216. </el-form-item>
  217. </el-col>
  218. </el-row>
  219. <el-row :gutter="20">
  220. <el-col :span="12">
  221. <el-form-item label="商品许可证有效期至:" prop="productLicenseExpiry">
  222. <el-date-picker v-model="form.productLicenseExpiry" type="date" placeholder="选择一天" value-format="YYYY-MM-DD" />
  223. </el-form-item>
  224. </el-col>
  225. <el-col :span="12">
  226. <el-form-item label="保质期:" prop="shelfLife">
  227. <el-input v-model="form.shelfLife" placeholder="请输入">
  228. <template #append>个月</template>
  229. </el-input>
  230. </el-form-item>
  231. </el-col>
  232. </el-row>
  233. <!-- 入货配置部分 -->
  234. <el-divider content-position="left">入货信息:</el-divider>
  235. <el-row :gutter="20">
  236. <el-col :span="12">
  237. <el-form-item label="入货价格:" prop="purchasePrice" required>
  238. <el-input v-model="form.purchasePrice" placeholder="请输入">
  239. <template #append>元</template>
  240. </el-input>
  241. </el-form-item>
  242. </el-col>
  243. <el-col :span="12">
  244. <el-form-item label="入货单位:" prop="purchaseUnit" required>
  245. <el-select v-model="form.purchaseUnit" placeholder="请选择" clearable>
  246. <el-option v-for="dict in product_package_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
  247. </el-select>
  248. </el-form-item>
  249. </el-col>
  250. </el-row>
  251. <el-row :gutter="20">
  252. <el-col :span="12">
  253. <el-form-item label="默认用法:" prop="defaultUsage" required>
  254. <el-select v-model="form.defaultUsage" placeholder="请选择" clearable>
  255. <el-option v-for="dict in default_usage" :key="dict.value" :label="dict.label" :value="dict.value" />
  256. </el-select>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="12">
  260. <el-form-item label="预包装单位:" prop="packageUnit">
  261. <el-select v-model="form.packageUnit" placeholder="请选择" clearable>
  262. <el-option v-for="dict in product_package_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
  263. </el-select>
  264. </el-form-item>
  265. </el-col>
  266. </el-row>
  267. <el-row :gutter="20">
  268. <el-col :span="12">
  269. <el-form-item label="商品规格:" prop="productSpec" required>
  270. <div style="display: flex; align-items: center;">
  271. <el-input v-model="form.productSpec" placeholder="请输入" style="width: 500px; border-top-right-radius: 0; border-bottom-right-radius: 0;" :maxlength="10" />
  272. <el-select v-model="form.productSpecUnit" style="width: 80px; border-radius: 0; border-left: none; border-top-left-radius: 0; border-bottom-left-radius: 0;" :popper-append-to-body="false" size="default" @change="onSpecUnitChange">
  273. <el-option v-for="dict in product_spec_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
  274. </el-select>
  275. <span style="margin-left: 8px; color: #606266; font-size: 14px;">/{{getDictLabel(product_package_unit ,form.packageUnit )|| '--' }}</span>
  276. </div>
  277. </el-form-item>
  278. </el-col>
  279. </el-row>
  280. <el-divider content-position="left">预包装销售设置:</el-divider>
  281. <el-row :gutter="20">
  282. <el-col :span="12">
  283. <el-form-item label="预包装销售价:" prop="packagePrice" required>
  284. <el-input v-model="form.packagePrice" placeholder="请输入">
  285. <template #append>元/{{getDictLabel(product_package_unit ,form.packageUnit )|| '--' }}</template>
  286. </el-input>
  287. </el-form-item>
  288. </el-col>
  289. <el-col :span="12">
  290. <el-form-item label="最小包装单位:" prop="minUnit">
  291. <el-select v-model="form.minUnit" placeholder="请选择" clearable>
  292. <el-option v-for="dict in product_package_unit" :key="dict.value" :label="dict.label" :value="dict.value" />
  293. </el-select>
  294. </el-form-item>
  295. </el-col>
  296. </el-row>
  297. <el-row :gutter="20">
  298. <el-col :span="12">
  299. <el-form-item label="最小包装规格:" prop="minSpec">
  300. <el-input v-model="form.minSpec" placeholder="请输入">
  301. <template #append>{{getDictLabel(product_spec_unit ,form.productSpecUnit )|| '--' }}/{{getDictLabel(product_package_unit ,form.minUnit )|| '--' }}</template>
  302. </el-input>
  303. </el-form-item>
  304. </el-col>
  305. <el-col :span="12">
  306. <el-form-item label="净含量/规格:" prop="minUnit">
  307. <span>--</span>
  308. </el-form-item>
  309. </el-col>
  310. </el-row>
  311. <el-divider content-position="left">配置销售设置::</el-divider>
  312. <el-row :gutter="20">
  313. <el-col :span="12">
  314. <el-form-item label="配置销售价格:" prop="configSalePrice" required>
  315. <el-input v-model="form.configSalePrice" placeholder="请输入">
  316. <template #append>元/{{getDictLabel(product_spec_unit ,form.productSpecUnit )|| '--' }}</template>
  317. </el-input>
  318. </el-form-item>
  319. </el-col>
  320. <el-col :span="12">
  321. <el-form-item label="配置损耗率:" prop="configLossRate">
  322. <el-input v-model="form.configLossRate" placeholder="请输入">
  323. <template #append>%</template>
  324. </el-input>
  325. </el-form-item>
  326. </el-col>
  327. </el-row>
  328. </el-form>
  329. </el-tab-pane>
  330. <el-tab-pane label="热能及三大营养素" name="nutrition">
  331. <span style="color: red; font-size: 16px; margin-bottom: 20px">注:每100(g/ml) 含量</span>
  332. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  333. <el-row :gutter="20" style="margin-top:20px">
  334. <el-col :span="8">
  335. <el-form-item label="热量:" prop="calorie">
  336. <el-input v-model="form.calorie" placeholder="请输入">
  337. <template #append>kcal</template>
  338. </el-input>
  339. </el-form-item>
  340. </el-col>
  341. <el-col :span="8">
  342. <el-form-item label="碳水化合物:" prop="carbohydrate">
  343. <el-input v-model="form.carbohydrate" placeholder="请输入">
  344. <template #append>g</template>
  345. </el-input>
  346. </el-form-item>
  347. </el-col>
  348. <el-col :span="8">
  349. <el-form-item label="热能:" prop="heatEnergy">
  350. <el-input v-model="form.heatEnergy" placeholder="请输入">
  351. <template #append>kj</template>
  352. </el-input>
  353. </el-form-item>
  354. </el-col>
  355. </el-row>
  356. <el-row :gutter="20">
  357. <el-col :span="8">
  358. <el-form-item label="蛋白质:" prop="protein">
  359. <el-input v-model="form.protein" placeholder="请输入">
  360. <template #append>g</template>
  361. </el-input>
  362. </el-form-item>
  363. </el-col>
  364. <el-col :span="8">
  365. <el-form-item label="脂肪:" prop="fat">
  366. <el-input v-model="form.fat" placeholder="请输入">
  367. <template #append>g</template>
  368. </el-input>
  369. </el-form-item>
  370. </el-col>
  371. </el-row>
  372. </el-form>
  373. </el-tab-pane>
  374. <el-tab-pane label="常量元素" name="macroElements">
  375. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  376. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  377. <el-row :gutter="20" style="margin-top:20px">
  378. <el-col :span="8">
  379. <el-form-item label="钙:" prop="ca">
  380. <el-input v-model="form.ca" placeholder="请输入">
  381. <template #append>mg</template>
  382. </el-input>
  383. </el-form-item>
  384. </el-col>
  385. <el-col :span="8">
  386. <el-form-item label="磷:" prop="p">
  387. <el-input v-model="form.p" placeholder="请输入">
  388. <template #append>mg</template>
  389. </el-input>
  390. </el-form-item>
  391. </el-col>
  392. <el-col :span="8">
  393. <el-form-item label="钾:" prop="k">
  394. <el-input v-model="form.k" placeholder="请输入">
  395. <template #append>mg</template>
  396. </el-input>
  397. </el-form-item>
  398. </el-col>
  399. </el-row>
  400. <el-row :gutter="20">
  401. <el-col :span="8">
  402. <el-form-item label="钠:" prop="na">
  403. <el-input v-model="form.na" placeholder="请输入">
  404. <template #append>mg</template>
  405. </el-input>
  406. </el-form-item>
  407. </el-col>
  408. <el-col :span="8">
  409. <el-form-item label="镁:" prop="mg">
  410. <el-input v-model="form.mg" placeholder="请输入">
  411. <template #append>mg</template>
  412. </el-input>
  413. </el-form-item>
  414. </el-col>
  415. <el-col :span="8">
  416. <el-form-item label="氯:" prop="cl">
  417. <el-input v-model="form.cl" placeholder="请输入">
  418. <template #append>mg</template>
  419. </el-input>
  420. </el-form-item>
  421. </el-col>
  422. </el-row>
  423. </el-form>
  424. </el-tab-pane>
  425. <el-tab-pane label="微量元素" name="microElements">
  426. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  427. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  428. <el-row :gutter="20" style="margin-top:20px">
  429. <el-col :span="8">
  430. <el-form-item label="铁:" prop="fe">
  431. <el-input v-model="form.fe" placeholder="请输入">
  432. <template #append>mg</template>
  433. </el-input>
  434. </el-form-item>
  435. </el-col>
  436. <el-col :span="8">
  437. <el-form-item label="锌:" prop="zn">
  438. <el-input v-model="form.zn" placeholder="请输入">
  439. <template #append>mg</template>
  440. </el-input>
  441. </el-form-item>
  442. </el-col>
  443. <el-col :span="8">
  444. <el-form-item label="硒:" prop="se">
  445. <el-input v-model="form.se" placeholder="请输入">
  446. <template #append>μg</template>
  447. </el-input>
  448. </el-form-item>
  449. </el-col>
  450. </el-row>
  451. <el-row :gutter="20">
  452. <el-col :span="8">
  453. <el-form-item label="铜:" prop="cu">
  454. <el-input v-model="form.cu" placeholder="请输入">
  455. <template #append>mg</template>
  456. </el-input>
  457. </el-form-item>
  458. </el-col>
  459. <el-col :span="8">
  460. <el-form-item label="锰:" prop="mn">
  461. <el-input v-model="form.mn" placeholder="请输入">
  462. <template #append>mg</template>
  463. </el-input>
  464. </el-form-item>
  465. </el-col>
  466. <el-col :span="8">
  467. <el-form-item label="碘:" prop="i">
  468. <el-input v-model="form.i" placeholder="请输入">
  469. <template #append>μg</template>
  470. </el-input>
  471. </el-form-item>
  472. </el-col>
  473. </el-row>
  474. <el-row :gutter="20">
  475. <el-col :span="8">
  476. <el-form-item label="氟:" prop="f">
  477. <el-input v-model="form.f" placeholder="请输入">
  478. <template #append>mg</template>
  479. </el-input>
  480. </el-form-item>
  481. </el-col>
  482. <el-col :span="8">
  483. <el-form-item label="铬:" prop="cr">
  484. <el-input v-model="form.cr" placeholder="请输入">
  485. <template #append>μg</template>
  486. </el-input>
  487. </el-form-item>
  488. </el-col>
  489. <el-col :span="8">
  490. <el-form-item label="钼:" prop="mo">
  491. <el-input v-model="form.mo" placeholder="请输入">
  492. <template #append>μg</template>
  493. </el-input>
  494. </el-form-item>
  495. </el-col>
  496. </el-row>
  497. </el-form>
  498. </el-tab-pane>
  499. <el-tab-pane label="氨基酸" name="aminoAcids">
  500. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  501. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  502. <el-row :gutter="20" style="margin-top:20px">
  503. <el-col :span="8">
  504. <el-form-item label="异亮氨酸:" prop="isoleucine">
  505. <el-input v-model="form.isoleucine" placeholder="请输入">
  506. <template #append>mg</template>
  507. </el-input>
  508. </el-form-item>
  509. </el-col>
  510. <el-col :span="8">
  511. <el-form-item label="色氨酸:" prop="tryptophan">
  512. <el-input v-model="form.tryptophan" placeholder="请输入">
  513. <template #append>mg</template>
  514. </el-input>
  515. </el-form-item>
  516. </el-col>
  517. <el-col :span="8">
  518. <el-form-item label="含硫氨基酸:" prop="sulfurAminoAcid">
  519. <el-input v-model="form.sulfurAminoAcid" placeholder="请输入">
  520. <template #append>mg</template>
  521. </el-input>
  522. </el-form-item>
  523. </el-col>
  524. </el-row>
  525. <el-row :gutter="20">
  526. <el-col :span="8">
  527. <el-form-item label="组氨酸:" prop="histidine">
  528. <el-input v-model="form.histidine" placeholder="请输入">
  529. <template #append>mg</template>
  530. </el-input>
  531. </el-form-item>
  532. </el-col>
  533. <el-col :span="8">
  534. <el-form-item label="芳香族氨基酸:" prop="aromaticAminoAcid">
  535. <el-input v-model="form.aromaticAminoAcid" placeholder="请输入">
  536. <template #append>mg</template>
  537. </el-input>
  538. </el-form-item>
  539. </el-col>
  540. <el-col :span="8">
  541. <el-form-item label="谷氨酸:" prop="glutamicAcid">
  542. <el-input v-model="form.glutamicAcid" placeholder="请输入">
  543. <template #append>mg</template>
  544. </el-input>
  545. </el-form-item>
  546. </el-col>
  547. </el-row>
  548. <el-row :gutter="20">
  549. <el-col :span="8">
  550. <el-form-item label="苏氨酸:" prop="threonine">
  551. <el-input v-model="form.threonine" placeholder="请输入">
  552. <template #append>mg</template>
  553. </el-input>
  554. </el-form-item>
  555. </el-col>
  556. <el-col :span="8">
  557. <el-form-item label="丝氨酸:" prop="serine">
  558. <el-input v-model="form.serine" placeholder="请输入">
  559. <template #append>mg</template>
  560. </el-input>
  561. </el-form-item>
  562. </el-col>
  563. <el-col :span="8">
  564. <el-form-item label="精氨酸:" prop="arginine">
  565. <el-input v-model="form.arginine" placeholder="请输入">
  566. <template #append>mg</template>
  567. </el-input>
  568. </el-form-item>
  569. </el-col>
  570. </el-row>
  571. <el-row :gutter="20">
  572. <el-col :span="8">
  573. <el-form-item label="赖氨酸:" prop="lysine">
  574. <el-input v-model="form.lysine" placeholder="请输入">
  575. <template #append>mg</template>
  576. </el-input>
  577. </el-form-item>
  578. </el-col>
  579. <el-col :span="8">
  580. <el-form-item label="天冬氨酸:" prop="asparticAcid">
  581. <el-input v-model="form.asparticAcid" placeholder="请输入">
  582. <template #append>mg</template>
  583. </el-input>
  584. </el-form-item>
  585. </el-col>
  586. <el-col :span="8">
  587. <el-form-item label="胱氨酸:" prop="cysteine">
  588. <el-input v-model="form.cysteine" placeholder="请输入">
  589. <template #append>mg</template>
  590. </el-input>
  591. </el-form-item>
  592. </el-col>
  593. </el-row>
  594. <el-row :gutter="20">
  595. <el-col :span="8">
  596. <el-form-item label="脯氨酸:" prop="proline">
  597. <el-input v-model="form.proline" placeholder="请输入">
  598. <template #append>mg</template>
  599. </el-input>
  600. </el-form-item>
  601. </el-col>
  602. <el-col :span="8">
  603. <el-form-item label="酪氨酸:" prop="tyrosine">
  604. <el-input v-model="form.tyrosine" placeholder="请输入">
  605. <template #append>mg</template>
  606. </el-input>
  607. </el-form-item>
  608. </el-col>
  609. <el-col :span="8">
  610. <el-form-item label="亮氨酸:" prop="leucine">
  611. <el-input v-model="form.leucine" placeholder="请输入">
  612. <template #append>mg</template>
  613. </el-input>
  614. </el-form-item>
  615. </el-col>
  616. </el-row>
  617. <el-row :gutter="20">
  618. <el-col :span="8">
  619. <el-form-item label="缬氨酸:" prop="valine">
  620. <el-input v-model="form.valine" placeholder="请输入">
  621. <template #append>mg</template>
  622. </el-input>
  623. </el-form-item>
  624. </el-col>
  625. <el-col :span="8">
  626. <el-form-item label="蛋氨酸:" prop="methionine">
  627. <el-input v-model="form.methionine" placeholder="请输入">
  628. <template #append>mg</template>
  629. </el-input>
  630. </el-form-item>
  631. </el-col>
  632. <el-col :span="8">
  633. <el-form-item label="丙氨酸:" prop="alanine">
  634. <el-input v-model="form.alanine" placeholder="请输入">
  635. <template #append>mg</template>
  636. </el-input>
  637. </el-form-item>
  638. </el-col>
  639. </el-row>
  640. <el-row :gutter="20">
  641. <el-col :span="8">
  642. <el-form-item label="苯丙氨酸:" prop="phenylalanine">
  643. <el-input v-model="form.phenylalanine" placeholder="请输入">
  644. <template #append>mg</template>
  645. </el-input>
  646. </el-form-item>
  647. </el-col>
  648. <el-col :span="8">
  649. <el-form-item label="甘氨酸:" prop="glycine">
  650. <el-input v-model="form.glycine" placeholder="请输入">
  651. <template #append>mg</template>
  652. </el-input>
  653. </el-form-item>
  654. </el-col>
  655. </el-row>
  656. </el-form>
  657. </el-tab-pane>
  658. <el-tab-pane label="脂肪酸" name="fattyAcids">
  659. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  660. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  661. <el-row :gutter="20" style="margin-top:20px">
  662. <el-col :span="8">
  663. <el-form-item label="脂肪酸:" prop="fattyAcid">
  664. <el-input v-model="form.fattyAcid" placeholder="请输入">
  665. <template #append>g</template>
  666. </el-input>
  667. </el-form-item>
  668. </el-col>
  669. <el-col :span="8">
  670. <el-form-item label="饱和脂肪酸:" prop="saturatedFattyAcid">
  671. <el-input v-model="form.saturatedFattyAcid" placeholder="请输入">
  672. <template #append>g</template>
  673. </el-input>
  674. </el-form-item>
  675. </el-col>
  676. <el-col :span="8">
  677. <el-form-item label="单不饱和脂肪酸:" prop="monounsaturatedFattyAcid">
  678. <el-input v-model="form.monounsaturatedFattyAcid" placeholder="请输入">
  679. <template #append>g</template>
  680. </el-input>
  681. </el-form-item>
  682. </el-col>
  683. </el-row>
  684. <el-row :gutter="20">
  685. <el-col :span="8">
  686. <el-form-item label="多不饱和脂肪酸:" prop="polyunsaturatedFattyAcid">
  687. <el-input v-model="form.polyunsaturatedFattyAcid" placeholder="请输入">
  688. <template #append>g</template>
  689. </el-input>
  690. </el-form-item>
  691. </el-col>
  692. </el-row>
  693. </el-form>
  694. </el-tab-pane>
  695. <el-tab-pane label="维生素" name="vitamins">
  696. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  697. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  698. <el-row :gutter="20" style="margin-top:20px">
  699. <el-col :span="8">
  700. <el-form-item label="维生素A:" prop="vitaminA">
  701. <el-input v-model="form.vitaminA" placeholder="请输入">
  702. <template #append>μgRAE</template>
  703. </el-input>
  704. </el-form-item>
  705. </el-col>
  706. <el-col :span="8">
  707. <el-form-item label="维生素A(胡萝卜素):" prop="vitaminACarotene">
  708. <el-input v-model="form.vitaminACarotene" placeholder="请输入">
  709. <template #append>μg</template>
  710. </el-input>
  711. </el-form-item>
  712. </el-col>
  713. <el-col :span="8">
  714. <el-form-item label="维生素A醇:" prop="vitaminAAlcohol">
  715. <el-input v-model="form.vitaminAAlcohol" placeholder="请输入">
  716. <template #append>μg</template>
  717. </el-input>
  718. </el-form-item>
  719. </el-col>
  720. </el-row>
  721. <el-row :gutter="20">
  722. <el-col :span="8">
  723. <el-form-item label="维生素D:" prop="vitaminD">
  724. <el-input v-model="form.vitaminD" placeholder="请输入">
  725. <template #append>mg</template>
  726. </el-input>
  727. </el-form-item>
  728. </el-col>
  729. <el-col :span="8">
  730. <el-form-item label="维生素E:" prop="vitaminE">
  731. <el-input v-model="form.vitaminE" placeholder="请输入">
  732. <template #append>mgα-TE</template>
  733. </el-input>
  734. </el-form-item>
  735. </el-col>
  736. <el-col :span="8">
  737. <el-form-item label="维生素E(生育酚):" prop="vitaminETocopherol">
  738. <el-input v-model="form.vitaminETocopherol" placeholder="请输入">
  739. <template #append>mg</template>
  740. </el-input>
  741. </el-form-item>
  742. </el-col>
  743. </el-row>
  744. <el-row :gutter="20">
  745. <el-col :span="8">
  746. <el-form-item label="维生素K:" prop="vitaminK">
  747. <el-input v-model="form.vitaminK" placeholder="请输入">
  748. <template #append>ug</template>
  749. </el-input>
  750. </el-form-item>
  751. </el-col>
  752. <el-col :span="8">
  753. <el-form-item label="维生素B1:" prop="vitaminBOne">
  754. <el-input v-model="form.vitaminBOne" placeholder="请输入">
  755. <template #append>mg</template>
  756. </el-input>
  757. </el-form-item>
  758. </el-col>
  759. <el-col :span="8">
  760. <el-form-item label="维生素B2:" prop="vitaminBTwo">
  761. <el-input v-model="form.vitaminBTwo" placeholder="请输入">
  762. <template #append>mg</template>
  763. </el-input>
  764. </el-form-item>
  765. </el-col>
  766. </el-row>
  767. <el-row :gutter="20">
  768. <el-col :span="8">
  769. <el-form-item label="维生素B6:" prop="vitaminBSix">
  770. <el-input v-model="form.vitaminBSix" placeholder="请输入">
  771. <template #append>mg</template>
  772. </el-input>
  773. </el-form-item>
  774. </el-col>
  775. <el-col :span="8">
  776. <el-form-item label="维生素B12:" prop="vitaminBTwelve">
  777. <el-input v-model="form.vitaminBTwelve" placeholder="请输入">
  778. <template #append>μg</template>
  779. </el-input>
  780. </el-form-item>
  781. </el-col>
  782. <el-col :span="8">
  783. <el-form-item label="烟酸(尼克酸):" prop="niacin">
  784. <el-input v-model="form.niacin" placeholder="请输入">
  785. <template #append>mgNE</template>
  786. </el-input>
  787. </el-form-item>
  788. </el-col>
  789. </el-row>
  790. <el-row :gutter="20">
  791. <el-col :span="8">
  792. <el-form-item label="维生素C:" prop="vitaminC">
  793. <el-input v-model="form.vitaminC" placeholder="请输入">
  794. <template #append>mg</template>
  795. </el-input>
  796. </el-form-item>
  797. </el-col>
  798. <el-col :span="8">
  799. <el-form-item label="叶酸:" prop="folicAcid">
  800. <el-input v-model="form.folicAcid" placeholder="请输入">
  801. <template #append>μgDFE</template>
  802. </el-input>
  803. </el-form-item>
  804. </el-col>
  805. <el-col :span="8">
  806. <el-form-item label="胆碱:" prop="choline">
  807. <el-input v-model="form.choline" placeholder="请输入">
  808. <template #append>mg</template>
  809. </el-input>
  810. </el-form-item>
  811. </el-col>
  812. </el-row>
  813. <el-row :gutter="20">
  814. <el-col :span="8">
  815. <el-form-item label="生物素:" prop="biotin">
  816. <el-input v-model="form.biotin" placeholder="请输入">
  817. <template #append>μg</template>
  818. </el-input>
  819. </el-form-item>
  820. </el-col>
  821. <el-col :span="8">
  822. <el-form-item label="泛酸:" prop="pantothenicAcid">
  823. <el-input v-model="form.pantothenicAcid" placeholder="请输入">
  824. <template #append>mg</template>
  825. </el-input>
  826. </el-form-item>
  827. </el-col>
  828. </el-row>
  829. </el-form>
  830. </el-tab-pane>
  831. <el-tab-pane label="脂类" name="lipids">
  832. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  833. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  834. <el-row :gutter="20" style="margin-top:20px">
  835. <el-col :span="8">
  836. <el-form-item label="胆固醇:" prop="cholesterol">
  837. <el-input v-model="form.cholesterol" placeholder="请输入">
  838. <template #append>g</template>
  839. </el-input>
  840. </el-form-item>
  841. </el-col>
  842. </el-row>
  843. </el-form>
  844. </el-tab-pane>
  845. <el-tab-pane label="其他" name="others">
  846. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  847. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px" style="margin-top:20px">
  848. <el-row :gutter="20">
  849. <el-col :span="8">
  850. <el-form-item label="血糖生成指数:" prop="bloodGlucoseIndex">
  851. <el-input v-model="form.bloodGlucoseIndex" placeholder="请输入">
  852. <template #append>%</template>
  853. </el-input>
  854. </el-form-item>
  855. </el-col>
  856. <el-col :span="8">
  857. <el-form-item label="不可溶性膳食纤维:" prop="insolubleDietaryFiber">
  858. <el-input v-model="form.insolubleDietaryFiber" placeholder="请输入">
  859. <template #append>g</template>
  860. </el-input>
  861. </el-form-item>
  862. </el-col>
  863. <el-col :span="8">
  864. <el-form-item label="膳食纤维:" prop="dietaryFiber">
  865. <el-input v-model="form.dietaryFiber" placeholder="请输入">
  866. <template #append>g</template>
  867. </el-input>
  868. </el-form-item>
  869. </el-col>
  870. </el-row>
  871. <el-row :gutter="20">
  872. <el-col :span="8">
  873. <el-form-item label="灰分:" prop="ash">
  874. <el-input v-model="form.ash" placeholder="请输入">
  875. <template #append>g</template>
  876. </el-input>
  877. </el-form-item>
  878. </el-col>
  879. <el-col :span="8">
  880. <el-form-item label="可溶性膳食纤维:" prop="solubleDietaryFiber">
  881. <el-input v-model="form.solubleDietaryFiber" placeholder="请输入">
  882. <template #append>g</template>
  883. </el-input>
  884. </el-form-item>
  885. </el-col>
  886. </el-row>
  887. </el-form>
  888. </el-tab-pane>
  889. <el-tab-pane label="商品说明" name="productDescription">
  890. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px">
  891. <el-row :gutter="20" style="margin-top:20px">
  892. <el-col :span="12">
  893. <el-form-item label="适用人群:" prop="applicableCrowd">
  894. <el-input v-model="form.applicableCrowd" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  895. </el-form-item>
  896. </el-col>
  897. <el-col :span="12">
  898. <el-form-item label="不适用人群:" prop="unsuitableCrowd">
  899. <el-input v-model="form.unsuitableCrowd" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  900. </el-form-item>
  901. </el-col>
  902. </el-row>
  903. <el-row :gutter="20" style="margin-top:20px">
  904. <el-col :span="12">
  905. <el-form-item label="渗透压:" prop="osmoticPressure">
  906. <el-input v-model="form.osmoticPressure" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  907. </el-form-item>
  908. </el-col>
  909. <el-col :span="12">
  910. <el-form-item label="原料:" prop="rawMaterial">
  911. <el-input v-model="form.rawMaterial" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  912. </el-form-item>
  913. </el-col>
  914. </el-row>
  915. <el-row :gutter="20" style="margin-top:20px">
  916. <el-col :span="12">
  917. <el-form-item label="适应症及禁忌:" prop="indicationsContraindications">
  918. <el-input v-model="form.indicationsContraindications" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  919. </el-form-item>
  920. </el-col>
  921. <el-col :span="12">
  922. <el-form-item label="食用方法和食用量:" prop="usageAndDosage">
  923. <el-input v-model="form.usageAndDosage" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  924. </el-form-item>
  925. </el-col>
  926. </el-row>
  927. <el-row :gutter="20" style="margin-top:20px">
  928. <el-col :span="12">
  929. <el-form-item label="产品特点:" prop="productFeatures">
  930. <el-input v-model="form.productFeatures" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  931. </el-form-item>
  932. </el-col>
  933. <el-col :span="12">
  934. <el-form-item label="储存条件:" prop="storageConditions">
  935. <el-input v-model="form.storageConditions" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  936. </el-form-item>
  937. </el-col>
  938. </el-row>
  939. <el-row :gutter="20" style="margin-top:20px">
  940. <el-col :span="12">
  941. <el-form-item label="警示说明及注意事项:" prop="warningInstructions">
  942. <el-input v-model="form.warningInstructions" type="textarea" maxlength="300" show-word-limit :rows="4" placeholder="请输入" />
  943. </el-form-item>
  944. </el-col>
  945. </el-row>
  946. </el-form>
  947. </el-tab-pane>
  948. <el-tab-pane label="商品附件" name="productAttachments">
  949. <el-form ref="nutritionFormRef" :model="form" :rules="rules" label-width="200px" style="margin-top: 30px">
  950. <el-form-item label="商品附件" prop="productAttachments">
  951. <FileUpload v-model="form.productAttachmentList" :limit="10" :file-size="10" :file-type="['jpg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx']" :is-show-tip="true" />
  952. </el-form-item>
  953. </el-form>
  954. </el-tab-pane>
  955. </el-scrollbar>
  956. </el-tabs>
  957. <template #footer>
  958. <div class="dialog-footer" style="text-align: center">
  959. <el-button type="primary" @click="submitForm">保存</el-button>
  960. <el-button type="primary" @click="submitFormAndPutaway">保存并上架</el-button>
  961. </div>
  962. </template>
  963. </el-dialog>
  964. <el-dialog title="批量设置" v-model="batchSetDialogVisible" width="400px" append-to-body>
  965. <el-form :model="batchSetForm" label-width="120px" :rules="batchRules">
  966. <el-form-item label="保质期临期提醒" prop="shelfLifeReminder">
  967. <el-input v-model="batchSetForm.shelfLifeReminder" min="1" placeholder="请输入" style="width: 200px;">
  968. <template #append>个月</template>
  969. </el-input>
  970. </el-form-item>
  971. <el-form-item label="许可证临期提醒" prop="licenseExpiryReminder">
  972. <el-input v-model="batchSetForm.licenseExpiryReminder" min="1" placeholder="请输入" style="width: 200px;">
  973. <template #append>个月</template>
  974. </el-input>
  975. </el-form-item>
  976. </el-form>
  977. <template #footer>
  978. <el-button type="primary" @click="handleBatchSetSubmit">提交</el-button>
  979. <el-button @click="batchSetDialogVisible = false">取消</el-button>
  980. </template>
  981. </el-dialog>
  982. <!-- 新增详情弹窗,内容全部静态分组展示,仿照a1.png -->
  983. <el-dialog title="营养产品详情" v-model="detailDialogVisible" width="60%" append-to-body class="nutrition-dialog">
  984. <el-tabs v-model="activeTab">
  985. <el-scrollbar height="calc(80vh - 120px)">
  986. <el-tab-pane label="基本信息" name="basic">
  987. <el-divider content-position="left">基本信息:</el-divider>
  988. <el-row :gutter="40" style="margin-top: 30px">
  989. <el-col :span="12">
  990. <div><b><span style="color:red;margin-right: 3px">*</span>产品名称:</b>{{ form.productName || '--' }}</div>
  991. <div><b><span style="color:red;margin-right: 3px">*</span>院方系统编码:</b>{{ form.hospitalSystemCode || '--' }}</div>
  992. <div><b><span style="color:red;margin-right: 3px">*</span>商品编码:</b>{{ form.productCode || '--' }}</div>
  993. <div><b><span style="color:red;margin-right: 3px">*</span>产品所属分类:</b>{{ form.productCategory || '--' }}</div>
  994. <div><b>生产厂商:</b>{{ productManufacturerList.find(item => item.value === form.manufacturer)?.label || '--' }}</div>
  995. <div><b>品牌:</b>{{ form.brand || '--' }}</div>
  996. <div><b>产品所属标签:</b>{{ form.productLabel || '--' }}</div>
  997. <div><b>许可证临期提醒:</b>{{ form.licenseExpiryReminder || '--' }}</div>
  998. <div><b>商品许可证有效期至:</b>{{ form.productLicenseExpiry ? (form.productLicenseExpiry.slice(0, 10)) : '--' }}</div>
  999. </el-col>
  1000. <el-col :span="12">
  1001. <div><b><span style="color:red;margin-right: 3px">*</span>商品资质:</b>{{ getDictLabel(product_qualification, form.productQualification) || '--' }}</div>
  1002. <div><b>批准文号:</b>{{ form.approvalNumber || '--' }}</div>
  1003. <div><b>口味:</b>{{ form.taste || '--' }}</div>
  1004. <div><b>剂型/形态:</b>{{ getDictLabel(dosage_form, form.dosageForm) || '--' }}</div>
  1005. <div><b>供应商:</b>{{ productSupplierList.find(item => item.value === form.supplier)?.label || '--' }}</div>
  1006. <div><b>产品适用科室:</b>{{ form.applicableDepartment|| '--' }}</div>
  1007. <div><b>禁忌症所属标签:</b>{{ form.contraindicationLabel || '--' }}</div>
  1008. <div><b><span style="color:red;margin-right: 3px">*</span>保质期临期提醒:</b>{{ form.shelfLifeReminder || '--' }}</div>
  1009. <div><b>保质期:</b>{{ form.shelfLife || '--' }}</div>
  1010. </el-col>
  1011. </el-row>
  1012. <el-divider content-position="left">入货信息:</el-divider>
  1013. <el-row :gutter="40" style="margin-top: 30px">
  1014. <el-col :span="12">
  1015. <div><b><span style="color:red;margin-right: 3px">*</span>入货价格:</b>{{ form.purchasePrice || '--' }} 元</div>
  1016. <div><b>默认用法:</b>{{ getDictLabel(default_usage, form.defaultUsage) || '--' }}</div>
  1017. <div><b><span style="color:red;margin-right: 3px">*</span>商品规格:</b>{{ form.productSpec || '--' }}{{getDictLabel(product_spec_unit ,form.productSpecUnit )|| '--' }}/{{getDictLabel(product_package_unit ,form.packageUnit )|| '--' }}</div>
  1018. </el-col>
  1019. <el-col :span="12">
  1020. <div><b><span style="color:red;margin-right: 3px">*</span>入货单位:</b>{{ getDictLabel(product_package_unit, form.purchaseUnit) || '--' }}</div>
  1021. <div><b><span style="color:red;margin-right: 3px">*</span>预包装单位:</b>{{ getDictLabel(product_package_unit, form.packageUnit) || '--' }}</div>
  1022. </el-col>
  1023. </el-row>
  1024. <el-divider content-position="left">预包装销售设置:</el-divider>
  1025. <el-row :gutter="40" style="margin-top: 30px">
  1026. <el-col :span="12">
  1027. <div><b><span style="color:red;margin-right: 3px">*</span>预包装销售价:</b>{{ form.packagePrice || '--' }}元/{{ getDictLabel(product_package_unit, form.packageUnit) || '--' }}</div>
  1028. <div><b>最小包装规格:</b>{{ form.minSpec || '--' }} {{getDictLabel(product_spec_unit ,form.productSpecUnit )|| '--' }}/{{ getDictLabel(product_package_unit, form.minUnit) || '--' }}</div>
  1029. </el-col>
  1030. <el-col :span="12">
  1031. <div><b>最小包装单位:</b>{{ getDictLabel(product_package_unit, form.minUnit) || '--' }}</div>
  1032. <div><b>净含量/规格:</b>{{ form.netContent || '--' }}</div>
  1033. </el-col>
  1034. </el-row>
  1035. <el-divider content-position="left">配置销售设置:</el-divider>
  1036. <el-row :gutter="40" style="margin-top: 30px">
  1037. <el-col :span="12">
  1038. <div><b><span style="color:red;margin-right: 3px">*</span>配置销售价格:</b>{{ form.configSalePrice || '--' }} 元/{{getDictLabel(product_spec_unit ,form.productSpecUnit )|| '--' }}</div>
  1039. </el-col>
  1040. <el-col :span="12">
  1041. <div><b>配置损耗率:</b>{{ form.configLossRate || '--' }} %</div>
  1042. </el-col>
  1043. </el-row>
  1044. </el-tab-pane>
  1045. <el-tab-pane label="热能及三大营养素" name="nutrition">
  1046. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1047. <el-row :gutter="40" style="margin-top: 30px">
  1048. <el-col :span="6">
  1049. <div><b>热量:</b>{{ form.calorie || '--' }} kcal</div>
  1050. </el-col>
  1051. <el-col :span="6">
  1052. <div><b>碳水化合物:</b>{{ form.carbohydrate || '--' }} g</div>
  1053. </el-col>
  1054. <el-col :span="6">
  1055. <div><b>热能:</b>{{ form.heatEnergy || '--' }} g</div>
  1056. </el-col>
  1057. <el-col :span="6">
  1058. <div><b>蛋白质:</b>{{ form.protein || '--' }} g</div>
  1059. </el-col>
  1060. </el-row>
  1061. <el-row :gutter="40" style="margin-top: 30px">
  1062. <el-col :span="6">
  1063. <div><b>脂肪:</b>{{ form.fat || '--' }} g</div>
  1064. </el-col>
  1065. </el-row>
  1066. </el-tab-pane>
  1067. <el-tab-pane label="常量元素" name="macroElements">
  1068. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1069. <el-row :gutter="40" style="margin-top: 30px">
  1070. <el-col :span="6">
  1071. <div><b>钙:</b>{{ form.ca || '--' }} mg</div>
  1072. </el-col>
  1073. <el-col :span="6">
  1074. <div><b>磷:</b>{{ form.p || '--' }} mg</div>
  1075. </el-col>
  1076. <el-col :span="6">
  1077. <div><b>钾:</b>{{ form.k || '--' }} mg</div>
  1078. </el-col>
  1079. <el-col :span="6">
  1080. <div><b>钠:</b>{{ form.na || '--' }} mg</div>
  1081. </el-col>
  1082. </el-row>
  1083. <el-row :gutter="40" style="margin-top: 30px">
  1084. <el-col :span="6">
  1085. <div><b>镁:</b>{{ form.mg || '--' }} mg</div>
  1086. </el-col>
  1087. <el-col :span="6">
  1088. <div><b>氯:</b>{{ form.cl || '--' }} mg</div>
  1089. </el-col>
  1090. </el-row>
  1091. </el-tab-pane>
  1092. <el-tab-pane label="微量元素" name="microElements">
  1093. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1094. <el-row :gutter="40" style="margin-top: 30px">
  1095. <el-col :span="6">
  1096. <div><b>铁:</b>{{ form.fe || '--' }} mg</div>
  1097. </el-col>
  1098. <el-col :span="6">
  1099. <div><b>锌:</b>{{ form.zn || '--' }} mg</div>
  1100. </el-col>
  1101. <el-col :span="6">
  1102. <div><b>硒:</b>{{ form.se || '--' }} μg</div>
  1103. </el-col>
  1104. <el-col :span="6">
  1105. <div><b>铜:</b>{{ form.cu || '--' }} mg</div>
  1106. </el-col>
  1107. </el-row>
  1108. <el-row :gutter="40" style="margin-top: 30px">
  1109. <el-col :span="6">
  1110. <div><b>锰:</b>{{ form.mn || '--' }} mg</div>
  1111. </el-col>
  1112. <el-col :span="6">
  1113. <div><b>碘:</b>{{ form.i || '--' }} μg</div>
  1114. </el-col>
  1115. <el-col :span="6">
  1116. <div><b>氟:</b>{{ form.f || '--' }} mg</div>
  1117. </el-col>
  1118. <el-col :span="6">
  1119. <div><b>铬:</b>{{ form.cr || '--' }} μg</div>
  1120. </el-col>
  1121. </el-row>
  1122. <el-row :gutter="40" style="margin-top: 30px">
  1123. <el-col :span="12">
  1124. <div><b>钼:</b>{{ form.mo || '--' }} μg</div>
  1125. </el-col>
  1126. </el-row>
  1127. </el-tab-pane>
  1128. <el-tab-pane label="氨基酸" name="aminoAcids">
  1129. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1130. <el-row :gutter="40" style="margin-top: 30px">
  1131. <el-col :span="6">
  1132. <div><b>异亮氨酸:</b>{{ form.isoleucine || '--' }} mg</div>
  1133. </el-col>
  1134. <el-col :span="6">
  1135. <div><b>色氨酸:</b>{{ form.tryptophan || '--' }} mg</div>
  1136. </el-col>
  1137. <el-col :span="6">
  1138. <div><b>含硫氨基酸:</b>{{ form.sulfurAminoAcid || '--' }} mg</div>
  1139. </el-col>
  1140. <el-col :span="6">
  1141. <div><b>组氨酸:</b>{{ form.histidine || '--' }} mg</div>
  1142. </el-col>
  1143. </el-row>
  1144. <el-row :gutter="40" style="margin-top: 30px">
  1145. <el-col :span="6">
  1146. <div><b>芳香族氨基酸:</b>{{ form.aromaticAminoAcid || '--' }} mg</div>
  1147. </el-col>
  1148. <el-col :span="6">
  1149. <div><b>谷氨酸:</b>{{ form.glutamicAcid || '--' }} mg</div>
  1150. </el-col>
  1151. <el-col :span="6">
  1152. <div><b>苏氨酸:</b>{{ form.threonine || '--' }} mg</div>
  1153. </el-col>
  1154. <el-col :span="6">
  1155. <div><b>丝氨酸:</b>{{ form.serine || '--' }} mg</div>
  1156. </el-col>
  1157. </el-row>
  1158. <el-row :gutter="40" style="margin-top: 30px">
  1159. <el-col :span="6">
  1160. <div><b>精氨酸:</b>{{ form.arginine || '--' }} mg</div>
  1161. </el-col>
  1162. <el-col :span="6">
  1163. <div><b>赖氨酸:</b>{{ form.lysine || '--' }} mg</div>
  1164. </el-col>
  1165. <el-col :span="6">
  1166. <div><b>天冬氨酸:</b>{{ form.asparticAcid || '--' }} mg</div>
  1167. </el-col>
  1168. <el-col :span="6">
  1169. <div><b>胱氨酸:</b>{{ form.cysteine || '--' }} mg</div>
  1170. </el-col>
  1171. </el-row>
  1172. <el-row :gutter="40" style="margin-top: 30px">
  1173. <el-col :span="6">
  1174. <div><b>脯氨酸:</b>{{ form.proline || '--' }} mg</div>
  1175. </el-col>
  1176. <el-col :span="6">
  1177. <div><b>酪氨酸:</b>{{ form.tyrosine || '--' }} mg</div>
  1178. </el-col>
  1179. <el-col :span="6">
  1180. <div><b>亮氨酸:</b>{{ form.leucine || '--' }} mg</div>
  1181. </el-col>
  1182. <el-col :span="6">
  1183. <div><b>缬氨酸:</b>{{ form.valine || '--' }} mg</div>
  1184. </el-col>
  1185. </el-row>
  1186. <el-row :gutter="40" style="margin-top: 30px">
  1187. <el-col :span="6">
  1188. <div><b>蛋氨酸:</b>{{ form.methionine || '--' }} mg</div>
  1189. </el-col>
  1190. <el-col :span="6">
  1191. <div><b>丙氨酸:</b>{{ form.alanine || '--' }} mg</div>
  1192. </el-col>
  1193. <el-col :span="6">
  1194. <div><b>苯丙氨酸:</b>{{ form.phenylalanine || '--' }} mg</div>
  1195. </el-col>
  1196. <el-col :span="6">
  1197. <div><b>甘氨酸:</b>{{ form.glycine || '--' }} mg</div>
  1198. </el-col>
  1199. </el-row>
  1200. </el-tab-pane>
  1201. <el-tab-pane label="脂肪酸" name="fattyAcids">
  1202. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1203. <el-row :gutter="40" style="margin-top: 30px">
  1204. <el-col :span="6">
  1205. <div><b>脂肪酸:</b>{{ form.fattyAcid || '--' }} mg</div>
  1206. </el-col>
  1207. <el-col :span="6">
  1208. <div><b>饱和脂肪酸:</b>{{ form.saturatedFattyAcid || '--' }} g</div>
  1209. </el-col>
  1210. <el-col :span="6">
  1211. <div><b>单不饱和脂肪酸:</b>{{ form.monounsaturatedFattyAcid || '--' }} g</div>
  1212. </el-col>
  1213. <el-col :span="6">
  1214. <div><b>多不饱和脂肪酸:</b>{{ form.polyunsaturatedFattyAcid || '--' }} g</div>
  1215. </el-col>
  1216. </el-row>
  1217. </el-tab-pane>
  1218. <el-tab-pane label="维生素" name="vitamins">
  1219. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1220. <el-row :gutter="40" style="margin-top: 30px">
  1221. <el-col :span="6">
  1222. <div><b>维生素A:</b>{{ form.vitaminA || '--' }} mg</div>
  1223. </el-col>
  1224. <el-col :span="6">
  1225. <div><b>维生素A(胡萝卜素):</b>{{ form.vitaminACarotene || '--' }} mg</div>
  1226. </el-col>
  1227. <el-col :span="6">
  1228. <div><b>维生素A醇:</b>{{ form.vitaminAAlcohol || '--' }} mg</div>
  1229. </el-col>
  1230. <el-col :span="6">
  1231. <div><b>维生素D:</b>{{ form.vitaminD || '--' }} mg</div>
  1232. </el-col>
  1233. </el-row>
  1234. <el-row :gutter="40" style="margin-top: 30px">
  1235. <el-col :span="6">
  1236. <div><b>维生素E:</b>{{ form.vitaminE || '--' }} mg</div>
  1237. </el-col>
  1238. <el-col :span="6">
  1239. <div><b>维生素E(生育酚):</b>{{ form.vitaminETocopherol || '--' }} mg</div>
  1240. </el-col>
  1241. <el-col :span="6">
  1242. <div><b>维生素K:</b>{{ form.vitaminK || '--' }} mg</div>
  1243. </el-col>
  1244. <el-col :span="6">
  1245. <div><b>维生素B1:</b>{{ form.vitaminBOne || '--' }} mg</div>
  1246. </el-col>
  1247. </el-row>
  1248. <el-row :gutter="40" style="margin-top: 30px">
  1249. <el-col :span="6">
  1250. <div><b>维生素B2:</b>{{ form.vitaminBTwo || '--' }} mg</div>
  1251. </el-col>
  1252. <el-col :span="6">
  1253. <div><b>维生素B6:</b>{{ form.vitaminBSix || '--' }} mg</div>
  1254. </el-col>
  1255. <el-col :span="6">
  1256. <div><b>维生素B12:</b>{{ form.vitaminBTwelve || '--' }} mg</div>
  1257. </el-col>
  1258. <el-col :span="6">
  1259. <div><b>烟酸(尼克酸):</b>{{ form.niacin || '--' }} mg</div>
  1260. </el-col>
  1261. </el-row>
  1262. <el-row :gutter="40" style="margin-top: 30px">
  1263. <el-col :span="6">
  1264. <div><b>维生素C:</b>{{ form.vitaminC || '--' }} mg</div>
  1265. </el-col>
  1266. <el-col :span="6">
  1267. <div><b>叶酸:</b>{{ form.folicAcid || '--' }} mg</div>
  1268. </el-col>
  1269. <el-col :span="6">
  1270. <div><b>胆碱:</b>{{ form.choline || '--' }} mg</div>
  1271. </el-col>
  1272. <el-col :span="6">
  1273. <div><b>生物素:</b>{{ form.biotin || '--' }} mg</div>
  1274. </el-col>
  1275. </el-row>
  1276. <el-row :gutter="40" style="margin-top: 30px">
  1277. <el-col :span="6">
  1278. <div><b>泛酸:</b>{{ form.pantothenicAcid || '--' }} mg</div>
  1279. </el-col>
  1280. </el-row>
  1281. </el-tab-pane>
  1282. <el-tab-pane label="脂类" name="lipids">
  1283. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1284. <el-row :gutter="40" style="margin-top: 30px">
  1285. <el-col :span="12">
  1286. <div><b>胆固醇:</b>{{ form.cholesterol || '--' }} mg</div>
  1287. </el-col>
  1288. </el-row>
  1289. </el-tab-pane>
  1290. <el-tab-pane label="其他" name="others">
  1291. <span style="color: red; font-size: 16px; margin-bottom: 10px">注:每100(g/ml) 含量</span>
  1292. <el-row :gutter="40" style="margin-top: 30px">
  1293. <el-col :span="6">
  1294. <div><b>血糖生成指数:</b>{{ form.bloodGlucoseIndex || '--' }} mg</div>
  1295. </el-col>
  1296. <el-col :span="6">
  1297. <div><b>不可溶性膳食纤维:</b>{{ form.insolubleDietaryFiber || '--' }} mg</div>
  1298. </el-col>
  1299. <el-col :span="6">
  1300. <div><b>膳食纤维:</b>{{ form.dietaryFiber || '--' }} mg</div>
  1301. </el-col>
  1302. <el-col :span="6">
  1303. <div><b>灰分:</b>{{ form.ash || '--' }} mg</div>
  1304. </el-col>
  1305. </el-row>
  1306. <el-row :gutter="40" style="margin-top: 30px">
  1307. <el-col :span="6">
  1308. <div><b>可溶性膳食纤维:</b>{{ form.solubleDietaryFiber || '--' }} mg</div>
  1309. </el-col>
  1310. </el-row>
  1311. </el-tab-pane>
  1312. <el-tab-pane label="商品说明" name="productDescription">
  1313. <el-row :gutter="40" style="margin-top: 50px">
  1314. <el-col :span="12">
  1315. <div><b>适用人群:</b>{{ form.applicableCrowd || '--' }} </div>
  1316. </el-col>
  1317. <el-col :span="12">
  1318. <div><b>不适用人群:</b>{{ form.unsuitableCrowd || '--' }} </div>
  1319. </el-col>
  1320. </el-row>
  1321. <el-row :gutter="40" style="margin-top: 50px">
  1322. <el-col :span="12">
  1323. <div><b>渗透压:</b>{{ form.osmoticPressure || '--' }} </div>
  1324. </el-col>
  1325. <el-col :span="12">
  1326. <div><b>原料:</b>{{ form.rawMaterial || '--' }} </div>
  1327. </el-col>
  1328. </el-row>
  1329. <el-row :gutter="40" style="margin-top: 50px">
  1330. <el-col :span="12">
  1331. <div><b>适应症及禁忌:</b>{{ form.indicationsContraindications || '--' }} </div>
  1332. </el-col>
  1333. <el-col :span="12">
  1334. <div><b>食用方法和食用量:</b>{{ form.usageAndDosage || '--' }} </div>
  1335. </el-col>
  1336. </el-row>
  1337. <el-row :gutter="40" style="margin-top: 50px">
  1338. <el-col :span="12">
  1339. <div><b>产品特点:</b>{{ form.productFeatures || '--' }} </div>
  1340. </el-col>
  1341. <el-col :span="12">
  1342. <div><b>储存条件:</b>{{ form.storageConditions || '--' }} </div>
  1343. </el-col>
  1344. </el-row>
  1345. <el-row :gutter="40" style="margin-top: 50px">
  1346. <el-col :span="12">
  1347. <div><b>警示说明及注意事项:</b>{{ form.warningInstructions || '--' }} </div>
  1348. </el-col>
  1349. </el-row>
  1350. </el-tab-pane>
  1351. <el-tab-pane label="商品附件" name="productAttachments">
  1352. <el-row :gutter="40" style="margin-top: 30px">
  1353. <el-col :span="24">
  1354. <div>
  1355. <b>商品附件:</b>
  1356. <div v-if="form.productAttachmentsList && form.productAttachmentsList.length">
  1357. <div v-for="(file, idx) in form.productAttachmentsList" :key="idx">
  1358. <a :href="file.url" target="_blank">{{ file.name }}</a>
  1359. </div>
  1360. </div>
  1361. <div v-else>--</div>
  1362. </div>
  1363. </el-col>
  1364. </el-row>
  1365. </el-tab-pane>
  1366. </el-scrollbar>
  1367. </el-tabs>
  1368. </el-dialog>
  1369. <!-- 上传excel -->
  1370. <el-dialog :title="dialogFile.title" v-model="dialogFile.visible" width="700px" append-to-body>
  1371. <el-upload drag :action="uploadFileUrl" :headers="headers" :file-list="fileList" accept=".xlsx,.xls" ref="imageUploadRef" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload" :on-error="handleUploadError">
  1372. <el-icon class="el-icon--upload">
  1373. <upload-filled />
  1374. </el-icon>
  1375. <div class="el-upload__text">
  1376. 将文件拖到此处,或 <em>点击上传</em>
  1377. </div>
  1378. </el-upload>
  1379. <div class="el-upload__tip">
  1380. 请上传 .xls , .xlsx 标准格式文件
  1381. </div>
  1382. </el-dialog>
  1383. <!-- 添加疾病标签弹窗 -->
  1384. <LabelDialog v-model="diseaseLabelDialogVisible" :initial-selected-labels="form.productLabelList || []" @confirm="onLabelConfirm" />
  1385. <!-- 添加禁忌症标签弹窗 -->
  1386. <LabelDialog v-model="contraindicationLabelDialogVisible" :initial-selected-labels="form.contraindicationLabelList || []" @confirm="onContraindicationLabelConfirm" />
  1387. </div>
  1388. </template>
  1389. <script setup lang="ts">
  1390. import { ref, reactive, onMounted, getCurrentInstance } from 'vue';
  1391. import { listNutrition, getNutrition, delNutrition, addNutrition, updateNutrition, batchUpdateNutrition } from '@/api/warehouse/productNutrition/index';
  1392. import { NutritionVO, NutritionQuery, NutritionForm } from '@/api/warehouse/productNutrition/types';
  1393. import { listCategory } from '@/api/warehouse/productCategory/index';
  1394. import { listDept } from '@/api/system/dept';
  1395. import { listSupplier } from '@/api/warehouse/productSupplier'
  1396. import { listManufacturer } from '@/api/warehouse/productManufacturer'
  1397. import { globalHeaders } from '@/utils/request';
  1398. import { FormInstance, ElMessageBox, UploadFile, UploadFiles } from 'element-plus';
  1399. import { log } from 'console';
  1400. import LabelDialog from './labelDialog.vue';
  1401. import FileUpload from '@/components/FileUpload/index.vue';
  1402. import { ManufacturerVO } from '@/api/warehouse/productManufacturer/types';
  1403. import type { SupplierQuery } from '@/api/warehouse/productSupplier/types';
  1404. import type { ManufacturerQuery } from '@/api/warehouse/productManufacturer/types';
  1405. const diseaseLabelDialogVisible = ref(false);
  1406. const contraindicationLabelDialogVisible = ref(false);
  1407. const { proxy } = getCurrentInstance() as ComponentInternalInstance;
  1408. const { product_qualification, dosage_form, product_package_unit, put_flag, default_usage, product_spec_unit } = toRefs < any > (proxy ?.useDict('product_qualification', 'dosage_form', 'product_package_unit', 'put_flag', 'default_usage', 'product_spec_unit'));
  1409. const nutritionList = ref < NutritionVO[] > ([]);
  1410. const baseUrl = import.meta.env.VITE_APP_BASE_API; // 上传文件地址
  1411. const uploadFileUrl = ref(baseUrl + 'warehouse/nutrition/importExcel');
  1412. const buttonLoading = ref(false);
  1413. const loading = ref(true);
  1414. const showSearch = ref(true);
  1415. const ids = ref < Array < string | number >> ([]);
  1416. const single = ref(true);
  1417. const multiple = ref(true);
  1418. const total = ref(0);
  1419. const headers = ref(globalHeaders()); // 请求头设置
  1420. const activeTab = ref('basic');
  1421. const detailDialogVisible = ref(false);
  1422. const batchSetDialogVisible = ref(false);
  1423. const fileList = ref([]); // 用于Excel导入的文件列表
  1424. const batchSetForm = reactive({
  1425. shelfLifeReminder: '',
  1426. licenseExpiryReminder: ''
  1427. });
  1428. const batchRules = {
  1429. shelfLifeReminder: [{ required: true, message: "保质期临期提醒不能为空", trigger: "blur" }],
  1430. licenseExpiryReminder: [{ required: true, message: "许可证临期提醒不能为空", trigger: "blur" }],
  1431. };
  1432. const treeData = ref([]); // 定义 treeData
  1433. const deptList = ref([]); // 定义 科室list
  1434. const queryFormRef = ref < FormInstance > ();
  1435. const nutritionFormRef = ref < FormInstance > ();
  1436. const dialog = reactive < DialogOption > ({
  1437. visible: false,
  1438. title: ''
  1439. });
  1440. const dialogFile = reactive < DialogOption > ({
  1441. visible: false,
  1442. title: '请上传'
  1443. });
  1444. const initFormData: NutritionForm = {
  1445. id: undefined,
  1446. ids: undefined,
  1447. productName: undefined,
  1448. hospitalSystemCode: undefined,
  1449. productCode: undefined,
  1450. productCategory: undefined,
  1451. productCategoryList: undefined,
  1452. manufacturer: undefined,
  1453. brand: undefined,
  1454. licenseExpiryReminder: undefined,
  1455. productLicenseExpiry: undefined,
  1456. productQualification: undefined,
  1457. approvalNumber: undefined,
  1458. taste: undefined,
  1459. dosageForm: undefined,
  1460. supplier: undefined,
  1461. applicableDepartment: undefined,
  1462. applicableDepartmentList: undefined,
  1463. contraindicationLabel: undefined,
  1464. shelfLifeReminder: undefined,
  1465. shelfLife: undefined,
  1466. purchasePrice: undefined,
  1467. purchaseUnit: '2',
  1468. defaultUsage: '2',
  1469. packageUnit: '2',
  1470. productSpec: undefined,
  1471. productSpecValue: undefined,
  1472. productSpecUnit: '1',
  1473. packagePrice: undefined,
  1474. minUnit: '3',
  1475. minSpec: undefined,
  1476. netContent: undefined,
  1477. configSalePrice: undefined,
  1478. configLossRate: undefined,
  1479. calorie: undefined,
  1480. carbohydrate: undefined,
  1481. heatEnergy: undefined,
  1482. protein: undefined,
  1483. fat: undefined,
  1484. moisture: undefined,
  1485. ca: undefined,
  1486. p: undefined,
  1487. k: undefined,
  1488. na: undefined,
  1489. mg: undefined,
  1490. cl: undefined,
  1491. fe: undefined,
  1492. zn: undefined,
  1493. se: undefined,
  1494. cu: undefined,
  1495. mn: undefined,
  1496. i: undefined,
  1497. f: undefined,
  1498. cr: undefined,
  1499. mo: undefined,
  1500. isoleucine: undefined,
  1501. tryptophan: undefined,
  1502. sulfurAminoAcid: undefined,
  1503. histidine: undefined,
  1504. aromaticAminoAcid: undefined,
  1505. glutamicAcid: undefined,
  1506. threonine: undefined,
  1507. serine: undefined,
  1508. arginine: undefined,
  1509. lysine: undefined,
  1510. asparticAcid: undefined,
  1511. cysteine: undefined,
  1512. proline: undefined,
  1513. tyrosine: undefined,
  1514. leucine: undefined,
  1515. valine: undefined,
  1516. methionine: undefined,
  1517. alanine: undefined,
  1518. phenylalanine: undefined,
  1519. glycine: undefined,
  1520. fattyAcid: undefined,
  1521. saturatedFattyAcid: undefined,
  1522. monounsaturatedFattyAcid: undefined,
  1523. polyunsaturatedFattyAcid: undefined,
  1524. vitaminA: undefined,
  1525. vitaminACarotene: undefined,
  1526. vitaminAAlcohol: undefined,
  1527. vitaminD: undefined,
  1528. vitaminE: undefined,
  1529. vitaminETocopherol: undefined,
  1530. vitaminK: undefined,
  1531. vitaminBOne: undefined,
  1532. vitaminBTwo: undefined,
  1533. vitaminBSix: undefined,
  1534. vitaminBTwelve: undefined,
  1535. niacin: undefined,
  1536. vitaminC: undefined,
  1537. folicAcid: undefined,
  1538. choline: undefined,
  1539. biotin: undefined,
  1540. pantothenicAcid: undefined,
  1541. cholesterol: undefined,
  1542. bloodGlucoseIndex: undefined,
  1543. insolubleDietaryFiber: undefined,
  1544. dietaryFiber: undefined,
  1545. ash: undefined,
  1546. solubleDietaryFiber: undefined,
  1547. applicableCrowd: undefined,
  1548. unsuitableCrowd: undefined,
  1549. osmoticPressure: undefined,
  1550. rawMaterial: undefined,
  1551. indicationsContraindications: undefined,
  1552. usageAndDosage: undefined,
  1553. productFeatures: undefined,
  1554. storageConditions: undefined,
  1555. warningInstructions: undefined,
  1556. productAttachments: undefined,
  1557. productAttachmentsList: [],
  1558. status: undefined,
  1559. putFlag: undefined,
  1560. outboundNumber: undefined,
  1561. productLabel: undefined,
  1562. productLabelList: [],
  1563. contraindicationLabelList: [],
  1564. };
  1565. const data = reactive < PageData < NutritionForm,
  1566. NutritionQuery >> ({
  1567. form: { ...initFormData },
  1568. queryParams: {
  1569. pageNum: 1,
  1570. pageSize: 10,
  1571. productName: undefined,
  1572. productCategory: undefined,
  1573. productCategoryList: [],
  1574. },
  1575. rules: {
  1576. productName: [
  1577. { required: true, message: "产品名称不能为空", trigger: "blur" }
  1578. ],
  1579. hospitalSystemCode: [
  1580. { required: true, message: "院方系统编码不能为空", trigger: "blur" }
  1581. ],
  1582. productCode: [
  1583. { required: true, message: "商品编码不能为空", trigger: "blur" }
  1584. ],
  1585. productCategory: [
  1586. { required: true, message: "产品所属分类不能为空", trigger: "blur" }
  1587. ],
  1588. productQualification: [
  1589. { required: true, message: "商品资质不能为空", trigger: "blur" }
  1590. ],
  1591. shelfLifeReminder: [
  1592. { required: true, message: "保质期临期提醒不能为空", trigger: "blur" }
  1593. ],
  1594. shelfLife: [
  1595. { required: true, message: "保质期不能为空", trigger: "blur" }
  1596. ],
  1597. purchasePrice: [
  1598. { required: true, message: "入货价格不能为空", trigger: "blur" }
  1599. ],
  1600. purchaseUnit: [
  1601. { required: true, message: "入货单位不能为空", trigger: "blur" }
  1602. ],
  1603. productSpec: [
  1604. { required: true, message: "商品规格不能为空", trigger: "blur" }
  1605. ],
  1606. configSalePrice: [
  1607. { required: true, message: "配置销售价格不能为空", trigger: "blur" }
  1608. ],
  1609. packagePrice: [
  1610. { required: true, message: "预包装价格不能为空", trigger: "blur" }
  1611. ],
  1612. }
  1613. });
  1614. const { queryParams, form, rules } = toRefs(data);
  1615. const categoryOptions = ref([]);
  1616. function buildCategoryTree(flatList) {
  1617. const idMap = {};
  1618. const tree = [];
  1619. flatList.forEach(item => {
  1620. idMap[item.categoryId] = {
  1621. label: item.categoryName,
  1622. value: item.categoryId,
  1623. children: []
  1624. };
  1625. });
  1626. flatList.forEach(item => {
  1627. if (item.parentId && item.parentId !== 0 && idMap[item.parentId]) {
  1628. idMap[item.parentId].children.push(idMap[item.categoryId]);
  1629. } else if (item.parentId === 0) {
  1630. tree.push(idMap[item.categoryId]);
  1631. }
  1632. });
  1633. // 去除没有children的children字段
  1634. function clean(node) {
  1635. if (node.children && node.children.length === 0) {
  1636. delete node.children;
  1637. } else if (node.children) {
  1638. node.children.forEach(clean);
  1639. }
  1640. }
  1641. tree.forEach(clean);
  1642. return tree;
  1643. }
  1644. /** 查询营养产品信息列表 */
  1645. const getList = async () => {
  1646. loading.value = true;
  1647. const res = await listNutrition(queryParams.value);
  1648. nutritionList.value = res.rows;
  1649. total.value = res.total;
  1650. loading.value = false;
  1651. }
  1652. interface ManufacturerOption {
  1653. value: string | number;
  1654. label: string;
  1655. }
  1656. const productManufacturerList = ref < ManufacturerOption[] > ([]);
  1657. const productSupplierList = ref < ManufacturerOption[] > ([]);
  1658. /** 获取生产厂商列表 */
  1659. const getManufacturerList = async () => {
  1660. try {
  1661. const params: ManufacturerQuery = {
  1662. pageNum: 1,
  1663. pageSize: 10,
  1664. name: undefined,
  1665. params: {}
  1666. };
  1667. const res = await listManufacturer(params);
  1668. productManufacturerList.value = res.rows.map(item => ({
  1669. value: item.id,
  1670. label: item.name
  1671. }));
  1672. } catch (error) {
  1673. proxy ?.$modal.msgError("获取生产厂商列表失败");
  1674. console.error("获取生产厂商列表失败:", error);
  1675. }
  1676. }
  1677. /** 获取供应商列表 */
  1678. const getSupplierList = async () => {
  1679. try {
  1680. const params: SupplierQuery = {
  1681. pageNum: 1,
  1682. pageSize: 10,
  1683. name: undefined,
  1684. params: {}
  1685. };
  1686. const res = await listSupplier(params);
  1687. productSupplierList.value = res.rows.map(item => ({
  1688. value: item.id,
  1689. label: item.name
  1690. }));
  1691. } catch (error) {
  1692. proxy ?.$modal.msgError("获取供应商列表失败");
  1693. console.error("获取供应商列表失败:", error);
  1694. }
  1695. }
  1696. const getDeptList = async () => {
  1697. loading.value = true;
  1698. try {
  1699. const res = await listDept({
  1700. pageNum: 1,
  1701. pageSize: 1000
  1702. });
  1703. if (!res.data) {
  1704. console.warn("部门数据为空");
  1705. deptList.value = [];
  1706. return;
  1707. }
  1708. // 处理树形数据
  1709. const processedData = proxy ?.handleTree(res.data, 'deptId');
  1710. if (!processedData) {
  1711. console.warn("树形数据处理失败");
  1712. deptList.value = [];
  1713. return;
  1714. }
  1715. deptList.value = processedData;
  1716. } catch (error) {
  1717. console.error('获取部门列表失败:', error);
  1718. deptList.value = [];
  1719. } finally {
  1720. loading.value = false;
  1721. }
  1722. };
  1723. /** 下载模板按钮操作 */
  1724. const downLoadTemplate = () => {
  1725. proxy ?.getDownload('warehouse/nutrition/downLoadTemplate', {}, `营养产品模版.xlsx`)
  1726. }
  1727. /** 导入按钮操作 */
  1728. const handleImport = () => {
  1729. dialogFile.visible = true;
  1730. fileList.value = [];
  1731. }
  1732. // 上传失败
  1733. const handleUploadError = () => {
  1734. proxy ?.$modal.msgError('上传Excel失败');
  1735. proxy ?.$modal.closeLoading();
  1736. };
  1737. // 上传成功回调
  1738. const handleUploadSuccess = (res: any, file: UploadFile) => {
  1739. if (res.code === 200) {
  1740. dialogFile.visible = false;
  1741. fileList.value = [];
  1742. proxy ?.$modal.closeLoading();
  1743. } else {
  1744. proxy ?.$modal.msgError(res.msg);
  1745. proxy ?.$modal.closeLoading();
  1746. }
  1747. fileList.value = [];
  1748. };
  1749. /** 上传前loading加载 */
  1750. const handleBeforeUpload = (file: any) => {
  1751. const isLt = file.size / 1024 / 1024 < 10;
  1752. if (!isLt) {
  1753. proxy ?.$modal.msgError(`上传头像图片大小不能超过10MB!`);
  1754. return false;
  1755. }
  1756. proxy ?.$modal.loading('正在上传文件,请稍候...');
  1757. return true;
  1758. };
  1759. function openBatchSetDialog() {
  1760. if (!ids.value.length) {
  1761. proxy ?.$modal.msgWarning('请先选择要批量设置的产品');
  1762. return;
  1763. }
  1764. batchSetForm.shelfLifeReminder = '';
  1765. batchSetForm.licenseExpiryReminder = '';
  1766. batchSetDialogVisible.value = true;
  1767. }
  1768. async function handleBatchSetSubmit() {
  1769. const params = {
  1770. ids: ids.value,
  1771. shelfLifeReminder: batchSetForm.shelfLifeReminder,
  1772. licenseExpiryReminder: batchSetForm.licenseExpiryReminder
  1773. };
  1774. try {
  1775. await batchUpdateNutrition(params);
  1776. proxy ?.$modal.msgSuccess('批量设置成功');
  1777. batchSetDialogVisible.value = false;
  1778. getList();
  1779. } catch (e) {
  1780. proxy ?.$modal.msgError('批量设置失败');
  1781. }
  1782. }
  1783. /** 取消按钮 */
  1784. const cancel = () => {
  1785. reset();
  1786. dialog.visible = false;
  1787. }
  1788. /** 表单重置 */
  1789. const reset = () => {
  1790. form.value = { ...initFormData };
  1791. nutritionFormRef.value ?.resetFields();
  1792. fileList.value = [];
  1793. }
  1794. /** 搜索按钮操作 */
  1795. const handleQuery = () => {
  1796. // 取最后一级分类ID传给后端
  1797. if (queryParams.value.productCategoryList && queryParams.value.productCategoryList.length) {
  1798. queryParams.value.productCategory = queryParams.value.productCategoryList.slice(-1)[0];
  1799. } else {
  1800. queryParams.value.productCategory = undefined;
  1801. }
  1802. queryParams.value.pageNum = 1;
  1803. getList();
  1804. }
  1805. /** 重置按钮操作 */
  1806. const resetQuery = () => {
  1807. queryFormRef.value ?.resetFields();
  1808. queryParams.value.productCategoryList = [];
  1809. queryParams.value.productCategory = undefined;
  1810. queryParams.value.productName = undefined;
  1811. handleQuery();
  1812. }
  1813. /** 多选框选中数据 */
  1814. const handleSelectionChange = (selection: NutritionVO[]) => {
  1815. ids.value = selection.map(item => item.id);
  1816. single.value = selection.length != 1;
  1817. multiple.value = !selection.length;
  1818. }
  1819. /** 新增按钮操作 */
  1820. const handleAdd = () => {
  1821. reset();
  1822. dialog.visible = true;
  1823. dialog.title = "添加营养产品信息";
  1824. }
  1825. /** 修改按钮操作 */
  1826. const handleUpdate = async (row ? : NutritionVO) => {
  1827. reset();
  1828. const _id = row ?.id || ids.value[0]
  1829. const res = await getNutrition(_id);
  1830. Object.assign(form.value, res.data);
  1831. dialog.visible = true;
  1832. dialog.title = "修改营养产品信息";
  1833. }
  1834. /** 提交按钮 */
  1835. const submitForm = () => {
  1836. nutritionFormRef.value ?.validate(async (valid: boolean) => {
  1837. if (valid) {
  1838. buttonLoading.value = true;
  1839. // form.value.productSpec = form.value.productSpec && form.value.productSpecUnit ? `${form.value.productSpec}${form.value.productSpecUnit}` : '';
  1840. if (form.value.id) {
  1841. await updateNutrition(form.value).finally(() => buttonLoading.value = false);
  1842. } else {
  1843. await addNutrition(form.value).finally(() => buttonLoading.value = false);
  1844. }
  1845. proxy ?.$modal.msgSuccess("操作成功");
  1846. dialog.visible = false;
  1847. await getList();
  1848. }
  1849. });
  1850. }
  1851. /** 保存并上架按钮操作 */
  1852. const submitFormAndPutaway = () => {
  1853. nutritionFormRef.value ?.validate(async (valid: boolean) => {
  1854. if (valid) {
  1855. buttonLoading.value = true;
  1856. form.value.putFlag = '1';
  1857. // form.value.productSpec = form.value.productSpec && form.value.productSpecUnit ? `${form.value.productSpec}${form.value.productSpecUnit}` : '';
  1858. if (form.value.id) {
  1859. await updateNutrition(form.value).finally(() => buttonLoading.value = false);
  1860. } else {
  1861. await addNutrition(form.value).finally(() => buttonLoading.value = false);
  1862. }
  1863. proxy ?.$modal.msgSuccess("操作成功");
  1864. dialog.visible = false;
  1865. await getList();
  1866. }
  1867. });
  1868. }
  1869. /** 删除按钮操作 */
  1870. const handleDelete = async (row ? : NutritionVO) => {
  1871. const _ids = row ?.id || ids.value;
  1872. await proxy ?.$modal.confirm('是否确认删除营养产品信息编号为"' + _ids + '"的数据项?');
  1873. await delNutrition(_ids);
  1874. proxy ?.$modal.msgSuccess("删除成功");
  1875. await getList();
  1876. }
  1877. /** 导出按钮操作 */
  1878. const handleExport = () => {
  1879. proxy ?.download('warehouse/nutrition/export', {
  1880. ...queryParams.value
  1881. }, `nutrition_${new Date().getTime()}.xlsx`)
  1882. }
  1883. const onSpecUnitChange = () => {
  1884. if (!form.value.productSpecUnit) form.value.productSpecUnit = 'g';
  1885. }
  1886. // 详情弹窗逻辑
  1887. const handleDetail = async (row: NutritionVO) => {
  1888. reset();
  1889. // 确保生产厂商列表已加载
  1890. if (productManufacturerList.value.length === 0) {
  1891. await getManufacturerList();
  1892. }
  1893. if (productSupplierList.value.length === 0) {
  1894. await getSupplierList();
  1895. }
  1896. const res = await getNutrition(row.id);
  1897. Object.assign(form.value, res.data);
  1898. detailDialogVisible.value = true;
  1899. activeTab.value = 'basic';
  1900. };
  1901. // 上下架切换
  1902. const handlePutFlag = async (row: NutritionVO, flag: string) => {
  1903. await proxy ?.$modal.confirm(`是否确认${flag === '1' ? '上架' : '下架'}该产品?`);
  1904. const updateData = { ...row, putFlag: flag };
  1905. await updateNutrition(updateData);
  1906. proxy ?.$modal.msgSuccess(`${flag === '1' ? '上架' : '下架'}成功`);
  1907. await getList();
  1908. };
  1909. onMounted(async () => {
  1910. getList();
  1911. getDeptList(); // 初始化时加载部门数据
  1912. getSupplierList(); // 初始化时加载供应商数据
  1913. getManufacturerList(); // 初始化时加载厂商数据
  1914. const res = await listCategory();
  1915. categoryOptions.value = buildCategoryTree(res.rows || []);
  1916. if (!form.value.productSpecUnit) form.value.productSpecUnit = 'g';
  1917. });
  1918. const getCategoryName = (categoryIds) => {
  1919. if (!categoryIds) return '--';
  1920. // 处理多个分类ID的情况
  1921. const ids = categoryIds.toString().split(',');
  1922. const categoryNames = ids.map(id => {
  1923. const findCategory = (categories, targetId) => {
  1924. for (const category of categories) {
  1925. if (category.value.toString() === targetId.toString()) {
  1926. return category.label;
  1927. }
  1928. if (category.children) {
  1929. const found = findCategory(category.children, targetId);
  1930. if (found) return found;
  1931. }
  1932. }
  1933. return null;
  1934. };
  1935. return findCategory(categoryOptions.value, id);
  1936. }).filter(name => name !== null);
  1937. return categoryNames.length > 0 ? categoryNames.join('/') : '--';
  1938. };
  1939. // 弹窗回填
  1940. function onLabelConfirm(selectedLabels) {
  1941. form.value.productLabelList = selectedLabels;
  1942. }
  1943. function onContraindicationLabelConfirm(selectedLabels) {
  1944. form.value.contraindicationLabelList = selectedLabels;
  1945. } // 字典label工具
  1946. function getDictLabel(dictList, value) {
  1947. if (!dictList || !Array.isArray(dictList)) return value || '--';
  1948. const found = dictList.find(item => item.value === value);
  1949. return found ? found.label : value || '--';
  1950. }
  1951. </script>
  1952. <style lang="scss" scoped>
  1953. .nutrition-dialog {
  1954. :deep(.el-dialog) {
  1955. height: 70vh;
  1956. margin-top: 15vh !important;
  1957. .el-dialog__body {
  1958. height: calc(100% - 120px);
  1959. padding: 10px 20px;
  1960. overflow: hidden;
  1961. }
  1962. .el-tabs {
  1963. height: 100%;
  1964. .el-tabs__content {
  1965. height: calc(100% - 40px);
  1966. overflow: hidden;
  1967. }
  1968. }
  1969. .el-scrollbar {
  1970. height: 100%;
  1971. .el-scrollbar__wrap {
  1972. overflow-x: hidden;
  1973. }
  1974. }
  1975. .el-form {
  1976. padding: 20px;
  1977. }
  1978. }
  1979. }
  1980. .dialog-footer {
  1981. padding: 20px;
  1982. text-align: right;
  1983. }
  1984. .custom-label-select .el-select__tags {
  1985. flex-wrap: wrap !important;
  1986. max-height: none;
  1987. }
  1988. .custom-label-select .el-tag {
  1989. background: #e6f7ff;
  1990. color: #409eff;
  1991. border: 1px solid #b3e5fc;
  1992. margin-bottom: 4px;
  1993. }
  1994. </style>