add.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145
  1. <template>
  2. <div id="addOder">
  3. <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
  4. <el-row :gutter="10">
  5. <el-col :span="1.5">
  6. <el-form-item label="调出库存组织">
  7. <el-select clearable size="small" v-model="basicForm.deliveryInventoryOrg" :disabled="sonDisable" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调出库存组织')" style="width: 200px">
  8. <el-option v-for="item in chuOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
  9. </el-select>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="1.5">
  13. <el-form-item label="订单类型">
  14. <el-select v-model="basicForm.billType" :disabled="sonDisable" size="small" style="width: 200px" clearable>
  15. <el-option v-for="dict in dict.type.sys_allot_billtype" :key="dict.value" :label="dict.label" :value="dict.value">
  16. </el-option>
  17. </el-select>
  18. </el-form-item>
  19. </el-col>
  20. <el-col :span="1.5">
  21. <el-form-item label="单据号">
  22. <el-input
  23. v-model="basicForm.code"
  24. size="small"
  25. :disabled="sonDisable"
  26. clearable
  27. style="width: 200px"
  28. />
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="1.5">
  32. <el-form-item label="单据日期">
  33. <el-date-picker
  34. v-model="basicForm.billDate"
  35. size="small"
  36. :disabled="sonDisable"
  37. type="date"
  38. clearable
  39. @change="changeBillDate"
  40. value-format="yyyy-MM-dd"
  41. style="width: 200px">
  42. </el-date-picker>
  43. </el-form-item>
  44. </el-col>
  45. <el-col :span="1.5">
  46. <el-form-item label="调拨方式">
  47. <el-select v-model="basicForm.allotType" disabled size="small" style="width: 200px" clearable>
  48. <el-option v-for="dict in dict.type.sys_to_type" :key="dict.value" :label="dict.label" :value="dict.value">
  49. </el-option>
  50. </el-select>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="1.5">
  54. <el-form-item label="调拨出库单号">
  55. <el-input
  56. v-model="basicForm.deliveryCode"
  57. size="small"
  58. :disabled="sonDisable"
  59. clearable
  60. style="width: 200px"
  61. />
  62. </el-form-item>
  63. </el-col>
  64. <el-col :span="1.5">
  65. <el-form-item label="调拨入库单号">
  66. <el-input
  67. v-model="basicForm.storageCode"
  68. size="small"
  69. :disabled="sonDisable"
  70. clearable
  71. style="width: 200px"
  72. />
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="1.5">
  76. <el-form-item label="调入库存组织">
  77. <el-select clearable size="small" v-model="basicForm.storageInventoryOrg" :disabled="sonDisable" @change="controlCk" @focus="chooseRefer('ORG_PARAM', true, '调入库存组织')" style="width: 200px">
  78. <el-option v-for="item in ruOrgOptions" :key="item.id" :label="item.name" :value="item.id" />
  79. </el-select>
  80. </el-form-item>
  81. </el-col>
  82. <el-col :span="1.5">
  83. <el-form-item label="调出业务员">
  84. <el-select clearable size="small" v-model="basicForm.businessPersonal" :disabled="sonDisable" @focus="chooseRefer('CONTACTS_PARAM', true, '调出业务员')" style="width: 200px">
  85. <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code" />
  86. </el-select>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-form-item label="调出部门">
  91. <el-select clearable size="small" v-model="basicForm.deliveryDept" :disabled="sonDisable || isOrg" @focus="chooseRefer('DEPT_PARAM', true, '调出部门', basicForm.deliveryInventoryOrg)" style="width: 200px">
  92. <el-option v-for="item in deptOptions" :key="item.id" :label="item.name" :value="item.id" />
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="1.5">
  97. <el-form-item label="币种">
  98. <el-select clearable size="small" v-model="basicForm.currency" :disabled="sonDisable" @focus="chooseRefer('CURRENCY_PARAM', true, '币种')" style="width: 200px">
  99. <el-option v-for="item in currencyOptions" :key="item.id" :label="item.name" :value="item.id" />
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :span="1.5">
  104. <el-form-item label="折本汇率">
  105. <el-input-number
  106. v-model="basicForm.rate"
  107. size="small"
  108. disabled
  109. :precision="2"
  110. :step="0.1"
  111. :max="10"
  112. style="width: 200px"
  113. ></el-input-number>
  114. </el-form-item>
  115. </el-col>
  116. <el-col :span="1.5">
  117. <el-form-item label="在途归属">
  118. <el-input
  119. v-model="basicForm.onRouteAffilliation"
  120. size="small"
  121. disabled
  122. clearable
  123. style="width: 200px"
  124. />
  125. </el-form-item>
  126. </el-col>
  127. <el-col :span="1.5">
  128. <el-form-item label="总数量">
  129. <el-input
  130. v-model="basicForm.qty"
  131. size="small"
  132. :disabled="sonDisable"
  133. clearable
  134. style="width: 200px"
  135. />
  136. </el-form-item>
  137. </el-col>
  138. <el-col :span="1.5">
  139. <el-form-item label="结算路径">
  140. <el-input
  141. v-model="basicForm.accountPath"
  142. size="small"
  143. :disabled="sonDisable"
  144. clearable
  145. style="width: 200px"
  146. />
  147. </el-form-item>
  148. </el-col>
  149. <el-col :span="1.5">
  150. <el-form-item label="客户">
  151. <el-input
  152. v-model="basicForm.customer"
  153. size="small"
  154. :disabled="sonDisable"
  155. clearable
  156. style="width: 200px"
  157. />
  158. </el-form-item>
  159. </el-col>
  160. <el-col :span="1.5">
  161. <el-form-item label="调入仓库">
  162. <el-select clearable size="small" v-model="basicForm.storageWarehouse" :disabled="sonDisable || isOrg" @change="controlDRHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调入仓库', basicForm.storageInventoryOrg, 'N', 'N')" style="width: 200px">
  163. <el-option v-for="item in ruHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
  164. </el-select>
  165. </el-form-item>
  166. </el-col>
  167. <el-col :span="1.5">
  168. <el-form-item label="调出仓库">
  169. <el-select clearable size="small" v-model="basicForm.deliveryWarehouse" :disabled="sonDisable || isOrg" @change="controlDCHW" @focus="chooseRefer('WAREHOUSE_PARAM', true, '调出仓库', basicForm.deliveryInventoryOrg, 'N', 'N')" style="width: 200px">
  170. <el-option v-for="item in chuHouseOptions" :key="item.id" :label="item.name" :value="item.id" />
  171. </el-select>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="1.5">
  175. <el-form-item label="物流项目组">
  176. <el-select v-model="basicForm.materialProject" :disabled="sonDisable" size="small" style="width: 200px" clearable>
  177. <el-option v-for="dict in dict.type.sys_project_group" :key="dict.value" :label="dict.label" :value="dict.value">
  178. </el-option>
  179. </el-select>
  180. </el-form-item>
  181. </el-col>
  182. <el-col :span="1.5">
  183. <el-form-item label="利润中心">
  184. <el-select clearable size="small" v-model="basicForm.liacenter" :disabled="sonDisable" @focus="chooseTreeRefer('LIACENTER_PARAM', false, '利润中心')" style="width: 200px">
  185. <el-option v-for="item in liacenterOptions" :key="item.id" :label="item.name" :value="item.id" />
  186. </el-select>
  187. </el-form-item>
  188. </el-col>
  189. <el-col :span="1.5">
  190. <el-form-item label="单据状态">
  191. <el-select disabled v-model="basicForm.status" size="small" style="width: 200px" clearable>
  192. <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
  193. </el-option>
  194. </el-select>
  195. </el-form-item>
  196. </el-col>
  197. <el-col :span="1.5">
  198. <el-form-item label="备注">
  199. <el-input
  200. v-model="basicForm.remark"
  201. size="small"
  202. :disabled="sonDisable"
  203. clearable
  204. style="width: 200px"
  205. />
  206. </el-form-item>
  207. </el-col>
  208. </el-row>
  209. <el-row>
  210. <el-col :span="1.5">
  211. <el-form-item label="NC单据号">
  212. <el-input
  213. v-model="basicForm.ncCode"
  214. size="small"
  215. disabled
  216. style="width: 200px"
  217. />
  218. </el-form-item>
  219. </el-col>
  220. </el-row>
  221. <el-row>
  222. <el-col :span="20">
  223. <el-form-item label="同步NC结果">
  224. <el-input
  225. v-model="basicForm.isSendWms"
  226. type="textarea"
  227. :rows="3"
  228. size="small"
  229. disabled
  230. clearable
  231. />
  232. </el-form-item>
  233. </el-col>
  234. </el-row>
  235. <el-tabs style="margin-top: 10px;" type="border-card">
  236. <el-tab-pane label="物料信息">
  237. <div class="btn_grooup">
  238. <el-button type="primary" size="small" v-if="!sonDisable" @click="addLine">增行</el-button>
  239. </div>
  240. <el-table
  241. :data="materialInfo"
  242. fit
  243. max-height="480"
  244. >
  245. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno">
  246. <template slot-scope="scope">
  247. {{ scope.$index + 1 + '0' }}
  248. </template>
  249. </el-table-column>
  250. <el-table-column show-overflow-tooltip label="采购需求单单号" align="center" prop="demandCode" width="200px"/>
  251. <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
  252. <template slot-scope="scope">
  253. <el-form-item class="hang">
  254. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
  255. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
  256. </el-input>
  257. </el-form-item>
  258. </template>
  259. </el-table-column>
  260. <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="200px"/>
  261. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="200px"/>
  262. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="200px"/>
  263. <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
  264. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="200px"/>
  265. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlaceName"/>
  266. <el-table-column show-overflow-tooltip label="型号" align="center" prop="model"/>
  267. <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName"/>
  268. <!-- <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName"/> -->
  269. <el-table-column show-overflow-tooltip label="数量" align="center" prop="qty" width="150px">
  270. <template slot-scope="scope">
  271. <el-form-item class="hang">
  272. <el-input :readonly="sonDisable" clearable size="small" v-model="scope.row.qty" @input="getSL(scope)"/>
  273. </el-form-item>
  274. </template>
  275. </el-table-column>
  276. <el-table-column show-overflow-tooltip label="主单位" align="center" prop="mainUnitName"/>
  277. <el-table-column show-overflow-tooltip label="换算率" align="center" prop="equation"/>
  278. <el-table-column show-overflow-tooltip label="主数量" align="center" prop="mainQty" width="150px">
  279. <template slot-scope="scope">
  280. <el-form-item class="hang">
  281. <el-input :readonly="sonDisable" clearable size="small" v-model="scope.row.mainQty" @input="getZSL(scope)"/>
  282. </el-form-item>
  283. </template>
  284. </el-table-column>
  285. <el-table-column show-overflow-tooltip label="税率" align="center" prop="rate"/>
  286. <el-table-column show-overflow-tooltip label="调出货位" align="center" prop="deliveryAllocationName" width="230px">
  287. <template slot-scope="scope">
  288. <el-form-item class="hang">
  289. <el-input clearable :disabled="sonDisable || isDCCk" size="small" v-model="scope.row.deliveryAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)">
  290. <el-button size="small" :disabled="sonDisable || isDCCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调出货位', basicForm.deliveryWarehouse)"></el-button>
  291. </el-input>
  292. </el-form-item>
  293. </template>
  294. </el-table-column>
  295. <el-table-column show-overflow-tooltip label="调入部门" align="center" prop="storageDeptName" width="230px">
  296. <template slot-scope="scope">
  297. <el-form-item class="hang">
  298. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.storageDeptName" @focus="chooseMxBM(scope.$index, 'DEPT_PARAM', true, '调入部门', basicForm.storageInventoryOrg)">
  299. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMxBM(scope.$index, 'DEPT_PARAM', true, '调入部门', basicForm.storageInventoryOrg)"></el-button>
  300. </el-input>
  301. </el-form-item>
  302. </template>
  303. </el-table-column>
  304. <el-table-column show-overflow-tooltip label="调入货位" align="center" prop="storageAllocationName" width="230px">
  305. <template slot-scope="scope">
  306. <el-form-item class="hang">
  307. <el-input clearable :disabled="sonDisable || isDRCk" size="small" v-model="scope.row.storageAllocationName" @focus="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)">
  308. <el-button size="small" :disabled="sonDisable || isDRCk" slot="append" icon="el-icon-more" @click="chooseMxHW(scope.$index, 'ALLOCATION_PARAM', true, '调入货位', basicForm.storageWarehouse)"></el-button>
  309. </el-input>
  310. </el-form-item>
  311. </template>
  312. </el-table-column>
  313. <el-table-column show-overflow-tooltip label="批次号" align="center" prop="patchNo" width="150px"/>
  314. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="producBatch" width="230px">
  315. <template slot-scope="scope">
  316. <el-form-item class="hang">
  317. <el-input readonly size="small" v-model="scope.row.producBatch">
  318. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseBatch(scope.$index)"></el-button>
  319. </el-input>
  320. </el-form-item>
  321. </template>
  322. </el-table-column>
  323. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="230px">
  324. <template slot-scope="scope">
  325. <el-form-item class="hang">
  326. <el-date-picker
  327. v-model="scope.row.manufactureDate"
  328. :readonly="sonDisable"
  329. type="date"
  330. size="small"
  331. value-format="yyyy-MM-dd">
  332. </el-date-picker>
  333. </el-form-item>
  334. </template>
  335. </el-table-column>
  336. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  337. <el-table-column show-overflow-tooltip label="调拨日期" align="center" prop="allotDate" width="230px">
  338. <template slot-scope="scope">
  339. <el-form-item class="hang">
  340. <el-date-picker
  341. ref="findDate"
  342. v-model="scope.row.allotDate"
  343. :readonly="sonDisable"
  344. type="date"
  345. size="small"
  346. :picker-options="pickerOptionsEnd"
  347. value-format="yyyy-MM-dd">
  348. </el-date-picker>
  349. </el-form-item>
  350. </template>
  351. </el-table-column>
  352. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="200px"/>
  353. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="200px"/>
  354. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  355. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  356. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug"/>
  357. <el-table-column show-overflow-tooltip label="调入调出结算规则明细" align="center" prop="ruleDetail" width="200px"/>
  358. <el-table-column show-overflow-tooltip label="上市许可持有人" align="center" prop="marketingApprovalPersonal" width="200px"/>
  359. <el-table-column show-overflow-tooltip label="生产许可证号/经营许可证号/备案凭证号" align="center" prop="production" width="260px"/>
  360. <el-table-column show-overflow-tooltip label="pi码" align="center" prop="pi">
  361. <template slot-scope="scope">
  362. <el-form-item class="hang">
  363. <el-input :readonly="sonDisable" size="small" v-model="scope.row.pi"/>
  364. </el-form-item>
  365. </template>
  366. </el-table-column>
  367. <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
  368. <!-- <el-table-column show-overflow-tooltip label="备注" align="center" prop="code"/> -->
  369. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  370. <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
  371. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  372. <el-table-column
  373. fixed="right"
  374. label="操作"
  375. align="center"
  376. >
  377. <template slot-scope="scope">
  378. <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
  379. </template>
  380. </el-table-column>
  381. </el-table>
  382. </el-tab-pane>
  383. <el-tab-pane label="收发货信息">
  384. <el-table
  385. :data="receiveInfo"
  386. fit
  387. max-height="480"
  388. >
  389. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
  390. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
  391. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
  392. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
  393. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
  394. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  395. <el-table-column show-overflow-tooltip label="调出仓库" align="center" prop="deliveryWarehouseName" width="150px"/>
  396. <el-table-column show-overflow-tooltip label="调入仓库" align="center" prop="storageWarehouseName" width="150px"/>
  397. <!-- <el-table-column show-overflow-tooltip label="收货利润中心" align="center" prop="code"/>
  398. <el-table-column show-overflow-tooltip label="发货利润中心" align="center" prop="code"/> -->
  399. <el-table-column show-overflow-tooltip label="调入业务员" align="center" prop="businessPersonalName" width="150px"/>
  400. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
  401. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
  402. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  403. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
  404. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
  405. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  406. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  407. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
  408. <el-table-column show-overflow-tooltip label="收货客户" align="center" prop="customerName" width="150px"/>
  409. <el-table-column show-overflow-tooltip label="收货地址" align="center" prop="addressaddress" width="150px"/>
  410. <el-table-column show-overflow-tooltip label="收货地区" align="center" prop="area" width="150px"/>
  411. <el-table-column show-overflow-tooltip label="收货地点" align="center" prop="place" width="150px"/>
  412. <el-table-column show-overflow-tooltip label="计划发货日期" align="center" prop="deliveryDate" width="150px"/>
  413. <el-table-column show-overflow-tooltip label="计划到货日期" align="center" prop="strageDate" width="150px"/>
  414. <el-table-column show-overflow-tooltip label="运输方式" align="center" prop="transportation" width="150px"/>
  415. <el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="150px"/>
  416. <el-table-column show-overflow-tooltip label="客户物料编码" align="center" prop="customerLogistic" width="150px"/>
  417. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  418. </el-table>
  419. </el-tab-pane>
  420. <el-tab-pane label="价格费用">
  421. <el-table
  422. :data="priceList"
  423. fit
  424. max-height="480"
  425. >
  426. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
  427. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
  428. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
  429. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
  430. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
  431. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  432. <!-- <el-table-column show-overflow-tooltip label="税率" align="center" prop="code"/> -->
  433. <!-- <el-table-column show-overflow-tooltip label="无税单价" align="center" prop="code"/> -->
  434. <!-- <el-table-column show-overflow-tooltip label="含税单价" align="center" prop="code"/> -->
  435. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
  436. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
  437. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  438. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
  439. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
  440. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  441. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  442. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
  443. <!-- <el-table-column show-overflow-tooltip label="询价无税价" align="center" prop="code"/> -->
  444. <!-- <el-table-column show-overflow-tooltip label="询价含税价" align="center" prop="code"/> -->
  445. <!-- <el-table-column show-overflow-tooltip label="税额" align="center" prop="code"/> -->
  446. <!-- <el-table-column show-overflow-tooltip label="加价率" align="center" prop="code"/> -->
  447. <!-- <el-table-column show-overflow-tooltip label="无税金额" align="center" prop="code"/> -->
  448. <!-- <el-table-column show-overflow-tooltip label="价税合计" align="center" prop="code"/> -->
  449. <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
  450. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  451. </el-table>
  452. </el-tab-pane>
  453. <el-tab-pane label="执行结果">
  454. <el-table
  455. :data="resultList"
  456. fit
  457. max-height="480"
  458. >
  459. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowno"/>
  460. <el-table-column show-overflow-tooltip label="调拨出库单号" align="center" prop="deliveryCode" width="150px"/>
  461. <el-table-column show-overflow-tooltip label="调拨入库单号" align="center" prop="storageCode" width="150px"/>
  462. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150px"/>
  463. <el-table-column show-overflow-tooltip label="产地" align="center" prop="originPlace" width="150px"/>
  464. <el-table-column show-overflow-tooltip label="类别" align="center" prop="classify" width="150px"/>
  465. <el-table-column show-overflow-tooltip label="产品批号" align="center" prop="productBatch" width="150px"/>
  466. <el-table-column show-overflow-tooltip label="生产日期" align="center" prop="manufactureDate" width="150px"/>
  467. <el-table-column show-overflow-tooltip label="有效期至/失效日期" align="center" prop="periodEndDate" width="150px"/>
  468. <el-table-column show-overflow-tooltip label="批准文号" align="center" prop="ratifyCode" width="150px"/>
  469. <el-table-column show-overflow-tooltip label="注册证号" align="center" prop="registration" width="150px"/>
  470. <el-table-column show-overflow-tooltip label="商品名" align="center" prop="productCode" width="150px"/>
  471. <el-table-column show-overflow-tooltip label="通用名" align="center" prop="commonCode" width="150px"/>
  472. <el-table-column show-overflow-tooltip label="剂型" align="center" prop="drug" width="150px"/>
  473. <!-- <el-table-column show-overflow-tooltip label="已调出主数量" align="center" prop="code"/>
  474. <el-table-column show-overflow-tooltip label="已调入主数量" align="center" prop="code"/> -->
  475. <!-- <el-table-column show-overflow-tooltip label="调拨在途主数量" align="center" prop="code"/> -->
  476. <!-- <el-table-column show-overflow-tooltip label="已发货主数量" align="center" prop="code"/> -->
  477. <!-- <el-table-column show-overflow-tooltip label="途损主数量" align="center" prop="code"/> -->
  478. <!-- <el-table-column show-overflow-tooltip label="累计退货主数量" align="center" prop="code"/> -->
  479. <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算主数量" align="center" prop="code"/> -->
  480. <!-- <el-table-column show-overflow-tooltip label="调出与调入已结算金额" align="center" prop="code"/> -->
  481. <el-table-column show-overflow-tooltip label="客户物料码" align="center" prop="customerLogistic" width="150px"/>
  482. <el-table-column show-overflow-tooltip label="客户物料名称" align="center" prop="customerLogisticName" width="150px"/>
  483. </el-table>
  484. </el-tab-pane>
  485. </el-tabs>
  486. <el-divider content-position="left">表尾信息</el-divider>
  487. <el-row :gutter="10">
  488. <el-col :span="1.5">
  489. <el-form-item label="制单人">
  490. <el-input
  491. v-model="basicForm.createByName"
  492. size="small"
  493. disabled
  494. clearable
  495. style="width: 200px"
  496. />
  497. </el-form-item>
  498. </el-col>
  499. <el-col :span="1.5">
  500. <el-form-item label="制单日期">
  501. <el-input
  502. v-model="basicForm.createTime"
  503. size="small"
  504. disabled
  505. clearable
  506. style="width: 200px"
  507. />
  508. </el-form-item>
  509. </el-col>
  510. <!-- <el-col :span="1.5">
  511. <el-form-item label="审批人">
  512. <el-input
  513. v-model="basicForm.code"
  514. size="small"
  515. disabled
  516. clearable
  517. style="width: 200px"
  518. />
  519. </el-form-item>
  520. </el-col>
  521. <el-col :span="1.5">
  522. <el-form-item label="审批日期">
  523. <el-input
  524. v-model="basicForm.code"
  525. size="small"
  526. disabled
  527. clearable
  528. style="width: 200px"
  529. />
  530. </el-form-item>
  531. </el-col> -->
  532. </el-row>
  533. <el-divider content-position="left">审计信息</el-divider>
  534. <el-row :gutter="10">
  535. <el-col :span="1.5">
  536. <el-form-item label="创建人">
  537. <el-input
  538. v-model="basicForm.createByName"
  539. size="small"
  540. disabled
  541. clearable
  542. style="width: 200px"
  543. />
  544. </el-form-item>
  545. </el-col>
  546. <el-col :span="1.5">
  547. <el-form-item label="创建时间">
  548. <el-input
  549. v-model="basicForm.createTime"
  550. size="small"
  551. disabled
  552. clearable
  553. style="width: 200px"
  554. />
  555. </el-form-item>
  556. </el-col>
  557. <el-col :span="1.5">
  558. <el-form-item label="最后修改人">
  559. <el-input
  560. v-model="basicForm.updateByName"
  561. size="small"
  562. disabled
  563. clearable
  564. style="width: 200px"
  565. />
  566. </el-form-item>
  567. </el-col>
  568. <el-col :span="1.5">
  569. <el-form-item label="最后修改时间">
  570. <el-input
  571. v-model="basicForm.updateTime"
  572. size="small"
  573. disabled
  574. clearable
  575. style="width: 200px"
  576. />
  577. </el-form-item>
  578. </el-col>
  579. </el-row>
  580. </el-form>
  581. <div class="btn_group">
  582. <!-- <el-col :span="1.5">
  583. <el-button type="primary" size="small" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
  584. </el-col> -->
  585. <el-col :span="1.5">
  586. <el-button type="primary" size="small" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
  587. </el-col>
  588. <el-col :span="1.5" style="margin: 0 10px;">
  589. <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
  590. </el-col>
  591. <el-col :span="1.5">
  592. <el-button size="small" plain @click="back">返回</el-button>
  593. </el-col>
  594. </div>
  595. <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
  596. <TreeRefers ref="tree" @doSubmit="selectionsToInput2" :single="true"/>
  597. <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
  598. <batchRefers ref="batchRefer" @doSubmit="selectBatch" :single="true"/>
  599. </div>
  600. </template>
  601. <script>
  602. import {addOrder, getOrderDetail, editOrder, submitOrder} from '@/api/purchase/transferOrder.js'
  603. import Refers from '@/components/Refers/refers.vue'
  604. // 用于回显参照框数据
  605. import { getRefer } from '@/api/purchase/basic.js'
  606. import TreeRefers from '@/components/Refers/treeRefer.vue'
  607. // 明细行选择物料参照
  608. import popDialog from '@/components/PopDialog/index.vue'
  609. // 明细行选择批次号
  610. import batchRefers from '@/components/Refers/batchRefer.vue'
  611. export default {
  612. name: 'addOder',
  613. dicts: ['sys_allot_billtype', 'sys_project_group', 'sys_status', 'sys_to_type'],
  614. props: ['pageStu','row', 'disable'],
  615. components: {
  616. Refers,
  617. TreeRefers,
  618. popDialog,
  619. batchRefers
  620. },
  621. model: {
  622. prop: 'isList',
  623. event: 'jugislist'
  624. },
  625. data() {
  626. return {
  627. // 不能直接改变props传来的值
  628. sonPageStu: this.pageStu,
  629. sonDisable: this.disable,
  630. basicForm: {
  631. deliveryInventoryOrg: '',
  632. deliveryInventoryOrgCode: '',
  633. deliveryInventoryOrgName: '',
  634. billType: '',
  635. code: '',
  636. billDate: '',
  637. allotType: '',
  638. deliveryCode: '',
  639. storageCode: '',
  640. storageInventoryOrg: '',
  641. storageInventory: '',
  642. storageInventoryOrgName: '',
  643. businessPersonal: '',
  644. businessPersonalName: '',
  645. deliveryDept: '',
  646. deliveryDeptName: '',
  647. currency: '',
  648. currencyName: '',
  649. rate: 1,
  650. onRouteAffilliation: '',
  651. qty: '',
  652. accountPath: '',
  653. customer: '',
  654. customerName: '',
  655. deliveryWarehouse: '',
  656. deliveryWarehouseCode: '',
  657. deliveryWarehouseName: '',
  658. storageWarehouse: '',
  659. storageWarehouseName: '',
  660. materialProject: '',
  661. liacenter: '',
  662. liacenterName: '',
  663. sourceIdentification: '',
  664. remark:'',
  665. ncCode: '',
  666. isSendWms: '',
  667. status: '0',
  668. tenantId: '',
  669. revision: '',
  670. createByName: '',
  671. updateByName: '',
  672. delFlag: '',
  673. },
  674. referCondition: {
  675. type: '',
  676. isPage: true,
  677. title: '',
  678. // 仓库编码
  679. stordocId: ''
  680. },
  681. referConditionMx: {
  682. orgCode: '',
  683. materialCode: '',
  684. unitCode: '',
  685. warehouseCode: ''
  686. },
  687. options: [{
  688. value: 'Y', label: '是',
  689. }, {
  690. value: 'N', label: '否'
  691. }],
  692. tableIndex: null,
  693. chuOrgOptions: [],
  694. ruOrgOptions:[],
  695. manOptions: [],
  696. deptOptions: [],
  697. currencyOptions: [],
  698. ruHouseOptions: [],
  699. chuHouseOptions: [],
  700. liacenterOptions: [],
  701. basicRules: {},
  702. materialInfo: [],
  703. receiveInfo: [],
  704. priceList: [],
  705. resultList: [],
  706. pickerOptionsEnd: {
  707. disabledDate: (time) => {
  708. let beginDateVal = this.basicForm.billDate;
  709. if (beginDateVal) {
  710. return (
  711. time.getTime() <
  712. new Date(beginDateVal).getTime() - 8.64e7
  713. );
  714. }
  715. }
  716. },
  717. isOrg: true,
  718. isDRCk: true,
  719. isDCCk: true,
  720. }
  721. },
  722. created() {
  723. if(this.pageStu == 'check') {
  724. console.log('数据', this.row)
  725. this.getDetails(this.row)
  726. } else if(this.pageStu == 'edit') {
  727. this.getDetails(this.row)
  728. }
  729. },
  730. methods: {
  731. // 改变单据日期时清空子表的调拨日期
  732. changeBillDate() {
  733. this.materialInfo.forEach(item => {
  734. item.allotDate = null
  735. })
  736. },
  737. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  738. controlCk() {
  739. console.log('进了吗')
  740. if (this.basicForm.deliveryInventoryOrg && this.basicForm.storageInventoryOrg) {
  741. this.isOrg = false
  742. } else {
  743. this.basicForm.deliveryDept = ''
  744. this.basicForm.storageWarehouse = ''
  745. this.basicForm.deliveryWarehouse = ''
  746. this.isOrg = true
  747. // 选择调入库存组织时判断调拨方式
  748. this.basicForm.allotType = ''
  749. }
  750. },
  751. // 控制子表内货位是否可以填写,根据选择仓库内csFlag
  752. controlDCHW() {
  753. console.log("🚀 ~ file: add.vue:735 调出货位")
  754. this.isDCCk = true
  755. this.materialInfo.forEach(item => {
  756. item.deliveryAllocation = null
  757. item.deliveryAllocationName = null
  758. })
  759. },
  760. controlDRHW() {
  761. console.log("🚀 ~ file: add.vue:735 调入货位")
  762. this.isDRCk = true
  763. this.materialInfo.forEach(item => {
  764. item.storageAllocation = null
  765. item.storageAllocationName = null
  766. })
  767. },
  768. // 输入数量或者主数量同步改变
  769. getZSL(scope) {
  770. scope.row.qty = scope.row.mainQty
  771. },
  772. getSL(scope) {
  773. scope.row.mainQty = scope.row.qty
  774. },
  775. copy() {
  776. },
  777. submit() {
  778. this.basicForm.stAllotMaterialList = this.materialInfo
  779. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
  780. this.basicForm.stAllotReceiveExecuteList = this.priceList
  781. this.basicForm.stAllotReceiveExpenseList = this.resultList
  782. submitOrder(this.basicForm).then(res => {
  783. if (res.code === 200) {
  784. this.$modal.msgSuccess("提交成功");
  785. this.back()
  786. }
  787. })
  788. },
  789. save() {
  790. if(this.pageStu == 'add') {
  791. this.basicForm.stAllotMaterialList = this.materialInfo
  792. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
  793. this.basicForm.stAllotReceiveExecuteList = this.priceList
  794. this.basicForm.stAllotReceiveExpenseList = this.resultList
  795. addOrder(this.basicForm).then(res => {
  796. if (res.code === 200) {
  797. this.$modal.msgSuccess("保存成功");
  798. this.$emit('jugislist', true)
  799. let queryParams = {
  800. pageNum: 1,
  801. pageSize: 5
  802. }
  803. this.$emit('refresh', queryParams)
  804. }
  805. })
  806. } else if (this.pageStu == 'edit') {
  807. this.basicForm.stAllotMaterialList = this.materialInfo
  808. this.basicForm.stAllotReceiveDeliverList = this.receiveInfo
  809. this.basicForm.stAllotReceiveExecuteList = this.priceList
  810. this.basicForm.stAllotReceiveExpenseList = this.resultList
  811. editOrder(this.basicForm).then(res => {
  812. if (res.code === 200) {
  813. this.$modal.msgSuccess("编辑成功");
  814. this.back()
  815. }
  816. })
  817. }
  818. },
  819. back() {
  820. this.$emit('jugislist', true)
  821. // let queryParams = {
  822. // pageNum: 1,
  823. // pageSize: 5
  824. // }
  825. // this.$emit('refresh', queryParams)
  826. },
  827. // 如果需要回显则调用详情接口
  828. getDetails(row) {
  829. getOrderDetail(row.id).then(res => {
  830. if (res.code === 200) {
  831. this.basicForm = res.data
  832. this.materialInfo = res.data.stAllotMaterialList
  833. this.receiveInfo = res.data.stAllotReceiveDeliverList
  834. this.priceList = res.data.stAllotReceiveExecuteList
  835. this.resultList = res.data.stAllotReceiveExpenseList
  836. if(this.basicForm.deliveryInventoryOrg) { this.reBackRefer('ORG_PARAM', this.basicForm.deliveryInventoryOrg, '调出库存组织') }
  837. if(this.basicForm.storageInventoryOrg) { this.reBackRefer('ORG_PARAM', this.basicForm.storageInventoryOrg, '调入库存组织') }
  838. if(this.basicForm.businessPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.businessPersonal) }
  839. if(this.basicForm.deliveryDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.deliveryDept) }
  840. if(this.basicForm.currency) { this.reBackRefer('CURRENCY_PARAM', this.basicForm.currency) }
  841. if(this.basicForm.storageWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.storageWarehouse, '调入仓库') }
  842. if(this.basicForm.deliveryWarehouse) { this.reBackRefer('WAREHOUSE_PARAM', this.basicForm.deliveryWarehouse, '调出仓库') }
  843. if(this.basicForm.liacenter) { this.reBackRefer('LIACENTER_PARAM', this.basicForm.liacenter) }
  844. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  845. this.controlCk()
  846. }
  847. })
  848. },
  849. // 回显参照框
  850. reBackRefer(type, id, title) {
  851. getRefer({ type: type, id: id, title: title }).then(res => {
  852. if (type == 'ORG_PARAM' && title == '调出库存组织') {
  853. this.chuOrgOptions = res.rows
  854. }
  855. if (type == 'ORG_PARAM' && title == '调入库存组织') {
  856. this.ruOrgOptions = res.rows
  857. }
  858. if (type == 'CONTACTS_PARAM') {
  859. this.manOptions = res.rows
  860. }
  861. if (type == 'DEPT_PARAM') {
  862. this.deptOptions = res.rows
  863. }
  864. if (type == 'CURRENCY_PARAM') {
  865. this.currencyOptions = res.rows
  866. }
  867. if (type == 'LIACENTER_PARAM') {
  868. this.liacenterOptions = res.rows
  869. }
  870. if (type == 'WAREHOUSE_PARAM' && title == '调入仓库') {
  871. this.ruHouseOptions = res.rows
  872. }
  873. if (type == 'WAREHOUSE_PARAM' && title == '调出仓库') {
  874. this.chuHouseOptions = res.rows
  875. }
  876. if (type == 'UNIT_PARAM') {
  877. this.materialInfo[this.tableIndex].unitCode = res.rows[0].code
  878. }
  879. })
  880. },
  881. addLine() {
  882. const newLine = {
  883. rowno: null,
  884. demandCode: null,
  885. material: null,
  886. materialCode: null,
  887. materialName: null,
  888. deliveryCode: null,
  889. storageCode: null,
  890. specification: null,
  891. manufacturer: null,
  892. originPlace: null,
  893. originPlaceName: null,
  894. model: null,
  895. unit: null,
  896. unitCode: null,
  897. unitName: null,
  898. deliveryWarehouseName: null,
  899. qty: null,
  900. mainUnit: null,
  901. mainUnitName: null,
  902. equation: '1/1',
  903. mainQty: null,
  904. rate: '0.00',
  905. storageWarehouseName: null,
  906. deliveryAllocationName: null,
  907. deliveryAllocation: null,
  908. storageDept: null,
  909. storageDeptName: null,
  910. storageAllocationName: null,
  911. storageAllocation: null,
  912. patchNo: null,
  913. producBatch: null,
  914. manufactureDate: null,
  915. periodEndDate: null,
  916. allotDate: null,
  917. ratifyCode: null,
  918. registration: null,
  919. productCode: null,
  920. commonCode: null,
  921. drug: null,
  922. ruleDetail: null,
  923. marketingApprovalPersonal: null,
  924. production: null,
  925. pi: null,
  926. classify: null,
  927. customerLogistic: null,
  928. customerLogisticName: null
  929. }
  930. this.materialInfo.push(newLine)
  931. },
  932. delLine(index) {
  933. console.log('删除行:', index)
  934. this.materialInfo.splice(index, 1)
  935. },
  936. chooseRefer(type, isPage, title, pkOrg, isDirectStore, gubFlag) {
  937. this.referCondition.type = type
  938. this.referCondition.isPage = isPage
  939. this.referCondition.title = title
  940. this.referCondition.pkOrg = pkOrg
  941. this.referCondition.isDirectStore = isDirectStore
  942. this.referCondition.gubFlag = gubFlag
  943. this.$refs.refer.init(this.referCondition)
  944. },
  945. selectionsToInput(selection) {
  946. if (this.referCondition.title == '调出库存组织') {
  947. this.chuOrgOptions = selection
  948. this.basicForm.deliveryInventoryOrg = selection[0].id
  949. this.basicForm.deliveryInventoryOrgCode = selection[0].code
  950. this.basicForm.deliveryInventoryOrgName = selection[0].name
  951. // 清空调出仓库,部门
  952. this.basicForm.deliveryWarehouse = ''
  953. this.basicForm.deliveryWarehouseCode = ''
  954. this.basicForm.deliveryWarehouseName = ''
  955. this.basicForm.deliveryDept = ''
  956. this.basicForm.deliveryDeptName = ''
  957. // 选择调入库存组织时判断调拨方式
  958. if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
  959. this.basicForm.allotType = '4'
  960. } else {
  961. this.basicForm.allotType = '2'
  962. }
  963. }
  964. if (this.referCondition.title == '调入库存组织') {
  965. this.ruOrgOptions = selection
  966. this.basicForm.storageInventoryOrg = selection[0].id
  967. this.basicForm.storageInventory = selection[0].code
  968. this.basicForm.storageInventoryOrgName = selection[0].name
  969. this.basicForm.onRouteAffilliation = selection[0].name
  970. // 选择调入库存组织清空仓库
  971. this.basicForm.storageWarehouse = ''
  972. this.basicForm.storageWarehouseName = ''
  973. // 选择调入库存组织时判断调拨方式
  974. if (this.basicForm.storageInventoryOrg == this.basicForm.deliveryInventoryOrg) {
  975. this.basicForm.allotType = '4'
  976. } else {
  977. this.basicForm.allotType = '2'
  978. }
  979. }
  980. if (this.referCondition.title == '调出业务员') {
  981. this.manOptions = selection
  982. this.basicForm.businessPersonal = selection[0].code
  983. this.basicForm.businessPersonalName = selection[0].name
  984. }
  985. if (this.referCondition.title == '调出部门') {
  986. this.deptOptions = selection
  987. this.basicForm.deliveryDept = selection[0].id
  988. this.basicForm.deliveryDeptName = selection[0].name
  989. }
  990. if (this.referCondition.title == '币种') {
  991. this.currencyOptions = selection
  992. this.basicForm.currency = selection[0].id
  993. this.basicForm.currencyName = selection[0].name
  994. }
  995. if (this.referCondition.title == '调入仓库') {
  996. this.ruHouseOptions = selection
  997. this.basicForm.storageWarehouse = selection[0].id
  998. this.basicForm.storageWarehouseName = selection[0].name
  999. console.log('1111', selection[0].csFlag)
  1000. // 清空调入货位
  1001. this.materialInfo.forEach(item => {
  1002. item.storageAllocation = null
  1003. item.storageAllocationName = null
  1004. })
  1005. if(selection[0].csFlag == 'N') {
  1006. this.isDRCk = true
  1007. } else {
  1008. this.isDRCk = false
  1009. }
  1010. }
  1011. if (this.referCondition.title == '调出仓库') {
  1012. this.chuHouseOptions = selection
  1013. this.basicForm.deliveryWarehouse = selection[0].id
  1014. this.basicForm.deliveryWarehouseCode = selection[0].code
  1015. this.basicForm.deliveryWarehouseName = selection[0].name
  1016. console.log('2222', selection[0].csFlag)
  1017. // 清空调出货位
  1018. this.materialInfo.forEach(item => {
  1019. item.deliveryAllocation = null
  1020. item.deliveryAllocationName = null
  1021. })
  1022. if (selection[0].csFlag == 'N') {
  1023. this.isDCCk = true
  1024. } else {
  1025. this.isDCCk = false
  1026. }
  1027. }
  1028. if (this.referCondition.title == '调出货位') {
  1029. this.materialInfo[this.tableIndex].deliveryAllocationName = selection[0].name
  1030. this.materialInfo[this.tableIndex].deliveryAllocation = selection[0].id
  1031. }
  1032. if (this.referCondition.title == '调入货位') {
  1033. this.materialInfo[this.tableIndex].storageAllocationName = selection[0].name
  1034. this.materialInfo[this.tableIndex].storageAllocation = selection[0].id
  1035. }
  1036. if (this.referCondition.title == '调入部门') {
  1037. this.materialInfo[this.tableIndex].storageDeptName = selection[0].name
  1038. this.materialInfo[this.tableIndex].storageDept = selection[0].id
  1039. }
  1040. // 控制先选调出库存组织和调入库存组织再选调出部门和调入调出仓库
  1041. this.controlCk()
  1042. },
  1043. chooseTreeRefer(type, isPage, title) {
  1044. this.referCondition.type = type
  1045. this.referCondition.isPage = isPage
  1046. this.referCondition.title = title
  1047. this.$refs.tree.init(this.referCondition)
  1048. },
  1049. selectionsToInput2(selection) {
  1050. this.liacenterOptions.push(selection)
  1051. this.basicForm.liacenter = selection.id
  1052. this.basicForm.liacenterName = selection.name
  1053. },
  1054. // 明细行选择物料编码带出数据
  1055. chooseMaterial(index) {
  1056. console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
  1057. this.tableIndex = index
  1058. this.$refs.materialRefer.init()
  1059. },
  1060. selectMaterial(selection) {
  1061. console.log('选中的物料', selection)
  1062. this.materialInfo[this.tableIndex].material = selection[0].id
  1063. this.materialInfo[this.tableIndex].materialCode = selection[0].code
  1064. this.materialInfo[this.tableIndex].materialName = selection[0].name
  1065. this.materialInfo[this.tableIndex].specification = selection[0].specification
  1066. this.materialInfo[this.tableIndex].model = selection[0].model
  1067. this.materialInfo[this.tableIndex].originPlace = selection[0].originPlace
  1068. this.materialInfo[this.tableIndex].originPlaceName = selection[0].originPlaceName
  1069. this.materialInfo[this.tableIndex].unit = selection[0].unitId
  1070. this.materialInfo[this.tableIndex].mainUnit = selection[0].unitId
  1071. this.materialInfo[this.tableIndex].unitName = selection[0].unitIdName
  1072. this.materialInfo[this.tableIndex].mainUnitName = selection[0].unitIdName
  1073. this.materialInfo[this.tableIndex].manufacturer = selection[0].manufacturerIdName
  1074. this.materialInfo[this.tableIndex].marketingApprovalPersonal = selection[0].registrant
  1075. this.materialInfo[this.tableIndex].production = selection[0].productionPermit
  1076. // 根据物料单位id查询单位code
  1077. this.reBackRefer('UNIT_PARAM', selection[0].unitId)
  1078. },
  1079. // 明细行选择批次号
  1080. chooseBatch(index) {
  1081. this.tableIndex = index
  1082. this.referConditionMx.orgCode = this.basicForm.deliveryInventoryOrgCode
  1083. this.referConditionMx.materialCode = this.materialInfo[this.tableIndex].materialCode
  1084. this.referConditionMx.unitCode = this.materialInfo[this.tableIndex].unitCode
  1085. this.referConditionMx.warehouseCode = this.basicForm.deliveryWarehouseCode
  1086. this.$refs.batchRefer.init(this.referConditionMx)
  1087. },
  1088. selectBatch(selection) {
  1089. console.log('选中的批次号', selection)
  1090. },
  1091. // 明细行选择货位
  1092. chooseMxHW(index, type, isPage, title, stordocId) {
  1093. this.tableIndex = index
  1094. this.referCondition.type = type
  1095. this.referCondition.isPage = isPage
  1096. this.referCondition.title = title
  1097. this.referCondition.pkOrg = ''
  1098. this.referCondition.stordocId = stordocId
  1099. this.$refs.refer.init(this.referCondition)
  1100. },
  1101. // 明细行选择调入部门
  1102. chooseMxBM(index, type, isPage, title, pkOrg) {
  1103. this.tableIndex = index
  1104. this.referCondition.type = type
  1105. this.referCondition.isPage = isPage
  1106. this.referCondition.title = title
  1107. this.referCondition.pkOrg = pkOrg
  1108. this.$refs.refer.init(this.referCondition)
  1109. },
  1110. }
  1111. }
  1112. </script>
  1113. <style lang="scss" scoped>
  1114. .btn_group {
  1115. width: 100%;
  1116. margin: 20px 0;
  1117. display: flex;
  1118. justify-content: center;
  1119. }
  1120. .btn_grooup {
  1121. margin-bottom: 10px;
  1122. display: flex;
  1123. justify-content: flex-end;
  1124. }
  1125. .hang {
  1126. margin: auto;
  1127. }
  1128. .hang ::v-deep .el-form-item__content{
  1129. margin-left: 0px !important;
  1130. }
  1131. </style>