add.vue 52 KB

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