details.vue 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560
  1. <!-- 物料信息基础档案——详情 -->
  2. <template>
  3. <div class="material-details">
  4. <!-- 操作栏 -->
  5. <!-- 基本信息栏 -->
  6. <div v-if="activeMainTab == 'material'">
  7. <el-row :gutter="10" class="mb10" v-if="!updateButtonGroup">
  8. <!-- 新增、修改、删除、复制 -->
  9. <el-col :span="1.5">
  10. <el-button-group>
  11. <el-button size="small" @click="handleInster">新增</el-button>
  12. <el-button size="small" @click="handleBasicEdit">修改</el-button>
  13. <el-button size="small" @click="handleDel">删除</el-button>
  14. <el-button size="small" @click="handleCopy">复制</el-button>
  15. </el-button-group>
  16. </el-col>
  17. <!-- 查询、刷新、过滤 -->
  18. <el-col :span="1.5">
  19. <el-button-group>
  20. <el-dropdown size="small" @command="handleFilter">
  21. <el-button size="small">
  22. 过滤<i class="el-icon-arrow-down el-icon--right"></i>
  23. </el-button>
  24. <el-dropdown-menu slot="dropdown">
  25. <el-dropdown-item :command="filterCondition('stop')">显示停用</el-dropdown-item>
  26. <el-dropdown-item :command="filterCondition('allot')">显示已分配</el-dropdown-item>
  27. </el-dropdown-menu>
  28. </el-dropdown>
  29. <el-button size="small" @click="handleQuery">查询</el-button>
  30. <el-button size="small" @click="handleRefresh">刷新</el-button>
  31. </el-button-group>
  32. </el-col>
  33. <!-- 启用 -->
  34. <el-col :span="1.5">
  35. <el-button-group>
  36. <el-dropdown split-button size="small" @click="handleIsInvoke(true)" @command="handleIsInvoke">
  37. 启用
  38. <el-dropdown-menu slot="dropdown">
  39. <el-dropdown-item :command="isInvoke(true)">启用</el-dropdown-item>
  40. <el-dropdown-item :command="isInvoke(false)">停用</el-dropdown-item>
  41. </el-dropdown-menu>
  42. </el-dropdown>
  43. </el-button-group>
  44. </el-col>
  45. <!-- 申请单查询 -->
  46. <el-col :span="1.5">
  47. <el-button-group>
  48. <el-button size="small" @click="handleQueryForm">申请单查询</el-button>
  49. </el-button-group>
  50. </el-col>
  51. <!-- 导入导出 -->
  52. <el-col :span="1.5">
  53. <el-button-group>
  54. <el-button size="small" @click="handleImport">批量导入</el-button>
  55. <el-button size="small" @click="handleExport">批量导出</el-button>
  56. </el-button-group>
  57. </el-col>
  58. </el-row>
  59. <!-- 基本信息修改状态下—— 保存、保存新增、更新导入、取消 -->
  60. <el-row :gutter="10" class="mb10" v-else>
  61. <el-col :span="1.5">
  62. <el-button-group>
  63. <el-button size="small" @click="handleSave">保存</el-button>
  64. <el-button size="small" @click="handleSaveAdd" :disabled="true">保存新增</el-button>
  65. <el-button size="small" @click="handleUpdateImport">更新导入</el-button>
  66. </el-button-group>
  67. </el-col>
  68. <el-col :span="1.5">
  69. <el-button-group>
  70. <el-button size="small" @click="handleCancel">取消</el-button>
  71. </el-button-group>
  72. </el-col>
  73. </el-row>
  74. </div>
  75. <!-- 其他标签页操作 修改、删除 -->
  76. <el-row :gutter="10" class="mb10" v-show="activeMainTab != 'material'">
  77. <el-col :span="1.5">
  78. <el-button-group>
  79. <el-button size="small" @click="handleEdit">修改</el-button>
  80. <el-button size="small" @click="handleDel">删除</el-button>
  81. </el-button-group>
  82. <el-button-group>
  83. <el-button size="small" @click="handleRefresh">刷新</el-button>
  84. </el-button-group>
  85. </el-col>
  86. </el-row>
  87. <el-card>
  88. <!-- 返回 切换 附件管理 -->
  89. <el-row type="flex" justify="space-between">
  90. <el-col :span="6">
  91. <!-- :disabled="headerParam.isEdit" -->
  92. <el-button size="small" @click="handleBack" :disabled="updateButtonGroup">返回</el-button>
  93. </el-col>
  94. <el-col :span="6" style="text-align: right;">
  95. <!-- 附件管理 -->
  96. <el-button-group>
  97. <el-button size="small" icon="el-icon-paperclip" @click="handleFile"></el-button>
  98. </el-button-group>
  99. <!-- 切换 -->
  100. <el-button-group>
  101. <el-button size="small" icon="el-icon-d-arrow-left" @click="handleChangePage('first')"></el-button>
  102. <el-button size="small" icon="el-icon-arrow-left" @click="handleChangePage('pre')"></el-button>
  103. <el-button size="small" icon="el-icon-arrow-right" @click="handleChangePage('next')"></el-button>
  104. <el-button size="small" icon="el-icon-d-arrow-right" @click="handleChangePage('end')"></el-button>
  105. </el-button-group>
  106. </el-col>
  107. </el-row>
  108. <div class="md-content">
  109. <el-form :inline="true" label-position="right" :model="basicData.value">
  110. <!-- <el-form-item label="所属组织"></el-form-item> -->
  111. <el-form-item label="物料编码">
  112. <el-input v-model="basicData.value.code" size="small" placeholder="物料编码"></el-input>
  113. </el-form-item>
  114. <el-form-item label="物料名称">
  115. <el-input v-model="basicData.value.name" size="small" placeholder="物料名称"></el-input>
  116. </el-form-item>
  117. <el-form-item label="英文名称">
  118. <el-input v-model="basicData.value.enName" size="small" placeholder="英文名称"></el-input>
  119. </el-form-item>
  120. <!-- <el-form-item label="版本号"></el-form-item> -->
  121. </el-form>
  122. <dr-tabs :tabList="detailsTabs" :handleTabClick="handleMainTabClick">
  123. <template #tabContent>
  124. <div class="md-basic">
  125. <!-- 主信息 -->
  126. <div class="md-main">
  127. <!-- 基本信息展示表单 -->
  128. <el-form v-if="activeMainTab == 'material'" :inline="true" label-position="right"
  129. :hide-required-asterisk="true" :model="basicData.value">
  130. <el-row :gutter="10">
  131. <el-col :span="8" v-for="f in basicData.form" style="text-align: right;">
  132. <template v-if="f.show">
  133. <!-- :disabled="!(headerParam.isEdit && f.edit)" -->
  134. <!-- 多选框 -->
  135. <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;">
  136. <el-checkbox :label="f.name" name="type" v-model="basicData.value[f.prop]"
  137. :disabled="!updateButtonGroup">
  138. </el-checkbox>
  139. </el-form-item>
  140. <!-- 下拉框 -->
  141. <el-form-item v-else-if="f.attribute == 'select'" :label="f.name"
  142. :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''">
  143. <el-select v-model="basicData.value[`${f.prop}Label`]" :placeholder="f.name"
  144. :key="basicData.value[f.prop]" :disabled="!updateButtonGroup"
  145. @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
  146. <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
  147. :value="d.dictValue">
  148. </el-option>
  149. <div slot="empty"></div>
  150. </el-select>
  151. </el-form-item>
  152. <el-form-item v-else-if="f.attribute == 'image'" :label="f.name">
  153. <el-image :src="basicData.value[f.prop]" fit="contain">
  154. </el-image>
  155. </el-form-item>
  156. <!--attribute 文本 数字 文本域 为null -->
  157. <el-form-item v-else :label="f.name">
  158. <el-input size="small" v-model="basicData.value[f.prop]" :type="f.attribute || 'text'"
  159. :readonly="!updateButtonGroup" :placeholder="f.name">
  160. </el-input>
  161. </el-form-item>
  162. </template>
  163. </el-col>
  164. </el-row>
  165. </el-form>
  166. <!-- 其他展示为列表 -->
  167. <el-table v-else :data="mainMsg.value" @cell-dblclick="handleMaindbClick"
  168. @selection-change="handleMainChange">
  169. <el-table-column type="selection" width="55" />
  170. <el-table-column type="index" label="序号" width="55" align="center" />
  171. <el-table-column v-for="m in mainMsg.form" v-if="m.show" :label="m.name" align="center" :prop="m.prop"
  172. show-overflow-tooltip />
  173. </el-table>
  174. </div>
  175. <!-- 副信息 -->
  176. <div class="md-vice">
  177. <dr-tabs v-if="activeMainTab == 'material'" :tabList="basicMessage" :handleTabClick="handleViceTabClick">
  178. <template #tabContent>
  179. <el-form v-if="activeViceTab == 'material_medcine'" :inline="true" label-position="right"
  180. :hide-required-asterisk="true" :model="medcineData.value" class="md-vice-content">
  181. <el-row :gutter="10">
  182. <el-col :span="8" v-for="m in medcineData.form" style="text-align: right;">
  183. <template v-if="m.show">
  184. <!-- 多选框 -->
  185. <el-form-item v-if="m.attribute == 'checkbox'">
  186. <el-checkbox :label="m.name" name="type" v-model="medcineData.value[m.prop]"
  187. :disabled="!updateButtonGroup">
  188. </el-checkbox>
  189. </el-form-item>
  190. <!-- 下拉框 -->
  191. <el-form-item v-else-if="m.attribute == 'select'" :label="m.name">
  192. <el-select v-model="medcineData.value[`${m.prop}Label`]" :placeholder="m.name"
  193. :key="medcineData.value[m.prop]" :disabled="!updateButtonGroup"
  194. @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
  195. <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue"
  196. :label="d.dictLabel" :value="d.dictValue">
  197. </el-option>
  198. <div slot="empty"></div>
  199. </el-select>
  200. </el-form-item>
  201. <!-- 图片 -->
  202. <el-form-item v-else-if="m.attribute == 'image'" :label="m.name">
  203. <el-image :src="medcineData.value[m.prop]" fit="contain">
  204. </el-image>
  205. </el-form-item>
  206. <!-- 文本、数字、textarae -->
  207. <el-form-item v-else :label="m.name">
  208. <el-input size="small" v-model="medcineData.value[m.prop]" :type="m.attribute || 'text'"
  209. :placeholder="m.name" :readonly="!updateButtonGroup">
  210. </el-input>
  211. </el-form-item>
  212. </template>
  213. </el-col>
  214. </el-row>
  215. </el-form>
  216. <!-- 其他展示为列表 -->
  217. <!-- 辅计量 -->
  218. <el-table v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
  219. class="material-table">
  220. <el-table-column type="index" label="序号" width="55" align="center" />
  221. <el-table-column v-for="v in unitDetails.form" v-if="v.show" :label="v.name" align="center"
  222. :prop="v.prop" show-overflow-tooltip />
  223. </el-table>
  224. <!-- 辅助属性 -->
  225. <el-table v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
  226. class="material-table">
  227. <el-table-column type="index" label="序号" width="55" align="center" />
  228. <el-table-column v-for="v in propertyDetail.form" v-if="v.show" :label="v.name" align="center"
  229. :prop="v.prop" show-overflow-tooltip />
  230. </el-table>
  231. </template>
  232. </dr-tabs>
  233. </div>
  234. <!-- 基本信息 - 审计信息 -->
  235. <div class="md-auditInfo" v-if="activeMainTab == 'material'">
  236. <el-divider content-position="left">审计信息</el-divider>
  237. <el-form :inline="true" label-position="right" :model="basicData.value">
  238. <el-form-item label="创建人">
  239. <el-input v-model="basicData.value.createBy" size="small" readonly placeholder="创建人"></el-input>
  240. </el-form-item>
  241. <el-form-item label="创建时间">
  242. <el-input v-model="basicData.value.createTime" size="small" readonly placeholder="创建时间"></el-input>
  243. </el-form-item>
  244. <el-form-item label="最后修改人">
  245. <el-input v-model="basicData.value.updateBy" size="small" readonly placeholder="最后修改人"></el-input>
  246. </el-form-item>
  247. <el-form-item label="最后修改时间">
  248. <el-input v-model="basicData.value.updateTime" size="small" readonly placeholder="最后修改时间"></el-input>
  249. </el-form-item>
  250. </el-form>
  251. </div>
  252. </div>
  253. </template>
  254. </dr-tabs>
  255. </div>
  256. </el-card>
  257. <!-- 操作提示弹窗 -->
  258. <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
  259. <span>是否确认{{ optionDialog.op }}?</span>
  260. <span slot="footer">
  261. <el-button @click="handleOptionCancal">取 消</el-button>
  262. <el-button type="primary" @click="handleComfirmOption('cancal')">确 定</el-button>
  263. </span>
  264. </el-dialog>
  265. <!-- 其他页签的操作 -->
  266. <el-dialog :title="otherDeatils.title" :visible.sync="otherDeatils.show" show-close width="70%"
  267. :before-close="handleCloseOtherDetails" :close-on-press-escape="false" :close-on-click-modal="false"
  268. class="otherDialog">
  269. <div>
  270. <!-- 其他标签页操作 修改、删除 -->
  271. <el-row :gutter="10" class="mb10">
  272. <el-col :span="1.5" v-if="!otherDeatils.isEdit">
  273. <el-button-group>
  274. <el-button size="small" @click="handleEdit">修改</el-button>
  275. <el-button size="small" @click="handleDel">删除</el-button>
  276. </el-button-group>
  277. <el-button-group>
  278. <el-button size="small" @click="handleRefresh">刷新</el-button>
  279. </el-button-group>
  280. </el-col>
  281. <el-col :span="1.5" v-else>
  282. <el-button-group>
  283. <el-button size="small" @click="handleOtherSave">保存</el-button>
  284. <el-button size="small" @click="handleOtherCancel">取消</el-button>
  285. </el-button-group>
  286. </el-col>
  287. </el-row>
  288. <el-collapse v-model="collapseActive" @change="handleCollapseChange">
  289. <el-collapse-item title="物料基本信息" name="basic">
  290. <el-form :inline="true" label-position="right" :model="basicData.value">
  291. <!-- <el-form-item label="所属组织">
  292. <el-input v-model="basicData.value.orgName" placeholder="所属组织"></el-input>
  293. </el-form-item> -->
  294. <el-form-item label="物料编码">
  295. <el-input v-model="basicData.value.code" size="small" readonly placeholder="物料编码"></el-input>
  296. </el-form-item>
  297. <el-form-item label="物料名称">
  298. <el-input v-model="basicData.value.name" size="small" readonly placeholder="物料名称"></el-input>
  299. </el-form-item>
  300. <el-form-item label="英文名称">
  301. <el-input v-model="basicData.value.enName" size="small" readonly placeholder="英文名称"></el-input>
  302. </el-form-item>
  303. <!-- <el-form-item label="版本号">
  304. <el-input v-model="basicData.value.version" placeholder="版本号"></el-input>
  305. </el-form-item> -->
  306. </el-form>
  307. </el-collapse-item>
  308. <el-collapse-item :title="otherDeatils.title" :name="activeMainTab">
  309. <div class="od-msg">
  310. <!-- 展示表单 -->
  311. <el-form :inline="true" label-position="right" :hide-required-asterisk="true" :model="otherDeatils.value">
  312. <el-row :gutter="10">
  313. <el-col :span="8" v-for="f in otherDeatils.form" style="text-align: right;">
  314. <template v-if="f.show">
  315. <!-- 多选框 -->
  316. <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;" class="od-msg-checkedbx">
  317. <el-checkbox :label="f.name" name="type" v-model="otherDeatils.value[f.prop]"
  318. :disabled="!(otherDeatils.isEdit && f.edit)">
  319. </el-checkbox>
  320. </el-form-item>
  321. <!-- 下拉框 -->
  322. <el-form-item v-else-if="f.attribute == 'select'" :label="f.name">
  323. <el-select v-model="otherDeatils.value[`${f.prop}Label`]" :placeholder="f.name"
  324. :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
  325. @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
  326. <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
  327. :value="d.dictValue">
  328. </el-option>
  329. <div slot="empty"></div>
  330. </el-select>
  331. </el-form-item>
  332. <el-form-item v-else-if="f.attribute == 'image'" :label="f.name">
  333. <el-image :src="otherDeatils.value[f.prop]" fit="contain">
  334. </el-image>
  335. </el-form-item>
  336. <!--attribute 文本 数字 文本域 为null -->
  337. <el-form-item v-else :label="f.name">
  338. <el-input size="small" v-model="otherDeatils.value[f.prop]" :type="f.attribute || 'text'"
  339. :placeholder="f.name" :readonly="!(otherDeatils.isEdit && f.edit)">
  340. </el-input>
  341. </el-form-item>
  342. </template>
  343. </el-col>
  344. </el-row>
  345. </el-form>
  346. </div>
  347. </el-collapse-item>
  348. <el-collapse-item title="审计信息" name="auditInfo">
  349. <!-- 基本信息 - 审计信息 -->
  350. <div class="md-auditInfo">
  351. <el-form :inline="true" label-position="right" :model="basicData.value">
  352. <el-form-item label="创建人">
  353. <el-input v-model="basicData.value.createBy" size="small" readonly placeholder="创建人"></el-input>
  354. </el-form-item>
  355. <el-form-item label="创建时间">
  356. <el-input v-model="basicData.value.createTime" size="small" readonly placeholder="创建时间"></el-input>
  357. </el-form-item>
  358. <el-form-item label="最后修改人">
  359. <el-input v-model="basicData.value.updateBy" size="small" readonly placeholder="最后修改人"></el-input>
  360. </el-form-item>
  361. <el-form-item label="最后修改时间">
  362. <el-input v-model="basicData.value.updateTime" size="small" readonly placeholder="最后修改时间"></el-input>
  363. </el-form-item>
  364. </el-form>
  365. </div>
  366. </el-collapse-item>
  367. </el-collapse>
  368. </div>
  369. </el-dialog>
  370. <!-- 参照弹窗 -->
  371. <el-dialog :title="MoreDataDialog.msg.name" :visible.sync="MoreDataDialog.show" width="70%" class="MoreDataDialog"
  372. :close-on-press-escape="false" :close-on-click-modal="false" :before-close="handleCloseRefer">
  373. <div>
  374. <el-row>
  375. <el-col :span="1.5">
  376. <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="small" @change="handleFilterRefer" />
  377. </el-col>
  378. </el-row>
  379. <!-- 树形 -->
  380. <el-tree class="referTree" v-loading="MoreDataDialog.loading" v-if="MoreDataDialog.type == 'tree'"
  381. :data="MoreDataDialog.list" @node-click="handleNodeClick" :props="defaultProps" node-key="id">
  382. </el-tree>
  383. <!-- 列表 -->
  384. <el-table v-else :data="MoreDataDialog.list" v-loading="MoreDataDialog.loading" style="width: 100%"
  385. @row-click="handleCurentRow" highlight-current-row>
  386. <el-table-column type="index" label="序号" width="55" align="center" />
  387. <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name" />
  388. </el-table>
  389. <!-- 按钮 -->
  390. <el-row class="more-button">
  391. <el-button round size="small" @click="handleConcalRefer">取消</el-button>
  392. <el-button round size="small" type="primary" @click="handleConfirmRefer">确认</el-button>
  393. </el-row>
  394. </div>
  395. </el-dialog>
  396. </div>
  397. </template>
  398. <script>
  399. import drTabs from '../components/dr-tabs.vue';
  400. import detailsTabs from '../config/detailsTabs';
  401. import materialApi from '@/api/material/basic';
  402. import { getDicts as getDicts } from '@/api/system/dict/data'
  403. export default {
  404. name: 'material-details',
  405. // dicts: [''],
  406. components: {
  407. drTabs
  408. },
  409. data() {
  410. return {
  411. count: 1,
  412. // 详情固定标签页
  413. detailsTabs,
  414. defaultProps: {
  415. children: 'childrens',
  416. label: 'name'
  417. },
  418. // 标签页当前激活状态
  419. activeMainTab: 'material',
  420. activeViceTab: 'material_medcine',
  421. materialId: this.$route.params.id,
  422. collapseActive: ['basic', '',],
  423. // 修改按钮 是否激活
  424. updateButtonGroup: false,
  425. // 基本信息下的页签
  426. basicMessage: [
  427. {
  428. label: '医药行业',
  429. code: 'material_medcine',
  430. isShow: true,
  431. },
  432. {
  433. label: '辅计量管理',
  434. code: 'material_unit',
  435. isShow: true,
  436. },
  437. {
  438. label: '辅助属性',
  439. code: 'material_property',
  440. isShow: true,
  441. },
  442. ],
  443. // 基本信息
  444. basicData: {
  445. value: {},
  446. form: []
  447. },
  448. // 医药行业
  449. medcineData: {
  450. value: {},
  451. form: []
  452. },
  453. // 辅助属性
  454. propertyDetail: {
  455. value: [],
  456. form: []
  457. },
  458. // 辅计量管理
  459. unitDetails: {
  460. value: [],
  461. form: []
  462. },
  463. // 主标签信息
  464. mainMsg: {
  465. form: [],
  466. value: [],
  467. checkedList: [],
  468. },
  469. // 副信息
  470. viceMsg: {
  471. form: [],
  472. value: []
  473. },
  474. // 操作弹窗
  475. optionDialog: {
  476. show: false,
  477. op: ''
  478. },
  479. // 其他页签操作弹窗
  480. otherDeatils: {
  481. show: false,
  482. title: '',
  483. // 查询关键字-物料id
  484. queryKey: '',
  485. isEdit: false,
  486. // 详情表头
  487. from: [],
  488. // 详情值
  489. value: {}
  490. },
  491. // 编辑-更多数据展示弹窗_ 参照
  492. MoreDataDialog: {
  493. loading: false,
  494. show: false,
  495. // 查询关键字
  496. key: '',
  497. // 需要查看参照的表单头信息
  498. msg: '',
  499. type: 'table',
  500. // 查询出的参照数据
  501. list: [],
  502. // 查询出的参照表头
  503. form: [],
  504. // 选中的参照数据
  505. value: '',
  506. // 参照最后应该赋值的地方
  507. target: {
  508. name: '',
  509. prop: ''
  510. }
  511. }
  512. }
  513. },
  514. methods: {
  515. // 返回
  516. handleBack() {
  517. this.$router.push({
  518. path: `/basic/material/basicFile`,
  519. });
  520. },
  521. // 附件按钮
  522. handleFile() {
  523. console.log('附件按钮');
  524. },
  525. // 改变分页情况
  526. handleChangePage(type) {
  527. switch (type) {
  528. case 'first':
  529. console.log('第一页');
  530. break;
  531. case 'pre':
  532. console.log('上一页');
  533. break;
  534. case 'next':
  535. console.log('下一页');
  536. break;
  537. case 'end':
  538. console.log('最后页');
  539. break;
  540. }
  541. },
  542. // 切换主信息标签
  543. handleMainTabClick(e) {
  544. this.activeMainTab = detailsTabs[e.index].code;
  545. this.collapseActive.splice(1, 1, this.activeMainTab);
  546. console.log(this.collapseActive, 'this.collapseActive');
  547. switch (this.activeMainTab) {
  548. // 基本信息
  549. case 'material':
  550. this.getTagList('material', (form) => {
  551. this.basicData.form = form;
  552. this.getMaterialDetails(this.materialId, 'material');
  553. })
  554. break;
  555. // 财物信息
  556. case 'material_finance':
  557. this.getTagList('material_finance', (form) => {
  558. this.mainMsg.form = form;
  559. this.getFinanceList('');
  560. });
  561. break;
  562. // 利润中心信息
  563. case 'profit_center':
  564. this.getTagList('profit_center', (form) => {
  565. this.mainMsg.form = form;
  566. this.getCenterList('');
  567. });
  568. break;
  569. // 采购信息
  570. case 'material_purchase':
  571. this.getTagList('material_purchase', (form) => {
  572. this.mainMsg.form = form;
  573. this.getPurchaseList();
  574. });
  575. break;
  576. // 库存信息
  577. case 'material_inventory':
  578. this.getTagList('material_inventory', (form) => {
  579. this.mainMsg.form = form;
  580. this.getInventoryList();
  581. });
  582. break;
  583. // 计划信息
  584. case 'material_plan':
  585. this.getTagList('material_plan', (form) => {
  586. this.mainMsg.form = form;
  587. this.getPlanList('');
  588. });
  589. break;
  590. // 成本信息
  591. case 'material_cost':
  592. this.getTagList('material_cost', (form) => {
  593. this.mainMsg.form = form;
  594. this.getCostList('');
  595. });
  596. break;
  597. default: break;
  598. }
  599. },
  600. // 切换副表信息
  601. handleViceTabClick(e) {
  602. console.log(this.basicMessage[e.index], '切换标签');
  603. this.activeViceTab = this.basicMessage[e.index].code;
  604. switch (this.activeViceTab) {
  605. // 医药行业
  606. case 'material_medcine':
  607. this.getTagList('material_medcine', (form) => {
  608. this.medcineData.form = form;
  609. this.getMedcineDetails(this.materialId, 'material_medcine');
  610. })
  611. break;
  612. // 辅计量管理
  613. case 'material_unit':
  614. this.getTagList('material_unit', (form) => {
  615. console.log(form, 'form');
  616. this.unitDetails.form = form;
  617. this.getUnitList('');
  618. });
  619. break;
  620. // 辅助属性
  621. case 'material_property':
  622. this.getTagList('material_property', (form) => {
  623. this.propertyDetail.form = form;
  624. this.getPropertyList('');
  625. });
  626. break;
  627. default:
  628. break;
  629. }
  630. },
  631. // 主标签页 列表双击
  632. handleMaindbClick(e) {
  633. console.log(e, '主标签页 列表双击');
  634. this.otherDeatils.queryKey = e.id;
  635. this.otherDeatils.show = true;
  636. let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
  637. console.log(activeTab, 'activeTab');
  638. this.otherDeatils.title = activeTab.label;
  639. this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
  640. },
  641. // 主页签 列表数据选择
  642. handleMainChange(e) {
  643. console.log(e, '主页签 列表数据选择');
  644. this.mainMsg.checkedList = e;
  645. },
  646. // 编辑状态下,弹窗显示查询数据
  647. handleQueryMore(msg, val, target) {
  648. this.MoreDataDialog.loading = true;
  649. let _this = this;
  650. console.log('编辑状态下,弹窗显示查询数据', msg, 'val', val, target);
  651. this.MoreDataDialog.show = true;
  652. this.MoreDataDialog.msg = msg;
  653. this.MoreDataDialog.target = target;
  654. this.getExecuteMethods(msg.apiUrl, { param: this.MoreDataDialog.key }, (data) => {
  655. console.log(data, '编辑状态下,弹窗显示查询数据');
  656. _this.MoreDataDialog.type = data.type;
  657. _this.MoreDataDialog.list = data.tableBody;
  658. if (data.type == 'tree') {
  659. } else {
  660. _this.MoreDataDialog.form = data.tableHeader;
  661. }
  662. console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
  663. console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
  664. })
  665. },
  666. // 根据apiUrl获取对应参照的值
  667. getExecuteMethods(methodName, params, cb) {
  668. materialApi.executeMethods(methodName, params).then(res => {
  669. this.MoreDataDialog.loading = false;
  670. if (res.code == 200) {
  671. cb(res.data);
  672. }
  673. })
  674. },
  675. // 获取物料基本信息详细信息
  676. getMaterialDetails(id, templateCode) {
  677. let _this = this;
  678. materialApi.materialDetails(
  679. id,
  680. templateCode,
  681. ).then(res => {
  682. console.log(res, '物料基本信息');
  683. let { code, data } = res;
  684. if (code == 200) {
  685. _this.basicData.value = data.data;
  686. // this.basicData.form = data.form;
  687. _this.handleAddReferLabel('basicData');
  688. }
  689. })
  690. },
  691. // 添加参照中的label
  692. handleAddReferLabel(dataName) {
  693. let _this = this;
  694. this[dataName].form.map(item => {
  695. // 查参照
  696. if (item.apiUrl && item.apiUrl != '') {
  697. _this.getExecuteMethods(item.apiUrl, {}, (data) => {
  698. let { tableBody } = data;
  699. let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
  700. _this[dataName].value[`${item.prop}Label`] = Blabel || '';
  701. })
  702. }
  703. })
  704. console.log(_this[dataName].value, '_this[dataName].value//////////////////////');
  705. },
  706. // 查询财务信息列表
  707. getFinanceList(materialId) {
  708. materialApi.financeList({ materialId }).then(res => {
  709. console.log(res, '查询财务信息列表');
  710. if (res.code == 200) {
  711. this.mainMsg.value = res.rows;
  712. }
  713. })
  714. },
  715. // 查询计划信息列表
  716. getPlanList(materialId) {
  717. materialApi.planList({ materialId }).then(res => {
  718. console.log(res, '查询计划信息列表');
  719. if (res.code == 200) {
  720. this.mainMsg.value = res.data.tableBody.rows;
  721. }
  722. })
  723. },
  724. // 查询成本信息列表
  725. getCostList(materialId) {
  726. materialApi.costList({ materialId }).then((res) => {
  727. console.log(res, '成本信息列表+表头');
  728. if (res.code == 200) {
  729. this.mainMsg.value = res.data.tableBody.rows;
  730. }
  731. })
  732. },
  733. // 查询利润中心列表
  734. getCenterList(materialId) {
  735. materialApi.centerList({ materialId }).then(res => {
  736. console.log(res, '查询利润中心信息');
  737. if (res.code == 200) {
  738. this.mainMsg.value = res.data.tableBody.rows;
  739. }
  740. })
  741. },
  742. // 查询采购中心列表
  743. getPurchaseList(materialId) {
  744. materialApi.purchaseList({ materialId }).then(res => {
  745. console.log(res, '查询采购中心');
  746. if (res.code == 200) {
  747. this.mainMsg.value = res.data.tableBody.rows;
  748. }
  749. })
  750. },
  751. // 获取库存信息列表
  752. getInventoryList(materialId) {
  753. materialApi.inventoryList({ materialId }).then(res => {
  754. console.log(res, '获取库存信息列表');
  755. if (res.code == 200) {
  756. this.mainMsg.value = res.data.tableBody.rows;
  757. }
  758. })
  759. },
  760. // 查询其他标签页列表详情
  761. getOtherListDetails(type, id) {
  762. console.log(type, id, '查询其他标签页列表详情');
  763. this.otherDeatils.form = this.mainMsg.form;
  764. console.log(this.otherDeatils.form, 'this.otherDeatils.form');
  765. switch (type) {
  766. // 财物信息
  767. case 'material_finance':
  768. this.getFinanceDetails(id);
  769. break;
  770. // 利润中心信息
  771. case 'profit_center':
  772. this.getCenterDetails(id);
  773. break;
  774. // 采购信息
  775. case 'material_purchase':
  776. this.getPurchaseDetails(id);
  777. break;
  778. // 库存信息
  779. case 'material_inventory':
  780. this.getInventoryDetails(id);
  781. break;
  782. // 计划信息
  783. case 'material_plan':
  784. this.getPlanDetails(id);
  785. break;
  786. // 成本信息
  787. case 'material_cost':
  788. this.getCostDetails(id);
  789. break;
  790. default: break;
  791. }
  792. },
  793. // 查询财务信息详情
  794. getFinanceDetails(id) {
  795. materialApi.financeDetails(id).then(res => {
  796. let _this = this;
  797. console.log('查询财务信息详情', res);
  798. if (res.code == 200) {
  799. this.otherDeatils.value = res.data.data;
  800. _this.handleAddReferLabel('otherDeatils');
  801. }
  802. })
  803. },
  804. // 获取利润中心详情
  805. getCenterDetails(materialId) {
  806. let _this = this;
  807. materialApi.centerDetails(materialId).then(res => {
  808. console.log(res, '获取利润中心详情');
  809. if (res.code == 200) {
  810. this.otherDeatils.value = res.data.data;
  811. _this.handleAddReferLabel('otherDeatils');
  812. }
  813. })
  814. },
  815. // 获取采购详细信息详情
  816. getPurchaseDetails(materialId) {
  817. let _this = this;
  818. materialApi.purchaseDetails(materialId).then(res => {
  819. console.log(res, '获取采购详细信息详情');
  820. if (res.code == 200) {
  821. this.otherDeatils.value = res.data.data;
  822. _this.handleAddReferLabel('otherDeatils');
  823. }
  824. })
  825. },
  826. // 获取成本信息详情
  827. getCostDetails(id) {
  828. let _this = this;
  829. materialApi.costDetails(id).then(res => {
  830. console.log(res, '获取成本信息详情');
  831. if (res.code == 200) {
  832. this.otherDeatils.value = res.data.data;
  833. _this.handleAddReferLabel('otherDeatils');
  834. }
  835. })
  836. },
  837. // 获取计划信息详情
  838. getPlanDetails(id) {
  839. let _this = this;
  840. materialApi.planDetails(id).then(res => {
  841. console.log(res, '获取计划信息详情');
  842. if (res.code == 200) {
  843. this.otherDeatils.value = res.data.data;
  844. _this.handleAddReferLabel('otherDeatils');
  845. }
  846. })
  847. },
  848. // 获取库存详细信息详情
  849. getInventoryDetails(materialId) {
  850. let _this = this;
  851. materialApi.inventoryDetails(materialId).then(res => {
  852. console.log(res, '获取库存详细信息详情');
  853. if (res.code == 200) {
  854. this.otherDeatils.value = res.data.data;
  855. _this.handleAddReferLabel('otherDeatils');
  856. }
  857. })
  858. },
  859. /* 二级标签页 */
  860. // 获取医药行业信息详细信息+表单属性
  861. getMedcineDetails(id, templateCode) {
  862. console.log(id, templateCode);
  863. materialApi.medcineDetails(
  864. id,
  865. templateCode,
  866. ).then((res) => {
  867. console.log(res, '医药行业');
  868. let { code, data } = res;
  869. if (code == 200) {
  870. this.medcineData.value = data.data || {};
  871. // this.medcineData.form = data.form;
  872. }
  873. })
  874. },
  875. // 获取物料辅助属性详细信息+表单列段属性
  876. getPropertyDetails(id) {
  877. materialApi.propertyDetails(id).then(res => {
  878. console.log(res, '物料辅助属性详细信息');
  879. if (res.code == 200) {
  880. this.propertyDetail.value = res.data.data || [];
  881. }
  882. })
  883. },
  884. // 查询物料辅助属性列表+表头字段
  885. getPropertyList() {
  886. materialApi.propertyList().then(res => {
  887. console.log(res, '料辅助属性列表');
  888. if (res.code == 200) {
  889. this.propertyDetail.value = res.data.data || [];
  890. }
  891. })
  892. },
  893. //获取辅助计量单位基本信息+表单列段属性
  894. getUnitDetails(materialId) {
  895. materialApi.unitDetails(materialId).then(res => {
  896. console.log(res, '辅助计量单位基本信息');
  897. if (res.code == 200) {
  898. this.unitDetails.value = res.data.data || [];
  899. }
  900. })
  901. },
  902. //获取辅计量管理列表信息+表头字段
  903. getUnitList() {
  904. materialApi.unitList().then(res => {
  905. console.log(res, '辅计量管理列表信息');
  906. if (res.code == 200) {
  907. this.unitDetails.value = res.data.data || [];
  908. }
  909. })
  910. },
  911. // 获取物料列表表头
  912. getTagList(templateCode, cb) {
  913. let _this = this
  914. materialApi.tagList({ templateCode }).then(res => {
  915. console.log(res, `获取${templateCode}表头`);
  916. let dictIdList = [];
  917. if (res.code == 200) {
  918. res.data.map(item => {
  919. // 查字典
  920. if (item.dictId && item.dictId != '') {
  921. // 通过接口获取有dict的对应的数据
  922. getDicts(item.dictId).then(dict => {
  923. if (dict.data) {
  924. item['dictValue'] = dict.data;
  925. }
  926. })
  927. }
  928. })
  929. // 动态更改dict
  930. // res.data.forEach(item => {
  931. // if (item.dictId) {
  932. // // 请求接口
  933. // dictIdList.push(item.dictId);
  934. // }
  935. // })
  936. // console.log(dictIdList, 'dictIdList');
  937. // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
  938. // console.log(_this.dicts, 'dicts');
  939. return cb(res.data);
  940. }
  941. })
  942. },
  943. // 新增
  944. handleInster() {
  945. this.$message({
  946. message: '物料只能通过申请审批增加,不能在节点直接录入!',
  947. type: 'warning'
  948. });
  949. },
  950. // 除基本信息之后的修改
  951. handleEdit() {
  952. console.log('除基本信息之后的修改', this.otherDeatils.queryKey);
  953. if ((this.otherDeatils.queryKey && this.otherDeatils.queryKey != '') || this.mainMsg.checkedList.length == 1) {
  954. this.otherDeatils.show = true;
  955. this.otherDeatils.isEdit = true;
  956. let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
  957. this.otherDeatils.title = activeTab.label;
  958. this.otherDeatils.queryKey = this.otherDeatils.queryKey || this.mainMsg.checkedList[0].id;
  959. console.log(this.otherDeatils, 'this.otherDeatils');
  960. // 查询其他标签页列表详情
  961. this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
  962. } else {
  963. this.$message({
  964. message: '修改请选择单个数据!',
  965. type: 'warning'
  966. });
  967. }
  968. },
  969. // 修改
  970. handleBasicEdit() {
  971. console.log('修改基本信息');
  972. this.updateButtonGroup = true;
  973. //需要禁止点击其他标签
  974. this.detailsTabs = this.detailsTabs.map(item => {
  975. item['disabled'] = true;
  976. return item
  977. })
  978. console.log(this.detailsTabs, 'this.detailsTabs ');
  979. },
  980. // 删除
  981. handleDel() {
  982. console.log('删除');
  983. },
  984. // 复制
  985. handleCopy() {
  986. console.log('复制');
  987. },
  988. //查询
  989. handleQuery() {
  990. },
  991. // 刷新
  992. handleRefresh() {
  993. console.log('刷新');
  994. },
  995. // 过滤
  996. handleFilter(e) {
  997. console.log(e, '过滤');
  998. },
  999. filterCondition(type) {
  1000. return {
  1001. type
  1002. }
  1003. },
  1004. // 启用
  1005. handleIsInvoke(e) {
  1006. console.log('启用', e);
  1007. },
  1008. isInvoke(val) {
  1009. return val;
  1010. },
  1011. // 申请单查询
  1012. handleQueryForm() {
  1013. console.log('申请单查询');
  1014. },
  1015. // 批量导入
  1016. handleImport() {
  1017. console.log('批量导入');
  1018. },
  1019. // 批量导出
  1020. handleExport() {
  1021. console.log('批量导出');
  1022. },
  1023. // 取消保存
  1024. handleCancel() {
  1025. console.log('取消保存');
  1026. this.optionDialog.op = '取消';
  1027. this.optionDialog.show = true;
  1028. },
  1029. // 保存修改
  1030. handleSave() {
  1031. console.log('保存修改');
  1032. this.handleSaveMaterial(() => {
  1033. this.$router.go(0)
  1034. });
  1035. },
  1036. // 保存修改并新增
  1037. handleSaveAdd() {
  1038. console.log('保存修改并新增');
  1039. },
  1040. // 其他标签页弹窗取消操作
  1041. handleOtherCancel() {
  1042. console.log('其他标签页弹窗取消操作');
  1043. this.optionDialog.show = true;
  1044. this.optionDialog.op = '修改';
  1045. },
  1046. // 其他标签页弹窗保存
  1047. handleOtherSave() {
  1048. console.log('其他标签页弹窗保存');
  1049. },
  1050. // 其他页签详情弹窗关闭事件
  1051. handleCloseOtherDetails(done) {
  1052. console.log('其他页签详情弹窗关闭事件');
  1053. // 处于编辑状态
  1054. if (this.otherDeatils.isEdit) {
  1055. this.$message({
  1056. message: '请先退出编辑操作',
  1057. type: 'warning'
  1058. });
  1059. } else {
  1060. done();
  1061. }
  1062. },
  1063. // 折叠菜单改变
  1064. handleCollapseChange(val) {
  1065. console.log(val, '折叠菜单改变');
  1066. },
  1067. // 更新导入
  1068. handleUpdateImport() {
  1069. console.log('更新导入');
  1070. },
  1071. // 确认弹窗操作
  1072. handleComfirmOption() {
  1073. console.log('确认弹窗操作');
  1074. this.optionDialog.show = false;
  1075. this.updateButtonGroup = false;
  1076. this.handleRest();
  1077. //需要禁止点击其他标签
  1078. this.detailsTabs = this.detailsTabs.map(item => {
  1079. item['disabled'] = false;
  1080. return item;
  1081. })
  1082. if (this.otherDeatils.isEdit) {
  1083. this.otherDeatils.isEdit = false;
  1084. }
  1085. },
  1086. // 参照弹窗过滤
  1087. handleFilterRefer() {
  1088. // this.MoreDataDialog.key =
  1089. console.log(this.MoreDataDialog.key, '查询关键字');
  1090. this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key);
  1091. },
  1092. // 操作提示弹窗关闭
  1093. handleOptionCancal() {
  1094. this.optionDialog.show = false;
  1095. this.otherDeatils.isEdit = true;
  1096. },
  1097. // 树形节点选择
  1098. handleNodeClick(e) {
  1099. console.log(e, '树形节点选择', this.MoreDataDialog.target);
  1100. // let node = { ...e, name: e.label }
  1101. this.MoreDataDialog.value = e;
  1102. },
  1103. // 修改-更多数据表格——选择行
  1104. handleCurentRow(row) {
  1105. console.log(row, '修改-更多数据表格——选择行');
  1106. this.MoreDataDialog.value = row;
  1107. },
  1108. // 参照弹窗确认
  1109. handleConfirmRefer() {
  1110. console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
  1111. if (this.MoreDataDialog.target.name == 'basicData') {
  1112. // 基本信息
  1113. this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
  1114. this.basicData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
  1115. console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}Label`], '//////////基本信息///////////');
  1116. } else if (this.MoreDataDialog.target.name == 'medcineData') {
  1117. // 医药信息
  1118. this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
  1119. this.medcineData.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
  1120. console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Label`], '//////医药信息//////////');
  1121. } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
  1122. // 其他页签
  1123. this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
  1124. this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Label`] = this.MoreDataDialog.value.name;
  1125. console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Label`], '/////////其他页签///////');
  1126. }
  1127. this.MoreDataDialog.show = false;
  1128. },
  1129. // 取消-关闭参照弹窗
  1130. handleConcalRefer() {
  1131. console.log('关闭参照弹窗');
  1132. this.MoreDataDialog.show = false;
  1133. this.MoreDataDialog.key = '';
  1134. },
  1135. // 关闭参照弹窗前
  1136. handleCloseRefer(done) {
  1137. this.MoreDataDialog.key = '';
  1138. done();
  1139. },
  1140. // 保存物料以及相关页签
  1141. handleSaveMaterial(cb) {
  1142. let param = {
  1143. ...this.basicData.value,
  1144. materialMedcine: this.medcineData.value,
  1145. materialMedcineItem: {}
  1146. };
  1147. // basicData this.medcineData.value materialMedcine
  1148. console.log(param, '保存物料以及相关页签param');
  1149. materialApi.insertMaterialInfo(param).then(res => {
  1150. console.log(res, '保存物料以及相关页签');
  1151. if(res.code) cb();
  1152. })
  1153. },
  1154. // 取消之后重新查询页面
  1155. handleRest() {
  1156. // 基本信息
  1157. this.getTagList('material', (form) => {
  1158. this.basicData.form = form;
  1159. this.getMaterialDetails(this.materialId, 'material');
  1160. })
  1161. // 医疗行业
  1162. this.getTagList('material_medcine', (form) => {
  1163. this.medcineData.form = form;
  1164. this.getMedcineDetails(this.materialId, 'material_medcine');
  1165. })
  1166. },
  1167. },
  1168. created() {
  1169. // 基本信息
  1170. this.handleRest();
  1171. },
  1172. }
  1173. </script>
  1174. <style lang="scss">
  1175. .material-details {
  1176. padding: 12px;
  1177. height: calc(100vh - 158px);
  1178. box-sizing: border-box;
  1179. .el-card__body {
  1180. height: calc(100vh - 160px);
  1181. box-sizing: border-box;
  1182. padding: 12px;
  1183. }
  1184. .md-content {
  1185. margin-top: 12px;
  1186. height: calc(100vh - 260px);
  1187. box-sizing: border-box;
  1188. .md-basic {
  1189. overflow: auto;
  1190. .md-main {
  1191. height: calc(100vh - 625px);
  1192. // max-height: 290px;
  1193. margin-bottom: 10px;
  1194. overflow-y: auto;
  1195. overflow-x: hidden;
  1196. }
  1197. .md-vice-content {
  1198. height: 140px;
  1199. overflow-y: auto;
  1200. overflow-x: hidden;
  1201. }
  1202. }
  1203. .md-auditInfo {
  1204. .el-divider--horizontal {
  1205. margin: 20px 0px 15px;
  1206. }
  1207. }
  1208. }
  1209. .otherDialog {
  1210. .el-collapse-item__content {
  1211. padding-bottom: 12px;
  1212. }
  1213. .el-dialog__body {
  1214. padding: 12px 20px;
  1215. height: 80%;
  1216. overflow: auto;
  1217. }
  1218. .od-msg {
  1219. max-height: 220px;
  1220. box-sizing: border-box;
  1221. overflow-y: auto;
  1222. overflow-x: hidden;
  1223. }
  1224. .el-dialog__header {
  1225. background-color: rgb(244, 244, 244);
  1226. }
  1227. }
  1228. .MoreDataDialog {
  1229. .el-dialog__body {
  1230. height: 500px;
  1231. padding: 20px 15px;
  1232. .el-table {
  1233. margin-top: 10px;
  1234. .el-table__body-wrapper {
  1235. height: 340px;
  1236. overflow-y: auto;
  1237. overflow-x: hidden;
  1238. }
  1239. }
  1240. .referTree {
  1241. height: 390px;
  1242. overflow-x: hidden;
  1243. overflow-y: auto;
  1244. }
  1245. }
  1246. .el-dialog__header {
  1247. background-color: rgb(244, 244, 244);
  1248. }
  1249. .more-button {
  1250. margin-top: 10px;
  1251. text-align: right;
  1252. }
  1253. }
  1254. }
  1255. // 修改下拉框样式
  1256. #selected {
  1257. /*很关键:将默认的select选择框样式清除*/
  1258. // appearance: none;
  1259. // -moz-appearance: none;
  1260. // -webkit-appearance: none;
  1261. // /*为下拉小箭头留出一点位置,避免被文字覆盖*/
  1262. // padding-right: 14px;
  1263. // /*自定义图片*/
  1264. // background: url("../images/search@2x.png") no-repeat scroll right center transparent;
  1265. // /*自定义图片的大小*/
  1266. // background-size: 16px 16px;
  1267. // /*将小箭头的样式去去掉*/
  1268. // .el-icon-arrow-up:before {
  1269. // content: '';
  1270. // }
  1271. // }
  1272. }
  1273. </style>
  1274. <style scoped>
  1275. .md-content>>>.el-form-item,
  1276. .otherDialog>>>.el-form-item {
  1277. margin-bottom: 10px;
  1278. }
  1279. .md-content>>>.el-tabs--border-card>.el-tabs__content {
  1280. padding-bottom: 8px;
  1281. }
  1282. .md-content .md-auditInfo>>>.el-form-item {
  1283. margin-bottom: 0px;
  1284. }
  1285. .md-main>>>.el-form-item,
  1286. .md-vice>>>.el-form-item,
  1287. .od-msg>>>.el-form-item {
  1288. width: 100%;
  1289. box-sizing: border-box;
  1290. }
  1291. .md-main>>>.el-form-item__label,
  1292. .md-vice>>>.el-form-item__label,
  1293. .od-msg>>>.el-form-item__label {
  1294. width: 40%;
  1295. }
  1296. .od-msg>>>.el-checkbox__input {
  1297. width: 15%;
  1298. }
  1299. .md-main>>>.el-form-item__content,
  1300. .md-vice>>>.el-form-item__content,
  1301. .od-msg>>>.el-form-item__content {
  1302. width: 60%;
  1303. box-sizing: border-box;
  1304. }
  1305. .od-msg>>>.el-checkbox__label {
  1306. width: 85%;
  1307. box-sizing: border-box;
  1308. }
  1309. .od-msg-checkedbx>>>.el-form-item__content {
  1310. width: 80%;
  1311. box-sizing: border-box;
  1312. }
  1313. .od-msg-checkedbx>>>.el-checkbox {
  1314. width: 75%;
  1315. box-sizing: border-box;
  1316. }
  1317. .md-content>>>.el-form-item__label,
  1318. .otherDialog>>>.el-form-item__label,
  1319. .od-msg>>>.el-form-item__label,
  1320. .od-msg>>>.el-checkbox__label {
  1321. font-weight: normal;
  1322. /* text-align: left;
  1323. width: 28%; */
  1324. white-space: nowrap;
  1325. /* IE6 需要定义宽度 */
  1326. overflow: hidden;
  1327. -o-text-overflow: ellipsis;
  1328. /* Opera */
  1329. text-overflow: ellipsis;
  1330. /* IE, Safari (WebKit) */
  1331. /* -moz-binding: url('ellipsis.xml#ellipsis'); */
  1332. /* Firefox */
  1333. }
  1334. .otherDialog>>>.el-form-item__label {
  1335. font-size: 12px;
  1336. }
  1337. .md-main>>>.material-table {
  1338. height: 100%;
  1339. }
  1340. .md-vice>>>.material-table {
  1341. height: 140px;
  1342. overflow-y: auto;
  1343. overflow-x: auto;
  1344. }
  1345. /* .otherDialog>>>.el-collapse-item__content {
  1346. padding-bottom: 12px;
  1347. }
  1348. .otherDialog>>>.el-dialog__body {
  1349. padding: 12px 20px;
  1350. } */
  1351. </style>