details.vue 92 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882
  1. <!-- 物料信息基础档案——详情 -->
  2. <template>
  3. <div class="material-details" v-loading="loading">
  4. <!-- 操作栏 -->
  5. <el-card>
  6. <!-- 基本信息栏 -->
  7. <div style="display: flex;justify-content: end;">
  8. <div v-if="activeMainTab == 'material'">
  9. <!-- 基本信息修改状态下—— 保存、保存新增、更新导入、取消 -->
  10. <el-row
  11. v-if="updateButtonGroup || maintainNewVersion"
  12. :gutter="10"
  13. class="mb10"
  14. type="flex"
  15. justify="end"
  16. >
  17. <el-col :span="1.5">
  18. <el-button-group>
  19. <el-button size="small" @click="handleSave"
  20. v-hasPermi="['system:material:add', `${maintainNewVersion ? '' : 'system:material:versions'}`]">
  21. 保存
  22. </el-button>
  23. </el-button-group>
  24. </el-col>
  25. <el-col :span="1.5">
  26. <el-button-group>
  27. <el-button size="small" @click="handleCancel">取消</el-button>
  28. </el-button-group>
  29. </el-col>
  30. </el-row>
  31. <el-row
  32. v-else
  33. :gutter="10"
  34. class="mb10"
  35. type="flex"
  36. justify="end"
  37. >
  38. <!-- 新增、修改、删除、复制 -->
  39. <el-col :span="1.5">
  40. <el-button-group>
  41. <!-- <el-button size="small" @click="handleInster">新增</el-button> -->
  42. <el-button size="small" @click="handleBasicEdit">修改</el-button>
  43. <!-- <el-button size="small" @click="handleDel">删除</el-button> -->
  44. <!-- <el-button size="small" @click="handleCopy">复制</el-button> -->
  45. </el-button-group>
  46. </el-col>
  47. <!-- 查询、刷新、过滤 -->
  48. <el-col :span="1.5">
  49. <el-button-group>
  50. <el-button size="small" @click="handleRefresh">刷新</el-button>
  51. </el-button-group>
  52. </el-col>
  53. <!-- 启用 -->
  54. <el-col :span="1.5">
  55. <el-button-group>
  56. <el-button size="small" @click="handleMaterialType">维护物料类别</el-button>
  57. <el-button size="small" @click="handleIsInvoke" :key="count" v-hasPermi="['system:material:add']">
  58. <!-- 0:启用 2:停用 -->
  59. {{ basicData.value.isEnable == '已启用' ? '停用' : '启用' }}
  60. </el-button>
  61. </el-button-group>
  62. </el-col>
  63. <!-- 维护新版本 -->
  64. <el-col :span="1.5">
  65. <el-button-group>
  66. <el-button size="small" @click="handleNewVersion" v-hasPermi="['system:material:versions']">维护新版本
  67. </el-button>
  68. </el-button-group>
  69. </el-col>
  70. </el-row>
  71. </div>
  72. <!-- 其他标签页操作 修改、删除 -->
  73. <el-row
  74. :gutter="10"
  75. class="mb10"
  76. v-show="activeMainTab != 'material'"
  77. type="flex"
  78. justify="end"
  79. >
  80. <el-col :span="1.5">
  81. <el-button-group>
  82. <el-button size="small" @click="handleOtherEdit('table')">修改</el-button>
  83. <el-button size="small" v-show="activeMainTab != 'material_finance'" @click="handleOtherDel">删除</el-button>
  84. </el-button-group>
  85. <el-button-group>
  86. <el-button size="small" @click="handleOtherListRefresh">刷新</el-button>
  87. </el-button-group>
  88. </el-col>
  89. </el-row>
  90. <!-- 返回 切换 附件管理 -->
  91. <el-row type="flex" justify="space-between">
  92. <el-col :span="6">
  93. <!-- :disabled="headerParam.isEdit" -->
  94. <el-button size="small" @click="handleBack" :disabled="updateButtonGroup">返回</el-button>
  95. </el-col>
  96. <el-col :span="6" style="text-align: right;">
  97. </el-col>
  98. </el-row>
  99. </div>
  100. <div class="md-content" :key="basicData.value.id">
  101. <el-form :inline="true" label-position="right" :model="basicData.value">
  102. <!-- <el-form-item label="所属组织"></el-form-item> -->
  103. <el-form-item label="物料编码">
  104. <el-input v-model="basicData.value.code" readonly size="mini"></el-input>
  105. </el-form-item>
  106. <el-form-item label="物料名称">
  107. <el-input v-model="basicData.value.name" readonly size="mini"></el-input>
  108. </el-form-item>
  109. <el-form-item label="英文名称">
  110. <el-input v-model="basicData.value.enName" readonly size="mini"></el-input>
  111. </el-form-item>
  112. <!-- <el-form-item label="版本号"></el-form-item> -->
  113. </el-form>
  114. <dr-tabs :tabList="detailsTabs" :handleTabClick="handleMainTabClick">
  115. <template #tabContent>
  116. <div class="md-basic" :key="count">
  117. <!-- 主信息 -->
  118. <div class="md-main">
  119. <!-- 基本信息展示表单 -->
  120. <el-form
  121. v-if="activeMainTab == 'material'"
  122. :inline="true"
  123. label-position="right"
  124. :model="basicData.value"
  125. :key="basicData.value.id"
  126. ref="basicMessageRef"
  127. :rules="rules"
  128. >
  129. <el-row :gutter="10">
  130. <el-col :span="6" v-for="f in basicData.form" style="text-align: right;">
  131. <template v-if="f.show">
  132. <!-- 多选框 -->
  133. <el-form-item
  134. v-if="f.attribute == 'checkbox'"
  135. style="text-align: left;"
  136. :prop="f.prop"
  137. :key="f.required"
  138. >
  139. <el-checkbox
  140. :label="f.name" name="type"
  141. v-model="basicData.value[f.prop]"
  142. true-label="0"
  143. false-label="2"
  144. :disabled="handleJudge(f)"
  145. size="mini"
  146. >
  147. </el-checkbox>
  148. </el-form-item>
  149. <!-- 下拉框 -->
  150. <el-form-item v-else-if="f.attribute == 'select'"
  151. :id="(updateButtonGroup && f.apiUrl) ? 'selected' : ''"
  152. :prop="f.apiUrl ? `${f.prop}Name` : f.prop"
  153. :key="f.required"
  154. :rules="[{ required: f.required ,message: `请选择${f.name}`, trigger: 'change' }]"
  155. >
  156. <template slot="label">
  157. <el-tooltip class="item" effect="dark" placement="top-start" :disabled="f.name.length < 10">
  158. <!-- <span :class="(f.apiUrl && f.required) ? 'redSpan': ''">{{ f.name }}</span> -->
  159. <span>{{ f.name }}</span>
  160. <div slot="content">
  161. <p> {{ f.name }}</p>
  162. </div>
  163. </el-tooltip>
  164. </template>
  165. <!-- 参照 -->
  166. <el-select v-if="f.apiUrl"
  167. v-model="basicData.value[`${f.prop}Name`]"
  168. placeholder="请选择"
  169. size="mini"
  170. :key="basicData.value[f.prop]"
  171. :disabled="handleJudge(f)"
  172. @focus="f.apiUrl && handleQueryMore(f, '', { name: 'basicData', prop: f.prop })">
  173. <div slot="empty"></div>
  174. </el-select>
  175. <!-- 字典 -->
  176. <el-select v-if="f.dictId"
  177. v-model="basicData.value[f.prop]"
  178. placeholder="请选择"
  179. size="mini"
  180. :key="basicData.value[f.prop]"
  181. :disabled="handleJudge(f)"
  182. >
  183. <el-option v-if="f.dictId"
  184. v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
  185. :value="d.dictValue">
  186. </el-option>
  187. </el-select>
  188. </el-form-item>
  189. <!-- 图片 -->
  190. <el-form-item v-else-if="f.attribute == 'image'" :label="f.name" @clicks="handleUpImage">
  191. <el-image :src="basicData.value[f.prop]" fit="contain"></el-image>
  192. <!-- <img :src="basicData.value[f.prop]" @clicks="handleUpImage" alt="加载失败"> -->
  193. </el-form-item>
  194. <!--attribute 文本 数字 文本域 为null -->
  195. <el-form-item v-else :prop="f.prop" :key="f.required">
  196. <template slot="label">
  197. <el-tooltip class="item" effect="dark" placement="top-start" :disabled="f.name.length < 10">
  198. <span>{{ f.name }}</span>
  199. <div slot="content">
  200. <p>{{ f.name }}</p>
  201. </div>
  202. </el-tooltip>
  203. </template>
  204. <el-input size="mini"
  205. v-model="basicData.value[f.prop]"
  206. :type="f.attribute || 'text'"
  207. :readonly="handleJudge(f)">
  208. </el-input>
  209. </el-form-item>
  210. </template>
  211. </el-col>
  212. </el-row>
  213. </el-form>
  214. <!-- 其他展示为列表 -->
  215. <el-table v-else
  216. border
  217. :data="mainMsg.value"
  218. @cell-dblclick="handleMaindbClick"
  219. @selection-change="handleMainChange"
  220. >
  221. <el-table-column type="selection" width="55"/>
  222. <el-table-column type="index" v-if="mainMsg.form.length" label="序号" width="55" align="center"/>
  223. <el-table-column
  224. v-for="m in mainMsg.form"
  225. v-if="m.show"
  226. :label="m.name"
  227. align="center"
  228. :prop="m.attribute == 'select' ? `${m.prop}Name` : m.prop"
  229. show-overflow-tooltip
  230. >
  231. <template slot-scope="scope">
  232. {{ m.attribute == 'select' ? scope.row[`${m.prop}Name`] :
  233. (m.attribute == 'checkbox' ?
  234. (scope.row[m.prop] == '0' ? '√' : '')
  235. : scope.row[m.prop])
  236. }}
  237. </template>
  238. </el-table-column>
  239. </el-table>
  240. </div>
  241. <!-- 副信息 -->
  242. <div class="md-vice">
  243. <dr-tabs
  244. v-if="activeMainTab == 'material'"
  245. :tabList="basicMessage"
  246. :handleTabClick="handleViceTabClick"
  247. >
  248. <template #tabContent>
  249. <el-form v-if="activeViceTab == 'material_medcine'"
  250. :inline="true"
  251. label-position="right"
  252. ref="medcineRef"
  253. :model="medcineData.value"
  254. class="md-vice-content"
  255. :rules="medcineRules"
  256. :key="medcineData.value.id"
  257. >
  258. <el-row :gutter="10">
  259. <el-col :span="6" v-for="m in medcineData.form" style="text-align: right;">
  260. <!-- 需要根据基本信息中的是否医药物料字段判断是否可以填写 -->
  261. <template v-if="m.show">
  262. <!-- 多选框 -->
  263. <el-form-item v-if="m.attribute == 'checkbox'" :prop="m.prop">
  264. <el-checkbox
  265. :label="m.name" name="type" v-model="medcineData.value[m.prop]" size="mini"
  266. :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
  267. true-label="0" false-label="2">
  268. </el-checkbox>
  269. </el-form-item>
  270. <!-- 下拉框 -->
  271. <el-form-item v-else-if="m.attribute == 'select'"
  272. :label="m.name"
  273. :prop="m.apiUrl ?`${m.prop}Name`: m.prop"
  274. :rules="[{ required: m.required ,message: `请选择${m.name}`, trigger: 'change' }]"
  275. >
  276. <!-- 参照弹窗 -->
  277. <el-select v-if="m.apiUrl"
  278. v-model="medcineData.value[`${m.prop}Name`]"
  279. placeholder="请选择"
  280. :key="medcineData.value[m.prop]" size="mini"
  281. :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
  282. @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
  283. <div slot="empty"></div>
  284. </el-select>
  285. <!-- 下拉选择 -->
  286. <el-select v-if="m.dictId"
  287. v-model="medcineData.value[m.prop]"
  288. placeholder="请选择"
  289. :key="medcineData.value[m.prop]"
  290. size="mini"
  291. :disabled="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')"
  292. @focus="m.apiUrl && handleQueryMore(m, '', { name: 'medcineData', prop: m.prop })">
  293. <el-option v-if="m.dictId" v-for="d in m.dictValue" :key="d.dictValue"
  294. :label="d.dictLabel" :value="d.dictValue">
  295. </el-option>
  296. </el-select>
  297. </el-form-item>
  298. <!-- 图片 -->
  299. <el-form-item v-else-if="m.attribute == 'image'" :label="m.name">
  300. <el-image :src="medcineData.value[m.prop]" fit="contain">
  301. </el-image>
  302. </el-form-item>
  303. <!-- 文本、数字、textarae -->
  304. <el-form-item v-else :label="m.name">
  305. <el-input size="mini"
  306. v-model="medcineData.value[m.prop]"
  307. :type="m.attribute || 'text'"
  308. :readonly="!(updateButtonGroup && m.edit && basicData.value.isMedicine == '0')">
  309. </el-input>
  310. </el-form-item>
  311. </template>
  312. </el-col>
  313. </el-row>
  314. </el-form>
  315. <!-- 其他展示为列表 -->
  316. <!-- 辅计量 -->
  317. <el-table border v-else-if="activeViceTab == 'material_unit'" :data="unitDetails.value"
  318. class="material-table">
  319. <el-table-column type="index" v-if="unitDetails.form.length" label="序号" width="55"
  320. align="center"/>
  321. <el-table-column v-for="v in unitDetails.form" v-if="v.show" :label="v.name" align="center"
  322. :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
  323. <template slot-scope="scope">
  324. {{ v.attribute == 'select' ? scope.row[`${v.prop}Name`] :
  325. (v.attribute == 'checkbox' ?
  326. (scope.row[v.prop] == '0' ? '√' : '')
  327. : scope.row[v.prop])
  328. }}
  329. </template>
  330. </el-table-column>
  331. </el-table>
  332. <!-- 辅助属性 -->
  333. <el-table border v-else-if="activeViceTab == 'material_property'" :data="propertyDetail.value"
  334. class="material-table">
  335. <el-table-column type="index" v-if="propertyDetail.form.length" label="序号" width="55"
  336. align="center"/>
  337. <el-table-column v-for="v in propertyDetail.form" v-if="v.show" :label="v.name" align="center"
  338. :prop="v.attribute == 'select' ? `${v.prop}Name` : v.prop" show-overflow-tooltip>
  339. <template slot-scope="scope">
  340. {{ v.attribute == 'select' ? scope.row[`${v.prop}Name`] :
  341. (v.attribute == 'checkbox' ?
  342. (scope.row[v.prop] == '0' ? '√' : '')
  343. : scope.row[v.prop])
  344. }}
  345. </template>
  346. </el-table-column>
  347. </el-table>
  348. </template>
  349. </dr-tabs>
  350. </div>
  351. <!-- 基本信息 - 审计信息 -->
  352. <div class="md-auditInfo" v-if="activeMainTab == 'material'">
  353. <el-divider content-position="left">审计信息</el-divider>
  354. <el-form :inline="true" label-position="right" :model="basicData.value">
  355. <el-form-item label="创建人">
  356. <el-input v-model="basicData.value.createByName" size="mini" readonly></el-input>
  357. </el-form-item>
  358. <el-form-item label="创建时间">
  359. <el-input v-model="basicData.value.createTime" size="mini" readonly></el-input>
  360. </el-form-item>
  361. <el-form-item label="最后修改人">
  362. <el-input v-model="basicData.value.updateByName" size="mini" readonly></el-input>
  363. </el-form-item>
  364. <el-form-item label="最后修改时间">
  365. <el-input v-model="basicData.value.updateTime" size="mini" readonly></el-input>
  366. </el-form-item>
  367. </el-form>
  368. </div>
  369. </div>
  370. </template>
  371. </dr-tabs>
  372. </div>
  373. </el-card>
  374. <!-- 维护物料类别弹窗 -->
  375. <el-dialog
  376. title="物料类别维护"
  377. :visible.sync="materialType.show"
  378. :before-close="handleCloseTypeDetails"
  379. :close-on-press-escape="false"
  380. :close-on-click-modal="false"
  381. width="80%"
  382. center
  383. class="materialType"
  384. >
  385. <!-- 操作按钮 -->
  386. <el-row
  387. :gutter="10"
  388. class="mb10"
  389. type="flex"
  390. justify="end"
  391. >
  392. <el-col :span="1.5">
  393. <el-button-group>
  394. <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('add')">增行
  395. </el-button>
  396. <el-button size="small" :disabled="!materialType.isEdit" @click="handleMaterialTypeRow('del')">删行
  397. </el-button>
  398. </el-button-group>
  399. <el-button-group>
  400. <el-button size="small" @click="handleMaterialTypeRow('edit')" v-hasPermi="['system:material:add']">{{
  401. materialType.isEdit
  402. ? '保存' : '修改' }}
  403. </el-button>
  404. <el-button size="small" v-if="materialType.isEdit" @click="handleMaterialTypeRow('cancal')">取消</el-button>
  405. <el-button size="small" @click="handleMaterialTypeRow">刷新</el-button>
  406. </el-button-group>
  407. </el-col>
  408. </el-row>
  409. <!-- 表格数据 -->
  410. <el-table
  411. border
  412. :data="materialType.value"
  413. stripe
  414. style="width: 100%"
  415. max-height="350"
  416. v-loading="materialType.loading"
  417. :key="refer"
  418. @selection-change="handleSelectionType"
  419. >
  420. <el-table-column type="selection" width="30"/>
  421. <el-table-column type="index" width="50" label="序号"/>
  422. <el-table-column v-for="mt in materialType.form" v-if="mt.show" :label="mt.name" width="180">
  423. <template slot-scope="scope">
  424. <!-- :prop="mt.prop" -->
  425. <!-- 多选框 -->
  426. <el-checkbox size="mini" v-if="mt.attribute == 'checkbox'" :disabled="!(materialType.isEdit && mt.edit)"
  427. true-label="0" false-label="2" v-model="scope.row[mt.prop]"/>
  428. <!-- 下拉框 / 参照弹窗---- 药品类别编码 scope.row[`${mt.prop}Name`] -->
  429. <el-select size="mini" v-else-if="mt.attribute == 'select' && mt.apiUrl" placeholder="请选择"
  430. :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]"
  431. :key="scope.row[mt.prop]"
  432. @focus="mt.apiUrl && handleQueryMore(mt, '', { name: 'materialType', prop: scope.row })">
  433. <div slot="empty"></div>
  434. </el-select>
  435. <!-- <el-select size="mini" v-else-if="mt.attribute == 'select' && mt.dictId" placeholder="请选择"
  436. :disabled="!(materialType.isEdit && mt.edit)" v-model="scope.row[mt.prop]" :key="scope.row[mt.prop]">
  437. <el-option v-if="mt.dictId" v-for="d in mt.dictId" :key="d.dictValue" :label="d.dictLabel"
  438. :value="d.dictValue"></el-option></el-select> -->
  439. <!-- 其他类型 -->
  440. <el-input v-else size="mini" v-model="scope.row[mt.prop]" :readonly="!(materialType.isEdit && mt.edit)"/>
  441. </template>
  442. </el-table-column>
  443. </el-table>
  444. </el-dialog>
  445. <!-- 操作提示弹窗 -->
  446. <el-dialog title="操作提示" :visible.sync="optionDialog.show" width="30%" center>
  447. <span>是否确认{{ optionDialog.op }}?</span>
  448. <span slot="footer">
  449. <el-button type="primary" @click="handleComfirmOption('cancal')">确 定</el-button>
  450. <el-button @click="handleOptionCancal">取 消</el-button>
  451. </span>
  452. </el-dialog>
  453. <!-- 其他页签的操作 -->
  454. <el-dialog
  455. :title="otherDeatils.title"
  456. :visible.sync="otherDeatils.show"
  457. show-close width="70%"
  458. :before-close="handleCloseOtherDetails"
  459. :close-on-press-escape="false"
  460. :close-on-click-modal="false"
  461. class="otherDialog"
  462. >
  463. <div v-loading="otherDeatils.loading">
  464. <!-- 其他标签页操作 修改、删除 -->
  465. <el-row
  466. :gutter="10"
  467. class="mb10"
  468. type="flex"
  469. justify="end"
  470. >
  471. <el-col :span="1.5" v-if="!otherDeatils.isEdit">
  472. <el-button-group>
  473. <el-button size="small" @click="handleOtherEdit('form')">修改</el-button>
  474. <!-- <el-button size="small" @click="handleOtherDel">删除</el-button> -->
  475. </el-button-group>
  476. <el-button-group>
  477. <el-button size="small" @click="handleOtherRefresh">刷新</el-button>
  478. </el-button-group>
  479. </el-col>
  480. <el-col :span="1.5" v-else>
  481. <el-button-group>
  482. <el-button size="small" @click="handleOtherSave">保存</el-button>
  483. <el-button size="small" @click="handleOtherCancel">取消</el-button>
  484. </el-button-group>
  485. </el-col>
  486. </el-row>
  487. <el-collapse v-model="collapseActive" @change="handleCollapseChange">
  488. <el-collapse-item title="物料基本信息" name="basic">
  489. <el-form :inline="true" label-position="right" :model="basicData.value">
  490. <el-form-item label="物料编码">
  491. <el-input v-model="basicData.value.code" size="small" readonly></el-input>
  492. </el-form-item>
  493. <el-form-item label="物料名称">
  494. <el-input v-model="basicData.value.name" size="small" readonly></el-input>
  495. </el-form-item>
  496. <el-form-item label="英文名称">
  497. <el-input v-model="basicData.value.enName" size="small" readonly></el-input>
  498. </el-form-item>
  499. </el-form>
  500. </el-collapse-item>
  501. <el-collapse-item :title="otherDeatils.title" :name="activeMainTab">
  502. <div class="od-msg">
  503. <!-- 展示表单 -->
  504. <el-form :inline="true" label-position="right" :key="refer" :hide-required-asterisk="true"
  505. :model="otherDeatils.value">
  506. <el-row :gutter="10">
  507. <el-col :span="8" v-for="f in otherDeatils.form" style="text-align: right;">
  508. <template v-if="f.show">
  509. <!-- 多选框 -->
  510. <el-form-item v-if="f.attribute == 'checkbox'" style="text-align: left;" class="od-msg-checkedbx">
  511. <el-checkbox :label="f.name" name="type" v-model="otherDeatils.value[f.prop]" true-label="0"
  512. false-label="2" :disabled="!(otherDeatils.isEdit && f.edit)">
  513. </el-checkbox>
  514. </el-form-item>
  515. <!-- 下拉框 - 弹窗参照 -->
  516. <el-form-item v-else-if="f.attribute == 'select'" :label="f.name">
  517. <el-select v-if="f.apiUrl" v-model="otherDeatils.value[`${f.prop}Name`]" placeholder="请选择"
  518. :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)"
  519. @focus="f.apiUrl && handleQueryMore(f, '', { name: 'otherDeatils', prop: f.prop })">
  520. <div slot="empty"></div>
  521. </el-select>
  522. <!-- 字典-下拉 -->
  523. <el-select v-if="f.dictId" v-model="otherDeatils.value[f.prop]" placeholder="请选择"
  524. :key="otherDeatils.value[f.prop]" :disabled="!(otherDeatils.isEdit && f.edit)">
  525. <el-option v-if="f.dictId" v-for="d in f.dictValue" :key="d.dictValue" :label="d.dictLabel"
  526. :value="d.dictValue">
  527. </el-option>
  528. </el-select>
  529. </el-form-item>
  530. <el-form-item v-else-if="f.attribute == 'image'" :label="f.name">
  531. <el-image :src="otherDeatils.value[f.prop]" fit="contain">
  532. </el-image>
  533. </el-form-item>
  534. <!--attribute 文本 数字 文本域 为null -->
  535. <el-form-item v-else :label="f.name">
  536. <el-input size="small" v-model="otherDeatils.value[f.prop]" :type="f.attribute || 'text'"
  537. :readonly="!(otherDeatils.isEdit && f.edit)">
  538. </el-input>
  539. </el-form-item>
  540. </template>
  541. </el-col>
  542. </el-row>
  543. </el-form>
  544. </div>
  545. </el-collapse-item>
  546. <el-collapse-item title="审计信息" name="auditInfo">
  547. <!-- 基本信息 - 审计信息 -->
  548. <div class="md-auditInfo">
  549. <el-form :inline="true" label-position="right" :model="basicData.value">
  550. <el-form-item label="创建人">
  551. <el-input v-model="basicData.value.createByName" size="small" readonly></el-input>
  552. </el-form-item>
  553. <el-form-item label="创建时间">
  554. <el-input v-model="basicData.value.createTime" size="small" readonly></el-input>
  555. </el-form-item>
  556. <el-form-item label="最后修改人">
  557. <el-input v-model="basicData.value.updateByName" size="small" readonly></el-input>
  558. </el-form-item>
  559. <el-form-item label="最后修改时间">
  560. <el-input v-model="basicData.value.updateTime" size="small" readonly></el-input>
  561. </el-form-item>
  562. </el-form>
  563. </div>
  564. </el-collapse-item>
  565. </el-collapse>
  566. </div>
  567. </el-dialog>
  568. <!-- 参照弹窗 -->
  569. <el-dialog
  570. :title="MoreDataDialog.msg.name"
  571. :visible.sync="MoreDataDialog.show"
  572. width="70%"
  573. class="MoreDataDialog"
  574. :close-on-press-escape="false"
  575. :close-on-click-modal="false"
  576. :before-close="handleCloseRefer"
  577. >
  578. <div>
  579. <el-row>
  580. <el-col :span="1.5">
  581. <el-input v-model="MoreDataDialog.key" placeholder="过滤" size="mini" @change="handleFilterRefer"/>
  582. </el-col>
  583. </el-row>
  584. <!-- 树形 -->
  585. <el-tree
  586. class="referTree"
  587. v-loading="MoreDataDialog.loading"
  588. v-if="MoreDataDialog.type == 'tree'"
  589. :data="MoreDataDialog.list"
  590. @node-click="handleNodeClick"
  591. :key="refer"
  592. :props="MoreDataDialog.msg.apiUrl == 'queryMedcineItemDrug' ? drugProps : defaultProps"
  593. node-key="id"
  594. >
  595. </el-tree>
  596. <!-- queryMedcineItemDrug -->
  597. <!-- 列表 -->
  598. <div v-else>
  599. <el-table
  600. border
  601. :data="MoreDataDialog.list"
  602. v-loading="MoreDataDialog.loading"
  603. style="width: 100%"
  604. @row-click="handleCurentRow"
  605. @row-dblclick="handleDbClick"
  606. highlight-current-row
  607. >
  608. <el-table-column type="index" label="序号" width="55" align="center"/>
  609. <el-table-column v-for="m in MoreDataDialog.form" v-if="m.show" :prop="m.prop" :label="m.name"/>
  610. </el-table>
  611. <el-pagination
  612. @size-change="handleSizeChange"
  613. @current-change="handleCurrentChange"
  614. :current-page="queryParams.pageNum"
  615. :page-sizes="[10, 20, 50, 100]"
  616. layout="total, sizes, prev, pager, next, jumper"
  617. :total="queryParams.total"
  618. >
  619. </el-pagination>
  620. </div>
  621. <!-- 按钮 -->
  622. <el-row class="more-button">
  623. <el-button round size="small" type="primary" @click="handleConfirmRefer">确认</el-button>
  624. <el-button round size="small" @click="handleConcalRefer">取消</el-button>
  625. </el-row>
  626. </div>
  627. </el-dialog>
  628. </div>
  629. </template>
  630. <script>
  631. import drTabs from '../components/dr-tabs.vue';
  632. import detailsTabs from '../config/detailsTabs';
  633. import materialApi from '@/api/material/basic';
  634. import {getDicts as getDicts} from '@/api/system/dict/data'
  635. import arrayUtils from '../tools/arrayUtils';
  636. import { initRules, initParams} from './init/index';
  637. import { getDetail } from '@/api/classify/basic';
  638. export default {
  639. name: 'material-details',
  640. // dicts: [],
  641. components: {
  642. drTabs
  643. },
  644. data() {
  645. return {
  646. count: 1,
  647. refer: 1,
  648. loading: false,
  649. rules:{},
  650. medcineRules:{},
  651. // 维护新版本
  652. maintainNewVersion: false,
  653. // 详情固定标签页
  654. detailsTabs,
  655. defaultProps: {
  656. children: 'childrens',
  657. label: 'name'
  658. },
  659. drugProps: {
  660. children: 'childrens',
  661. label: function (data, node) {
  662. return data.code + ' ' + data.name
  663. }
  664. // 'name'
  665. },
  666. // 标签页当前激活状态
  667. activeMainTab: 'material',
  668. activeViceTab: 'material_medcine',
  669. materialId: this.$route.params.id,
  670. collapseActive: ['basic', '',],
  671. // 修改按钮 是否激活
  672. updateButtonGroup: false,
  673. // 基本信息下的页签
  674. basicMessage: [
  675. {
  676. label: '医药行业',
  677. code: 'material_medcine',
  678. isShow: true,
  679. },
  680. {
  681. label: '辅计量管理',
  682. code: 'material_unit',
  683. isShow: true,
  684. },
  685. {
  686. label: '辅助属性',
  687. code: 'material_property',
  688. isShow: true,
  689. },
  690. ],
  691. // 基本信息
  692. basicData: {
  693. value: {},
  694. form: []
  695. },
  696. // 物料类别
  697. materialType: {
  698. show: false,
  699. value: [],
  700. form: [],
  701. loading: false,
  702. checkedList: [],
  703. isEdit: false,
  704. },
  705. // 医药行业
  706. medcineData: {
  707. value: {},
  708. form: []
  709. },
  710. // 辅助属性
  711. propertyDetail: {
  712. value: [],
  713. form: []
  714. },
  715. // 辅计量管理
  716. unitDetails: {
  717. value: [],
  718. form: []
  719. },
  720. // 主标签信息
  721. mainMsg: {
  722. form: [],
  723. value: [],
  724. checkedList: [],
  725. },
  726. // 副信息
  727. viceMsg: {
  728. form: [],
  729. value: [],
  730. },
  731. // 操作弹窗
  732. optionDialog: {
  733. show: false,
  734. op: ''
  735. },
  736. // 其他页签操作弹窗
  737. otherDeatils: {
  738. loading: false,
  739. show: false,
  740. title: '',
  741. // 查询关键字-物料id
  742. queryKey: '',
  743. isEdit: false,
  744. // 详情表头
  745. from: [],
  746. // 详情值
  747. value: {}
  748. },
  749. // 编辑-更多数据展示弹窗_ 参照
  750. MoreDataDialog: {
  751. loading: false,
  752. show: false,
  753. // 查询关键字
  754. key: '',
  755. // 需要查看参照的表单头信息
  756. msg: '',
  757. type: 'table',
  758. // 查询出的参照数据
  759. list: [],
  760. // 查询出的参照表头
  761. form: [],
  762. // 选中的参照数据
  763. value: '',
  764. // 参照最后应该赋值的地方
  765. target: {
  766. name: '',
  767. prop: ''
  768. }
  769. },
  770. // 参照分页参数
  771. queryParams: {
  772. pageNum: 1,
  773. total: 0,
  774. pageSize: 10,
  775. },
  776. }
  777. },
  778. methods: {
  779. // 判断效期管理
  780. handleJudge(attribute) {
  781. // 维护新版本才能修改:批号及库存状态管理(isInventoryStatus)、
  782. if (attribute.prop == 'isInventoryStatus') {
  783. return !(this.maintainNewVersion && attribute.edit);
  784. }
  785. // 序列号管理(serialNoManager):维护新版本 && 批号及库存状态管理
  786. else if (attribute.prop == 'serialNoManager') {
  787. if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['serialNoManager'] = '2';
  788. return !(this.maintainNewVersion && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
  789. }
  790. // 批号及库存状态管理(isInventoryStatus) 控制 效期管理是否展示(expiryDateManagerment)
  791. else if (attribute.prop == 'expiryDateManagerment') {
  792. if (this.basicData.value['isInventoryStatus'] == '2') this.basicData.value['expiryDateManagerment'] = '2';
  793. return !(this.updateButtonGroup && attribute.edit && this.basicData.value['isInventoryStatus'] == '0');
  794. }
  795. // 效期管理(expiryDateManagerment):控制一下几个是否可编辑
  796. // expiryUnitId 效期单位 usefulLife 有效期 usefulLifeUnitId 有效期至单位
  797. else if (attribute.prop == 'expiryUnitId'
  798. || attribute.prop == 'usefulLife'
  799. || attribute.prop == 'usefulLifeUnitId'
  800. || attribute.prop == 'recentWarningPeriod'
  801. ) {
  802. if (this.basicData.value['expiryDateManagerment'] == '2') {
  803. this.basicData.value['expiryUnitId'] = '';
  804. this.basicData.value['usefulLife'] = '';
  805. this.basicData.value['usefulLifeUnitId'] = '';
  806. this.basicData.value['recentWarningPeriod'] = '';
  807. }
  808. return !(this.updateButtonGroup && attribute.edit && this.basicData.value['expiryDateManagerment'] == '0');
  809. }
  810. // 默认采购组织:purchasingOrganization 业务部门:businessDepartment
  811. else if (attribute.prop == 'businessDepartment') {
  812. return !(this.updateButtonGroup && attribute.edit && this.basicData.value['purchasingOrganization']);
  813. } else {
  814. // 其他属性是否可编辑
  815. return !(this.updateButtonGroup && attribute.edit);
  816. }
  817. },
  818. // 返回
  819. handleBack() {
  820. this.$store.dispatch('tagsView/delView', this.$route)
  821. this.$router.go(-1)
  822. // this.$router.push({
  823. // path: `/basic/material/basicFile`,
  824. // });
  825. },
  826. // 附件按钮
  827. handleFile() {
  828. console.log('附件按钮');
  829. },
  830. // 改变分页情况
  831. handleChangePage(type) {
  832. switch (type) {
  833. case 'first':
  834. console.log('第一页');
  835. break;
  836. case 'pre':
  837. console.log('上一页');
  838. break;
  839. case 'next':
  840. console.log('下一页');
  841. break;
  842. case 'end':
  843. console.log('最后页');
  844. break;
  845. }
  846. },
  847. // 切换主信息标签
  848. handleMainTabClick(e) {
  849. this.activeMainTab = detailsTabs[e.index].code;
  850. this.collapseActive.splice(1, 1, this.activeMainTab);
  851. console.log(this.collapseActive, 'this.collapseActive');
  852. this.handleOtherListRefresh();
  853. },
  854. // 切换副表信息
  855. handleViceTabClick(e) {
  856. // console.log(this.basicMessage[e.index], '切换标签');
  857. this.activeViceTab = this.basicMessage[e.index].code;
  858. switch (this.activeViceTab) {
  859. // 医药行业
  860. case 'material_medcine':
  861. this.getTagList('material_medcine', (form) => {
  862. this.medcineData.form = [...form];
  863. this.medcineData.value = initParams(this.medcineData.form,'prop');
  864. this.medcineRules = initRules(form);
  865. this.getMedcineDetails(this.materialId, 'material_medcine');
  866. })
  867. break;
  868. // 辅计量管理
  869. case 'material_unit':
  870. this.getTagList('material_unit', (form) => {
  871. console.log(form, 'form');
  872. this.unitDetails.form = form;
  873. this.getUnitList(this.materialId);
  874. });
  875. break;
  876. // 辅助属性
  877. case 'material_property':
  878. this.getTagList('material_property', (form) => {
  879. this.propertyDetail.form = form;
  880. this.getPropertyList(this.materialId);
  881. });
  882. break;
  883. default:
  884. break;
  885. }
  886. },
  887. // 主标签页 列表双击
  888. handleMaindbClick(e) {
  889. this.otherDeatils.queryKey = e.id;
  890. this.otherDeatils.show = true;
  891. let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
  892. console.log(activeTab, 'activeTab');
  893. this.otherDeatils.title = activeTab.label;
  894. this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
  895. },
  896. // 主页签 列表数据选择
  897. handleMainChange(e) {
  898. this.mainMsg.checkedList = e;
  899. },
  900. // 上传图片
  901. handleUpImage() {
  902. },
  903. // 编辑状态下,参照弹窗显示查询数据
  904. handleQueryMore(msg, val, target) {
  905. this.MoreDataDialog.loading = true;
  906. let _this = this;
  907. console.log('编辑状态下,弹窗显示查询数据', msg, 'val', val, target);
  908. this.MoreDataDialog.show = true;
  909. this.MoreDataDialog.msg = msg;
  910. this.MoreDataDialog.target = target;
  911. let par = {param: this.MoreDataDialog.key};
  912. this[target.name].form.map(t => {
  913. if (t.relevance && t.relevance != '') {
  914. let reList = t.relevance.split(',');
  915. console.log(reList, 'reList-------------------');
  916. reList.forEach(i => {
  917. par[i] = this.basicData.value[i]
  918. })
  919. console.log(par, 'par/////////////////////////');
  920. }
  921. })
  922. this.getExecuteMethods(msg.apiUrl, par, (data) => {
  923. console.log(data, '编辑状态下,弹窗显示查询数据');
  924. _this.MoreDataDialog.type = data.type;
  925. if (data.type == 'tree') {
  926. _this.MoreDataDialog.list = arrayUtils.filterTreeData(data.tableBody);
  927. } else {
  928. _this.MoreDataDialog.list = data.tableBody;
  929. _this.MoreDataDialog.form = data.tableHeader;
  930. }
  931. this.refer++;
  932. // this.count++;s
  933. console.log(_this.MoreDataDialog.list, 'this.MoreDataDialog.list');
  934. console.log(_this.MoreDataDialog.form, 'this.MoreDataDialog.form');
  935. })
  936. },
  937. // 参照改变分页大小
  938. handleSizeChange(e) {
  939. this.queryParams.pageSize = e;
  940. this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
  941. },
  942. // 参照改变当前页
  943. handleCurrentChange(e) {
  944. this.queryParams.pageNum = e;
  945. this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
  946. },
  947. // 根据apiUrl获取对应参照的值
  948. getExecuteMethods(methodName, param, cb) {
  949. let page = {
  950. pageSize: this.queryParams.pageSize,
  951. pageNum: this.queryParams.pageNum,
  952. }
  953. let params = {...param};
  954. // 业务部门需要 依据默认采购组组织查询
  955. if (methodName == "queryOperatingDepptTree") {
  956. params['puOrgId'] = this.basicData.value['purchasingOrganization']
  957. }
  958. materialApi.executeMethods(methodName, params, page).then(res => {
  959. this.MoreDataDialog.loading = false;
  960. if (res.code == 200) {
  961. this.queryParams.total = res.data.total;
  962. cb(res.data);
  963. }
  964. })
  965. },
  966. // 获取物料基本信息详细信息
  967. async getMaterialDetails(id, templateCode) {
  968. let _this = this;
  969. await materialApi.materialDetails(
  970. id,
  971. templateCode,
  972. ).then(res => {
  973. this.loading = false;
  974. console.log(res, '物料基本信息');
  975. let {code, data} = res;
  976. if (code == 200) {
  977. _this.basicData.value ={... _this.basicData.value,...data.data};
  978. for (const key in data.data) {
  979. _this.basicData.value[key] = (typeof data.data[key] === 'number') ? String(data.data[key]) : data.data[key];
  980. }
  981. // _this.handleAddReferLabel('basicData');
  982. this.count++;
  983. }
  984. })
  985. },
  986. // 添加参照中的label
  987. // handleAddReferLabel(dataName) {
  988. // let _this = this;
  989. // this[dataName].form.map(item => {
  990. // // 查参照
  991. // if (item.apiUrl && item.apiUrl != '') {
  992. // let param = {};
  993. // if (item.relevance && item.relevance != '') {
  994. // let reList = item.relevance.split(',');
  995. // console.log(reList, 'reList-------------------');
  996. // reList.forEach(i => {
  997. // param[i] = this.basicData.value[i]
  998. // })
  999. // console.log(param, 'param/////////////////////////');
  1000. // }
  1001. // _this.getExecuteMethods(item.apiUrl, param, (data) => {
  1002. // let { tableBody } = data;
  1003. // // 维护物料类别 --- 属于列表中获取label
  1004. // if (dataName == 'materialType') {
  1005. // _this[dataName].value.length && (_this[dataName].value = _this[dataName].value.map(d => {
  1006. // let Blabel = tableBody.filter((t) => t.id == d[item.prop])[0];
  1007. // console.log(Blabel, 'Blabel``````````````````````````');
  1008. // d[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
  1009. // return d;
  1010. // }))
  1011. // } else {
  1012. // let Blabel = tableBody.filter((t) => t.id == _this[dataName].value[item.prop])[0];
  1013. // console.log(Blabel, 'Blabel``````````````````````````');
  1014. // _this[dataName].value[`${item.prop}Label`] = (Blabel && Blabel.name) || Blabel || '';
  1015. // }
  1016. // // this.count++;
  1017. // this.loading = false;
  1018. // console.log(_this[dataName].value, `${dataName}//////////////////////`);
  1019. // })
  1020. // }
  1021. // })
  1022. // this.materialType.loading = false;
  1023. // },
  1024. // 查询财务信息列表
  1025. async getFinanceList(materialId) {
  1026. try {
  1027. this.loading = true;
  1028. let {code,data} = await materialApi.financeList({materialId});
  1029. if (code == 200) {
  1030. this.mainMsg.value = data.tableBody.rows;
  1031. }
  1032. } catch (error) {
  1033. }finally{
  1034. this.loading = false;
  1035. }
  1036. },
  1037. // 查询计划信息列表
  1038. async getPlanList(materialId) {
  1039. try {
  1040. this.loading = true;
  1041. let {code,data} = await materialApi.planList({materialId});
  1042. if (code == 200) {
  1043. this.mainMsg.value = data.tableBody.rows;
  1044. }
  1045. } catch (error) {
  1046. }finally{
  1047. this.loading = false;
  1048. }
  1049. },
  1050. // 查询成本信息列表
  1051. async getCostList(materialId) {
  1052. try {
  1053. this.loading = true;
  1054. let {code,data} = await materialApi.costList({materialId});
  1055. if (code == 200) {
  1056. this.mainMsg.value = data.tableBody.rows;
  1057. }
  1058. } catch (error) {
  1059. }finally{
  1060. this.loading = false;
  1061. }
  1062. },
  1063. // 查询利润中心列表
  1064. async getCenterList(materialId) {
  1065. try {
  1066. this.loading = true;
  1067. let {code,data} = await materialApi.centerList({materialId});
  1068. if (code == 200) {
  1069. this.mainMsg.value = data.tableBody.rows;
  1070. }
  1071. } catch (error) {
  1072. }finally{
  1073. this.loading = false;
  1074. }
  1075. },
  1076. // 查询采购中心列表
  1077. async getPurchaseList(materialId) {
  1078. try {
  1079. this.loading = true;
  1080. let {code,data} = await materialApi.purchaseList({materialId});
  1081. if (code == 200) {
  1082. this.mainMsg.value = data.tableBody.rows;
  1083. }
  1084. } catch (error) {
  1085. }finally{
  1086. this.loading = false;
  1087. }
  1088. },
  1089. // 获取库存信息列表
  1090. async getInventoryList(materialId) {
  1091. try {
  1092. this.loading = true;
  1093. let {code,data} = await materialApi.inventoryList({materialId});
  1094. if (code == 200) {
  1095. this.mainMsg.value = data.tableBody.rows;
  1096. }
  1097. } catch (error) {}finally{
  1098. this.loading = false;
  1099. }
  1100. },
  1101. // 查询其他标签页列表详情
  1102. getOtherListDetails(type, id) {
  1103. console.log(type, id, '查询其他标签页列表详情');
  1104. this.otherDeatils.form = this.mainMsg.form;
  1105. console.log(this.otherDeatils.form, 'this.otherDeatils.form');
  1106. switch (type) {
  1107. // 财物信息
  1108. case 'material_finance':
  1109. this.getFinanceDetails(id);
  1110. break;
  1111. // 利润中心信息
  1112. case 'profit_center':
  1113. this.getCenterDetails(id);
  1114. break;
  1115. // 采购信息
  1116. case 'material_purchase':
  1117. this.getPurchaseDetails(id);
  1118. break;
  1119. // 库存信息
  1120. case 'material_inventory':
  1121. this.getInventoryDetails(id);
  1122. break;
  1123. // 计划信息
  1124. case 'material_plan':
  1125. this.getPlanDetails(id);
  1126. break;
  1127. // 成本信息
  1128. case 'material_cost':
  1129. this.getCostDetails(id);
  1130. break;
  1131. default:
  1132. break;
  1133. }
  1134. },
  1135. // 查询财务信息详情
  1136. async getFinanceDetails(id) {
  1137. try {
  1138. this.otherDeatils.loading = true;
  1139. let {code,data} = await materialApi.financeDetails(id);
  1140. if (code == 200) {
  1141. this.otherDeatils.value = data.data;
  1142. }
  1143. } catch (error) {}
  1144. finally{
  1145. setTimeout(()=>{
  1146. this.otherDeatils.loading = false;
  1147. },200)
  1148. }
  1149. },
  1150. // 获取利润中心详情
  1151. async getCenterDetails(id) {
  1152. try {
  1153. this.otherDeatils.loading = true;
  1154. let {code,data} = await materialApi.centerDetails(id);
  1155. if (code == 200) {
  1156. this.otherDeatils.value = data.data;
  1157. }
  1158. } catch (error) {}
  1159. finally{
  1160. setTimeout(()=>{
  1161. this.otherDeatils.loading = false;
  1162. },200)
  1163. }
  1164. },
  1165. // 获取采购详细信息详情
  1166. async getPurchaseDetails(id) {
  1167. try {
  1168. this.otherDeatils.loading = true;
  1169. let {code,data} = await materialApi.purchaseDetails(id);
  1170. if (code == 200) {
  1171. this.otherDeatils.value = data.data;
  1172. }
  1173. } catch (error) {}
  1174. finally{
  1175. setTimeout(()=>{
  1176. this.otherDeatils.loading = false;
  1177. },200)
  1178. }
  1179. },
  1180. // 获取成本信息详情
  1181. async getCostDetails(id) {
  1182. try {
  1183. this.otherDeatils.loading = true;
  1184. let {code,data} = await materialApi.costDetails(id);
  1185. if (code == 200) {
  1186. this.otherDeatils.value = data.data;
  1187. }
  1188. } catch (error) {}
  1189. finally{
  1190. setTimeout(()=>{
  1191. this.otherDeatils.loading = false;
  1192. },200)
  1193. }
  1194. },
  1195. // 获取计划信息详情
  1196. async getPlanDetails(id) {
  1197. try {
  1198. this.otherDeatils.loading = true;
  1199. let {code,data} = await materialApi.planDetails(id);
  1200. if (code == 200) {
  1201. this.otherDeatils.value = data.data;
  1202. }
  1203. } catch (error) {}
  1204. finally{
  1205. setTimeout(()=>{
  1206. this.otherDeatils.loading = false;
  1207. },200)
  1208. }
  1209. },
  1210. //
  1211. async getInventoryDetails(id) {
  1212. try {
  1213. this.otherDeatils.loading = true;
  1214. let {code,data} = await materialApi.inventoryDetails(id);
  1215. if (code == 200) {
  1216. this.otherDeatils.value = data.data;
  1217. }
  1218. } catch (error) {}
  1219. finally{
  1220. setTimeout(()=>{
  1221. this.otherDeatils.loading = false;
  1222. },200)
  1223. }
  1224. },
  1225. /* 二级标签页 */
  1226. // 根据物料id获取医药行业信息详细信息
  1227. async getMedcineDetails(id) {
  1228. let _this = this;
  1229. console.log(id);
  1230. await materialApi.medcineDetailsInfo(id).then((res) => {
  1231. this.loading = false;
  1232. console.log(res, '医药行业');
  1233. let {code, data} = res;
  1234. if (code == 200) {
  1235. _this.medcineData.value = data.data || {};
  1236. // this.medcineData.form = data.form;
  1237. // _this.handleAddReferLabel('medcineData');
  1238. console.log(' _this.medcineData', _this.medcineData, res);
  1239. this.count++;
  1240. }
  1241. })
  1242. },
  1243. // 获取物料辅助属性详细信息+表单列段属性
  1244. getPropertyDetails(id) {
  1245. materialApi.propertyDetails(id).then(res => {
  1246. console.log(res, '物料辅助属性详细信息');
  1247. if (res.code == 200) {
  1248. this.propertyDetail.value = res.data.data || [];
  1249. }
  1250. })
  1251. },
  1252. // 查询物料辅助属性列表+表头字段
  1253. getPropertyList(materialId) {
  1254. materialApi.propertyList({materialId}).then(res => {
  1255. console.log(res, '料辅助属性列表');
  1256. if (res.code == 200) {
  1257. this.propertyDetail.value = res.data.data || [];
  1258. }
  1259. })
  1260. },
  1261. //获取辅助计量单位基本信息+表单列段属性
  1262. getUnitDetails(materialId) {
  1263. materialApi.unitDetails(materialId).then(res => {
  1264. console.log(res, '辅助计量单位基本信息');
  1265. if (res.code == 200) {
  1266. this.unitDetails.value = res.data.tableBody.rows || [];
  1267. }
  1268. })
  1269. },
  1270. //获取辅计量管理列表信息
  1271. getUnitList(materialId) {
  1272. materialApi.unitList({materialId}).then(res => {
  1273. console.log(res, '辅计量管理列表信息');
  1274. if (res.code == 200) {
  1275. this.unitDetails.value = res.data.tableBody.rows || [];
  1276. }
  1277. })
  1278. },
  1279. // 获取物料列表表头
  1280. async getTagList(templateCode, cb) {
  1281. let _this = this;
  1282. await materialApi.tagList({templateCode}).then(async (res) => {
  1283. console.log(res, `获取${templateCode}表头`);
  1284. let dictIdList = [];
  1285. if (res.code == 200) {
  1286. res.data.map(async(item) => {
  1287. // 查字典
  1288. if (item.dictId && item.dictId != '') {
  1289. // 通过接口获取有dict的对应的数据
  1290. await getDicts(item.dictId).then(dict => {
  1291. if (dict.data) {
  1292. item['dictValue'] = dict.data;
  1293. }
  1294. })
  1295. }
  1296. })
  1297. return cb(res.data);
  1298. // 动态更改dict
  1299. // res.data.forEach(item => {
  1300. // if (item.dictId) {
  1301. // // 请求接口
  1302. // dictIdList.push(item.dictId);
  1303. // }
  1304. // })
  1305. // console.log(dictIdList, 'dictIdList');
  1306. // _this.dict = [..._this.dict, ...dictIdList];
  1307. // _this.dict = Array.from(new Set([..._this.dict, ...dictIdList]));
  1308. // console.log(_this.dict, 'dicts');
  1309. // return cb(res.data);
  1310. }
  1311. })
  1312. },
  1313. // 根据物料id获取物料类别维护列表
  1314. getMedcineitemList(materialId) {
  1315. let _this = this;
  1316. materialApi.medcineitemList({materialId}).then(res => {
  1317. this.materialType.loading = false;
  1318. console.log(res, '根据物料id获取物料类别维护列表');
  1319. if (res.code == 200) {
  1320. _this.materialType.value = res.data.tableBody.rows;
  1321. // _this.handleAddReferLabel('materialType');
  1322. }
  1323. })
  1324. },
  1325. // 新增
  1326. handleInster() {
  1327. this.$notify({
  1328. title: '警告',
  1329. message: '物料只能通过申请审批增加,不能在节点直接录入!',
  1330. type: 'warning'
  1331. });
  1332. },
  1333. // 除基本信息之后的修改
  1334. handleOtherEdit(type) {
  1335. // debugger
  1336. console.log('除基本信息之后的修改', type);
  1337. if ('table' === type) {
  1338. if (this.mainMsg.checkedList.length == 1) {
  1339. this.otherDeatils.show = true;
  1340. this.otherDeatils.isEdit = true;
  1341. let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
  1342. this.otherDeatils.title = activeTab.label;
  1343. this.otherDeatils.queryKey = this.mainMsg.checkedList[0].id;
  1344. console.log(this.otherDeatils, 'this.otherDeatils');
  1345. // 查询其他标签页列表详情
  1346. this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
  1347. } else {
  1348. this.$notify({
  1349. title: '警告',
  1350. message: '修改请选择单个数据!',
  1351. type: 'warning'
  1352. });
  1353. }
  1354. } else if ('form' === type) {
  1355. if (this.otherDeatils.queryKey) {
  1356. this.otherDeatils.show = true;
  1357. this.otherDeatils.isEdit = true;
  1358. let activeTab = this.detailsTabs.filter(item => item.code == this.activeMainTab)[0];
  1359. this.otherDeatils.title = activeTab.label;
  1360. // 查询其他标签页列表详情
  1361. this.getOtherListDetails(activeTab.code, this.otherDeatils.queryKey);
  1362. }
  1363. }
  1364. },
  1365. // 其他标签详情弹窗-刷新
  1366. handleOtherRefresh() {
  1367. this.getOtherListDetails(this.activeMainTab, this.otherDeatils.queryKey);
  1368. },
  1369. // 其他标签详情弹窗-删除
  1370. handleOtherDel() {
  1371. let ids = this.mainMsg.checkedList.map(i => i.id);
  1372. console.log(`${this.activeMainTab}其他标签详情弹窗-删除---id合集`, ids);
  1373. if (ids.length) {
  1374. switch (this.activeMainTab) {
  1375. // 财物信息
  1376. case 'material_finance':
  1377. this.handleDelFinance(ids);
  1378. break;
  1379. // 利润中心信息
  1380. case 'profit_center':
  1381. this.handledDelCenter(ids);
  1382. break;
  1383. // 采购信息
  1384. case 'material_purchase':
  1385. this.handledelPurchase(ids);
  1386. break;
  1387. // 库存信息
  1388. case 'material_inventory':
  1389. this.handleDelInventory(ids);
  1390. break;
  1391. // 计划信息
  1392. case 'material_plan':
  1393. this.handleDelPlan(ids);
  1394. break;
  1395. // 成本信息
  1396. case 'material_cost':
  1397. this.handleDelCost(ids);
  1398. default:
  1399. break;
  1400. }
  1401. } else {
  1402. this.$notify({
  1403. title: '警告',
  1404. message: '请选择需要删除的数据!',
  1405. type: 'warning'
  1406. });
  1407. }
  1408. },
  1409. // 其他标签页刷新
  1410. async handleOtherListRefresh() {
  1411. switch (this.activeMainTab) {
  1412. // 基本信息
  1413. case 'material':
  1414. await this.getTagList('material', async(form) => {
  1415. // this.basicData.form = [...form];
  1416. this.basicData.form = [...form];
  1417. this.rules = initRules(form);
  1418. this.basicData.value = initParams(this.basicData.form,'prop')
  1419. await this.getMaterialDetails(this.materialId, 'material');
  1420. })
  1421. break;
  1422. // 财物信息
  1423. case 'material_finance':
  1424. await this.getTagList('material_finance', async(form) => {
  1425. this.mainMsg.form = [...form];
  1426. await this.getFinanceList(this.materialId);
  1427. });
  1428. break;
  1429. // 利润中心信息
  1430. case 'profit_center':
  1431. await this.getTagList('profit_center', async(form) => {
  1432. this.mainMsg.form = [...form];
  1433. await this.getCenterList(this.materialId);
  1434. });
  1435. break;
  1436. // 采购信息
  1437. case 'material_purchase':
  1438. await this.getTagList('material_purchase', async(form) => {
  1439. this.mainMsg.form = [...form];
  1440. await this.getPurchaseList(this.materialId);
  1441. });
  1442. break;
  1443. // 库存信息
  1444. case 'material_inventory':
  1445. await this.getTagList('material_inventory', async(form) => {
  1446. this.mainMsg.form = [...form];
  1447. await this.getInventoryList(this.materialId);
  1448. });
  1449. break;
  1450. // 计划信息
  1451. case 'material_plan':
  1452. await this.getTagList('material_plan', async(form) => {
  1453. this.mainMsg.form = [...form];
  1454. await this.getPlanList(this.materialId);
  1455. });
  1456. break;
  1457. // 成本信息
  1458. case 'material_cost':
  1459. await this.getTagList('material_cost',async(form) => {
  1460. this.mainMsg.form = [...form];
  1461. await this.getCostList(this.materialId);
  1462. });
  1463. break;
  1464. default:
  1465. break;
  1466. }
  1467. },
  1468. // 修改
  1469. handleBasicEdit() {
  1470. console.log('修改基本信息');
  1471. this.updateButtonGroup = true;
  1472. // this.count++;
  1473. //需要禁止点击其他标签
  1474. // this.detailsTabs = this.detailsTabs.map(item => {
  1475. // item['disabled'] = true;
  1476. // return item
  1477. // })
  1478. console.log(this.detailsTabs, 'this.detailsTabs ');
  1479. },
  1480. // 删除
  1481. handleDel() {
  1482. console.log('删除----基本信息');
  1483. },
  1484. // 复制
  1485. handleCopy() {
  1486. console.log('复制');
  1487. },
  1488. //查询
  1489. handleQuery() {
  1490. },
  1491. // 刷新
  1492. handleRefresh() {
  1493. console.log('刷新');
  1494. this.$refs.basicMessageRef.clearValidate();
  1495. this.$refs.medcineRef.clearValidate();
  1496. this.handleRest();
  1497. },
  1498. // 过滤
  1499. handleFilter(e) {
  1500. console.log(e, '过滤');
  1501. },
  1502. filterCondition(type) {
  1503. return {
  1504. type
  1505. }
  1506. },
  1507. // 维护物料类别
  1508. handleMaterialType() {
  1509. console.log('维护物料类别');
  1510. this.materialType.show = true;
  1511. this.materialType.loading = true;
  1512. this.getTagList('material_medcine_item', (form) => {
  1513. this.materialType.form = form;
  1514. this.getMedcineitemList(this.materialId);
  1515. });
  1516. },
  1517. // 启用
  1518. handleIsInvoke(e) {
  1519. console.log('启用', this.basicData.value.isEnable);
  1520. let param = {
  1521. isEnable: this.basicData.value.isEnable == '已启用' ? '2' : '0',
  1522. id: this.basicData.value.id
  1523. };
  1524. console.log(param, '启用/停用param');
  1525. materialApi.updateEnableMaterial(param).then(res => {
  1526. console.log(res, '启用/停用');
  1527. if (res.code == 200) this.handleRefresh();
  1528. })
  1529. },
  1530. // 维护新版本
  1531. handleNewVersion() {
  1532. let _this = this;
  1533. let data = {
  1534. // 物料编码
  1535. code: this.basicData.value.code
  1536. }
  1537. materialApi.versions(data).then(res => {
  1538. console.log(res, '维护新版本');
  1539. if (res.code == 200) {
  1540. _this.maintainNewVersion = res.data.result;
  1541. // 维护版本消息展示 by shiy 2023/05/31
  1542. if (!res.data.result) {
  1543. this.$notify({
  1544. title: '警告',
  1545. message: res.data.msg,
  1546. type: 'warning'
  1547. });
  1548. }
  1549. }
  1550. })
  1551. },
  1552. // 维护物料保存
  1553. handleSaveNewVersion(cb) {
  1554. let data = {
  1555. // 物料编码
  1556. materialCode: this.basicData.value.code,
  1557. //序列号管理; 2= 否,0= 是
  1558. serialNoManager: this.basicData.value.serialNoManager,
  1559. // 批号及库存状态管理;2=否,0=是
  1560. isInventoryStatus: this.basicData.value.isInventoryStatus,
  1561. }
  1562. materialApi.saveVersions(data).then(res => {
  1563. console.log(res, '维护物料保存');
  1564. if (res.code == 200) {
  1565. cb();
  1566. }
  1567. })
  1568. .catch((error) => {
  1569. this.loading = false;
  1570. })
  1571. },
  1572. // 取消保存
  1573. handleCancel() {
  1574. console.log('取消保存');
  1575. this.optionDialog.op = '取消';
  1576. this.optionDialog.show = true;
  1577. },
  1578. // 保存修改
  1579. handleSave() {
  1580. console.log('保存修改');
  1581. // this.$refs['basicMessageRef'].validate(async (valid) => {
  1582. // if (valid) {
  1583. this.loading = true;
  1584. // 普通保存修改
  1585. this.updateButtonGroup && this.handleSaveMaterial(() => {
  1586. this.updateButtonGroup = false;
  1587. this.handleRefresh();
  1588. });
  1589. // 维护新版本保存修改
  1590. this.maintainNewVersion && this.handleSaveNewVersion(() => {
  1591. this.maintainNewVersion = false;
  1592. this.handleRefresh();
  1593. })
  1594. // } else {
  1595. // this.$notify.error({
  1596. // title: '错误',
  1597. // message: '存在必填项未填写!'
  1598. // });
  1599. // console.log('error submit!!');
  1600. // return false;
  1601. // }
  1602. // })
  1603. },
  1604. // 物料类别列表选中
  1605. handleSelectionType(list) {
  1606. console.log('物料类别列表选中', list);
  1607. this.materialType.checkedList = list;
  1608. },
  1609. // 物料类别增删行
  1610. handleMaterialTypeRow(op) {
  1611. let _this = this;
  1612. switch (op) {
  1613. // 增行
  1614. case 'add':
  1615. let rowObj = {};
  1616. for (const key in _this.materialType.value[0]) {
  1617. if (Object.hasOwnProperty.call(_this.materialType.value[0], key)) {
  1618. rowObj[key] = '';
  1619. }
  1620. }
  1621. rowObj['insertId'] = new Date().getTime();
  1622. this.materialType.value.push(rowObj);
  1623. console.log(this.materialType.value, '物料类别增行rowObj后');
  1624. break;
  1625. // 删行
  1626. case 'del':
  1627. console.log('物料类别删行', _this.materialType.checkedList);
  1628. if (_this.materialType.checkedList.length) {
  1629. _this.materialType.checkedList.map(c => {
  1630. _this.materialType.value = _this.materialType.value.filter(m => {
  1631. if (m.id && m.id != '' && m.id != c.id) {
  1632. return m;
  1633. } else if (m.insertId && m.insertId != '' && m.insertId != c.insertId) {
  1634. return m
  1635. }
  1636. })
  1637. })
  1638. } else {
  1639. this.$notify({
  1640. title: '警告',
  1641. message: '请选择需要删除的信息!',
  1642. type: 'warning'
  1643. });
  1644. }
  1645. break;
  1646. // 取消
  1647. case 'cancal':
  1648. this.materialType.isEdit = false;
  1649. this.handleMaterialTypeRow();
  1650. break;
  1651. // 保存、修改
  1652. case 'edit':
  1653. if (_this.materialType.isEdit) {
  1654. // 编辑状态
  1655. let nullList = _this.materialType.value.filter(m => (!m.drugId || m.drugId == ''));
  1656. console.log(nullList, 'nullList');
  1657. if (!nullList.length && _this.materialType.value.length) {
  1658. console.log('物料类别保存', _this.materialType.value);
  1659. let params = {
  1660. materialId: _this.materialId,
  1661. medcineItems: _this.materialType.value
  1662. }
  1663. materialApi.medcineitemBatchSave(params).then(res => {
  1664. console.log(res, '保存物料类型');
  1665. if (res.code == 200) {
  1666. _this.materialType.isEdit = false;
  1667. _this.handleMaterialTypeRow();
  1668. }
  1669. })
  1670. // 保存
  1671. } else {
  1672. this.$notify({
  1673. title: '警告',
  1674. message: '不能保存空数据或存在数据为空!',
  1675. type: 'warning'
  1676. });
  1677. }
  1678. } else {
  1679. // 非编辑状态
  1680. console.log('物料类别修改');
  1681. this.materialType.isEdit = true;
  1682. }
  1683. break;
  1684. // 刷新
  1685. default:
  1686. console.log('物料类别刷新');
  1687. if (this.materialType.isEdit) {
  1688. this.$notify({
  1689. title: '警告',
  1690. message: '请先保存数据!',
  1691. type: 'warning'
  1692. });
  1693. } else {
  1694. this.materialType.loading = true;
  1695. this.getTagList('material_medcine_item', (form) => {
  1696. this.materialType.form = form;
  1697. this.getMedcineitemList(this.materialId);
  1698. });
  1699. }
  1700. break;
  1701. }
  1702. },
  1703. // 物料类别弹窗关闭前
  1704. handleCloseTypeDetails(done) {
  1705. console.log('物料类别弹窗关闭前');
  1706. this.materialType.isEdit ? this.$notify({
  1707. title: '警告',
  1708. message: '请先保存数据!',
  1709. type: 'warning'
  1710. }): done();
  1711. },
  1712. // 保存修改并新增
  1713. handleSaveAdd() {
  1714. console.log('保存修改并新增');
  1715. },
  1716. // 其他标签页弹窗取消操作
  1717. handleOtherCancel() {
  1718. console.log('其他标签页弹窗取消操作');
  1719. this.optionDialog.show = true;
  1720. this.optionDialog.op = '修改';
  1721. },
  1722. // 其他标签页弹窗保存
  1723. async handleOtherSave() {
  1724. console.log('其他标签页弹窗保存', this.activeMainTab);
  1725. let data = this.otherDeatils.value;
  1726. console.log(data, 'params');
  1727. switch (this.activeMainTab) {
  1728. // 财物信息
  1729. case 'material_finance':
  1730. await this.handleSaveFinance(data);
  1731. break;
  1732. // 利润中心信息
  1733. case 'profit_center':
  1734. await this.handleSaveCenter(data);
  1735. break;
  1736. // 采购信息
  1737. case 'material_purchase':
  1738. await this.handleSavePurchase(data);
  1739. break;
  1740. // 库存信息
  1741. case 'material_inventory':
  1742. await this.handleSaveInventoryEdit(data);
  1743. break;
  1744. // 计划信息
  1745. case 'material_plan':
  1746. await this.handleSavePlan(data);
  1747. break;
  1748. // 成本信息
  1749. case 'material_cost':
  1750. await this.handleSaveCost(data);
  1751. break;
  1752. default:
  1753. break;
  1754. }
  1755. // this.handleOtherRefresh();
  1756. },
  1757. // 其他页签详情弹窗关闭事件
  1758. handleCloseOtherDetails(done) {
  1759. console.log('其他页签详情弹窗关闭事件');
  1760. // 处于编辑状态
  1761. if (this.otherDeatils.isEdit) {
  1762. this.$notify({
  1763. title: '警告',
  1764. message: '请先退出编辑操作',
  1765. type: 'warning'
  1766. });
  1767. } else {
  1768. this.handleOtherListRefresh();
  1769. done();
  1770. }
  1771. },
  1772. // 折叠菜单改变
  1773. handleCollapseChange(val) {
  1774. console.log(val, '折叠菜单改变');
  1775. },
  1776. // 更新导入
  1777. handleUpdateImport() {
  1778. console.log('更新导入');
  1779. },
  1780. // 确认弹窗操作
  1781. async handleComfirmOption() {
  1782. console.log('确认弹窗操作');
  1783. this.optionDialog.show = false;
  1784. // 取消基本信息修改
  1785. if (this.updateButtonGroup) {
  1786. this.updateButtonGroup = false;
  1787. // this.handleRest();
  1788. await this.getMaterialDetails(this.materialId, 'material');
  1789. await this.getMedcineDetails(this.materialId, 'material_medcine');
  1790. this.$refs.basicMessageRef.clearValidate();
  1791. this.$refs.medcineRef.clearValidate();
  1792. }
  1793. // 取消其他主页签详情弹窗修改
  1794. if (this.otherDeatils.isEdit) {
  1795. this.otherDeatils.isEdit = false;
  1796. this.handleOtherRefresh();
  1797. }
  1798. // 取消维护新版本修改
  1799. if (this.maintainNewVersion) {
  1800. console.log('取消维护新版本修改');
  1801. this.maintainNewVersion = false;
  1802. this.handleRefresh();
  1803. }
  1804. },
  1805. // 参照弹窗过滤
  1806. handleFilterRefer() {
  1807. // this.MoreDataDialog.key =
  1808. console.log(this.MoreDataDialog.key, '查询关键字', this.MoreDataDialog.target);
  1809. this.handleQueryMore(this.MoreDataDialog.msg, this.MoreDataDialog.key, this.MoreDataDialog.target);
  1810. },
  1811. // 操作提示弹窗关闭
  1812. handleOptionCancal() {
  1813. this.optionDialog.show = false;
  1814. this.otherDeatils.isEdit = true;
  1815. },
  1816. // 树形节点选择
  1817. handleNodeClick(e) {
  1818. console.log(e, '树形节点选择', this.MoreDataDialog.target);
  1819. // let node = { ...e, name: e.label }
  1820. this.MoreDataDialog.value = e;
  1821. },
  1822. // 修改-更多数据表格——选择行
  1823. handleCurentRow(row) {
  1824. console.log(row, '修改-更多数据表格——选择行');
  1825. this.MoreDataDialog.value = row;
  1826. },
  1827. handleDbClick(row){
  1828. this.MoreDataDialog.value = row;
  1829. this.handleConfirmRefer();
  1830. },
  1831. // 参照弹窗确认
  1832. handleConfirmRefer() {
  1833. let _this = this;
  1834. console.log('确认参照弹窗', `{this.${this.MoreDataDialog.target.name}:${this.MoreDataDialog.value.id}}`);
  1835. let confirm = true;
  1836. if (this.MoreDataDialog.target.name == 'basicData') {
  1837. // 基本信息
  1838. this.basicData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
  1839. this.basicData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
  1840. console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
  1841. console.log(this.basicData.value[`${this.MoreDataDialog.target.prop}`], '值', this.basicData.value[`${this.MoreDataDialog.target.prop}Name`], '//////////基本信息///////////');
  1842. // 默认采购组织:purchasingOrganization 业务部门:businessDepartment
  1843. if (this.MoreDataDialog.target.prop == 'purchasingOrganization') {
  1844. this.basicData.value['businessDepartment'] = '';
  1845. this.basicData.value['businessDepartmentName'] = '';
  1846. }
  1847. // 物料税类materialRate
  1848. if (this.MoreDataDialog.target.prop == 'materialRate') {
  1849. this.basicData.value['rateCode'] = this.MoreDataDialog.value.code
  1850. }
  1851. } else if (this.MoreDataDialog.target.name == 'medcineData') {
  1852. // 医药信息
  1853. this.medcineData.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
  1854. this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
  1855. console.log(this.MoreDataDialog.target.prop, 'props-----------------', this.MoreDataDialog.value);
  1856. console.log(this.medcineData.value[`${this.MoreDataDialog.target.prop}Name`], '//////医药信息//////////');
  1857. } else if (this.MoreDataDialog.target.name == 'otherDeatils') {
  1858. // 其他页签
  1859. this.otherDeatils.value[this.MoreDataDialog.target.prop] = this.MoreDataDialog.value.id;
  1860. this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`] = this.MoreDataDialog.value.name;
  1861. console.log(this.otherDeatils.value[`${this.MoreDataDialog.target.prop}Name`], '/////////其他页签///////');
  1862. } else if (this.MoreDataDialog.target.name == 'materialType') {
  1863. // 物料类别
  1864. console.log('确认时选择的数据', this.MoreDataDialog.value);
  1865. this.materialType.value = this.materialType.value.map(m => {
  1866. if ((m.id && m.id != '' && m.id == _this.MoreDataDialog.target.prop['id']) ||
  1867. (m.insertId && m.insertId == _this.MoreDataDialog.target.prop['insertId'])
  1868. ) {
  1869. let drug = _this.materialType.value.filter(d => d.drugId == _this.MoreDataDialog.value['id'])
  1870. console.log(drug, 'drug------------------------------------');
  1871. if (drug.length) {
  1872. _this.$notify({
  1873. title: '警告',
  1874. message: '不能维护相同的物料类别!',
  1875. type: 'warning'
  1876. });
  1877. confirm = false;
  1878. } else {
  1879. m.drugId = _this.MoreDataDialog.value['id'];
  1880. m.drugCode = _this.MoreDataDialog.value['code'];
  1881. m.drugName = _this.MoreDataDialog.value['name'];
  1882. }
  1883. }
  1884. return m;
  1885. })
  1886. console.log(this.materialType.value, '修改之后-----this.materialType.value');
  1887. }
  1888. if (confirm) {
  1889. // this.count++;
  1890. this.refer++;
  1891. this.MoreDataDialog.show = false;
  1892. this.MoreDataDialog.key = '';
  1893. this.MoreDataDialog.value = {};
  1894. }
  1895. },
  1896. // 取消-关闭参照弹窗
  1897. handleConcalRefer() {
  1898. console.log('关闭参照弹窗');
  1899. this.MoreDataDialog.show = false;
  1900. this.MoreDataDialog.key = '';
  1901. },
  1902. // 关闭参照弹窗前
  1903. handleCloseRefer(done) {
  1904. this.MoreDataDialog.key = '';
  1905. done();
  1906. },
  1907. // 删除利润中心信息
  1908. handledDelCenter(ids) {
  1909. console.log('删除利润中心信息');
  1910. materialApi.delCenter(ids).then(res => {
  1911. if (res.code == 200) {
  1912. this.handleOtherListRefresh();
  1913. }
  1914. })
  1915. },
  1916. // 删除库存信息
  1917. handleDelInventory(ids) {
  1918. console.log('删除库存信息');
  1919. materialApi.delInventory(ids).then(res => {
  1920. if (res.code == 200) {
  1921. this.handleOtherListRefresh();
  1922. }
  1923. })
  1924. },
  1925. // 删除成本信息
  1926. handleDelCost(ids) {
  1927. console.log('删除成本信息');
  1928. materialApi.delCost(ids).then(res => {
  1929. if (res.code == 200) {
  1930. this.handleOtherListRefresh();
  1931. }
  1932. })
  1933. },
  1934. // 删除计划信息
  1935. handleDelPlan(ids) {
  1936. console.log('删除计划信息');
  1937. materialApi.delPlan(ids).then(res => {
  1938. if (res.code == 200) {
  1939. this.handleOtherListRefresh();
  1940. }
  1941. })
  1942. },
  1943. // 删除财物信息
  1944. handleDelFinance(ids) {
  1945. console.log('删除财物信息');
  1946. materialApi.delFinance(ids).then(res => {
  1947. if (res.code == 200) {
  1948. this.handleOtherListRefresh();
  1949. }
  1950. })
  1951. },
  1952. // 删除采购信息
  1953. handledelPurchase(ids) {
  1954. console.log('删除采购信息');
  1955. materialApi.delPurchase(ids).then(res => {
  1956. if (res.code == 200) {
  1957. this.handleOtherListRefresh();
  1958. }
  1959. });
  1960. },
  1961. // 保存物料以及相关页签
  1962. handleSaveMaterial(cb) {
  1963. let param = {
  1964. ...this.basicData.value,
  1965. materialMedcine: this.medcineData.value,
  1966. materialMedcineItem: {}
  1967. };
  1968. // diCode
  1969. param.diCode = param.diCode.replace(/ /g, '');
  1970. console.log(param, '保存物料以及相关页签param');
  1971. materialApi.insertMaterialInfo(param).then(res => {
  1972. console.log(res, '保存物料以及相关页签');
  1973. if (res.code == 200) cb();
  1974. }).catch((error) => {
  1975. this.loading = false;
  1976. })
  1977. },
  1978. // 保存财务信息——单个数据
  1979. async handleSaveFinance(data) {
  1980. console.log(data, '保存财务信息——单个数据');
  1981. try {
  1982. this.otherDeatils.loading = true;
  1983. let {code,msg} = await materialApi.financeEdit(data);
  1984. if (code == 200) {
  1985. this.otherDeatils.isEdit = false;
  1986. this.handleOtherRefresh();
  1987. this.$notify({
  1988. title: '成功',
  1989. message: msg,
  1990. type: 'success'
  1991. });
  1992. }
  1993. } catch (error) {
  1994. }finally{
  1995. this.otherDeatils.loading = false;
  1996. }
  1997. // this.otherDeatils.loading = true;
  1998. // materialApi.financeEdit(data).then(res => {
  1999. // if (res.code == 200) {
  2000. // this.otherDeatils.isEdit = false;
  2001. // this.handleOtherRefresh();
  2002. // }
  2003. // this.otherDeatils.loading = false;
  2004. // })
  2005. },
  2006. // 保存利润中心信息
  2007. async handleSaveCenter(data) {
  2008. console.log(data, '保存利润中心信息');
  2009. try {
  2010. this.otherDeatils.loading = true;
  2011. let {code,msg} = await materialApi.centerEdit(data);
  2012. if (code == 200) {
  2013. this.otherDeatils.isEdit = false;
  2014. this.handleOtherRefresh();
  2015. this.$notify({
  2016. title: '成功',
  2017. message: msg,
  2018. type: 'success'
  2019. });
  2020. }
  2021. } catch (error) {}
  2022. finally{
  2023. this.otherDeatils.loading = false;
  2024. }
  2025. // materialApi.centerEdit(data).then(res => {
  2026. // if (res.code == 200) {
  2027. // this.otherDeatils.isEdit = false;
  2028. // this.handleOtherRefresh();
  2029. // }
  2030. // })
  2031. },
  2032. // 保存采购信息
  2033. async handleSavePurchase(data) {
  2034. console.log(data, '保存采购信息');
  2035. try {
  2036. this.otherDeatils.loading = true;
  2037. let {code,msg} = await materialApi.purchaseEdit(data);
  2038. if (code == 200) {
  2039. this.otherDeatils.isEdit = false;
  2040. this.handleOtherRefresh();
  2041. this.$notify({
  2042. title: '成功',
  2043. message: msg,
  2044. type: 'success'
  2045. });
  2046. }
  2047. } catch (error) {}
  2048. finally{
  2049. this.otherDeatils.loading = false;
  2050. }
  2051. // materialApi.purchaseEdit(data).then(res => {
  2052. // if (res.code == 200) {
  2053. // this.otherDeatils.isEdit = false;
  2054. // this.handleOtherRefresh();
  2055. // }
  2056. // })
  2057. },
  2058. // 保存库存信息
  2059. async handleSaveInventoryEdit(data) {
  2060. console.log(data, '保存库存信息');
  2061. try {
  2062. this.otherDeatils.loading = true;
  2063. let {code,msg} = await materialApi.inventoryEdit(data);
  2064. if (code == 200) {
  2065. this.otherDeatils.isEdit = false;
  2066. this.handleOtherRefresh();
  2067. this.$notify({
  2068. title: '成功',
  2069. message: msg,
  2070. type: 'success'
  2071. });
  2072. }
  2073. } catch (error) {}
  2074. finally{
  2075. this.otherDeatils.loading = false;
  2076. }
  2077. // materialApi.inventoryEdit(data).then(res => {
  2078. // if (res.code == 200) {
  2079. // this.otherDeatils.isEdit = false;
  2080. // this.handleOtherRefresh();
  2081. // }
  2082. // })
  2083. },
  2084. // 保存计划信息
  2085. async handleSavePlan(data) {
  2086. console.log(data, '保存计划信息');
  2087. try {
  2088. this.otherDeatils.loading = true;
  2089. let {code,msg} = await materialApi.planEdit(data);
  2090. if (code == 200) {
  2091. this.otherDeatils.isEdit = false;
  2092. this.handleOtherRefresh();
  2093. this.$notify({
  2094. title: '成功',
  2095. message: msg,
  2096. type: 'success'
  2097. });
  2098. }
  2099. } catch (error) {}
  2100. finally{
  2101. this.otherDeatils.loading = false;
  2102. }
  2103. // materialApi.planEdit(data).then(res => {
  2104. // if (res.code == 200) {
  2105. // this.otherDeatils.isEdit = false;
  2106. // this.handleOtherRefresh();
  2107. // }
  2108. // })
  2109. },
  2110. // 保存成本信息
  2111. async handleSaveCost(data) {
  2112. console.log(data, '保存成本信息');
  2113. try {
  2114. this.otherDeatils.loading = true;
  2115. let {code,msg} = await materialApi.costEdit(data);
  2116. if (code == 200) {
  2117. this.otherDeatils.isEdit = false;
  2118. this.handleOtherRefresh();
  2119. this.$notify({
  2120. title: '成功',
  2121. message: msg,
  2122. type: 'success'
  2123. });
  2124. }
  2125. } catch (error) {}
  2126. finally{
  2127. this.otherDeatils.loading = false;
  2128. }
  2129. // materialApi.costEdit(data).then(res => {
  2130. // if (res.code == 200) {
  2131. // this.otherDeatils.isEdit = false;
  2132. // this.handleOtherRefresh();
  2133. // }
  2134. // })
  2135. },
  2136. judgeIsRequriedByProps(message){
  2137. // condiition:条件,tergetNames:目标porps数组,formName:表单,formRef:表单ref名,
  2138. this[message.formName].form.forEach(formItem => {
  2139. let target = message.tergetNames.filter(t => t === formItem.prop);
  2140. if(target && target.length){
  2141. (formItem.required = message.condiition ? false : true);
  2142. }
  2143. })
  2144. this.rules = initRules(this[message.formName].form);
  2145. this.$nextTick( ()=> {
  2146. message.condiition && this.$refs[message.formRef].clearValidate(message.tergetNames);
  2147. })
  2148. },
  2149. // 重新加载
  2150. async handleRest() {
  2151. this.loading = true;
  2152. // 基本信息
  2153. await this.getTagList('material', async(form) => {
  2154. this.basicData.form = [...form];
  2155. this.rules = initRules(form);
  2156. this.basicData.value = initParams(this.basicData.form,'prop')
  2157. await this.getMaterialDetails(this.materialId, 'material');
  2158. })
  2159. // 医疗行业
  2160. await this.getTagList('material_medcine',async (form) => {
  2161. // form.forEach((item) => {
  2162. // this.medcineData.value[item.prop] = ''
  2163. // })
  2164. this.medcineData.form = [...form];
  2165. this.medcineData.value = initParams(this.medcineData.form,'prop');
  2166. this.medcineRules = initRules(form);
  2167. await this.getMedcineDetails(this.materialId, 'material_medcine');
  2168. })
  2169. },
  2170. },
  2171. watch: {
  2172. // 监听主标签修改标识,控制其他标签是否禁止点击
  2173. 'updateButtonGroup': function (nVal, oVal) {
  2174. console.log(nVal, 'nVal', oVal, 'oVal');
  2175. this.detailsTabs = this.detailsTabs.map(item => {
  2176. item['disabled'] = nVal;
  2177. return item;
  2178. })
  2179. },
  2180. 'maintainNewVersion': function (nVal, oVal) {
  2181. console.log(nVal, 'nVal', oVal, 'oVal');
  2182. this.detailsTabs = this.detailsTabs.map(item => {
  2183. item['disabled'] = nVal;
  2184. return item;
  2185. })
  2186. },
  2187. "basicData.value.isMedicine": {
  2188. handler(nVal, oVal) {
  2189. this.basicData.form = this.basicData.form.map(formItem => {
  2190. if (formItem.prop === 'productionPermit') {
  2191. formItem.required = nVal == '0' ? true : false;
  2192. }
  2193. return formItem;
  2194. })
  2195. },
  2196. deep: true,
  2197. },
  2198. // 通过一级分类判断业务线是否必填
  2199. // "basicData.value.oneClass": {
  2200. // handler(nVal, oVal) {
  2201. // this.basicData.form = this.basicData.form.map(formItem => {
  2202. // if (formItem.prop === "businessLine" && nVal) {
  2203. // if ( nVal.includes('介入耗材&5') || nVal.includes('骨科耗材&2') ||
  2204. // nVal.includes('普通耗材&3') || nVal.includes('医用设备&1') ||
  2205. // nVal.includes('体外诊断&4')) {
  2206. // formItem.required = true
  2207. // } else {
  2208. // formItem.required = false
  2209. // }
  2210. // }
  2211. // return formItem;
  2212. // })
  2213. // },
  2214. // deep: true,
  2215. // },
  2216. // 物料分类改变同时改变一二三级分类
  2217. "basicData.value.classifyId": {
  2218. async handler(nVal, oVal) {
  2219. if(nVal !== oVal){
  2220. try {
  2221. let {code, data } = await getDetail(nVal);
  2222. if( code == 200){
  2223. let {oneClass,twoClass,threeClass} = data;
  2224. this.basicData.value['oneClass'] = oneClass;
  2225. this.basicData.value['twoClass'] = twoClass;
  2226. this.basicData.value['threeClass'] = threeClass;
  2227. }
  2228. } catch (error) {}
  2229. }
  2230. },
  2231. deep: true,
  2232. },
  2233. // 效期管理 expiryDateManagerment 控制 expiryUnitId 效期单位 usefulLife 有效期 usefulLifeUnitId 有效期至单位 必填
  2234. "basicData.value.expiryDateManagerment":{
  2235. handler(nVal, oVal) {
  2236. this.judgeIsRequriedByProps({
  2237. condiition:(nVal === '2'),
  2238. tergetNames:['expiryUnitId','usefulLife','usefulLifeUnitId','recentWarningPeriod'],
  2239. formName:'basicData',
  2240. formRef:'basicMessageRef',
  2241. })
  2242. },
  2243. deep: true,
  2244. },
  2245. },
  2246. created() {
  2247. console.log(this, 'created');
  2248. // 基本信息
  2249. this.handleRest();
  2250. if (window.name === '') {
  2251. this.$route.query.isEdit && this.handleBasicEdit();
  2252. } else {
  2253. console.log('页面被刷新')
  2254. }
  2255. }
  2256. }
  2257. </script>
  2258. <style lang="scss">
  2259. .material-details {
  2260. padding: 12px;
  2261. height: 100%;
  2262. // height: calc(100vh - 158px);
  2263. box-sizing: border-box;
  2264. .el-card__body {
  2265. height: calc(100vh - 40px);
  2266. // height: 100%;
  2267. box-sizing: border-box;
  2268. padding: 12px;
  2269. overflow-y: auto;
  2270. overflow-x: auto;
  2271. .el-select {
  2272. width: 100%;
  2273. }
  2274. }
  2275. .md-content {
  2276. margin-top: 12px;
  2277. // height: calc(100vh - 260px);
  2278. height: calc(100vh - 228px);
  2279. box-sizing: border-box;
  2280. .md-basic {
  2281. overflow: auto;
  2282. .md-main {
  2283. // height: calc(100vh - 625px);
  2284. margin-bottom: 10px;
  2285. .el-table__body {
  2286. // height: calc(100vh - 300px);
  2287. }
  2288. .el-form {
  2289. max-height: 350px;
  2290. overflow-y: auto;
  2291. overflow-x: hidden;
  2292. .redSpan::before {
  2293. content: "* ";
  2294. color: red;
  2295. }
  2296. .el-checkbox {
  2297. padding: 0 58%;
  2298. }
  2299. }
  2300. }
  2301. .md-vice-content {
  2302. height: 140px;
  2303. overflow-y: auto;
  2304. overflow-x: hidden;
  2305. }
  2306. }
  2307. .md-auditInfo {
  2308. .el-divider--horizontal {
  2309. margin: 20px 0px 15px;
  2310. }
  2311. }
  2312. }
  2313. // .md-content>.el-tabs {
  2314. // height: calc(100vh - 280px);
  2315. // }
  2316. .otherDialog {
  2317. .el-collapse-item__content {
  2318. padding-bottom: 12px;
  2319. }
  2320. .el-form {
  2321. .el-checkbox {
  2322. width: 100%;
  2323. padding: 0 10%;
  2324. }
  2325. }
  2326. .el-dialog__body {
  2327. padding: 12px 20px;
  2328. height: 80%;
  2329. overflow: auto;
  2330. }
  2331. .od-msg {
  2332. max-height: 220px;
  2333. box-sizing: border-box;
  2334. overflow-y: auto;
  2335. overflow-x: hidden;
  2336. }
  2337. // .el-dialog__header {
  2338. // background-color: rgb(244, 244, 244);
  2339. // }
  2340. }
  2341. .el-dialog__header {
  2342. background-color: rgb(244, 244, 244);
  2343. }
  2344. .MoreDataDialog {
  2345. .el-dialog__body {
  2346. height: 500px;
  2347. padding: 20px 15px;
  2348. .el-table {
  2349. margin-top: 10px;
  2350. .el-table__body-wrapper {
  2351. height: 300px;
  2352. overflow-y: auto;
  2353. overflow-x: hidden;
  2354. }
  2355. }
  2356. .el-pagination {
  2357. text-align: right;
  2358. margin-top: 5px;
  2359. }
  2360. .referTree {
  2361. height: 390px;
  2362. overflow-x: hidden;
  2363. overflow-y: auto;
  2364. }
  2365. }
  2366. .more-button {
  2367. margin-top: 10px;
  2368. text-align: right;
  2369. }
  2370. }
  2371. }
  2372. // 修改下拉框样式
  2373. #selected {
  2374. /*很关键:将默认的select选择框样式清除*/
  2375. // appearance: none;
  2376. // -moz-appearance: none;
  2377. // -webkit-appearance: none;
  2378. // /*为下拉小箭头留出一点位置,避免被文字覆盖*/
  2379. // padding-right: 14px;
  2380. // /*自定义图片*/
  2381. // background: url("../images/search@2x.png") no-repeat scroll right center transparent;
  2382. // /*自定义图片的大小*/
  2383. // background-size: 16px 16px;
  2384. // /*将小箭头的样式去去掉*/
  2385. // .el-icon-arrow-up:before {
  2386. // content: '';
  2387. // }
  2388. // }
  2389. }
  2390. </style>
  2391. <style scoped>
  2392. .md-content >>> .el-form-item,
  2393. .otherDialog >>> .el-form-item {
  2394. margin-bottom: 10px;
  2395. }
  2396. .md-content >>> .el-tabs--border-card > .el-tabs__content {
  2397. padding-bottom: 8px;
  2398. }
  2399. .md-content .md-auditInfo >>> .el-form-item {
  2400. margin-bottom: 0px;
  2401. }
  2402. .md-main >>> .el-form-item,
  2403. .md-vice >>> .el-form-item,
  2404. .od-msg >>> .el-form-item {
  2405. width: 100%;
  2406. box-sizing: border-box;
  2407. }
  2408. .md-main >>> .el-form-item__label,
  2409. .md-vice >>> .el-form-item__label,
  2410. .od-msg >>> .el-form-item__label {
  2411. width: 40%;
  2412. }
  2413. .od-msg >>> .el-checkbox__input {
  2414. width: 15%;
  2415. }
  2416. .md-main >>> .el-form-item__content,
  2417. .md-vice >>> .el-form-item__content,
  2418. .od-msg >>> .el-form-item__content {
  2419. width: 60%;
  2420. box-sizing: border-box;
  2421. height: 36px;
  2422. }
  2423. .od-msg >>> .el-checkbox__label {
  2424. width: 85%;
  2425. box-sizing: border-box;
  2426. }
  2427. .od-msg-checkedbx >>> .el-form-item__content {
  2428. width: 80%;
  2429. box-sizing: border-box;
  2430. }
  2431. .od-msg-checkedbx >>> .el-checkbox {
  2432. width: 75%;
  2433. box-sizing: border-box;
  2434. }
  2435. .md-content >>> .el-form-item__label,
  2436. .otherDialog >>> .el-form-item__label,
  2437. .od-msg >>> .el-form-item__label,
  2438. .od-msg >>> .el-checkbox__label {
  2439. font-weight: normal;
  2440. /* text-align: left;
  2441. width: 28%; */
  2442. white-space: nowrap;
  2443. /* IE6 需要定义宽度 */
  2444. overflow: hidden;
  2445. -o-text-overflow: ellipsis;
  2446. /* Opera */
  2447. text-overflow: ellipsis;
  2448. /* IE, Safari (WebKit) */
  2449. /* -moz-binding: url('ellipsis.xml#ellipsis'); */
  2450. /* Firefox */
  2451. }
  2452. .otherDialog >>> .el-form-item__label {
  2453. font-size: 12px;
  2454. }
  2455. .md-main >>> .material-table {
  2456. height: 100%;
  2457. }
  2458. .md-vice >>> .material-table {
  2459. height: 140px;
  2460. overflow-y: auto;
  2461. overflow-x: auto;
  2462. }
  2463. >>> .referTree {
  2464. margin-top: 10px;
  2465. }
  2466. /* .md-main>>>.el-table .el-table__body {
  2467. height: calc(100vh - 300px);
  2468. } */
  2469. /* .otherDialog>>>.el-collapse-item__content {
  2470. padding-bottom: 12px;
  2471. }
  2472. .otherDialog>>>.el-dialog__body {
  2473. padding: 12px 20px;
  2474. } */
  2475. </style>