stockInOrderAdd.vue 48KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb v-if="type == 1" :crumbs='crumbs'></bread-crumb>
  5. <bread-crumb v-if="type == 2" :crumbs='crumbs2'></bread-crumb>
  6. <div style="float:right;">
  7. <el-button size="small" @click="back()" class="filter-item">取 消</el-button>
  8. <el-button size="small" type="primary" @click="submit()" class="filter-item" v-loading="loading">保 存</el-button>
  9. <el-button size="small" type="primary" v-show="showCheck" @click="toCheck()" class="filter-item">审 核</el-button>
  10. <!-- <el-button size="small" type="primary" v-show="showReturnCheck" @click="toReturnCheck()" class="filter-item">反 审 核</el-button> -->
  11. </div>
  12. </div>
  13. <div class="app-container" v-loading="loading">
  14. <stock-in-dialog ref="dialog" :propForm="propForm"
  15. :visibility="isVisibility"
  16. v-on:dialog-comfirm="comfirm"
  17. v-on:dialog-cancle="cancle">
  18. </stock-in-dialog>
  19. <div class="cell clearfix">
  20. <label class="title"><span class="name"><span style="color:red">*</span>仓库</span> :</label>
  21. <el-select size="small" v-model="storehouse_id" filterable placeholder="请选择仓库" style="width:200px">
  22. <el-option
  23. v-for="(option, index) in list"
  24. :key="index"
  25. :label="option.storehouse_name"
  26. :value="option.id">
  27. </el-option>
  28. </el-select>
  29. <label class="title"><span class="name">入库时间</span> : </label>
  30. <el-date-picker size="small" v-model="warehousing_time" prefix-icon="el-icon-date" :editable="false"
  31. style="width: 196px;" type="date" placeholder="选择日期时间" align="right" format="yyyy-MM-dd"
  32. value-format="yyyy-MM-dd"></el-date-picker>
  33. </div>
  34. <el-form :rules="tableRules" :model="recordInfo" ref="tableForm">
  35. <el-table id="oictable" :data="recordInfo.recordData" :class="signAndWeighBoxPatients" border
  36. style="width: 100%"
  37. max-height="450" :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)'}"
  38. >
  39. <el-table-column align="center" width="200" fixed="left">
  40. <template slot="header" slot-scope="scope">
  41. <span>耗材名称</span>
  42. </template>
  43. <template slot-scope="scope">
  44. <el-autocomplete
  45. class="checkSearch"
  46. popper-class="my-autocomplete"
  47. v-model="scope.row.good_name"
  48. :fetch-suggestions="querySearchAsync"
  49. :trigger-on-focus="true"
  50. placeholder="请输入耗材名称"
  51. @select="handleSelect"
  52. @input="changeGoodName(scope.$index)"
  53. style="width:160px;"
  54. :popper-append-to-body="true"
  55. >
  56. <i class="el-icon-search el-input__icon" slot="suffix"></i>
  57. <template slot-scope="{ item }">
  58. <div class="name">{{ item.good_name +" " +item.specification_name + " "+item.manufacturer }}</div>
  59. </template>
  60. </el-autocomplete>
  61. </template>
  62. </el-table-column>
  63. <el-table-column align="center" width="140">
  64. <template slot="header" slot-scope="scope">
  65. <span>耗材类型<span style="color: red">*</span></span>
  66. </template>
  67. <template slot-scope="scope">
  68. <el-form-item style="padding-top: 20px;">
  69. <el-input placeholder="请输入耗材类型" v-model="scope.row.good_type_id" :value="typeName(scope.row.good_type_id)"></el-input>
  70. </el-form-item>
  71. </template>
  72. </el-table-column>
  73. <el-table-column align="center" width="140">
  74. <template slot="header" slot-scope="scope">
  75. <span>规格&单位<span style="color: red">*</span></span>
  76. </template>
  77. <template slot-scope="scope">
  78. <el-form-item style="padding-top: 20px">
  79. <el-input placeholder="请输入规格名称" v-model="scope.row.name"></el-input>
  80. </el-form-item>
  81. </template>
  82. </el-table-column>
  83. <el-table-column align="center" width="150">
  84. <template slot="header" slot-scope="scope">
  85. <span>批号<span style="color: red">*</span></span>
  86. </template>
  87. <template slot-scope="scope">
  88. <el-form-item style="padding-top: 20px" :prop="'recordData.' + scope.$index + '.number'"
  89. :rules='tableRules.number' >
  90. <el-input placeholder="请输入批号" v-model="scope.row.number"></el-input>
  91. </el-form-item>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" width="120">
  95. <template slot="header" slot-scope="scope">
  96. <span>入库数量<span style="color: red">*</span></span>
  97. </template>
  98. <template slot-scope="scope">
  99. <el-form-item :prop="'recordData.' + scope.$index + '.warehousing_count'"
  100. :rules='tableRules.warehousing_count' style="padding-top: 20px">
  101. <!-- <el-input placeholder="请输入入库数量" type="number" v-model="scope.row.warehousing_count" oninput="value=value.replace(/\D|^0/g,'')"></el-input> -->
  102. <el-input placeholder="请输入入库数量" v-model="scope.row.warehousing_count"></el-input>
  103. {{scope.row.min_unit}}
  104. </el-form-item>
  105. </template>
  106. </el-table-column>
  107. <el-table-column align="center" width="200">
  108. <template slot="header" slot-scope="scope">
  109. <span>当前溯源码数量</span>
  110. </template>
  111. <template slot-scope="scope">
  112. <el-form-item
  113. :prop="'recordData.' + scope.$index + '.good_code_cnt'"
  114. style="padding-top: 10px"
  115. >
  116. <div style="display: flex">
  117. <el-input
  118. placeholder="请输入入库数量"
  119. v-model="scope.row.good_code_cnt"
  120. style="width: 120px"
  121. disabled
  122. ></el-input>
  123. </div>
  124. </el-form-item>
  125. </template>
  126. </el-table-column>
  127. <el-table-column align="center" width="100">
  128. <template slot="header" slot-scope="scope">
  129. <span>拆零次数</span>
  130. </template>
  131. <template slot-scope="scope">
  132. <el-form-item
  133. style="padding-top: 10px"
  134. >
  135. <div style="display: flex">
  136. <el-input
  137. type="number"
  138. placeholder="请输入入库数量"
  139. v-model="scope.row.split_of_number"
  140. style="width: 100px"
  141. ></el-input>
  142. </div>
  143. </el-form-item>
  144. </template>
  145. </el-table-column>
  146. <el-table-column align="center" width="120">
  147. <template slot="header" slot-scope="scope">
  148. <span>零售价<span style="color: red">*</span></span>
  149. </template>
  150. <template slot-scope="scope">
  151. <el-form-item :prop="'recordData.' + scope.$index + '.packing_price'" :rules='tableRules.packing_price'
  152. style="padding-top: 20px">
  153. <el-input placeholder="请输入单价" type="number" v-model="scope.row.packing_price"></el-input>
  154. </el-form-item>
  155. </template>
  156. </el-table-column>
  157. <el-table-column align="center" width="120">
  158. <template slot="header" slot-scope="scope">
  159. <span>进货单价<span style="color: red">*</span></span>
  160. </template>
  161. <template slot-scope="scope">
  162. <el-form-item :prop="'recordData.' + scope.$index + '.price'" :rules='tableRules.price'
  163. style="padding-top: 20px">
  164. <el-input placeholder="请输入单价" type="number" v-model="scope.row.price"></el-input>
  165. </el-form-item>
  166. </template>
  167. </el-table-column>
  168. <el-table-column label="总价" align="center" width="80">
  169. <template slot-scope="scope">
  170. {{calculate(scope.row.price*scope.row.warehousing_count)}}
  171. </template>
  172. </el-table-column>
  173. <el-table-column align="center" width="180">
  174. <template slot="header" slot-scope="scope">
  175. <span>有效日期<span style="color: red">*</span></span>
  176. </template>
  177. <template slot-scope="scope">
  178. <el-form-item :prop="'recordData.' + scope.$index + '.expiry_date'"
  179. :rules="tableRules.expiry_date">
  180. <el-date-picker prefix-icon="el-icon-date" style="width: 145px" v-model="scope.row.expiry_date"
  181. type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
  182. value-format="yyyy-MM-dd">
  183. </el-date-picker>
  184. </el-form-item>
  185. </template>
  186. </el-table-column>
  187. <el-table-column label="生产日期" align="center" width="180">
  188. <template slot-scope="scope">
  189. <el-date-picker prefix-icon="el-icon-date" v-model="scope.row.product_date" style="width: 145px"
  190. type="date" placeholder="选择日期时间" format="yyyy-MM-dd"
  191. value-format="yyyy-MM-dd">
  192. </el-date-picker>
  193. </template>
  194. </el-table-column>
  195. <el-table-column label="生产厂家" align="center" width="150">
  196. <template slot-scope="scope">
  197. <el-select size="small" v-model="scope.row.manufacturer" filterable placeholder="请选择厂商">
  198. <el-option
  199. v-for="(option, index) in manufacturerList"
  200. :key="index"
  201. :label="option.manufacturer_name"
  202. :value="option.id">
  203. </el-option>
  204. </el-select>
  205. </template>
  206. </el-table-column>
  207. <el-table-column align="center" width="150" v-if="org_id!=10653&&org_id!=0">
  208. <template slot="header" slot-scope="scope">
  209. <span>批准文号</span>
  210. </template>
  211. <template slot-scope="scope">
  212. <el-form-item style="padding-top: 20px">
  213. <el-input placeholder="请输入批准文号" v-model="scope.row.license_number" ></el-input>
  214. </el-form-item>
  215. </template>
  216. </el-table-column>
  217. <el-table-column align="center" width="150" v-if="org_id ==10653 || org_id == 0">
  218. <template slot="header" slot-scope="scope">
  219. <span>生产许可证号</span>
  220. </template>
  221. <template slot-scope="scope">
  222. <el-form-item style="padding-top: 20px">
  223. <el-input placeholder="请输入生产许可证号" v-model="scope.row.license_number" ></el-input>
  224. </el-form-item>
  225. </template>
  226. </el-table-column>
  227. <el-table-column align="center" width="150">
  228. <template slot="header" slot-scope="scope">
  229. <span>注册编码</span>
  230. </template>
  231. <template slot-scope="scope">
  232. <el-form-item style="padding-top: 20px">
  233. <el-input placeholder="请输入注册编码" v-model="scope.row.register_number" ></el-input>
  234. </el-form-item>
  235. </template>
  236. </el-table-column>
  237. <el-table-column label="经销商" align="center" width="150">
  238. <template slot-scope="scope">
  239. <el-select size="small" v-model="scope.row.dealer" filterable placeholder="请选择厂商">
  240. <el-option
  241. v-for="(option, index) in dealerList"
  242. :key="index"
  243. :label="option.dealer_name"
  244. :value="option.id">
  245. </el-option>
  246. </el-select>
  247. </template>
  248. </el-table-column>
  249. <el-table-column label="耗材追溯码" align="center" width="150">
  250. <template slot-scope="scope">
  251. <div @click="changeGoodCode(scope.row,scope.$index)">
  252. <el-input v-model="scope.row.good_code" placeholder="请输入耗材追溯码"></el-input>
  253. </div>
  254. </template>
  255. </el-table-column>
  256. <el-table-column label="追溯码数量" align="center" width="150">
  257. <template slot-scope="scope">
  258. {{ getGoodCode(scope.row.good_code) }}
  259. </template>
  260. </el-table-column>
  261. <el-table-column label="备注" align="center" width="150">
  262. <template slot-scope="scope">
  263. <el-input placeholder="请输入备注" v-model="scope.row.remark"></el-input>
  264. </template>
  265. </el-table-column>
  266. <el-table-column label="操作" align="center" fixed="right" width="150">
  267. <template slot-scope="scope">
  268. <el-tooltip class="item" effect="dark" content="新增" placement="top">
  269. <el-button
  270. size="mini"
  271. type="primary"
  272. icon="el-icon-circle-plus-outline"
  273. @click="handleEdit(scope.$index, scope.row)">
  274. </el-button>
  275. </el-tooltip>
  276. <el-tooltip class="item" effect="dark" content="删除" placement="top">
  277. <el-button
  278. size="mini"
  279. type="danger"
  280. icon="el-icon-delete"
  281. @click="handleDelete(scope.$index, scope.row)">
  282. </el-button>
  283. </el-tooltip>
  284. </template>
  285. </el-table-column>
  286. </el-table>
  287. <div style="margin-top: 20px;">合计金额: {{getTotalPirce() }} </div>
  288. </el-form>
  289. </div>
  290. <el-dialog
  291. title="耗材追溯码"
  292. @open="openDialog"
  293. :visible.sync="dialogVisible"
  294. width="40%">
  295. <div style="margin-bottom: 10px;">
  296. <span >追溯码个数:{{getTotal() }} 个</span>
  297. </div>
  298. <span>
  299. <el-input
  300. ref="inputRef"
  301. inputmode="verbatim"
  302. @keyup.native="changeText"
  303. @paste.native.prevent="handlePaste"
  304. type="textarea"
  305. placeholder="请输入内容"
  306. v-model="textarea"
  307. :rows="10"
  308. >
  309. </el-input>
  310. </span>
  311. <span slot="footer" class="dialog-footer">
  312. <el-button @click="dialogVisible = false">取 消</el-button>
  313. <el-button type="primary" @click="saveTextArea()">确 定</el-button>
  314. </span>
  315. </el-dialog>
  316. <el-dialog
  317. title="重复值警告"
  318. :visible.sync="showDuplicateAlert"
  319. width="30%"
  320. append-to-body>
  321. <div v-for="(item, index) in duplicateList" :key="index">
  322. <el-alert
  323. :title="`重复值: ${item.value} (出现 ${item.count} 次)`"
  324. type="error"
  325. :closable="false"
  326. show-icon>
  327. </el-alert>
  328. </div>
  329. <span slot="footer" class="dialog-footer">
  330. <el-button type="primary" @click="showDuplicateAlert = false">我知道了</el-button>
  331. </span>
  332. </el-dialog>
  333. <el-dialog
  334. title="重复值警告"
  335. :visible.sync="showDuplicateAlertOne"
  336. width="30%"
  337. append-to-body>
  338. <span>{{ msg }}</span>
  339. <span slot="footer" class="dialog-footer">
  340. <el-button type="primary" @click="showDuplicateAlertOne = false">我知道了</el-button>
  341. </span>
  342. </el-dialog>
  343. </div>
  344. </template>
  345. <script>
  346. import stockInDialog from './Dialog/stockInDialog'
  347. import { uParseTime } from '@/utils/tools'
  348. import {getDataConfig } from "@/utils/data";
  349. import {
  350. deleteWarehouseInfo,
  351. GetAllConfig,
  352. GetAllGoodInfo,
  353. GetAllGoodInfoByID,
  354. GetAllGoodType,
  355. getWarehouseInfoByOrdeNumber,
  356. modifyWarehouseInfo,
  357. postWarehouse,
  358. postSearchGoodList,
  359. toCheckWarehouseInfo,
  360. toReturnCheckWarehouseInfo,
  361. getRepatGoodList
  362. } from '@/api/stock'
  363. import BreadCrumb from '../components/bread-crumb'
  364. export default {
  365. components: { BreadCrumb, stockInDialog },
  366. name: 'stockIn',
  367. data() {
  368. var checkGoodId = (rule, value, callback) => {
  369. setTimeout(() => {
  370. if (value == '' || value == 0) {
  371. return callback(new Error('规格名称不能为空'))
  372. }
  373. }, 2000)
  374. }
  375. return {
  376. crumbs: [
  377. { path: false, name: '库存管理' },
  378. { path: false, name: '耗材入库单' },
  379. { path: false, name: '新增入库单' }
  380. ],
  381. crumbs2: [
  382. { path: false, name: '库存管理' },
  383. { path: false, name: '其他入库单' },
  384. { path: false, name: '新增入库单' }
  385. ],
  386. signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
  387. warehousing_time: '',
  388. adminUserOptions: null,
  389. currentIndex: 0,
  390. recordInfo: {
  391. recordData: [],
  392. stock_in_code: '',
  393. current_index: ''
  394. },
  395. tableRules: {
  396. price: [
  397. { required: true, message: '单价不能为空', trigger: 'blur' }
  398. ],
  399. packing_price: [
  400. { required: true, message: '零售价不能为空', trigger: 'blur' }
  401. ],
  402. warehousing_count: [
  403. { required: true, message: '数量不能为空', trigger: 'blur' }
  404. ],
  405. good_id: [
  406. { validator: checkGoodId, trigger: 'blur' }
  407. ],
  408. number:[
  409. { required: true, message: '批号不能为空', trigger: 'blur' }
  410. ],
  411. expiry_date:[
  412. { required: true, message: '有效日期不能为空', trigger: 'blur' }
  413. ],
  414. },
  415. type: this.$route.query.type,
  416. total: '',
  417. product_date: '',
  418. expiry_date: '',
  419. numbers: '',
  420. // prop
  421. isVisibility: false,
  422. propForm: {
  423. goods: [],
  424. goodType: [],
  425. goodInfo: [],
  426. goodUnit: [],
  427. title: '入库',
  428. formValue: {
  429. good_type_id: '',
  430. good_id: '',
  431. number: '',
  432. product_date: '',
  433. expiry_date: '',
  434. warehousing_count: '',
  435. price: '',
  436. remark: '',
  437. dealer: '',
  438. manufacturer: '',
  439. good_code:"",
  440. good_code_count:""
  441. },
  442. isCreated: 1
  443. },
  444. goodInfo: {
  445. loading: false,
  446. goodTypeData: [],
  447. type_code: ''
  448. },
  449. form: {
  450. manufacturer: '',
  451. dealer: ''
  452. },
  453. formValue: {
  454. good_type_id: '',
  455. good_id: '',
  456. number: '',
  457. product_date: '',
  458. expiry_date: '',
  459. warehousing_count: '',
  460. price: '',
  461. remark: '',
  462. dealer: '',
  463. manufacturer: ''
  464. },
  465. manufacturer: [],
  466. dealerList: [],
  467. goodType: [],
  468. manufacturerList:[],
  469. goodList:[],
  470. loading:false,
  471. list:[],
  472. storehouse_id:"",
  473. showCheck:false,
  474. showReturnCheck:false,
  475. warehousing_info_id:0,
  476. org_id:0,
  477. dialogVisible:false,
  478. currentRow:{},
  479. currentIndex:0,
  480. textarea:"",
  481. duplicateList:[],
  482. showDuplicateAlert:false,
  483. showDuplicateAlertOne:false,
  484. good_id:0,
  485. isComposing: false
  486. }
  487. },
  488. methods: {
  489. handleKeyDown(e) {
  490. },
  491. handlePaste(e) {
  492. e.preventDefault(); // 完全禁止粘贴,避免绕过输入限制
  493. this.$message.warning('扫码输入不支持粘贴');
  494. },
  495. getTotal(){
  496. if(this.textarea!=null){
  497. var textAreaList = this.textarea.split(",")
  498. console.log("textArrleti",textAreaList)
  499. var arr = []
  500. if(textAreaList!=null && textAreaList.length>0){
  501. for(let i=0;i<textAreaList.length;i++){
  502. if(textAreaList[i]!=""){
  503. arr.push(textAreaList[i])
  504. }
  505. }
  506. return arr.length
  507. }else{
  508. return ""
  509. }
  510. }
  511. },
  512. openDialog(){
  513. this.$nextTick(() => {
  514. this.$refs.inputRef.focus()
  515. });
  516. },
  517. handleSave: function() {
  518. if (this.recordInfo.recordData.length <= 0) {
  519. this.$message.error('请添加入库信息')
  520. return
  521. }
  522. sessionStorage.removeItem('warehousing_orders')
  523. this.$router.back(-1)
  524. }, handleCancle: function() {
  525. this.$confirm('是否放弃编辑返回上一页?', '放弃编辑', {
  526. confirmButtonText: '确定',
  527. cancelButtonText: '取消',
  528. type: 'warning'
  529. }).then(() => {
  530. sessionStorage.removeItem('warehousing_orders')
  531. this.$router.back(-1)
  532. }).catch(() => {
  533. })
  534. }, handleCreate: function() {
  535. this.propForm.formValue = {}
  536. this.propForm.isCreated = 1
  537. this.isVisibility = true
  538. },
  539. comfirm: function(val) {
  540. this.propForm.goodType = []
  541. this.propForm.goods = []
  542. this.$refs.dialog.hide()
  543. console.log(val)
  544. if (val.selectedGoodInfo.length > 0) {
  545. for (let i = val.selectedGoodInfo.length - 1; i >= 0; i--) {
  546. if (i == 0) {
  547. this.recordInfo.recordData[this.currentIndex].good_type_id = val.selectedGoodInfo[i].good_type_id
  548. this.recordInfo.recordData[this.currentIndex].good_id = val.selectedGoodInfo[i].id
  549. this.recordInfo.recordData[this.currentIndex].price = val.selectedGoodInfo[i].buy_price.toString()
  550. this.recordInfo.recordData[this.currentIndex].good_unit = val.selectedGoodInfo[i].good_unit
  551. this.recordInfo.recordData[this.currentIndex].good_name = val.selectedGoodInfo[i].good_name
  552. } else {
  553. const tempForm = {}
  554. tempForm['good_type_id'] =val.selectedGoodInfo[i].good_type_id
  555. tempForm['good_id'] = val.selectedGoodInfo[i].id
  556. tempForm['number'] = ''
  557. tempForm['product_date'] = ''
  558. tempForm['expiry_date'] = ''
  559. tempForm['warehousing_count'] = ''
  560. tempForm['price'] = val.selectedGoodInfo[i].buy_price.toString()
  561. tempForm['remark'] = ''
  562. tempForm['dealer'] = ''
  563. tempForm['manufacturer'] = ''
  564. tempForm['good_unit'] = val.selectedGoodInfo[i].good_unit
  565. tempForm['good_name'] = val.selectedGoodInfo[i].good_name
  566. this.recordInfo.recordData.splice(this.currentIndex + 1, 0, tempForm)
  567. }
  568. }
  569. }
  570. this.currentIndex = -1
  571. }, cancle: function() {
  572. this.propForm.goodType = []
  573. this.propForm.goods = []
  574. this.$refs.dialog.hide()
  575. },
  576. GetAllGoodType: function() {
  577. GetAllGoodType().then(response => {
  578. if (response.data.state == 0) {
  579. this.$message.error(response.data.msg)
  580. return false
  581. } else {
  582. for (let i = 0; i < response.data.data.goodType.length; i++) {
  583. this.propForm.goodType.push(response.data.data.goodType[i])
  584. }
  585. }
  586. })
  587. },
  588. GetAllGoodInfo: function() {
  589. GetAllGoodInfo().then(response => {
  590. if (response.data.state == 0) {
  591. this.$message.error(response.data.msg)
  592. return false
  593. } else {
  594. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  595. this.propForm.goodInfo.push(response.data.data.goodInfo[i])
  596. }
  597. }
  598. })
  599. },
  600. GetConfigInfo: function() {
  601. const loading = this.$loading({
  602. lock: true,
  603. text: 'Loading',
  604. spinner: 'el-icon-loading',
  605. background: 'rgba(0, 0, 0, 0.7)'
  606. })
  607. GetAllConfig().then(response => {
  608. if (response.data.state == 0) {
  609. this.$message.error(response.data.msg)
  610. return false
  611. } else {
  612. this.manufacturer = response.data.data.manufacturer
  613. this.dealer = response.data.data.dealer
  614. this.goodType = response.data.data.goodType
  615. this.goodInfo = response.data.data.goodInfo
  616. this.manufacturer.splice(0, 0, { id: 0, manufacturer_name: '全部' })
  617. this.dealer.splice(0, 0, { id: 0, dealer_name: '全部' })
  618. this.manufacturer.splice(0, 0, { id: -1, manufacturer_name: '其他' })
  619. this.dealer.splice(0, 0, { id: -1, dealer_name: '其他' })
  620. this.form.manufacturer = 0
  621. this.form.dealer = 0
  622. this.list = response.data.data.list
  623. this.storehouse_id = response.data.data.configlist.storehouse_info
  624. }
  625. loading.close()
  626. })
  627. }, typeName: function(good_type_id) {
  628. let name = ''
  629. for (let i = 0; i < this.goodType.length; i++) {
  630. if (this.goodType[i].id == good_type_id) {
  631. name = this.goodType[i].type_name
  632. }
  633. }
  634. return name
  635. }, specificationName: function(good_info_id) {
  636. let name = ''
  637. for (let i = 0; i < this.goodInfo.length; i++) {
  638. if (this.goodInfo[i].id == good_info_id) {
  639. name = this.goodInfo[i].specification_name
  640. }
  641. }
  642. return name
  643. },
  644. handleEdit: function(index, row) {
  645. const tempObj = {}
  646. tempObj['good_type_id'] = 0
  647. tempObj['good_id'] = 0
  648. tempObj['number'] = ''
  649. tempObj['product_date'] = ''
  650. tempObj['expiry_date'] = ''
  651. tempObj['warehousing_count'] = ''
  652. tempObj['price'] = ''
  653. tempObj['remark'] = ''
  654. tempObj['dealer'] = ''
  655. tempObj['manufacturer'] = ''
  656. tempObj['good_unit'] = ''
  657. tempObj['specification_name'] = ''
  658. tempObj['name'] = ''
  659. tempObj['license_number'] = ""
  660. tempObj["packing_price"] = ""
  661. tempObj["id"] = 0
  662. tempObj['register_number'] = ''
  663. tempObj['good_code'] = ""
  664. tempObj['good_code_cnt'] = ''
  665. tempObj["good_code_count"] =''
  666. tempObj['split_of_number'] = 24
  667. this.recordInfo.recordData.push(tempObj)
  668. }, handleDelete: function(index, row) {
  669. if (this.recordInfo.recordData.length <= 1) {
  670. this.$message.error('只有一条记录的时候无法删除')
  671. return
  672. } else {
  673. this.recordInfo.recordData.splice(index, 1)
  674. }
  675. },
  676. calculate: function(val) {
  677. if (val == 0) {
  678. return ''
  679. }
  680. return Math.round(parseFloat(val) * 100) / 100
  681. },
  682. GetWarehouseInfoByOrdeNumber: function() {
  683. const params = {
  684. 'warehousing_order': sessionStorage.getItem('warehousing_orders')
  685. }
  686. this.recordInfo.recordData = []
  687. getWarehouseInfoByOrdeNumber(params).then(response => {
  688. if (response.data.state != 0) {
  689. for (let i = 0; i < response.data.data.info.length; i++) {
  690. this.recordInfo.recordData.push(response.data.data.info[i])
  691. }
  692. console.log("333333333",this.recordInfo.recordData)
  693. }
  694. })
  695. }, getTime(val, temp) {
  696. if (val != 0) {
  697. return uParseTime(val, temp)
  698. } else {
  699. return ''
  700. }
  701. },
  702. showDialog(index, row) {
  703. const loading = this.$loading({
  704. lock: true,
  705. text: 'Loading',
  706. spinner: 'el-icon-loading',
  707. background: 'rgba(0, 0, 0, 0.7)'
  708. })
  709. this.currentIndex = index
  710. this.isVisibility = true
  711. const params = {
  712. manufacturer_id: this.form.manufacturer,
  713. dealer_id: this.form.dealer
  714. }
  715. this.propForm.goods = []
  716. GetAllGoodInfoByID(params).then(response => {
  717. if (response.data.state == 0) {
  718. this.$message.error(response.data.msg)
  719. return false
  720. loading.close()
  721. } else {
  722. loading.close()
  723. if (response.data.data.goodInfo.length <= 0) {
  724. this.$message.error('该厂商或经销商没有物品信息')
  725. return
  726. }
  727. this.$refs.dialog.show()
  728. for (let i = 0; i < response.data.data.goodInfo.length; i++) {
  729. this.propForm.goodType.push(response.data.data.goodInfo[i].type)
  730. }
  731. const obj = {}
  732. this.propForm.goodType = this.propForm.goodType.reduce((cur, next) => {
  733. obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
  734. return cur
  735. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  736. }
  737. for (let i = 0; i < this.propForm.goodType.length; i++) {
  738. let goodInfo = []
  739. let goodObj = {}
  740. for (let a = 0; a < response.data.data.goodInfo.length; a++) {
  741. var respObj = response.data.data.goodInfo[a]
  742. respObj['isSelected'] = false
  743. if (respObj.type.id == this.propForm.goodType[i].id) {
  744. goodInfo.push(respObj)
  745. }
  746. }
  747. const obj = {}
  748. goodInfo = goodInfo.reduce((cur, next) => {
  749. obj[next.id] ? '' : obj[next.id] = true && cur.push(next)
  750. return cur
  751. }, []) // 设置cur默认类型为数组,并且初始值为空的数组
  752. this.$set(goodObj, this.propForm.goodType[i].id, goodInfo)
  753. this.propForm.goods.push(goodObj)
  754. }
  755. console.log( this.propForm.goods)
  756. }
  757. )
  758. },
  759. getSummaries(param) {
  760. const { columns, data } = param
  761. const sums = []
  762. columns.forEach((column, index) => {
  763. if (index === 0) {
  764. sums[index] = '总价'
  765. return
  766. }
  767. const values = data.map(item => Number(item[column.property]))
  768. if (!values.every(value => isNaN(value))) {
  769. sums[index] = values.reduce((prev, curr) => {
  770. const value = Number(curr)
  771. if (!isNaN(value)) {
  772. return prev + curr
  773. } else {
  774. return prev
  775. }
  776. }, 0)
  777. sums[index] += ' 元'
  778. } else {
  779. sums[index] = 'N/A'
  780. }
  781. })
  782. return sums
  783. }
  784. ,
  785. back() {
  786. this.$router.go(-1)
  787. }
  788. ,
  789. submit() {
  790. this.$refs['tableForm'].validate((valid) => {
  791. if (valid) {
  792. this.loading = true
  793. const array = this.recordInfo.recordData
  794. if(this.storehouse_id == 0){
  795. this.$message.error("仓库不能为空!")
  796. return
  797. }
  798. for (let i = 0; i < array.length; i++) {
  799. if (array[i].good_type_id == 0) {
  800. this.$message.error('商品类型不能为空')
  801. return
  802. }
  803. array[i].price = array[i].price.toString()
  804. array[i].packing_price = array[i].packing_price.toString()
  805. }
  806. if(this.$store.getters.xt_user.org_id == 10138 || this.$store.getters.xt_user.org_id == 10278 || this.$store.getters.xt_user.org_id == 10610 || this.$store.getters.xt_user.org_id == 10537 ) {
  807. for (let i = 0; i < array.length; i++) {
  808. if (array[i].good_code.length == 0) {
  809. this.$message.error(array[i].good_name + " 溯源码不能为空");
  810. this.loading = false;
  811. return;
  812. }
  813. var aaa = array[i].good_code.split(",")
  814. if(new Set(aaa).size !== aaa.length){
  815. this.$message.error( array[i].good_name + " 溯源码不能重复");
  816. this.loading = false;
  817. return;
  818. }
  819. }
  820. }
  821. if(this.recordInfo.recordData.length <= 0){
  822. this.$message.success('请添加入库商品')
  823. return
  824. }
  825. for(let i=0;i<this.recordInfo.recordData.length;i++){
  826. if(this.recordInfo.recordData[i].dealer == ""){
  827. this.recordInfo.recordData[i].dealer = 0
  828. }
  829. if(this.recordInfo.recordData[i].split_of_number>0){
  830. this.recordInfo.recordData[i].split_of_number = parseInt(this.recordInfo.recordData[i].split_of_number)
  831. }else{
  832. this.recordInfo.recordData[i].split_of_number=0
  833. }
  834. for(let j=0;j<this.manufacturerList.length;j++){
  835. if(this.recordInfo.recordData[i].manufacturer == this.manufacturerList[j].manufacturer_name){
  836. this.recordInfo.recordData[i].manufacturer = this.manufacturerList[j].id
  837. }
  838. }
  839. }
  840. for(let i=0;i<this.recordInfo.recordData.length;i++){
  841. for(let j=0;j<this.dealerList.length;j++){
  842. if(this.recordInfo.recordData[i].dealer == this.dealerList[j].dealer_name){
  843. this.recordInfo.recordData[i].dealer = this.dealerList[j].id
  844. }
  845. }
  846. this.recordInfo.recordData[i].warehousing_count = this.recordInfo.recordData[i].warehousing_count.toString()
  847. }
  848. const loading = this.$loading({
  849. lock: true,
  850. text: 'Loading',
  851. spinner: 'el-icon-loading',
  852. background: 'rgba(0, 0, 0, 0.7)'
  853. })
  854. const params = {
  855. 'stockIn': this.recordInfo.recordData
  856. }
  857. console.log("param232232323232323w",params)
  858. postWarehouse(params, this.warehousing_time, this.type,this.storehouse_id,this.warehousing_info_id).then(response => {
  859. if (response.data.state == 0) {
  860. this.loading = false
  861. this.$message.error(response.data.msg)
  862. loading.close()
  863. return false
  864. } else {
  865. loading.close()
  866. this.loading = false
  867. this.$message.success('保存成功')
  868. var list = response.data.data.list
  869. console.log("list2332323323",list)
  870. var dealerList = response.data.data.dealerList
  871. var manufacturerList = response.data.data.manufacturerList
  872. var info = response.data.data.info
  873. this.warehousing_info_id = info.id
  874. for(let i=0;i<list.length;i++){
  875. for(let j=0;j<dealerList.length;j++){
  876. if(list[i].dealer == dealerList[j].id){
  877. list[i].dealer = dealerList[j].dealer_name
  878. }
  879. }
  880. for(let s=0;s<manufacturerList.length;s++){
  881. if(list[i].manufacturer == manufacturerList[s].id){
  882. list[i].manufacturer = manufacturerList[s].manufacturer_name
  883. }
  884. }
  885. list[i].expiry_date = this.getTimeOne(list[i].expiry_date)
  886. list[i].product_date = this.getTimeOne(list[i].product_date)
  887. list[i].good_name = list[i].GoodInfo.good_name
  888. list[i].name = list[i].GoodInfo.specification_name +"/"+ list[i].GoodInfo.packing_unit
  889. list[i].good_code = list[i].good_code
  890. list[i].split_of_number = list[i].split_of_number
  891. }
  892. this.recordInfo.recordData = []
  893. this.recordInfo.recordData = list
  894. this.showCheck = true
  895. // this.$router.back(-1)
  896. }
  897. })
  898. } else {
  899. return false
  900. }
  901. })
  902. }
  903. ,
  904. changeManufacturer(val) {
  905. },
  906. changeDealer(val) {
  907. },
  908. getDataConfig(module, filed_name){
  909. return getDataConfig(module, filed_name)
  910. },
  911. querySearchAsync(keyword, cb) {
  912. let key = '';
  913. if (keyword != undefined) {
  914. key = keyword
  915. }
  916. postSearchGoodList(key,this.storehouse_id).then(response => {
  917. if (response.data.state == 1) {
  918. var list = response.data.data.list
  919. this.goodList = list
  920. var manufacturerList = response.data.data.manufacturerList
  921. this.manufacturerList = manufacturerList
  922. var dealer = response.data.data.dealerList
  923. this.dealerList = dealer
  924. for(let i=0;i<this.goodList.length;i++){
  925. for(let j=0;j<this.manufacturerList.length;j++){
  926. if(this.goodList[i].manufacturer == this.manufacturerList[j].id){
  927. this.goodList[i].manufacturer = this.manufacturerList[j].manufacturer_name
  928. }
  929. }
  930. }
  931. for(let i=0;i<this.goodList.length;i++){
  932. for(let j=0;j<this.dealerList.length;j++){
  933. if(this.goodList[i].dealer == this.dealerList[j].id){
  934. this.goodList[i].dealer = this.dealerList[j].dealer_name
  935. }
  936. }
  937. }
  938. cb(this.goodList)
  939. } else {
  940. cb([])
  941. }
  942. })
  943. },
  944. changeGoodName(val){
  945. this.currentIndex = val
  946. },
  947. handleSelect(val){
  948. console.log("al32323232323223",val)
  949. this.good_id = 0
  950. this.good_id = val.id
  951. for(let i=0;i<this.recordInfo.recordData.length;i++){
  952. if(this.currentIndex == i){
  953. this.recordInfo.recordData[i].id = 0
  954. this.recordInfo.recordData[i].good_name = val.good_name
  955. this.recordInfo.recordData[i].good_type_id = val.good_type_id
  956. this.recordInfo.recordData[i].name = val.specification_name +"/"+val.packing_unit
  957. this.recordInfo.recordData[i].manufacturer = val.manufacturer
  958. this.recordInfo.recordData[i].remark = val.remark
  959. this.recordInfo.recordData[i].license_number = val.number
  960. this.recordInfo.recordData[i].register_number = val.register_number
  961. if(val.buy_price == 0){
  962. this.recordInfo.recordData[i].price = "0"
  963. }else{
  964. this.recordInfo.recordData[i].price = val.buy_price
  965. }
  966. if(val.packing_price == 0){
  967. this.recordInfo.recordData[i].packing_price = "0"
  968. }else{
  969. this.recordInfo.recordData[i].packing_price = val.packing_price
  970. }
  971. this.recordInfo.recordData[i].specification_name = val.specification_name
  972. this.recordInfo.recordData[i].good_id = val.id
  973. this.recordInfo.recordData[i].packing_unit = val.packing_unit
  974. if(val.dealer == 0){
  975. this.recordInfo.recordData[i].dealer = ""
  976. }else{
  977. this.recordInfo.recordData[i].dealer = val.dealer
  978. }
  979. }
  980. }
  981. },
  982. getTimeOne(val) {
  983. if(val < 0){
  984. return ""
  985. }
  986. if(val == ""){
  987. return ""
  988. }else {
  989. return uParseTime(val, '{y}-{m}-{d}')
  990. }
  991. },
  992. toCheck(){
  993. const loading = this.$loading({
  994. lock: true,
  995. text: 'Loading',
  996. spinner: 'el-icon-loading',
  997. background: 'rgba(0, 0, 0, 0.7)'
  998. })
  999. var params = {
  1000. warehousing_info_id:this.warehousing_info_id,
  1001. }
  1002. toCheckWarehouseInfo(params).then(response=>{
  1003. if(response.data.state == 1){
  1004. var list = response.data.data.list
  1005. // var total_one = response.data.data.total_one
  1006. // var total_two = response.data.data.total_two
  1007. // this.$message.success("审核成功!,追溯码成功"+total_one+"个"+"追溯码重复"+total_two+"个")
  1008. this.showCheck = false
  1009. this.showReturnCheck = true
  1010. this.$router.back(-1)
  1011. loading.close()
  1012. }else{
  1013. this.$message.error("审核失败")
  1014. loading.close()
  1015. }
  1016. })
  1017. },
  1018. toReturnCheck(){
  1019. const loading = this.$loading({
  1020. lock: true,
  1021. text: 'Loading',
  1022. spinner: 'el-icon-loading',
  1023. background: 'rgba(0, 0, 0, 0.7)'
  1024. })
  1025. var params = {
  1026. warehousing_info_id:this.warehousing_info_id,
  1027. }
  1028. toReturnCheckWarehouseInfo(params).then(response=>{
  1029. if(response.data.state == 1){
  1030. var list = response.data.data.list
  1031. this.$message.success("反审核成功!")
  1032. this.showCheck = true
  1033. this.showReturnCheck = false
  1034. loading.close()
  1035. this.$router.back(-1)
  1036. }else{
  1037. this.$message.error("反审核失败!")
  1038. loading.close()
  1039. }
  1040. })
  1041. },
  1042. getTotalPirce(){
  1043. var total_price = 0
  1044. if(this.recordInfo.recordData!=null && this.recordInfo.recordData.length>0){
  1045. for(let i=0;i<this.recordInfo.recordData.length;i++){
  1046. total_price += this.recordInfo.recordData[i].price * parseInt(this.recordInfo.recordData[i].warehousing_count)
  1047. }
  1048. if(total_price>0){
  1049. return total_price.toFixed(4)
  1050. }else{
  1051. return ""
  1052. }
  1053. }
  1054. },
  1055. changeGoodCode(row,index){
  1056. this.textarea=""
  1057. this.textarea = row.good_code
  1058. this.currentRow = row
  1059. this.currentIndex =index
  1060. this.dialogVisible = true
  1061. },
  1062. changeText(event){
  1063. // 1. 转换为半角字符(英文输入法标准)
  1064. const halfWidth = this.textarea.replace(/[\uff01-\uff5e]/g, ch =>
  1065. String.fromCharCode(ch.charCodeAt(0) - 0xfee0)
  1066. );
  1067. // 2. 移除中文空格(全角空格转半角)
  1068. const normalizedSpace = halfWidth.replace(/\u3000/g, ' ');
  1069. // const fullToHalfMap = {
  1070. // '(': '(', ')': ')',
  1071. // '0': '0', '1': '1', '2': '2', '3': '3', '4': '4',
  1072. // '5': '5', '6': '6', '7': '7', '8': '8', '9': '9',
  1073. // 'A': 'A', 'B': 'B', 'C': 'C', 'D': 'D', 'E': 'E',
  1074. // 'F': 'F', 'G': 'G', 'H': 'H', 'I': 'I', 'J': 'J',
  1075. // 'K': 'K', 'L': 'L', 'M': 'M', 'N': 'N', 'O': 'O',
  1076. // 'P': 'P', 'Q': 'Q', 'R': 'R', 'S': 'S', 'T': 'T',
  1077. // 'U': 'U', 'V': 'V', 'W': 'W', 'X': 'X', 'Y': 'Y',
  1078. // 'Z': 'Z', 'a': 'a', 'b': 'b', 'c': 'c', 'd': 'd',
  1079. // 'e': 'e', 'f': 'f', 'g': 'g', 'h': 'h', 'i': 'i',
  1080. // 'j': 'j', 'k': 'k', 'l': 'l', 'm': 'm', 'n': 'n',
  1081. // 'o': 'o', 'p': 'p', 'q': 'q', 'r': 'r', 's': 's',
  1082. // 't': 't', 'u': 'u', 'v': 'v', 'w': 'w', 'x': 'x',
  1083. // 'y': 'y', 'z': 'z'
  1084. // };
  1085. // // 2. 执行转换
  1086. // let result = '';
  1087. // for (const char of this.textarea) {
  1088. // result += fullToHalfMap[char] || char;
  1089. // }
  1090. // // 3. 提取标准格式数据
  1091. // const normalizedSpace = result.match(/(\(\d{2}\)[\dA-Za-z]+)+/g);
  1092. // console.log("normalizedSpace---",normalizedSpace[0])
  1093. var textAreaList = normalizedSpace.split(",")
  1094. if (event.key === 'Enter') {
  1095. var textarea = ""
  1096. textarea += normalizedSpace.replace(/^\s*[\r\n]|\r?\n\s*$/gm, '') + ","
  1097. var parts = textarea.split(',')
  1098. for(let i=0;i<textAreaList.length;i++){
  1099. if(parts[parts.length-2] == textAreaList[i]){
  1100. this.$message.error("该条码已经存在,不能重复扫码")
  1101. }
  1102. }
  1103. const uniqueStr = [...new Set(textarea.split(','))].join(',');
  1104. this.textarea = uniqueStr
  1105. }
  1106. },
  1107. saveTextArea(){
  1108. for(let i=0;i<this.recordInfo.recordData.length;i++){
  1109. if(this.currentIndex == i){
  1110. this.recordInfo.recordData[i].good_code = this.textarea
  1111. this.recordInfo.recordData[i].good_code_count = this.getTotal()
  1112. // 去除换行符
  1113. let noNewLineStr = this.textarea.replace(/\n/g, "");
  1114. // 按逗号分割成数组
  1115. let resultArray = noNewLineStr.split(",");
  1116. let arr = []
  1117. for(let c = 0; c < resultArray.length; c++){
  1118. if(resultArray[c] != ""){
  1119. arr.push(resultArray[c])
  1120. }
  1121. }
  1122. this.recordInfo.recordData[i].good_code_cnt = arr.length
  1123. }
  1124. }
  1125. if (this.checkDuplicates()) {
  1126. this.showDuplicateAlert = true
  1127. return
  1128. }
  1129. // if(this.org_id == 10164 || this.org_id == 0){
  1130. // this.getRepatGood(this.textarea)
  1131. // this.showDuplicateAlertOne = true
  1132. // }
  1133. this.dialogVisible = false
  1134. },
  1135. getCodeList() {
  1136. return this.textarea.replace(/\n/g,',') .split(',').map(item => item.trim()).filter(item => item !== '')
  1137. },
  1138. checkDuplicates() {
  1139. const codes = this.getCodeList()
  1140. const countMap = new Map()
  1141. this.duplicateList = []
  1142. this.duplicateCount = 0
  1143. // 统计出现次数
  1144. codes.forEach(code => {
  1145. countMap.set(code, (countMap.get(code) || 0) + 1)
  1146. })
  1147. // 找出重复项
  1148. countMap.forEach((count, code) => {
  1149. if (count > 1) {
  1150. this.duplicateList.push({
  1151. value: code,
  1152. count: count
  1153. })
  1154. this.duplicateCount += (count - 1)
  1155. }
  1156. })
  1157. return this.duplicateList.length > 0
  1158. },
  1159. getGoodCode(val){
  1160. var newArr = []
  1161. var total = 0
  1162. if(val!=undefined){
  1163. newArr = val.split(",")
  1164. total = newArr.length - 1
  1165. if(total >0){
  1166. return total
  1167. }else{
  1168. return ""
  1169. }
  1170. }
  1171. },
  1172. getRepatGood(val){
  1173. var params = {
  1174. good_str:val,
  1175. good_id:this.good_id,
  1176. }
  1177. getRepatGoodList(params).then(response=>{
  1178. if(response.data.state == 1){
  1179. var msg = response.data.data.msg
  1180. }else{
  1181. var msg = response.data.msg
  1182. this.msg = msg
  1183. this.$message.error(msg)
  1184. }
  1185. })
  1186. }
  1187. }
  1188. ,
  1189. created() {
  1190. this.org_id = this.$store.getters.xt_user.org.id
  1191. var nowDate = new Date()
  1192. var nowYear = nowDate.getFullYear()
  1193. var nowMonth = nowDate.getMonth() + 1
  1194. var nowDay = nowDate.getDate()
  1195. this.warehousing_time =
  1196. nowYear +
  1197. '-' +
  1198. (nowMonth < 10 ? '0' + nowMonth : nowMonth) +
  1199. '-' +
  1200. (nowDay < 10 ? '0' + nowDay : nowDay)
  1201. const tempObj = {}
  1202. tempObj['good_type_id'] = 0
  1203. tempObj['good_id'] = 0
  1204. tempObj['number'] = ''
  1205. tempObj['product_date'] = ''
  1206. tempObj['expiry_date'] = ''
  1207. tempObj['warehousing_count'] = ''
  1208. tempObj['price'] = ''
  1209. tempObj['remark'] = ''
  1210. tempObj['dealer'] = ''
  1211. tempObj['manufacturer'] = ''
  1212. tempObj['good_unit'] = ''
  1213. tempObj['good_name'] = ''
  1214. tempObj['specification_name'] = ''
  1215. tempObj['name'] = ''
  1216. tempObj['license_number'] = ''
  1217. tempObj['packing_price']= ''
  1218. tempObj['id']= 0
  1219. tempObj['register_number'] = ''
  1220. tempObj['good_code'] = ''
  1221. tempObj['good_code_cnt'] = ''
  1222. tempObj['split_of_number'] = 24
  1223. this.recordInfo.recordData.push(tempObj)
  1224. this.GetConfigInfo()
  1225. this.propForm.goodUnit = this.$store.getters.good_unit
  1226. }
  1227. }
  1228. </script>
  1229. <style>
  1230. #oictable ::-webkit-scrollbar {
  1231. height: 15px;
  1232. }
  1233. </style>
  1234. <style rel="stylesheet/css" lang="scss" scoped>
  1235. .information {
  1236. border: 1px #dcdfe6 solid;
  1237. padding: 30px 20px 30px 20px;
  1238. .border {
  1239. border-bottom: 1px #dcdfe6 solid;
  1240. margin: 0px 0 20px 0;
  1241. }
  1242. }
  1243. .edit_separater {
  1244. border-top: 1px solid rgb(233, 233, 233);
  1245. margin-top: 15px;
  1246. margin-bottom: 15px;
  1247. }
  1248. </style>
  1249. <style>
  1250. .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
  1251. font-size: 12px;
  1252. }
  1253. .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
  1254. background: #6fb5fa;
  1255. }
  1256. .el-autocomplete-suggestion{
  1257. /* width: 400px !important; */
  1258. width: auto !important;
  1259. }
  1260. </style>