MaterialModal.vue 68 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787
  1. <template>
  2. <j-modal
  3. :title="title"
  4. :width="width"
  5. :visible="visible"
  6. :confirmLoading="confirmLoading"
  7. v-bind:prefixNo="prefixNo"
  8. fullscreen
  9. switchHelp
  10. switchFullscreen
  11. @cancel="handleCancel"
  12. :id="prefixNo"
  13. :style="modalStyle"
  14. >
  15. <template slot="footer">
  16. <a-button key="back" @click="handleCancel">取消</a-button>
  17. <a-button type="primary" v-if="showOkFlag" :loading="confirmLoading" @click="handleOk">保存(Ctrl+S)</a-button>
  18. </template>
  19. <a-spin :spinning="confirmLoading">
  20. <a-form :form="form">
  21. <a-tabs default-active-key="1" size="small">
  22. <a-tab-pane key="1" tab="基本信息" id="materialHeadModal" forceRender>
  23. <a-row class="form-row" :gutter="24">
  24. <a-col :md="6" :sm="24">
  25. <a-form-item
  26. :labelCol="labelCol"
  27. :wrapperCol="wrapperCol"
  28. label="名称"
  29. data-step="1"
  30. data-title="名称"
  31. data-intro="名称必填,可以重复"
  32. >
  33. <a-input
  34. placeholder="请输入名称"
  35. v-decorator.trim="['name', validatorRules.name]"
  36. @change="handleNameChange"
  37. />
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-form-item
  42. :labelCol="labelCol"
  43. :wrapperCol="wrapperCol"
  44. label="规格"
  45. data-step="2"
  46. data-title="规格"
  47. data-intro="规格不必填,比如:10克"
  48. >
  49. <a-input placeholder="请输入规格" v-decorator.trim="['standard', validatorRules.standard]" />
  50. </a-form-item>
  51. </a-col>
  52. <a-col :md="6" :sm="24">
  53. <a-form-item
  54. :labelCol="labelCol"
  55. :wrapperCol="wrapperCol"
  56. label="型号"
  57. data-step="3"
  58. data-title="型号"
  59. data-intro="型号是比规格更小的属性,比如:RX-01"
  60. >
  61. <a-input placeholder="请输入型号" v-decorator.trim="['model', validatorRules.model]" />
  62. </a-form-item>
  63. </a-col>
  64. <a-col :md="6" :sm="24">
  65. <a-form-item
  66. :labelCol="labelCol"
  67. :wrapperCol="wrapperCol"
  68. label="单位"
  69. data-step="4"
  70. data-title="单位"
  71. data-intro="此处支持单个单位和多单位,勾选多单位就可以切换到多单位的下拉框,多单位需要先在【多单位】页面进行录入。
  72. 比如牛奶有瓶和箱两种单位,12瓶=1箱,这就构成了多单位,多单位中有个换算比例"
  73. >
  74. <a-row class="form-row" :gutter="24">
  75. <a-col :lg="15" :md="15" :sm="24" style="padding: 0px 0px 0px 12px">
  76. <a-input
  77. placeholder="输入单位"
  78. v-if="!unitChecked"
  79. v-decorator.trim="['unit', validatorRules.unit]"
  80. @change="onlyUnitOnChange"
  81. />
  82. <a-select
  83. :value="unitList"
  84. placeholder="选择多单位"
  85. v-decorator="['unitId', validatorRules.unitId]"
  86. @change="manyUnitOnChange"
  87. showSearch
  88. optionFilterProp="children"
  89. v-if="unitChecked"
  90. :dropdownMatchSelectWidth="false"
  91. >
  92. <div slot="dropdownRender" slot-scope="menu">
  93. <v-nodes :vnodes="menu" />
  94. <a-divider style="margin: 4px 0" />
  95. <div
  96. style="padding: 4px 8px; cursor: pointer"
  97. @mousedown="(e) => e.preventDefault()"
  98. @click="addUnit"
  99. >
  100. <a-icon type="plus" /> 新增多单位
  101. </div>
  102. </div>
  103. <a-select-option v-for="(item, index) in unitList" :key="index" :value="item.id">
  104. {{ item.name }}
  105. </a-select-option>
  106. </a-select>
  107. </a-col>
  108. <a-col :lg="9" :md="9" :sm="24" style="padding: 0px; text-align: center">
  109. <a-checkbox :checked="unitChecked" @change="unitOnChange">多单位</a-checkbox>
  110. </a-col>
  111. </a-row>
  112. </a-form-item>
  113. </a-col>
  114. </a-row>
  115. <a-row class="form-row" :gutter="24">
  116. <a-col :md="6" :sm="24">
  117. <a-form-item
  118. :labelCol="labelCol"
  119. :wrapperCol="wrapperCol"
  120. label="颜色"
  121. data-step="5"
  122. data-title="颜色"
  123. data-intro="请填写商品的颜色,如果是多属性商品可以不填(下面有多属性开关)"
  124. >
  125. <a-input placeholder="请输入颜色" v-decorator.trim="['color']" />
  126. </a-form-item>
  127. </a-col>
  128. <a-col :md="6" :sm="24">
  129. <a-form-item
  130. :labelCol="labelCol"
  131. :wrapperCol="wrapperCol"
  132. label="品牌"
  133. data-step="6"
  134. data-title="品牌"
  135. data-intro="请填写商品的品牌,方便区别不同品牌的商品"
  136. >
  137. <a-input placeholder="请输入品牌" v-decorator.trim="['brand']" />
  138. </a-form-item>
  139. </a-col>
  140. <a-col :md="6" :sm="24">
  141. <a-form-item
  142. :labelCol="labelCol"
  143. :wrapperCol="wrapperCol"
  144. label="助记码"
  145. data-step="7"
  146. data-title="助记码"
  147. data-intro="助记码自动生成,助记码是商品名称的首字母缩写"
  148. >
  149. <a-input placeholder="" v-decorator.trim="['mnemonic']" :readOnly="true" />
  150. </a-form-item>
  151. </a-col>
  152. <a-col :md="6" :sm="24">
  153. <a-form-item
  154. :labelCol="labelCol"
  155. :wrapperCol="wrapperCol"
  156. label="类别"
  157. data-step="8"
  158. data-title="类别"
  159. data-intro="类别需要在【商品类别】页面进行录入,录入之后在此处进行调用"
  160. >
  161. <a-tree-select
  162. style="width: 100%"
  163. :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
  164. allow-clear
  165. :treeData="categoryTree"
  166. v-decorator="['categoryId', validatorRules.categoryId]"
  167. placeholder="请选择类别"
  168. >
  169. </a-tree-select>
  170. </a-form-item>
  171. </a-col>
  172. </a-row>
  173. <a-row class="form-row" :gutter="24">
  174. <a-col :md="6" :sm="24">
  175. <a-form-item
  176. :labelCol="labelCol"
  177. :wrapperCol="wrapperCol"
  178. label="基础重量"
  179. data-step="9"
  180. data-title="基础重量"
  181. data-intro="请填写基本单位对应的重量,用于计算按重量分摊费用时单据中各行商品分摊的费用成本"
  182. >
  183. <a-input-number style="width: 100%" placeholder="请输入基础重量(kg)" v-decorator.trim="['weight']" />
  184. </a-form-item>
  185. </a-col>
  186. <a-col :md="6" :sm="24">
  187. <a-form-item
  188. :labelCol="labelCol"
  189. :wrapperCol="wrapperCol"
  190. label="序列号"
  191. data-step="10"
  192. data-title="序列号"
  193. data-intro="此处是商品的序列号开关,如果选择了有,则在采购入库单据需要录入该商品的序列号,在销售出库单据需要选择该商品的序列号进行出库"
  194. >
  195. <a-tooltip title="如果选择为有,则在采购入库单需要录入该商品的序列号">
  196. <a-select placeholder="有无序列号" v-decorator="['enableSerialNumber']">
  197. <a-select-option value="1">有</a-select-option>
  198. <a-select-option value="0">无</a-select-option>
  199. </a-select>
  200. </a-tooltip>
  201. </a-form-item>
  202. </a-col>
  203. <a-col :md="6" :sm="24">
  204. <a-form-item
  205. :labelCol="labelCol"
  206. :wrapperCol="wrapperCol"
  207. label="系统SKU"
  208. data-step="11"
  209. data-title="系统SKU"
  210. data-intro="系统SKU"
  211. >
  212. <a-input placeholder="提交后自动生成" disabled v-decorator="['systemSku']" />
  213. </a-form-item>
  214. </a-col>
  215. <a-col :md="6" :sm="24">
  216. <a-form-item
  217. :labelCol="labelCol"
  218. :wrapperCol="wrapperCol"
  219. label="无动销提醒周期"
  220. data-step="12"
  221. data-title="无动销提醒周期"
  222. data-intro="无动销提醒周期"
  223. >
  224. <a-tooltip title="无动销提醒周期">
  225. <a-select placeholder="无动销提醒周期" v-decorator="['movingPinReminderCycle']">
  226. <a-select-option value="一周">一周</a-select-option>
  227. <a-select-option value="两周">两周</a-select-option>
  228. <a-select-option value="一个月">一个月</a-select-option>
  229. <a-select-option value="一季度">一季度</a-select-option>
  230. </a-select>
  231. </a-tooltip>
  232. </a-form-item>
  233. </a-col>
  234. <!-- <a-col :md="6" :sm="24">
  235. <a-form-item
  236. :labelCol="labelCol"
  237. :wrapperCol="wrapperCol"
  238. label="保质期"
  239. data-step="10"
  240. data-title="保质期"
  241. data-intro="保质期指的是商品的保质期(天),主要针对带生产日期的,此类商品一般有批号"
  242. >
  243. <a-input-number style="width: 100%" placeholder="请输入保质期(天)" v-decorator.trim="['expiryNum']" />
  244. </a-form-item>
  245. </a-col>
  246. <a-col :md="6" :sm="24">
  247. <a-form-item
  248. :labelCol="labelCol"
  249. :wrapperCol="wrapperCol"
  250. label="仓位货架"
  251. data-step="11"
  252. data-title="仓位货架"
  253. data-intro="仓位货架指的是仓库中的仓位和货架号,主要适用于仓库较大的场景,方便查找商品的准确位置"
  254. >
  255. <a-input style="width: 100%" placeholder="请输入仓位货架" v-decorator.trim="['position']" />
  256. </a-form-item>
  257. </a-col>
  258. <a-col :md="6" :sm="24">
  259. <a-form-item
  260. :labelCol="labelCol"
  261. :wrapperCol="wrapperCol"
  262. label="制造商"
  263. data-step="12"
  264. data-title="制造商"
  265. data-intro="请填写商品的制造商,一般适用于制造行业"
  266. >
  267. <a-input placeholder="请输入制造商" v-decorator.trim="['mfrs']" />
  268. </a-form-item>
  269. </a-col> -->
  270. </a-row>
  271. <!-- <a-row class="form-row" :gutter="24">
  272. <a-col :md="6" :sm="24">
  273. <a-form-item
  274. :labelCol="labelCol"
  275. :wrapperCol="wrapperCol"
  276. label="批号"
  277. data-step="14"
  278. data-title="批号"
  279. data-intro="此处是商品的批号开关,如果选择了有,则在采购入库单据需要录入该商品的批号和有效期,在销售出库单据需要选择该商品的批号进行出库"
  280. >
  281. <a-tooltip title="如果选择为有,则在采购入库单需要录入该商品的批号和有效期">
  282. <a-select placeholder="有无批号" v-decorator="['enableBatchNumber']">
  283. <a-select-option value="1">有</a-select-option>
  284. <a-select-option value="0">无</a-select-option>
  285. </a-select>
  286. </a-tooltip>
  287. </a-form-item>
  288. </a-col>
  289. <a-col :md="6" :sm="24" v-if="!model.id">
  290. <a-form-item
  291. :labelCol="labelCol"
  292. :wrapperCol="wrapperCol"
  293. label="多属性"
  294. data-step="13"
  295. data-title="多属性"
  296. data-intro="多属性是针对的sku商品(比如服装、鞋帽行业),此处开关如果启用就可以在下方进行多sku的配置,配置具体的颜色、尺码之类的组合"
  297. >
  298. <a-tooltip title="多属性针对服装、鞋帽等行业,需要先录入单位才能激活此处输入框">
  299. <a-tag class="tag-info" v-if="!manySkuStatus">需要先录入单位才能激活</a-tag>
  300. <a-select
  301. mode="multiple"
  302. v-decorator="['manySku']"
  303. showSearch
  304. optionFilterProp="children"
  305. placeholder="请选择多属性(可多选)"
  306. @change="onManySkuChange"
  307. v-show="manySkuStatus"
  308. >
  309. <a-select-option
  310. v-for="(item, index) in materialAttributeList"
  311. :key="index"
  312. :value="item.value"
  313. :disabled="item.disabled"
  314. >
  315. {{ item.name }}
  316. </a-select-option>
  317. </a-select>
  318. </a-tooltip>
  319. </a-form-item>
  320. </a-col>
  321. </a-row> -->
  322. <a-row class="form-row" :gutter="24">
  323. <a-col :md="12" :sm="24" v-if="manySkuSelected >= 1">
  324. <a-form-item
  325. :labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
  326. :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
  327. :label="skuOneTitle"
  328. >
  329. <a-select
  330. mode="multiple"
  331. v-decorator="['skuOne']"
  332. showSearch
  333. optionFilterProp="children"
  334. placeholder="请选择(可多选)"
  335. @select="onSkuChange"
  336. @deselect="onSkuOneDeSelect"
  337. >
  338. <a-select-option v-for="(item, index) in skuOneList" :key="index" :value="item.value">
  339. {{ item.name }}
  340. </a-select-option>
  341. </a-select>
  342. </a-form-item>
  343. </a-col>
  344. <a-col :md="12" :sm="24" v-if="manySkuSelected >= 2">
  345. <a-form-item
  346. :labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
  347. :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
  348. :label="skuTwoTitle"
  349. >
  350. <a-select
  351. mode="multiple"
  352. v-decorator="['skuTwo']"
  353. showSearch
  354. optionFilterProp="children"
  355. placeholder="请选择(可多选)"
  356. @select="onSkuChange"
  357. @deselect="onSkuTwoDeSelect"
  358. >
  359. <a-select-option v-for="(item, index) in skuTwoList" :key="index" :value="item.value">
  360. {{ item.name }}
  361. </a-select-option>
  362. </a-select>
  363. </a-form-item>
  364. </a-col>
  365. <a-col :md="12" :sm="24" v-if="manySkuSelected >= 3">
  366. <a-form-item
  367. :labelCol="{ xs: { span: 24 }, sm: { span: 4 } }"
  368. :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
  369. :label="skuThreeTitle"
  370. >
  371. <a-select
  372. mode="multiple"
  373. v-decorator="['skuThree']"
  374. showSearch
  375. optionFilterProp="children"
  376. placeholder="请选择(可多选)"
  377. @select="onSkuChange"
  378. @deselect="onSkuThreeDeSelect"
  379. >
  380. <a-select-option v-for="(item, index) in skuThreeList" :key="index" :value="item.value">
  381. {{ item.name }}
  382. </a-select-option>
  383. </a-select>
  384. </a-form-item>
  385. </a-col>
  386. </a-row>
  387. <div style="margin-top: 8px" id="materialDetailModal">
  388. <j-editable-table
  389. ref="editableMeTable"
  390. :loading="meTable.loading"
  391. :columns="meTable.columns"
  392. :dataSource="meTable.dataSource"
  393. :height="300"
  394. :minWidth="1000"
  395. :maxHeight="300"
  396. :rowNumber="false"
  397. :rowSelection="true"
  398. :actionButton="true"
  399. @valueChange="onValueChange"
  400. @added="onAdded"
  401. @deleted="onDeleted"
  402. >
  403. <template #supplierId="{ handleChange, value }">
  404. <a-select
  405. placeholder="请选择供应商"
  406. v-decorator="['supplierId']"
  407. :dropdownMatchSelectWidth="false"
  408. showSearch
  409. optionFilterProp="children"
  410. :value="value"
  411. @change="($event) => handleChange($event)"
  412. >
  413. <div slot="dropdownRender" slot-scope="menu">
  414. <v-nodes :vnodes="menu" />
  415. <a-divider style="margin: 4px 0" />
  416. <div
  417. style="padding: 4px 8px; cursor: pointer"
  418. @mousedown="(e) => e.preventDefault()"
  419. @click="addVendor"
  420. >
  421. <a-icon type="plus" /> 新增供应商
  422. </div>
  423. </div>
  424. <a-select-option v-for="(item, index) in supList" :key="index" :value="item.id">
  425. {{ item.supplier }}
  426. </a-select-option>
  427. </a-select>
  428. </template>
  429. <template #depotId="{ handleChange, value }">
  430. <a-select
  431. placeholder="请选择仓库名称"
  432. v-decorator="['depotId']"
  433. :dropdownMatchSelectWidth="false"
  434. showSearch
  435. optionFilterProp="children"
  436. :value="value"
  437. @change="($event) => handleChange($event)"
  438. >
  439. <div slot="dropdownRender" slot-scope="menu">
  440. <v-nodes :vnodes="menu" />
  441. <a-divider style="margin: 4px 0" />
  442. <div
  443. style="padding: 4px 8px; cursor: pointer"
  444. @mousedown="(e) => e.preventDefault()"
  445. @click="addDepot"
  446. >
  447. <a-icon type="plus" /> 新增仓库
  448. </div>
  449. </div>
  450. <a-select-option v-for="(item, index) in depotList" :key="index" :value="item.value">
  451. {{ item.text }}
  452. </a-select-option>
  453. </a-select>
  454. </template>
  455. <template #buttonAfter>
  456. <a-button @click="batchSetPrice('purchase')">采购价-批量</a-button>
  457. <a-button style="margin-left: 8px" @click="batchSetPrice('commodity')">零售价-批量</a-button>
  458. <a-button style="margin-left: 8px" @click="batchSetPrice('wholesale')">销售价-批量</a-button>
  459. <a-button style="margin-left: 8px" @click="batchSetPrice('low')">最低售价-批量</a-button>
  460. </template>
  461. </j-editable-table>
  462. <!-- 表单区域 -->
  463. <batch-set-price-modal ref="priceModalForm" @ok="batchSetPriceModalFormOk"></batch-set-price-modal>
  464. </div>
  465. <a-row class="form-row" :gutter="24">
  466. <a-col :lg="24" :md="24" :sm="24">
  467. <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }" label="">
  468. <a-textarea :rows="1" placeholder="请输入备注" v-decorator="['remark']" style="margin-top: 8px" />
  469. </a-form-item>
  470. </a-col>
  471. </a-row>
  472. </a-tab-pane>
  473. <a-tab-pane key="2" tab="扩展信息" forceRender>
  474. <a-row v-if="mpShort.otherField1.enabled" class="form-row" :gutter="24">
  475. <a-col :lg="6" :md="6" :sm="6">
  476. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="mpShort.otherField1.name">
  477. <a-input v-decorator.trim="['otherField1']" />
  478. </a-form-item>
  479. </a-col>
  480. </a-row>
  481. <a-row v-if="mpShort.otherField2.enabled" class="form-row" :gutter="24">
  482. <a-col :lg="6" :md="6" :sm="6">
  483. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="mpShort.otherField2.name">
  484. <a-input v-decorator.trim="['otherField2']" />
  485. </a-form-item>
  486. </a-col>
  487. </a-row>
  488. <a-row v-if="mpShort.otherField3.enabled" class="form-row" :gutter="24">
  489. <a-col :lg="6" :md="6" :sm="6">
  490. <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="mpShort.otherField3.name">
  491. <a-input v-decorator.trim="['otherField3']" />
  492. </a-form-item>
  493. </a-col>
  494. </a-row>
  495. </a-tab-pane>
  496. <a-tab-pane key="3" tab="库存数量" forceRender>
  497. <j-editable-table
  498. ref="editableDepotTable"
  499. :loading="depotTable.loading"
  500. :columns="depotTable.columns"
  501. :dataSource="depotTable.dataSource"
  502. :minWidth="1000"
  503. :maxHeight="300"
  504. :rowNumber="true"
  505. :rowSelection="false"
  506. :actionButton="false"
  507. >
  508. <template #buttonAfter>
  509. <a-button style="margin: 0px 0px 8px 0px" @click="batchSetStock('initStock')">期初库存-批量</a-button>
  510. <a-button style="margin-left: 8px" @click="batchSetStock('lowSafeStock')">最低安全库存-批量</a-button>
  511. <a-button style="margin-left: 8px" @click="batchSetStock('highSafeStock')">最高安全库存-批量</a-button>
  512. </template>
  513. </j-editable-table>
  514. <!-- 表单区域 -->
  515. <batch-set-stock-modal ref="stockModalForm" @ok="batchSetStockModalFormOk"></batch-set-stock-modal>
  516. </a-tab-pane>
  517. <a-tab-pane key="4" tab="图片信息" forceRender>
  518. <a-row class="form-row" :gutter="24" style="padding-top: 20px">
  519. <a-col :lg="18" :md="18" :sm="24">
  520. <a-form-item
  521. :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }"
  522. :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
  523. label="图片信息"
  524. >
  525. <j-image-upload v-model="fileList" bizPath="material" text="上传" isMultiple></j-image-upload>
  526. </a-form-item>
  527. </a-col>
  528. <a-col :lg="6" :md="6" :sm="24"></a-col>
  529. </a-row>
  530. <a-row class="form-row" :gutter="24">
  531. <a-col :lg="18" :md="18" :sm="24">
  532. <a-form-item
  533. :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }"
  534. :wrapperCol="{ xs: { span: 24 }, sm: { span: 20 } }"
  535. label="上传提示"
  536. >
  537. 图片最多4张,且单张大小不超过1M
  538. </a-form-item>
  539. </a-col>
  540. <a-col :lg="6" :md="6" :sm="24"></a-col>
  541. </a-row>
  542. </a-tab-pane>
  543. </a-tabs>
  544. </a-form>
  545. </a-spin>
  546. <!-- 供应商modal -->
  547. <vendor-modal ref="vendorModalForm" @ok="vendorModalFormOk"></vendor-modal>
  548. <!-- 仓库modal -->
  549. <depot-modal ref="depotModalForm" @ok="depotModalFormOk"></depot-modal>
  550. <unit-modal ref="unitModalForm" @ok="unitModalFormOk"></unit-modal>
  551. </j-modal>
  552. </template>
  553. <script>
  554. import pick from 'lodash.pick'
  555. import BatchSetPriceModal from './BatchSetPriceModal'
  556. import BatchSetStockModal from './BatchSetStockModal'
  557. import UnitModal from '../../system/modules/UnitModal'
  558. import VendorModal from '@/views//system/modules/VendorModal'
  559. import DepotModal from '@/views//system/modules/DepotModal'
  560. import JEditableTable from '@/components/jeecg/JEditableTable'
  561. import { FormTypes, getRefPromise, VALIDATE_NO_PASSED, validateFormAndTables } from '@/utils/JEditableTableUtil'
  562. import {
  563. checkMaterial,
  564. checkMaterialBarCode,
  565. getMaterialAttributeNameList,
  566. getMaterialAttributeValueListById,
  567. getMaxBarCode,
  568. queryMaterialCategoryTreeList,
  569. changeNameToPinYin,
  570. } from '@/api/api'
  571. import { removeByVal, autoJumpNextInput, handleIntroJs } from '@/utils/util'
  572. import { getAction, httpAction } from '@/api/manage'
  573. import JImageUpload from '@/components/jeecg/JImageUpload'
  574. import JDate from '@/components/jeecg/JDate'
  575. import Vue from 'vue'
  576. import { MaterialModalMixins } from '../mixins/MaterialModalMixins'
  577. export default {
  578. name: 'MaterialModal',
  579. mixins: [MaterialModalMixins],
  580. components: {
  581. BatchSetPriceModal,
  582. BatchSetStockModal,
  583. UnitModal,
  584. VendorModal,
  585. DepotModal,
  586. JImageUpload,
  587. JDate,
  588. JEditableTable,
  589. VNodes: {
  590. functional: true,
  591. render: (h, ctx) => ctx.props.vnodes,
  592. },
  593. },
  594. data() {
  595. return {
  596. title: '操作',
  597. width: '1300px',
  598. visible: false,
  599. modalStyle: '',
  600. categoryTree: [],
  601. unitList: [],
  602. depotList: [],
  603. fileList: [],
  604. unitStatus: false,
  605. manyUnitStatus: true,
  606. unitChecked: false,
  607. manySkuStatus: false,
  608. switchDisabled: false, //开关的启用状态
  609. barCodeSwitch: false, //生成条码开关
  610. maxBarCodeInfo: '', //最大条码
  611. meDeleteIdList: [], //删除条码信息的id数组
  612. prefixNo: 'material',
  613. materialAttributeList: [],
  614. skuOneTitle: '属性1',
  615. skuTwoTitle: '属性2',
  616. skuThreeTitle: '属性3',
  617. skuOneList: [],
  618. skuTwoList: [],
  619. skuThreeList: [],
  620. manySkuSelected: 0,
  621. model: {},
  622. showOkFlag: true,
  623. setTimeFlag: null,
  624. labelCol: {
  625. xs: { span: 24 },
  626. sm: { span: 8 },
  627. },
  628. wrapperCol: {
  629. xs: { span: 24 },
  630. sm: { span: 16 },
  631. },
  632. mpShort: {
  633. mfrs: {},
  634. otherField1: {},
  635. otherField2: {},
  636. otherField3: {},
  637. },
  638. meTable: {
  639. loading: false,
  640. dataSource: [],
  641. columns: [
  642. {
  643. title: '批次号',
  644. // key: 'barCode',
  645. key: 'batchNumber',
  646. width: '15%',
  647. type: FormTypes.input,
  648. disabled: true,
  649. defaultValue: '',
  650. placeholder: '自动生成',
  651. // validateRules: [
  652. // { required: true, message: '${title}不能为空' },
  653. // { pattern: /^.{4,40}$/, message: '长度为4到40位' },
  654. // { handler: this.validateBarCode },
  655. // ],
  656. },
  657. {
  658. title: '单位',
  659. key: 'commodityUnit',
  660. width: '8%',
  661. type: FormTypes.input,
  662. disabled: true,
  663. defaultValue: '',
  664. placeholder: '请输入${title}',
  665. // validateRules: [{ required: true, message: '${title}不能为空' }],
  666. },
  667. {
  668. title: '多属性',
  669. key: 'sku',
  670. width: '25%',
  671. type: FormTypes.input,
  672. defaultValue: '',
  673. readonly: true,
  674. placeholder: '请输入${title}',
  675. },
  676. {
  677. title: '采购价',
  678. key: 'purchaseDecimal',
  679. width: '9%',
  680. type: FormTypes.inputNumber,
  681. defaultValue: '',
  682. placeholder: '请输入${title}',
  683. },
  684. {
  685. title: '零售价',
  686. key: 'commodityDecimal',
  687. width: '9%',
  688. type: FormTypes.inputNumber,
  689. defaultValue: '',
  690. placeholder: '请输入${title}',
  691. },
  692. {
  693. title: '销售价',
  694. key: 'wholesaleDecimal',
  695. width: '9%',
  696. type: FormTypes.inputNumber,
  697. defaultValue: '',
  698. placeholder: '请输入${title}',
  699. },
  700. {
  701. title: '最低售价',
  702. key: 'lowDecimal',
  703. width: '9%',
  704. type: FormTypes.inputNumber,
  705. defaultValue: '',
  706. placeholder: '请输入${title}',
  707. },
  708. {
  709. title: '生产日期',
  710. key: 'productionDate',
  711. width: '12%',
  712. type: FormTypes.date,
  713. defaultValue: '',
  714. placeholder: '请选择${title}',
  715. },
  716. {
  717. title: '保质期(天)',
  718. key: 'expiryNum',
  719. width: '9%',
  720. type: FormTypes.inputNumber,
  721. defaultValue: '',
  722. placeholder: '请输入${title}',
  723. },
  724. {
  725. title: '供应商',
  726. key: 'supplierId',
  727. width: '12%',
  728. type: FormTypes.slot,
  729. slotName: 'supplierId',
  730. defaultValue: '',
  731. placeholder: '请选择${title}',
  732. },
  733. {
  734. title: '商品条码',
  735. key: 'barCode',
  736. width: '12%',
  737. type: FormTypes.input,
  738. defaultValue: '',
  739. placeholder: '请输入${title}',
  740. },
  741. {
  742. title: '库存(最小单位)',
  743. key: 'inventory',
  744. width: '9%',
  745. type: FormTypes.inputNumber,
  746. defaultValue: '',
  747. placeholder: '请输入${title}',
  748. },
  749. {
  750. title: '仓库名称',
  751. key: 'depotId',
  752. width: '10%',
  753. type: FormTypes.slot,
  754. slotName: 'depotId',
  755. defaultValue: '',
  756. placeholder: '请选择${title}',
  757. },
  758. {
  759. title: '仓位货架',
  760. key: 'position',
  761. width: '9%',
  762. type: FormTypes.input,
  763. defaultValue: '',
  764. placeholder: '请输入${title}',
  765. },
  766. ],
  767. },
  768. depotTable: {
  769. loading: false,
  770. dataSource: [],
  771. columns: [
  772. {
  773. title: '仓库',
  774. key: 'name',
  775. width: '15%',
  776. type: FormTypes.normal,
  777. },
  778. {
  779. title: '期初库存数量',
  780. key: 'initStock',
  781. width: '15%',
  782. type: FormTypes.inputNumber,
  783. defaultValue: '',
  784. placeholder: '请输入${title}',
  785. },
  786. {
  787. title: '最低安全库存数量',
  788. key: 'lowSafeStock',
  789. width: '15%',
  790. type: FormTypes.inputNumber,
  791. defaultValue: '',
  792. placeholder: '请输入${title}',
  793. },
  794. {
  795. title: '最高安全库存数量',
  796. key: 'highSafeStock',
  797. width: '15%',
  798. type: FormTypes.inputNumber,
  799. defaultValue: '',
  800. placeholder: '请输入${title}',
  801. },
  802. ],
  803. },
  804. confirmLoading: false,
  805. form: this.$form.createForm(this),
  806. validatorRules: {
  807. name: {
  808. rules: [
  809. { required: true, message: '请输入名称!' },
  810. { max: 100, message: '长度请小于100个字符', trigger: 'blur' },
  811. ],
  812. },
  813. standard: {
  814. rules: [{ max: 100, message: '长度请小于100个字符', trigger: 'blur' }],
  815. },
  816. categoryId: {
  817. rules: [{ required: true, message: '请选择类别!' }],
  818. },
  819. model: {
  820. rules: [{ max: 100, message: '长度请小于100个字符', trigger: 'blur' }],
  821. },
  822. unit: {
  823. rules: [{ required: true, message: '请输入单位!' }],
  824. },
  825. unitId: {
  826. rules: [{ required: true, message: '请选择多单位!' }],
  827. },
  828. },
  829. url: {
  830. add: '/material/add',
  831. edit: '/material/update',
  832. materialsExtendList: '/materialsExtend/getDetailList',
  833. depotWithStock: '/depot/getAllListWithStock',
  834. },
  835. }
  836. },
  837. created() {
  838. this.loadParseMaterialProperty()
  839. let realScreenWidth = window.screen.width
  840. this.width = realScreenWidth < 1500 ? '1200px' : '1400px'
  841. this.initSelectOpts()
  842. },
  843. mounted() {
  844. document.getElementById(this.prefixNo).addEventListener('keydown', this.handleOkKey)
  845. },
  846. beforeDestroy() {
  847. document.getElementById(this.prefixNo).removeEventListener('keydown', this.handleOkKey)
  848. },
  849. methods: {
  850. // 快捷键
  851. handleOkKey(e) {
  852. const key = window.event.keyCode ? window.event.keyCode : window.event.which
  853. if (key === 83 && e.ctrlKey) {
  854. //保存 CTRL+S
  855. this.handleOk()
  856. e.preventDefault()
  857. }
  858. },
  859. // 获取所有的editableTable实例
  860. getAllTable() {
  861. return Promise.all([getRefPromise(this, 'editableMeTable'), getRefPromise(this, 'editableDepotTable')])
  862. },
  863. add() {
  864. //隐藏多属性
  865. this.meTable.columns[2].type = FormTypes.hidden
  866. // 默认新增一条数据
  867. this.getAllTable().then((editableTables) => {
  868. editableTables[0].add()
  869. })
  870. this.edit({})
  871. this.$nextTick(() => {
  872. handleIntroJs('material', 11)
  873. })
  874. },
  875. edit(record) {
  876. this.form.resetFields()
  877. this.model = Object.assign({}, record)
  878. this.activeKey = '1'
  879. this.manySkuSelected = 0
  880. this.barCodeSwitch = false
  881. this.manySkuStatus = false
  882. this.maxBarCodeInfo = ''
  883. this.visible = true
  884. this.meDeleteIdList = []
  885. this.modalStyle = 'top:20px;height: 95%;'
  886. if (JSON.stringify(record) === '{}') {
  887. this.fileList = []
  888. } else {
  889. setTimeout(() => {
  890. this.fileList = record.imgName
  891. }, 5)
  892. }
  893. this.$nextTick(() => {
  894. this.form.setFieldsValue(
  895. pick(
  896. this.model,
  897. 'name',
  898. 'standard',
  899. 'unit',
  900. 'unitId',
  901. 'model',
  902. 'color',
  903. 'brand',
  904. 'mnemonic',
  905. 'categoryId',
  906. 'enableSerialNumber',
  907. 'movingPinReminderCycle',
  908. 'systemSku',
  909. 'weight',
  910. 'remark',
  911. 'otherField1',
  912. 'otherField2',
  913. 'otherField3'
  914. )
  915. )
  916. autoJumpNextInput('materialHeadModal')
  917. autoJumpNextInput('materialDetailModal')
  918. })
  919. this.initMaterialAttribute()
  920. this.loadTreeData()
  921. this.loadUnitListData()
  922. // 加载子表数据
  923. if (this.model.id) {
  924. //禁用多属性开关
  925. this.switchDisabled = true
  926. // 判断是否是多单位
  927. if (this.model.unit) {
  928. this.unitChecked = false
  929. this.unitStatus = false
  930. this.manyUnitStatus = true
  931. } else {
  932. this.unitChecked = true
  933. this.unitStatus = true
  934. this.manyUnitStatus = false
  935. }
  936. let params = { materialId: this.model.id }
  937. //编辑商品的时候多属性字段可以修改
  938. this.meTable.columns[2].readonly = false
  939. this.requestMeTableData(this.url.materialsExtendList, params, this.meTable)
  940. this.requestDepotTableData(this.url.depotWithStock, { mId: this.model.id }, this.depotTable)
  941. } else {
  942. this.switchDisabled = false
  943. this.meTable.columns[2].readonly = true
  944. this.requestDepotTableData(this.url.depotWithStock, { mId: 0 }, this.depotTable)
  945. }
  946. },
  947. /** 查询条码tab的数据 */
  948. requestMeTableData(url, params, tab) {
  949. tab.loading = true
  950. getAction(url, params)
  951. .then((res) => {
  952. for (let i = 0; i < res.data.rows.length; i++) {
  953. if (res.data.rows[i].sku) {
  954. this.meTable.columns[2].type = FormTypes.input
  955. } else {
  956. this.meTable.columns[2].type = FormTypes.hidden
  957. }
  958. }
  959. tab.dataSource = res.data.rows || []
  960. console.log('tab.dataSource-----', tab.dataSource)
  961. })
  962. .finally(() => {
  963. tab.loading = false
  964. })
  965. },
  966. /** 查询仓库tab的数据 */
  967. requestDepotTableData(url, params, tab) {
  968. tab.loading = true
  969. getAction(url, params)
  970. .then((res) => {
  971. tab.dataSource = res.data || []
  972. console.log('====================', res.data)
  973. })
  974. .finally(() => {
  975. tab.loading = false
  976. })
  977. },
  978. close() {
  979. this.$emit('close')
  980. this.visible = false
  981. this.modalStyle = ''
  982. this.unitStatus = false
  983. this.manyUnitStatus = true
  984. this.unitChecked = false
  985. this.getAllTable().then((editableTables) => {
  986. editableTables[0].initialize()
  987. editableTables[1].initialize()
  988. })
  989. },
  990. handleOk() {
  991. this.validateFields()
  992. },
  993. handleCancel() {
  994. this.close()
  995. },
  996. /** 触发表单验证 */
  997. validateFields() {
  998. this.getAllTable()
  999. .then((tables) => {
  1000. /** 一次性验证主表和所有的次表 */
  1001. return validateFormAndTables(this.form, tables)
  1002. })
  1003. .then((allValues) => {
  1004. let formData = this.classifyIntoFormData(allValues)
  1005. formData.sortList = []
  1006. if (formData.unit === undefined) {
  1007. formData.unit = ''
  1008. }
  1009. if (formData.unitId === undefined) {
  1010. formData.unitId = ''
  1011. }
  1012. if (this.unitChecked) {
  1013. formData.unit = ''
  1014. } else {
  1015. formData.unitId = ''
  1016. }
  1017. // 发起请求
  1018. return this.requestAddOrEdit(formData)
  1019. })
  1020. .catch((e) => {
  1021. if (e.error === VALIDATE_NO_PASSED) {
  1022. // 如果有未通过表单验证的子表,就自动跳转到它所在的tab
  1023. this.activeKey = e.index == null ? this.activeKey : (e.index + 1).toString()
  1024. } else {
  1025. console.error(e)
  1026. }
  1027. })
  1028. },
  1029. /** 整理成formData */
  1030. classifyIntoFormData(allValues) {
  1031. let materialMain = Object.assign(this.model, allValues.formValue)
  1032. return {
  1033. ...materialMain, // 展开
  1034. meList: allValues.tablesValue[0].values,
  1035. stock: allValues.tablesValue[1].values,
  1036. }
  1037. },
  1038. /** 发起新增或修改的请求 */
  1039. requestAddOrEdit(formData) {
  1040. console.log('formData------------', formData)
  1041. if (formData.meList.length === 0) {
  1042. this.$message.warning('抱歉,请输入条码信息!')
  1043. return
  1044. }
  1045. if (formData.enableSerialNumber === '1' && formData.enableBatchNumber === '1') {
  1046. this.$message.warning('抱歉,序列号和批号只能选择一项!')
  1047. return
  1048. }
  1049. //校验商品是否存在,通过校验商品的名称、型号、规格、颜色、单位、制造商等
  1050. let param = {
  1051. id: this.model.id ? this.model.id : 0,
  1052. name: this.model.name,
  1053. model: this.parseParam(this.model.model),
  1054. color: this.parseParam(this.model.color),
  1055. standard: this.parseParam(this.model.standard),
  1056. mfrs: this.parseParam(this.model.mfrs),
  1057. otherField1: this.parseParam(this.model.otherField1),
  1058. otherField2: this.parseParam(this.model.otherField2),
  1059. otherField3: this.parseParam(this.model.otherField3),
  1060. unit: this.parseParam(this.model.unit),
  1061. unitId: this.parseParam(this.model.unitId),
  1062. }
  1063. checkMaterial(param).then((res) => {
  1064. if (res && res.code === 200) {
  1065. if (res.data.status) {
  1066. this.$message.warning('抱歉,该商品已存在!')
  1067. return
  1068. } else {
  1069. //进一步校验单位
  1070. let basicUnit = '',
  1071. otherUnit = '',
  1072. otherUnitTwo = '',
  1073. otherUnitThree = ''
  1074. if (formData.unitId) {
  1075. let unitArr = this.unitList
  1076. for (let i = 0; i < unitArr.length; i++) {
  1077. if (unitArr[i].id == formData.unitId) {
  1078. basicUnit = unitArr[i].basicUnit
  1079. otherUnit = unitArr[i].otherUnit
  1080. if (unitArr[i].otherUnitTwo) {
  1081. otherUnitTwo = unitArr[i].otherUnitTwo
  1082. }
  1083. if (unitArr[i].otherUnitThree) {
  1084. otherUnitThree = unitArr[i].otherUnitThree
  1085. }
  1086. }
  1087. }
  1088. }
  1089. // if (!formData.unit) {
  1090. // // 此时为多单位
  1091. // if (formData.meList.length < 2) {
  1092. // this.$message.warning('多单位的商品条码行数至少要有两行,请再新增一行条码信息!')
  1093. // return
  1094. // }
  1095. // if (formData.meList[0].commodityUnit != basicUnit) {
  1096. // this.$message.warning(
  1097. // '条码之后的单位填写有误,单位【' +
  1098. // formData.meList[0].commodityUnit +
  1099. // '】请修改为【' +
  1100. // basicUnit +
  1101. // '】!'
  1102. // )
  1103. // return
  1104. // }
  1105. // if (formData.meList[1].commodityUnit != otherUnit) {
  1106. // this.$message.warning(
  1107. // '条码之后的单位填写有误,单位【' +
  1108. // formData.meList[1].commodityUnit +
  1109. // '】请修改为【' +
  1110. // otherUnit +
  1111. // '】!'
  1112. // )
  1113. // return
  1114. // }
  1115. // }
  1116. let skuCount = 0
  1117. for (let i = 0; i < formData.meList.length; i++) {
  1118. // let commodityUnit = formData.meList[i].commodityUnit
  1119. // if (formData.unit) {
  1120. // if (commodityUnit != formData.unit) {
  1121. // this.$message.warning(
  1122. // '条码之后的单位填写有误,单位【' + commodityUnit + '】请修改为【' + formData.unit + '】!'
  1123. // )
  1124. // return
  1125. // }
  1126. // } else if (formData.unitId) {
  1127. // if (
  1128. // commodityUnit != basicUnit &&
  1129. // commodityUnit != otherUnit &&
  1130. // commodityUnit != otherUnitTwo &&
  1131. // commodityUnit != otherUnitThree
  1132. // ) {
  1133. // let warnInfo =
  1134. // '条码之后的单位填写有误,单位【' +
  1135. // commodityUnit +
  1136. // '】请修改为【' +
  1137. // basicUnit +
  1138. // '】或【' +
  1139. // otherUnit +
  1140. // '】'
  1141. // if (otherUnitTwo) {
  1142. // warnInfo += '或【' + otherUnitTwo + '】'
  1143. // }
  1144. // if (otherUnitThree) {
  1145. // warnInfo += '或【' + otherUnitThree + '】'
  1146. // }
  1147. // warnInfo += '!'
  1148. // this.$message.warning(warnInfo)
  1149. // return
  1150. // }
  1151. // }
  1152. if (formData.sku) {
  1153. skuCount++
  1154. }
  1155. }
  1156. //对最低和最高安全库存进行校验
  1157. for (let i = 0; i < formData.stock.length; i++) {
  1158. let depotStockObj = formData.stock[i]
  1159. if (skuCount && depotStockObj.initStock && depotStockObj.initStock - 0) {
  1160. this.$message.warning('抱歉,多属性商品不能录入期初库存,建议进行盘点录入!')
  1161. return
  1162. }
  1163. if (formData.enableSerialNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
  1164. this.$message.warning('抱歉,序列号商品不能录入期初库存,建议进行入库单据录入!')
  1165. return
  1166. }
  1167. if (formData.enableBatchNumber === '1' && depotStockObj.initStock && depotStockObj.initStock - 0) {
  1168. this.$message.warning('抱歉,批号商品不能录入期初库存,建议进行入库单据录入!')
  1169. return
  1170. }
  1171. if (depotStockObj.lowSafeStock && depotStockObj.highSafeStock) {
  1172. if (depotStockObj.lowSafeStock - 0 > depotStockObj.highSafeStock - 0) {
  1173. this.$message.warning('抱歉,' + depotStockObj.name + '的最低安全库存大于最高安全库存!')
  1174. return
  1175. }
  1176. }
  1177. }
  1178. //图片校验
  1179. if (this.fileList && this.fileList.length > 0) {
  1180. formData.imgName = this.fileList
  1181. let fileArr = this.fileList.split(',')
  1182. if (fileArr.length > 4) {
  1183. this.$message.warning('抱歉,商品图片不能超过4张!')
  1184. return
  1185. }
  1186. } else {
  1187. formData.imgName = ''
  1188. }
  1189. formData.meDeleteIdList = this.meDeleteIdList
  1190. //接口调用
  1191. let url = this.url.add,
  1192. method = 'post'
  1193. if (this.model.id) {
  1194. url = this.url.edit
  1195. method = 'put'
  1196. }
  1197. const that = this
  1198. this.confirmLoading = true
  1199. httpAction(url, formData, method)
  1200. .then((res) => {
  1201. if (res.code === 200) {
  1202. that.$emit('ok')
  1203. that.confirmLoading = false
  1204. that.close()
  1205. } else {
  1206. that.$message.warning(res.data.message)
  1207. that.confirmLoading = false
  1208. }
  1209. })
  1210. .finally(() => {})
  1211. }
  1212. }
  1213. })
  1214. },
  1215. parseParam(param) {
  1216. return param ? param : ''
  1217. },
  1218. validateBarCode(type, value, row, column, callback, target) {
  1219. let params = {
  1220. barCode: value,
  1221. id: row.id.length >= 20 ? 0 : row.id,
  1222. }
  1223. checkMaterialBarCode(params).then((res) => {
  1224. if (res && res.code === 200) {
  1225. if (!res.data.status) {
  1226. callback(true)
  1227. } else {
  1228. callback(false, '该条码已经存在')
  1229. }
  1230. } else {
  1231. callback(false, res.data)
  1232. }
  1233. })
  1234. },
  1235. loadTreeData() {
  1236. let that = this
  1237. let params = {}
  1238. params.id = ''
  1239. queryMaterialCategoryTreeList(params).then((res) => {
  1240. if (res) {
  1241. that.categoryTree = []
  1242. for (let i = 0; i < res.length; i++) {
  1243. let temp = res[i]
  1244. that.categoryTree.push(temp)
  1245. }
  1246. }
  1247. })
  1248. },
  1249. loadUnitListData() {
  1250. let that = this
  1251. let params = {}
  1252. params.currentPage = 1
  1253. params.pageSize = 100
  1254. getAction('/unit/getAllList', params).then((res) => {
  1255. if (res) {
  1256. that.unitList = res.data
  1257. }
  1258. })
  1259. },
  1260. onManySkuChange(value) {
  1261. this.manySkuSelected = value.length
  1262. //控制多属性下拉框中选择项的状态
  1263. if (value.length < 3) {
  1264. this.materialAttributeList.forEach((item, index, array) => {
  1265. array.indexOf(item.value) === -1 ? Vue.set(array[index], 'disabled', false) : ''
  1266. })
  1267. } else {
  1268. this.materialAttributeList.forEach((item, index, array) => {
  1269. value.indexOf(item.value) === -1 ? Vue.set(array[index], 'disabled', true) : ''
  1270. })
  1271. }
  1272. //更新属性1和属性2和属性3的下拉框
  1273. if (value.length <= 3) {
  1274. let skuOneId = value[0]
  1275. let skuTwoId = value[1]
  1276. let skuThreeId = value[2]
  1277. this.materialAttributeList.forEach((item) => {
  1278. if (item.value === skuOneId) {
  1279. this.skuOneTitle = item.name
  1280. }
  1281. if (item.value === skuTwoId) {
  1282. this.skuTwoTitle = item.name
  1283. }
  1284. if (item.value === skuThreeId) {
  1285. this.skuThreeTitle = item.name
  1286. }
  1287. })
  1288. if (skuOneId) {
  1289. getMaterialAttributeValueListById({ id: skuOneId }).then((res) => {
  1290. this.skuOneList = res ? res : []
  1291. })
  1292. }
  1293. if (skuTwoId) {
  1294. getMaterialAttributeValueListById({ id: skuTwoId }).then((res) => {
  1295. this.skuTwoList = res ? res : []
  1296. })
  1297. }
  1298. if (skuThreeId) {
  1299. getMaterialAttributeValueListById({ id: skuThreeId }).then((res) => {
  1300. this.skuThreeList = res ? res : []
  1301. })
  1302. }
  1303. }
  1304. //控制条码列表中的多属性列
  1305. if (value.length > 0) {
  1306. this.meTable.columns[2].type = FormTypes.input
  1307. } else {
  1308. this.meTable.columns[2].type = FormTypes.hidden
  1309. }
  1310. this.barCodeSwitch = false
  1311. this.meTable.dataSource = []
  1312. },
  1313. onSkuChange() {
  1314. let skuOneData = this.form.getFieldValue('skuOne')
  1315. let skuTwoData = this.form.getFieldValue('skuTwo')
  1316. let skuThreeData = this.form.getFieldValue('skuThree')
  1317. this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
  1318. },
  1319. onSkuOneDeSelect(value) {
  1320. let skuOneData = this.form.getFieldValue('skuOne')
  1321. let skuTwoData = this.form.getFieldValue('skuTwo')
  1322. let skuThreeData = this.form.getFieldValue('skuThree')
  1323. removeByVal(skuOneData, value)
  1324. this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
  1325. },
  1326. onSkuTwoDeSelect(value) {
  1327. let skuOneData = this.form.getFieldValue('skuOne')
  1328. let skuTwoData = this.form.getFieldValue('skuTwo')
  1329. let skuThreeData = this.form.getFieldValue('skuThree')
  1330. removeByVal(skuTwoData, value)
  1331. this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
  1332. },
  1333. onSkuThreeDeSelect(value) {
  1334. let skuOneData = this.form.getFieldValue('skuOne')
  1335. let skuTwoData = this.form.getFieldValue('skuTwo')
  1336. let skuThreeData = this.form.getFieldValue('skuThree')
  1337. removeByVal(skuThreeData, value)
  1338. this.autoSkuList(skuOneData, skuTwoData, skuThreeData)
  1339. },
  1340. autoSkuList(skuOneData, skuTwoData, skuThreeData) {
  1341. let unit = this.form.getFieldValue('unit')
  1342. if (unit) {
  1343. //计算多属性已经选择了几个
  1344. let skuArr = []
  1345. if (this.getNumByField('skuOne')) {
  1346. skuArr.push(skuOneData)
  1347. }
  1348. if (this.getNumByField('skuTwo')) {
  1349. skuArr.push(skuTwoData)
  1350. }
  1351. if (this.getNumByField('skuThree')) {
  1352. skuArr.push(skuThreeData)
  1353. }
  1354. let skuArrOne = skuArr[0]
  1355. let skuArrTwo = skuArr[1]
  1356. let skuArrThree = skuArr[2]
  1357. let count = this.getNumByField('skuOne') + this.getNumByField('skuTwo') + this.getNumByField('skuThree')
  1358. let barCodeSku = []
  1359. if (count === 1) {
  1360. let skuArrOnly = []
  1361. if (this.getNumByField('skuOne')) {
  1362. skuArrOnly = skuOneData
  1363. } else if (this.getNumByField('skuTwo')) {
  1364. skuArrOnly = skuTwoData
  1365. } else if (this.getNumByField('skuThree')) {
  1366. skuArrOnly = skuThreeData
  1367. }
  1368. for (let i = 0; i < skuArrOnly.length; i++) {
  1369. barCodeSku.push(skuArrOnly[i])
  1370. }
  1371. } else if (count === 2) {
  1372. for (let i = 0; i < skuArrOne.length; i++) {
  1373. for (let j = 0; j < skuArrTwo.length; j++) {
  1374. barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j])
  1375. }
  1376. }
  1377. } else if (count === 3) {
  1378. for (let i = 0; i < skuArrOne.length; i++) {
  1379. for (let j = 0; j < skuArrTwo.length; j++) {
  1380. for (let k = 0; k < skuArrThree.length; k++) {
  1381. barCodeSku.push(skuArrOne[i] + '/' + skuArrTwo[j] + '/' + skuArrThree[k])
  1382. }
  1383. }
  1384. }
  1385. }
  1386. let meTableData = []
  1387. getMaxBarCode({}).then((res) => {
  1388. if (res && res.code === 200) {
  1389. let maxBarCode = res.data.barCode - 0
  1390. for (let i = 0; i < barCodeSku.length; i++) {
  1391. let currentBarCode = maxBarCode + i + 1
  1392. meTableData.push({ barCode: currentBarCode, commodityUnit: unit, sku: barCodeSku[i] })
  1393. }
  1394. this.meTable.dataSource = meTableData
  1395. }
  1396. })
  1397. } else {
  1398. this.$message.warning('请填写单位(注意不要勾选多单位)')
  1399. this.barCodeSwitch = false
  1400. }
  1401. },
  1402. getNumByField(field) {
  1403. let num = 0
  1404. if (this.form.getFieldValue(field)) {
  1405. if (this.form.getFieldValue(field).length > 0) {
  1406. num = 1
  1407. }
  1408. }
  1409. return num
  1410. },
  1411. onAdded(event) {
  1412. const { row, target } = event
  1413. let formUnit = ''
  1414. // 勾选多单位
  1415. if(this.unitChecked){
  1416. const obj = this.unitList.find(item => item.id === this.form.getFieldValue('unitId'))
  1417. if(obj){
  1418. formUnit = obj.basicUnit
  1419. }
  1420. }else{
  1421. formUnit = this.form.getFieldValue('unit')
  1422. }
  1423. target.setValues([{ rowKey: row.id, values: { barCode: '', commodityUnit: formUnit } }])
  1424. },
  1425. onDeleted(value) {
  1426. this.meDeleteIdList = value
  1427. },
  1428. //单元值改变一个字符就触发一次
  1429. onValueChange(event) {
  1430. console.log('onValueChange--------table-change', event)
  1431. const { type, row, column, value, target } = event
  1432. switch (column.key) {
  1433. case 'purchaseDecimal':
  1434. case 'commodityDecimal':
  1435. case 'wholesaleDecimal':
  1436. case 'lowDecimal':
  1437. this.changeDecimalByValue(row)
  1438. break
  1439. }
  1440. },
  1441. //修改商品明细中的价格触发计算
  1442. changeDecimalByValue(row) {
  1443. let unitArr = this.unitList
  1444. let basicUnit = '',
  1445. otherUnit = '',
  1446. ratio = 1,
  1447. otherUnitTwo = '',
  1448. ratioTwo = 1,
  1449. otherUnitThree = '',
  1450. ratioThree = 1
  1451. for (let i = 0; i < unitArr.length; i++) {
  1452. if (unitArr[i].id === this.form.getFieldValue('unitId')) {
  1453. basicUnit = unitArr[i].basicUnit
  1454. otherUnit = unitArr[i].otherUnit
  1455. ratio = unitArr[i].ratio
  1456. if (unitArr[i].otherUnitTwo) {
  1457. otherUnitTwo = unitArr[i].otherUnitTwo
  1458. ratioTwo = unitArr[i].ratioTwo
  1459. }
  1460. if (unitArr[i].otherUnitThree) {
  1461. otherUnitThree = unitArr[i].otherUnitThree
  1462. ratioThree = unitArr[i].ratioThree
  1463. }
  1464. }
  1465. }
  1466. if (row.commodityUnit === basicUnit) {
  1467. this.$refs.editableMeTable.getValues((error, values) => {
  1468. let mArr = values,
  1469. basicPurchaseDecimal = '',
  1470. basicCommodityDecimal = '',
  1471. basicWholesaleDecimal = '',
  1472. basicLowDecimal = ''
  1473. for (let i = 0; i < mArr.length; i++) {
  1474. let mInfo = mArr[i]
  1475. if (i === 0) {
  1476. basicPurchaseDecimal = mInfo.purchaseDecimal
  1477. basicCommodityDecimal = mInfo.commodityDecimal
  1478. basicWholesaleDecimal = mInfo.wholesaleDecimal
  1479. basicLowDecimal = mInfo.lowDecimal
  1480. } else {
  1481. //副单位进行换算
  1482. if (basicPurchaseDecimal) {
  1483. mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
  1484. }
  1485. if (basicCommodityDecimal) {
  1486. mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
  1487. }
  1488. if (basicWholesaleDecimal) {
  1489. mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
  1490. }
  1491. if (basicLowDecimal) {
  1492. mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
  1493. }
  1494. if (otherUnitTwo && i === 2) {
  1495. if (basicPurchaseDecimal) {
  1496. mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
  1497. }
  1498. if (basicCommodityDecimal) {
  1499. mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
  1500. }
  1501. if (basicWholesaleDecimal) {
  1502. mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
  1503. }
  1504. if (basicLowDecimal) {
  1505. mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
  1506. }
  1507. }
  1508. if (otherUnitThree && i === 3) {
  1509. if (basicPurchaseDecimal) {
  1510. mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
  1511. }
  1512. if (basicCommodityDecimal) {
  1513. mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
  1514. }
  1515. if (basicWholesaleDecimal) {
  1516. mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
  1517. }
  1518. if (basicLowDecimal) {
  1519. mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
  1520. }
  1521. }
  1522. }
  1523. }
  1524. this.meTable.dataSource = mArr
  1525. })
  1526. }
  1527. },
  1528. batchSetPrice(type) {
  1529. if (this.manySkuSelected > 0 || this.model.id) {
  1530. this.$refs.priceModalForm.add(type)
  1531. this.$refs.priceModalForm.disableSubmit = false
  1532. } else {
  1533. this.$message.warning('抱歉,只有开启多属性才能进行批量操作!')
  1534. }
  1535. },
  1536. batchSetStock(type) {
  1537. this.$refs.stockModalForm.add(type)
  1538. this.$refs.stockModalForm.disableSubmit = false
  1539. },
  1540. batchSetPriceModalFormOk(price, batchType) {
  1541. let arr = this.meTable.dataSource
  1542. if (arr.length === 0) {
  1543. this.$message.warning('请先录入条码、单位等信息!')
  1544. } else {
  1545. let meTableData = []
  1546. for (let i = 0; i < arr.length; i++) {
  1547. let meInfo = {
  1548. barCode: arr[i].barCode,
  1549. commodityUnit: arr[i].commodityUnit,
  1550. sku: arr[i].sku,
  1551. purchaseDecimal: arr[i].purchaseDecimal,
  1552. commodityDecimal: arr[i].commodityDecimal,
  1553. wholesaleDecimal: arr[i].wholesaleDecimal,
  1554. lowDecimal: arr[i].lowDecimal,
  1555. }
  1556. if (batchType === 'purchase') {
  1557. meInfo.purchaseDecimal = price - 0
  1558. } else if (batchType === 'commodity') {
  1559. meInfo.commodityDecimal = price - 0
  1560. } else if (batchType === 'wholesale') {
  1561. meInfo.wholesaleDecimal = price - 0
  1562. } else if (batchType === 'low') {
  1563. meInfo.lowDecimal = price - 0
  1564. }
  1565. if (arr[i].id) {
  1566. meInfo.id = arr[i].id
  1567. }
  1568. meTableData.push(meInfo)
  1569. }
  1570. this.meTable.dataSource = meTableData
  1571. }
  1572. },
  1573. batchSetStockModalFormOk(stock, batchType) {
  1574. let arr = this.depotTable.dataSource
  1575. let depotTableData = []
  1576. for (let i = 0; i < arr.length; i++) {
  1577. let depotInfo = {
  1578. name: arr[i].name,
  1579. initStock: arr[i].initStock,
  1580. lowSafeStock: arr[i].lowSafeStock,
  1581. highSafeStock: arr[i].highSafeStock,
  1582. }
  1583. if (batchType === 'initStock') {
  1584. depotInfo.initStock = stock - 0
  1585. } else if (batchType === 'lowSafeStock') {
  1586. depotInfo.lowSafeStock = stock - 0
  1587. } else if (batchType === 'highSafeStock') {
  1588. depotInfo.highSafeStock = stock - 0
  1589. }
  1590. if (arr[i].id) {
  1591. depotInfo.id = arr[i].id
  1592. }
  1593. depotTableData.push(depotInfo)
  1594. }
  1595. this.depotTable.dataSource = depotTableData
  1596. },
  1597. initMaterialAttribute() {
  1598. getMaterialAttributeNameList().then((res) => {
  1599. if (res) {
  1600. this.materialAttributeList = res
  1601. }
  1602. })
  1603. },
  1604. loadParseMaterialProperty() {
  1605. let mpList = Vue.ls.get('materialPropertyList')
  1606. for (let i = 0; i < mpList.length; i++) {
  1607. if (mpList[i].nativeName === '制造商') {
  1608. this.mpShort.mfrs.name = mpList[i].anotherName
  1609. this.mpShort.mfrs.enabled = mpList[i].enabled
  1610. }
  1611. if (mpList[i].nativeName === '自定义1') {
  1612. this.mpShort.otherField1.name = mpList[i].anotherName
  1613. this.mpShort.otherField1.enabled = mpList[i].enabled
  1614. }
  1615. if (mpList[i].nativeName === '自定义2') {
  1616. this.mpShort.otherField2.name = mpList[i].anotherName
  1617. this.mpShort.otherField2.enabled = mpList[i].enabled
  1618. }
  1619. if (mpList[i].nativeName === '自定义3') {
  1620. this.mpShort.otherField3.name = mpList[i].anotherName
  1621. this.mpShort.otherField3.enabled = mpList[i].enabled
  1622. }
  1623. }
  1624. },
  1625. handleNameChange(e) {
  1626. let that = this
  1627. if (e.target.value) {
  1628. if (this.setTimeFlag != null) {
  1629. clearTimeout(this.setTimeFlag)
  1630. }
  1631. this.setTimeFlag = setTimeout(() => {
  1632. changeNameToPinYin({ name: e.target.value }).then((res) => {
  1633. if (res && res.code === 200) {
  1634. that.form.setFieldsValue({ mnemonic: res.data })
  1635. } else {
  1636. that.$message.warning(res.data)
  1637. }
  1638. })
  1639. }, 500)
  1640. } else {
  1641. that.form.setFieldsValue({ mnemonic: '' })
  1642. }
  1643. },
  1644. onlyUnitOnChange(e) {
  1645. if (e.target.value) {
  1646. //单位有填写了之后则显示多属性的文本框
  1647. this.manySkuStatus = true
  1648. } else {
  1649. this.manySkuStatus = false
  1650. }
  1651. this.$refs.editableMeTable.getValues((error, values) => {
  1652. let mArr = values
  1653. for (let i = 0; i < mArr.length; i++) {
  1654. let mInfo = mArr[i]
  1655. mInfo.commodityUnit = e.target.value
  1656. }
  1657. this.meTable.dataSource = mArr
  1658. })
  1659. },
  1660. manyUnitOnChange(value) {
  1661. let unitArr = this.unitList
  1662. let basicUnit = '',
  1663. otherUnit = '',
  1664. ratio = 1,
  1665. otherUnitTwo = '',
  1666. ratioTwo = 1,
  1667. otherUnitThree = '',
  1668. ratioThree = 1
  1669. for (let i = 0; i < unitArr.length; i++) {
  1670. if (unitArr[i].id === value) {
  1671. basicUnit = unitArr[i].basicUnit
  1672. otherUnit = unitArr[i].otherUnit
  1673. ratio = unitArr[i].ratio
  1674. if (unitArr[i].otherUnitTwo) {
  1675. otherUnitTwo = unitArr[i].otherUnitTwo
  1676. ratioTwo = unitArr[i].ratioTwo
  1677. }
  1678. if (unitArr[i].otherUnitThree) {
  1679. otherUnitThree = unitArr[i].otherUnitThree
  1680. ratioThree = unitArr[i].ratioThree
  1681. }
  1682. }
  1683. }
  1684. this.$refs.editableMeTable.getValues((error, values) => {
  1685. let mArr = values,
  1686. basicPurchaseDecimal = '',
  1687. basicCommodityDecimal = '',
  1688. basicWholesaleDecimal = '',
  1689. basicLowDecimal = ''
  1690. for (let i = 0; i < mArr.length; i++) {
  1691. let mInfo = mArr[i]
  1692. mInfo.commodityUnit = basicUnit
  1693. if (i === 0) {
  1694. // mInfo.commodityUnit = basicUnit
  1695. basicPurchaseDecimal = mInfo.purchaseDecimal
  1696. basicCommodityDecimal = mInfo.commodityDecimal
  1697. basicWholesaleDecimal = mInfo.wholesaleDecimal
  1698. basicLowDecimal = mInfo.lowDecimal
  1699. } else {
  1700. //副单位进行换算
  1701. // mInfo.commodityUnit = otherUnit
  1702. if (basicPurchaseDecimal) {
  1703. mInfo.purchaseDecimal = (basicPurchaseDecimal * ratio).toFixed(2)
  1704. }
  1705. if (basicCommodityDecimal) {
  1706. mInfo.commodityDecimal = (basicCommodityDecimal * ratio).toFixed(2)
  1707. }
  1708. if (basicWholesaleDecimal) {
  1709. mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratio).toFixed(2)
  1710. }
  1711. if (basicLowDecimal) {
  1712. mInfo.lowDecimal = (basicLowDecimal * ratio).toFixed(2)
  1713. }
  1714. if (otherUnitTwo && i === 2) {
  1715. // mInfo.commodityUnit = otherUnitTwo
  1716. if (basicPurchaseDecimal) {
  1717. mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioTwo).toFixed(2)
  1718. }
  1719. if (basicCommodityDecimal) {
  1720. mInfo.commodityDecimal = (basicCommodityDecimal * ratioTwo).toFixed(2)
  1721. }
  1722. if (basicWholesaleDecimal) {
  1723. mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioTwo).toFixed(2)
  1724. }
  1725. if (basicLowDecimal) {
  1726. mInfo.lowDecimal = (basicLowDecimal * ratioTwo).toFixed(2)
  1727. }
  1728. }
  1729. if (otherUnitThree && i === 3) {
  1730. // mInfo.commodityUnit = otherUnitThree
  1731. if (basicPurchaseDecimal) {
  1732. mInfo.purchaseDecimal = (basicPurchaseDecimal * ratioThree).toFixed(2)
  1733. }
  1734. if (basicCommodityDecimal) {
  1735. mInfo.commodityDecimal = (basicCommodityDecimal * ratioThree).toFixed(2)
  1736. }
  1737. if (basicWholesaleDecimal) {
  1738. mInfo.wholesaleDecimal = (basicWholesaleDecimal * ratioThree).toFixed(2)
  1739. }
  1740. if (basicLowDecimal) {
  1741. mInfo.lowDecimal = (basicLowDecimal * ratioThree).toFixed(2)
  1742. }
  1743. }
  1744. }
  1745. }
  1746. this.meTable.dataSource = mArr
  1747. })
  1748. },
  1749. unitOnChange(e) {
  1750. let isChecked = e.target.checked
  1751. if (isChecked) {
  1752. this.unitStatus = true
  1753. this.manyUnitStatus = false
  1754. this.unitChecked = true
  1755. } else {
  1756. this.unitStatus = false
  1757. this.manyUnitStatus = true
  1758. this.unitChecked = false
  1759. }
  1760. },
  1761. addUnit() {
  1762. this.$refs.unitModalForm.add()
  1763. this.$refs.unitModalForm.title = '新增多单位'
  1764. this.$refs.unitModalForm.disableSubmit = false
  1765. },
  1766. unitModalFormOk() {
  1767. this.loadUnitListData()
  1768. },
  1769. },
  1770. }
  1771. </script>
  1772. <style scoped>
  1773. .input-table {
  1774. max-width: 100%;
  1775. min-width: 1200px;
  1776. }
  1777. .tag-info {
  1778. font-size: 14px;
  1779. height: 32px;
  1780. line-height: 32px;
  1781. width: 100%;
  1782. padding: 0px 11px;
  1783. color: #bbb;
  1784. background-color: #ffffff;
  1785. }
  1786. </style>