add.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055
  1. <template>
  2. <div id="addDemandList">
  3. <span>基本信息</span>
  4. <el-form :model="basicForm" :rules="basicRules" ref="basic" label-width="auto">
  5. <el-row :gutter="10">
  6. <el-col :span="1.5">
  7. <el-form-item label="编码">
  8. <el-input
  9. v-model="basicForm.code"
  10. size="small"
  11. disabled
  12. style="width: 200px"
  13. />
  14. </el-form-item>
  15. </el-col>
  16. <el-col :span="1.5">
  17. <el-form-item label="组织" prop="org" :rules="{ required: true, message: '请选择组织', trigger: 'blur' }">
  18. <el-select clearable size="small" v-model="basicForm.org" :disabled="sonDisable" @focus="chooseOrg('ORG_PARAM', true, '选择组织')" style="width: 200px">
  19. <el-option v-for="item in orgOptions" :key="item.id" :label="item.name" :value="item.id" />
  20. </el-select>
  21. </el-form-item>
  22. </el-col>
  23. <el-col :span="1.5">
  24. <el-form-item label="需求处理方式">
  25. <el-select disabled v-model="basicForm.demandBusinessType" size="small" style="width: 200px">
  26. <el-option v-for="dict in dict.type.sys_processing_mode" :key="dict.value" :label="dict.label" :value="dict.value">
  27. </el-option>
  28. </el-select>
  29. </el-form-item>
  30. </el-col>
  31. <el-col :span="1.5">
  32. <el-form-item label="单据状态">
  33. <el-select disabled v-model="basicForm.status" size="small" style="width: 200px">
  34. <el-option v-for="dict in dict.type.sys_status" :key="dict.value" :label="dict.label" :value="dict.value">
  35. </el-option>
  36. </el-select>
  37. </el-form-item>
  38. </el-col>
  39. <el-col :span="1.5">
  40. <el-form-item label="需求客户" prop="customer" :rules="{ required: true, message: '请选择需求客户', trigger: 'blur' }">
  41. <el-select clearable size="small" v-model="basicForm.customer" :disabled="sonDisable" @clear="cleanCustomer" @focus="chooseOrg('CUSTOMER_PARAM', true, '选择客户')" style="width: 200px">
  42. <el-option v-for="item in customerOptions" :key="item.id" :label="item.name" :value="item.id" />
  43. </el-select>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="1.5">
  47. <el-form-item label="需求客户名称">
  48. <el-input disabled v-model="basicForm.customerName" size="small" style="width: 200px"></el-input>
  49. </el-form-item>
  50. </el-col>
  51. <el-col :span="1.5">
  52. <el-form-item label="客户负责人">
  53. <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
  54. </el-form-item>
  55. </el-col>
  56. <el-col :span="1.5">
  57. <el-form-item label="需求人员">
  58. <el-select clearable size="small" v-model="basicForm.demandPersonal" :disabled="sonDisable" @focus="chooseOrg('CONTACTS_PARAM', true, '需求人员')" style="width: 200px">
  59. <el-option v-for="item in personOptions" :key="item.id" :label="item.name" :value="item.code" />
  60. </el-select>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-form-item label="需求部门">
  65. <el-select clearable v-model="basicForm.demandDept" size="small" :disabled="sonDisable" @focus="chooseOrg('DEPT_PARAM', true, '需求部门')" style="width: 200px">
  66. <el-option
  67. v-for="item in deptOptions"
  68. :key="item.id"
  69. :label="item.name"
  70. :value="item.id">
  71. </el-option>
  72. </el-select>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="1.5">
  76. <el-form-item label="需求日期" prop="demandDate" :rules="{ required: true, message: '请选择需求日期', trigger: 'blur' }">
  77. <el-date-picker
  78. v-model="basicForm.demandDate"
  79. :disabled="sonDisable"
  80. clearable
  81. type="date"
  82. value-format="yyyy-MM-dd"
  83. size="small"
  84. style="width: 200px"
  85. >
  86. </el-date-picker>
  87. </el-form-item>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-form-item label="单据来源">
  91. <el-select v-model="basicForm.source" disabled size="small" style="width: 200px">
  92. <el-option v-for="dict in dict.type.sys_bill_source" :key="dict.value" :label="dict.label" :value="dict.value">
  93. </el-option>
  94. </el-select>
  95. </el-form-item>
  96. </el-col>
  97. <el-col :span="1.5">
  98. <el-form-item label="业务类型">
  99. <el-select clearable v-model="basicForm.billType" @change="changeBillType" :disabled="sonDisable" size="small" style="width: 200px">
  100. <el-option v-for=" dict in dict.type.sys_business" :key="dict.value" :label="dict.label" :value="dict.value">
  101. </el-option>
  102. </el-select>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :span="1.5">
  106. <el-form-item label="是否客户指定">
  107. <el-select clearable v-model="basicForm.isSpeical" :disabled="sonDisable" size="small" style="width: 200px">
  108. <el-option v-for=" item in options" :key="item.value" :label="item.label" :value="item.value">
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. <!-- <el-col :span="1.5">
  114. <el-form-item label="是否处理需求">
  115. <el-input
  116. v-model="basicForm.isProcess"
  117. size="small"
  118. placeholder=""
  119. clearable
  120. style="width: 200px"
  121. />
  122. </el-form-item>
  123. </el-col> -->
  124. <el-col :span="1.5">
  125. <el-form-item label="备注">
  126. <el-input
  127. v-model.trim="basicForm.remark"
  128. size="small"
  129. :disabled="sonDisable"
  130. clearable
  131. style="width: 200px"
  132. />
  133. </el-form-item>
  134. </el-col>
  135. </el-row>
  136. <span>明细信息</span>
  137. <el-card>
  138. <div class="btn_grooup">
  139. <el-button type="primary" size="small" @click="addLine" v-if="!sonDisable">增行</el-button>
  140. <el-button type="primary" size="small" v-if="!sonDisable">批量调整</el-button>
  141. <el-button type="primary" size="small" v-if="sonPageStu == 'check' || sonPageStu == 'edit'" @click="showReserved">货权预留单</el-button>
  142. </div>
  143. <el-table
  144. :data="basicForm.puDemandItemList"
  145. fit
  146. max-height="300"
  147. @selection-change="handleSelectionChange"
  148. >
  149. <el-table-column show-overflow-tooltip type="selection"/>
  150. <el-table-column show-overflow-tooltip label="序号" type="index" align="center"/>
  151. <el-table-column show-overflow-tooltip label="行状态" align="center" prop="status" :formatter="hangStatus" width="150px"/>
  152. <el-table-column show-overflow-tooltip label="行号" align="center" prop="rowNo" />
  153. <!-- <el-table-column show-overflow-tooltip label="业务部门名称" align="center" width="180px"/> -->
  154. <!-- <el-table-column show-overflow-tooltip label="业务部门" align="center" width="180px"/> -->
  155. <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="demandCustomerName" width="200px"/>
  156. <el-table-column show-overflow-tooltip label="一级品类" align="center" prop="materialClassifyOneName" width="180px">
  157. <template slot-scope="scope">
  158. <el-form-item class="hang">
  159. <el-input readonly size="small" v-model="scope.row.materialClassifyOneName"/>
  160. </el-form-item>
  161. </template>
  162. </el-table-column>
  163. <el-table-column show-overflow-tooltip label="二级品类" align="center" prop="materialClassifyTwoName" width="180px">
  164. <template slot-scope="scope">
  165. <el-form-item class="hang">
  166. <el-input readonly size="small" v-model="scope.row.materialClassifyTwoName"/>
  167. </el-form-item>
  168. </template>
  169. </el-table-column>
  170. <el-table-column show-overflow-tooltip label="三级品类" align="center" prop="materialClassifyThreeName" width="180px">
  171. <template slot-scope="scope">
  172. <el-form-item class="hang">
  173. <el-input readonly size="small" v-model="scope.row.materialClassifyThreeName"/>
  174. </el-form-item>
  175. </template>
  176. </el-table-column>
  177. <el-table-column show-overflow-tooltip label="四级品类" align="center" prop="materialClassifyFourName" width="180px">
  178. <template slot-scope="scope">
  179. <el-form-item class="hang">
  180. <el-input readonly size="small" v-model="scope.row.materialClassifyFourName"/>
  181. </el-form-item>
  182. </template>
  183. </el-table-column>
  184. <el-table-column show-overflow-tooltip label="预留比例" align="center" prop="reservedProportion" width="150px">
  185. <template slot-scope="scope">
  186. <el-form-item class="hang">
  187. <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.reservedProportion">
  188. <el-option v-for=" dict in dict.type.sys_reserve_ratio" :key="dict.value" :label="dict.label" :value="dict.value">
  189. </el-option>
  190. </el-select>
  191. <!-- <el-input v-model="scope.row.reservedProportion"/> -->
  192. </el-form-item>
  193. </template>
  194. </el-table-column>
  195. <el-table-column show-overflow-tooltip label="预留周期" align="center" prop="reservedPeriod" width="150px">
  196. <template slot-scope="scope">
  197. <el-form-item class="hang">
  198. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.reservedPeriod"/>
  199. </el-form-item>
  200. </template>
  201. </el-table-column>
  202. <el-table-column show-overflow-tooltip label="预留数量" align="center" prop="reservedQty" width="150px">
  203. <template slot-scope="scope">
  204. <el-form-item class="hang">
  205. <el-input readonly size="small" v-model="scope.row.reservedQty"/>
  206. </el-form-item>
  207. </template>
  208. </el-table-column>
  209. <el-table-column show-overflow-tooltip label="采购员名称" align="center" prop="buyerName" width="120px"/>
  210. <el-table-column show-overflow-tooltip label="采购员" align="center" prop="buyer"/>
  211. <el-table-column show-overflow-tooltip label="物料编码" align="center" prop="materialCode" width="230px">
  212. <template slot-scope="scope">
  213. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'materialCode'" :rules="{ required: true, message: '请选择物料编码', trigger: 'blur' }">
  214. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.materialCode" @focus="chooseMaterial(scope.$index)">
  215. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseMaterial(scope.$index)"></el-button>
  216. </el-input>
  217. </el-form-item>
  218. </template>
  219. </el-table-column>
  220. <el-table-column show-overflow-tooltip label="物料名称" align="center" prop="materialName" width="230px" />
  221. <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification" />
  222. <el-table-column show-overflow-tooltip label="型号" align="center" prop="model"/>
  223. <el-table-column show-overflow-tooltip label="单位" align="center" prop="unitName"/>
  224. <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="230px"/>
  225. <el-table-column show-overflow-tooltip label="注册人" align="center" prop="registrant" width="150px"/>
  226. <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod" width="150px">
  227. <template slot-scope="scope">
  228. <el-form-item class="hang">
  229. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.puPeriod"/>
  230. </el-form-item>
  231. </template>
  232. </el-table-column>
  233. <el-table-column show-overflow-tooltip label="有效期" align="center" prop="expiry" width="120px"/>
  234. <el-table-column show-overflow-tooltip label="有效期单位" align="center" prop="expiryUnit" width="120px"/>
  235. <el-table-column show-overflow-tooltip label="最小包装" align="center" prop="minPackage" width="120px"/>
  236. <el-table-column show-overflow-tooltip label="最小订货量" align="center" prop="minOrderQty" width="120px"/>
  237. <el-table-column show-overflow-tooltip label="最小批量" align="center" prop="minBatch" width="120px"/>
  238. <el-table-column show-overflow-tooltip label="安全库存" align="center" prop="safeStock" width="120px">
  239. <template slot-scope="scope">
  240. <el-form-item class="hang">
  241. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.safeStock"/>
  242. </el-form-item>
  243. </template>
  244. </el-table-column>
  245. <el-table-column show-overflow-tooltip label="月均销量" align="center" prop="averageQtyMonth" width="120px"/>
  246. <el-table-column show-overflow-tooltip label="实际(业务)需求量" align="center" prop="qty" width="120px">
  247. <template slot-scope="scope">
  248. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'qty'" :rules="{ required: true, message: '请填写实际(业务)需求量', trigger: 'blur' }">
  249. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.qty"/>
  250. </el-form-item>
  251. </template>
  252. </el-table-column>
  253. <el-table-column show-overflow-tooltip label="需求可用周期" align="center" prop="demandPeriod" width="120px"/>
  254. <el-table-column show-overflow-tooltip label="集团预测分类" align="center" prop="forecastClassify" width="120px"/>
  255. <el-table-column show-overflow-tooltip label="交货日期" align="center" prop="deliveryDate" width="230px">
  256. <template slot-scope="scope">
  257. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'deliveryDate'" :rules="{ required: true, message: '请填写交货日期', trigger: 'blur' }">
  258. <el-date-picker
  259. v-model="scope.row.deliveryDate"
  260. :readonly="sonDisable"
  261. clearable
  262. type="datetime"
  263. size="small"
  264. format="yyyy-MM-dd"
  265. value-format="yyyy-MM-dd HH:mm:ss"
  266. placeholder="选择日期">
  267. </el-date-picker>
  268. </el-form-item>
  269. </template>
  270. </el-table-column>
  271. <el-table-column show-overflow-tooltip label="补单标识" align="center" prop="isReplenishment" width="100px">
  272. <template slot-scope="scope">
  273. <el-form-item class="hang">
  274. <el-switch
  275. v-model="scope.row.isReplenishment"
  276. disabled
  277. active-value="Y"
  278. inactive-value="N"
  279. active-color="#13ce66"
  280. inactive-color="#a1a3a9">
  281. </el-switch>
  282. </el-form-item>
  283. </template>
  284. </el-table-column>
  285. <el-table-column show-overflow-tooltip label="批号锁定标识" align="center" prop="isBatchLock" width="100px">
  286. <template slot-scope="scope">
  287. <el-form-item class="hang">
  288. <el-switch
  289. v-model="scope.row.isBatchLock"
  290. :disabled="sonDisable"
  291. active-value="Y"
  292. inactive-value="N"
  293. active-color="#13ce66"
  294. inactive-color="#a1a3a9">
  295. </el-switch>
  296. </el-form-item>
  297. </template>
  298. </el-table-column>
  299. <el-table-column show-overflow-tooltip label="业务备注" align="center" prop="remark" width="150px">
  300. <template slot-scope="scope">
  301. <el-form-item class="hang">
  302. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.remark"/>
  303. </el-form-item>
  304. </template>
  305. </el-table-column>
  306. <el-table-column show-overflow-tooltip label="采购备注" align="center" prop="puRemark" width="150px"/>
  307. <!-- <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" /> -->
  308. <el-table-column show-overflow-tooltip label="调拨占有量" align="center" prop="superiorAllotQty" width="150px"/>
  309. <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="150px">
  310. <template slot-scope="scope">
  311. <el-form-item class="hang">
  312. <el-input clearable :readonly="sonDisable" size="small" v-model="scope.row.resDemandQty"/>
  313. </el-form-item>
  314. </template>
  315. </el-table-column>
  316. <el-table-column show-overflow-tooltip label="收货仓库" align="center" prop="deliveryWarehouseName" width="200px">
  317. <template slot-scope="scope">
  318. <el-form-item class="hang">
  319. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryWarehouseName" @clear="clearHang(scope.$index, '选择收货仓库')" @focus="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')">
  320. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'WAREHOUSE_PARAM', true, '选择收货仓库')"></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="deliveryAllocationName" width="200px">
  326. <template slot-scope="scope">
  327. <el-form-item class="hang">
  328. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAllocationName" @clear="clearHang(scope.$index, '选择收货货位')" @focus="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)">
  329. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="choosehuoWei(scope.$index, 'ALLOCATION_PARAM', true, '选择收货货位', scope.row.deliveryWarehouse)"></el-button>
  330. </el-input>
  331. </el-form-item>
  332. </template>
  333. </el-table-column>
  334. <!-- <el-table-column show-overflow-tooltip label="收货货位编码" align="center" prop="deliveryAllocation" width="200px"/> -->
  335. <el-table-column show-overflow-tooltip label="末级供应仓库" align="center" prop="lastWarehouseName" width="200px"/>
  336. <el-table-column show-overflow-tooltip label="末级供应货位" align="center" prop="lastAllocationName" width="200px"/>
  337. <el-table-column show-overflow-tooltip label="紧急标识" align="center" prop="isUrgency" width="100px">
  338. <template slot-scope="scope">
  339. <el-form-item class="hang">
  340. <el-switch
  341. v-model="scope.row.isUrgency"
  342. disabled
  343. active-value="Y"
  344. inactive-value="N"
  345. active-color="#13ce66"
  346. inactive-color="#a1a3a9">
  347. </el-switch>
  348. </el-form-item>
  349. </template>
  350. </el-table-column>
  351. <el-table-column show-overflow-tooltip label="默认采购组织" align="center" prop="purOrgName" width="200px"/>yu
  352. <el-table-column show-overflow-tooltip label="默认采购组织编码" align="center" prop="puOrg" width="200px"/>
  353. <!-- <el-table-column show-overflow-tooltip label="末级供应调拨待入量" align="center" prop="lastStockQty" width="150px"/> -->
  354. <!-- <el-table-column show-overflow-tooltip label="上级供应中心现存量" align="center" prop="superiorCenterQty" width="200px"/> -->
  355. <!-- <el-table-column show-overflow-tooltip label="上级库存被调拨占用量" align="center" prop="superiorAllotQty" width="200px"/> -->
  356. <!-- <el-table-column show-overflow-tooltip label="可用量" align="center" prop="availableQty"/> -->
  357. <el-table-column show-overflow-tooltip label="调拨状态" align="center" prop="statusAllot" width="100px">
  358. <template slot-scope="scope">
  359. <el-form-item class="hang">
  360. <el-switch
  361. v-model="scope.row.statusAllot"
  362. :disabled="sonDisable"
  363. active-value="Y"
  364. inactive-value="N"
  365. active-color="#13ce66"
  366. inactive-color="#a1a3a9">
  367. </el-switch>
  368. </el-form-item>
  369. </template>
  370. </el-table-column>
  371. <el-table-column show-overflow-tooltip label="补单供应商编码" align="center" prop="additionalSupplier" width="200px">
  372. <template slot-scope="scope">
  373. <el-form-item class="hang" :prop="'puDemandItemList.' + scope.$index + '.' + 'additionalSupplier'" :rules="{ required: isBDXQ, message: '请选择补单供应商', trigger: 'blur' }">
  374. <el-input clearable :disabled="sonDisable || BDZT" size="small" v-model="scope.row.additionalSupplier" @clear="clearHang(scope.$index, '选择补单供应商')" @focus="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')">
  375. <el-button size="small" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'SUPPLIER_PARAM', true, '选择补单供应商')"></el-button>
  376. </el-input>
  377. </el-form-item>
  378. </template>
  379. </el-table-column>
  380. <el-table-column show-overflow-tooltip label="补单供应商名称" align="center" prop="additionalSupplierName" width="200px">
  381. <template slot-scope="scope">
  382. <el-form-item class="hang">
  383. <el-input readonly size="small" v-model="scope.row.additionalSupplierName"/>
  384. </el-form-item>
  385. </template>
  386. </el-table-column>
  387. <!-- <el-table-column show-overflow-tooltip label="周期单位" align="center" prop="periodUnit" width="150px">
  388. <template slot-scope="scope">
  389. <el-form-item class="hang">
  390. <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.periodUnit">
  391. <el-option v-for=" dict in dict.type.sys_period_unit" :key="dict.value" :label="dict.label" :value="dict.value">
  392. </el-option>
  393. </el-select>
  394. </el-form-item>
  395. </template>
  396. </el-table-column> -->
  397. <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
  398. <el-table-column show-overflow-tooltip label="中心仓可用量" align="center" prop="centralWarehouseQty" width="200px"/>
  399. <el-table-column show-overflow-tooltip label="调拨单号" align="center" prop="allotCode"></el-table-column>
  400. <el-table-column show-overflow-tooltip label="收货地址" align="center" prop="deliveryAddressName" width="200px">
  401. <template slot-scope="scope">
  402. <el-form-item class="hang">
  403. <el-input clearable :disabled="sonDisable" size="small" v-model="scope.row.deliveryAddressName" @clear="clearHang(scope.$index, '选择收货地址')" @focus="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')">
  404. <el-button size="small" :disabled="sonDisable" slot="append" icon="el-icon-more" @click="chooseDept(scope.$index, 'ADDRESS_PARAM', true, '选择收货地址')"></el-button>
  405. </el-input>
  406. </el-form-item>
  407. </template>
  408. </el-table-column>
  409. <el-table-column show-overflow-tooltip label="收货地址编码" align="center" prop="deliveryAddress" width="200px"></el-table-column>
  410. <el-table-column show-overflow-tooltip label="联系人" align="center" prop="contacts"/>
  411. <el-table-column show-overflow-tooltip label="联系人电话" align="center" prop="contactsPhone" width="200px"/>
  412. <el-table-column show-overflow-tooltip label="详细地址" align="center" prop="address" width="200px"/>
  413. <el-table-column show-overflow-tooltip label="价格类型" align="center" prop="priceType" width="150px">
  414. <template slot-scope="scope">
  415. <el-form-item class="hang">
  416. <el-select clearable :disabled="sonDisable" size="small" v-model="scope.row.priceType">
  417. <el-option v-for=" dict in dict.type.sys_price_type" :key="dict.value" :label="dict.label" :value="dict.value">
  418. </el-option>
  419. </el-select>
  420. <!-- <el-input v-model="scope.row.periodUnit"/> -->
  421. </el-form-item>
  422. </template>
  423. </el-table-column>
  424. <el-table-column
  425. fixed="right"
  426. label="操作"
  427. align="center"
  428. >
  429. <template slot-scope="scope">
  430. <el-button type="text" size="small" :disabled="sonDisable" @click="delLine(scope.$index, scope.row)">删除</el-button>
  431. </template>
  432. </el-table-column>
  433. </el-table>
  434. </el-card>
  435. </el-form>
  436. <div class="btn_group">
  437. <el-col :span="1.5">
  438. <el-button type="primary" size="small" plain @click="copy" v-if="sonPageStu == 'check'">复制</el-button>
  439. </el-col>
  440. <el-col :span="1.5">
  441. <el-button type="primary" size="small" plain @click="save" v-if="sonPageStu == 'add' || sonPageStu == 'edit'">保存</el-button>
  442. </el-col>
  443. <el-col :span="1.5" style="margin: 0 10px;">
  444. <el-button type="primary" size="small" plain @click="submit" v-if="sonPageStu == 'check' && (row.status == '0' || row.status == '3')">提交</el-button>
  445. </el-col>
  446. <el-col :span="1.5">
  447. <el-button size="small" plain @click="back">返回</el-button>
  448. </el-col>
  449. <Reserved v-if="dialog.config" :isVisible="dialog.config" :info="row" @updateReserved="updateReserved"/>
  450. <Refers ref="refer" @doSubmit="selectionsToInput" :single="true"/>
  451. <popDialog ref="materialRefer" @doSubmit="selectMaterial" :single="true" />
  452. </div>
  453. </div>
  454. </template>
  455. <script>
  456. import Reserved from './reserved.vue'
  457. import Refers from '@/components/Refers/refers.vue'
  458. import {addDemand,getDemandDetail, getDemandSonDetail, editDemand, submitDemand, queryMan } from '@/api/purchase/purchaseDemand.js'
  459. // 用于回显参照框数据
  460. import {getRefer} from '@/api/purchase/basic.js'
  461. // 明细行选择物料参照
  462. import popDialog from '@/components/PopDialog/index.vue'
  463. export default {
  464. name: 'addDemandList',
  465. props: ['pageStu','row', 'disable'],
  466. dicts: ['sys_processing_mode', 'sys_status', 'sys_bill_source', 'sys_business','sys_reserve_ratio', 'sys_period_unit', 'sys_price_type'],
  467. components: {
  468. Reserved,
  469. Refers,
  470. popDialog
  471. },
  472. model: {
  473. prop: 'isList',
  474. event: 'jugislist'
  475. },
  476. data() {
  477. return {
  478. // 不能直接改变props传来的值
  479. sonPageStu: this.pageStu,
  480. sonDisable: this.disable,
  481. // BDZT是补单供应商是否可以编辑条件
  482. BDZT: true,
  483. dialog: {
  484. config: false
  485. },
  486. basicForm: {
  487. code: '',
  488. org: '',
  489. orgName: '',
  490. demandBusinessType: '1',
  491. status: '0',
  492. customer: '',
  493. customerName: '',
  494. customerCode: '',
  495. customerPrincipal: '',
  496. demandPersonal: '',
  497. demandDept: '',
  498. demandDate: '',
  499. source: '4',
  500. billType: '',
  501. isSpeical: '',
  502. isProcess: '',
  503. isMonthleyCalculate: '',
  504. remark: '',
  505. puDemandItemList: []
  506. },
  507. options: [{
  508. value: 'Y', label: '是',
  509. }, {
  510. value: 'N', label: '否'
  511. }],
  512. basicRules: {},
  513. tableList: [],
  514. referCondition: {
  515. type: '',
  516. isPage: true,
  517. title: '',
  518. },
  519. referConditionMx: {
  520. type: '',
  521. isPage: true,
  522. title: '',
  523. },
  524. tableIndex: null,
  525. orgOptions: [],
  526. personOptions: [],
  527. deptOptions: [],
  528. customerOptions: [],
  529. isBDXQ: false
  530. }
  531. },
  532. created() {
  533. if(this.pageStu == 'check') {
  534. console.log('数据', this.row)
  535. this.getDetails(this.row)
  536. } else if(this.pageStu == 'edit') {
  537. this.getDetails(this.row)
  538. }
  539. },
  540. methods: {
  541. // 更改业务类型调整明细行内补单或紧急标识
  542. changeBillType() {
  543. if (this.basicForm.billType == 'BDXQ' && this.basicForm.puDemandItemList.length != 0) {
  544. this.isBDXQ = true
  545. this.BDZT = false
  546. this.basicForm.puDemandItemList.forEach(item => {item.isReplenishment = 'Y'})
  547. } else {
  548. this.isBDXQ = false
  549. this.BDZT = true
  550. this.basicForm.puDemandItemList.forEach(item => {
  551. item.isReplenishment = 'N'
  552. item.additionalSupplier = null
  553. item.additionalSupplierName = null
  554. })
  555. }
  556. if (this.basicForm.billType == 'JJXQ' && this.basicForm.puDemandItemList.length != 0) {
  557. this.basicForm.puDemandItemList.forEach(item => {item.isUrgency = 'Y'})
  558. } else {
  559. this.basicForm.puDemandItemList.forEach(item => { item.isUrgency = 'N' })
  560. }
  561. },
  562. hangStatus(row) {
  563. switch (row.status) {
  564. case '0':
  565. return '需补货'
  566. case '1':
  567. return '待计划确认'
  568. case '2':
  569. return '计划已确认'
  570. case '3':
  571. return '计划已审核'
  572. case '4':
  573. return '行关闭'
  574. case '5':
  575. return '总供应可满足'
  576. }
  577. },
  578. copy() {
  579. this.$modal.msgSuccess("复制成功");
  580. this.sonPageStu = 'add'
  581. this.sonDisable = false
  582. this.getDetails(this.row)
  583. this.basicForm.id = ''
  584. this.basicForm.code = ''
  585. },
  586. handleData() {
  587. console.log('222')
  588. // 复制新增把id,编码置为空,子表去掉id
  589. this.basicForm.id = ''
  590. this.basicForm.code = ''
  591. if (this.basicForm.puDemandItemList.length !== 0) {
  592. this.basicForm.puDemandItemList.forEach(item => {
  593. if (item.id) {
  594. delete item.id
  595. }
  596. if (item.demandId) {
  597. delete item.demandId
  598. }
  599. })
  600. }
  601. },
  602. async save() {
  603. if(this.basicForm.puDemandItemList.length !== 0) {
  604. this.$refs['basic'].validate((valid) => {
  605. if(valid) {
  606. if(this.sonPageStu == 'add') {
  607. this.handleData()
  608. addDemand(this.basicForm).then(res => {
  609. console.log(333)
  610. if (res.code === 200) {
  611. this.$modal.msgSuccess("保存成功");
  612. this.back()
  613. }
  614. })
  615. } else if (this.sonPageStu == 'edit') {
  616. editDemand(this.basicForm).then(res => {
  617. if (res.code === 200) {
  618. this.$modal.msgSuccess("编辑成功");
  619. this.back()
  620. }
  621. })
  622. }
  623. }
  624. })
  625. } else {
  626. this.$modal.msgWarning("明细信息不能为空!");
  627. }
  628. },
  629. submit() {
  630. submitDemand(this.basicForm).then(res => {
  631. if (res.code === 200) {
  632. this.$modal.msgSuccess("提交成功");
  633. this.back()
  634. }
  635. })
  636. },
  637. // 增行
  638. addLine() {
  639. const newLine = {
  640. contacts: null,
  641. id: null,
  642. demandId: null,
  643. status: null,
  644. businessDept: null,
  645. businessDeptName: null,
  646. materialCategory: null,
  647. buyer: null,
  648. buyerName: null,
  649. mateiralClassifyOne: null,
  650. materialClassifyOneName: null,
  651. materialClassifyTwo: null,
  652. materialClassifyTwoName: null,
  653. materialClassifyThree: null,
  654. materialClassifyThreeName: null,
  655. materialClassifyFour: null,
  656. materialClassifyFourName: null,
  657. materialCode: null,
  658. material: null,
  659. materialName: null,
  660. classifyId: null,
  661. specification: null,
  662. unit: null,
  663. unitName: null,
  664. manufacturerName: null,
  665. registrant: null,
  666. puPeriod: null,
  667. expiryUnit: null,
  668. expiry: null,
  669. minPackage: null,
  670. minOrderQty: null,
  671. minBatch: null,
  672. safeStock: null,
  673. averageQtyMonth: null,
  674. qty: null,
  675. adjustmentPersonal: null,
  676. adjustmentTime: null,
  677. manualRegulation: null,
  678. updateCause: null,
  679. reservedProportion: null,
  680. reservedPeriod: null,
  681. reservedQty: null,
  682. demandPeriod: null,
  683. forecastClassify: null,
  684. deliveryDate: null,
  685. isUrgency: this.basicForm.billType == 'JJXQ' ? 'Y' : 'N',
  686. isReplenishment: this.basicForm.billType == 'BDXQ'? 'Y': 'N',
  687. isBatchLock: 'N',
  688. remark: null,
  689. puRemark: null,
  690. lastWarehouseQty: null,
  691. resDemandQty: null,
  692. lastWarehouse: null,
  693. lastWarehouseName: null,
  694. deliveryWarehouse: null,
  695. deliveryWarehouseName: null,
  696. lastAllocation: null,
  697. lastAllocationName: null,
  698. deliveryAllocation: null,
  699. deliveryAllocationName: null,
  700. passageOn: null,
  701. puOrg: null,
  702. purOrgName: null,
  703. lastStockQty: null,
  704. superiorCenterQty: null,
  705. superiorAllotQty: null,
  706. availableQty: null,
  707. statusAllot: 'N',
  708. additionalSupplier: null,
  709. additionalSupplierName: null,
  710. periodUnit: null,
  711. demandCustomer: this.basicForm.customer,
  712. demandCustomerName: this.basicForm.customerName,
  713. businessDept: this.basicForm.demandDept,
  714. businessDeptName: null,
  715. lastStockOrg: null,
  716. lastStockOrgName: null,
  717. superiorStockOrg: null,
  718. superiorStockOrgName: null,
  719. allotCode: null,
  720. deliveryAddress: null,
  721. deliveryAddressName: null,
  722. contacts: null,
  723. contactsPhone: null,
  724. address: null,
  725. source: null,
  726. priceType: null,
  727. puManagerApprover: null,
  728. puManagerApproverName: null,
  729. processTime: null,
  730. affirmer: null,
  731. tenantId: null,
  732. revision: null,
  733. createBy: null,
  734. createByName: null,
  735. createTime: null,
  736. updateBy: null,
  737. updateByName: null,
  738. updateTime: null,
  739. delFlag: 0,
  740. // 新增字段
  741. model: null,
  742. storageCondition: null,
  743. transportationCondition: null,
  744. }
  745. this.basicForm.puDemandItemList.push(newLine)
  746. // 补单需求状态改变
  747. if (this.basicForm.billType == 'BDXQ') {
  748. this.BDZT = false
  749. } else {
  750. this.BDZT = true
  751. }
  752. },
  753. delLine(index) {
  754. console.log('删除行:', index)
  755. // this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
  756. // return item.id !== row.id
  757. // })
  758. this.basicForm.puDemandItemList.splice(index,1)
  759. },
  760. back() {
  761. this.$emit('jugislist', true)
  762. let queryParams = {
  763. pageNum: 1,
  764. pageSize: 10
  765. }
  766. this.$emit('refresh', queryParams)
  767. },
  768. // 如果需要回显则调用详情接口
  769. getDetails(row) {
  770. getDemandDetail(row.id).then(res => {
  771. if (res.code === 200) {
  772. // this.basicForm = res.data
  773. let reciveForm = res.data
  774. let params = {...{id: row.id}, ...{pageNum:1, pageSize: 10}}
  775. getDemandSonDetail(params).then(res => {
  776. if (res.code === 200) {
  777. reciveForm.puDemandItemList = res.data
  778. console.log('reciveForm',reciveForm)
  779. this.basicForm = reciveForm
  780. if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
  781. if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
  782. if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
  783. if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
  784. // 详情时将收货仓库id赋值给stordocId
  785. // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
  786. if(this.basicForm.billType == 'BDXQ') {
  787. this.BDZT = false
  788. this.isBDXQ = true
  789. } else {
  790. this.BDZT = true
  791. this.isBDXQ = false
  792. }
  793. }
  794. })
  795. }
  796. })
  797. },
  798. handleSelectionChange() {},
  799. // 点击预留单展示
  800. showReserved() {
  801. this.dialog.config = true
  802. },
  803. // 修改是否让页面显示与隐藏的事件
  804. updateReserved (val) {
  805. this.dialog.config = val
  806. },
  807. // 回显参照框
  808. reBackRefer(type, id) {
  809. getRefer({type: type, id: id}).then(res => {
  810. if(type == 'ORG_PARAM') {
  811. this.orgOptions = res.rows
  812. }
  813. if (type == 'CUSTOMER_PARAM') {
  814. this.customerOptions = res.rows
  815. }
  816. if (type == 'CONTACTS_PARAM') {
  817. this.personOptions = res.rows
  818. }
  819. if (type == 'DEPT_PARAM') {
  820. this.deptOptions = res.rows
  821. }
  822. })
  823. },
  824. chooseOrg(type, isPage, title) {
  825. this.referCondition.type = type
  826. this.referCondition.isPage = isPage
  827. this.referCondition.title = title
  828. this.$refs.refer.init(this.referCondition)
  829. },
  830. selectionsToInput(selection) {
  831. if(this.referCondition.type == 'ORG_PARAM' && this.referCondition.title == '选择组织') {
  832. this.orgOptions = selection
  833. this.basicForm.org = selection[0].id
  834. this.basicForm.orgName = selection[0].name
  835. }
  836. if(this.referCondition.type == 'CUSTOMER_PARAM' && this.referCondition.title == '选择客户') {
  837. this.customerOptions = selection
  838. this.basicForm.customer = selection[0].id
  839. this.basicForm.customerName = selection[0].name
  840. this.basicForm.customerCode = selection[0].code
  841. if(this.basicForm.puDemandItemList.length !== 0) {
  842. this.basicForm.puDemandItemList.forEach(item => {
  843. item.demandCustomerName = this.basicForm.customerName
  844. item.demandCustomer = this.basicForm.customer
  845. })
  846. }
  847. }
  848. if(this.referCondition.type == 'CONTACTS_PARAM') {
  849. this.personOptions = selection
  850. this.basicForm.demandPersonal = selection[0].code
  851. }
  852. if(this.referCondition.type == 'DEPT_PARAM') {
  853. this.deptOptions = selection
  854. this.basicForm.demandDept = selection[0].id
  855. }
  856. // if(this.referConditionMx.type == 'DEPT_PARAM') {
  857. // this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].code
  858. // this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].name
  859. // }
  860. if(this.referConditionMx.title == '选择收货仓库') {
  861. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = selection[0].id
  862. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = selection[0].name
  863. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
  864. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
  865. }
  866. if(this.referConditionMx.title == '选择收货货位') {
  867. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = selection[0].id
  868. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = selection[0].name
  869. }
  870. if(this.referConditionMx.title == '选择补单供应商') {
  871. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = selection[0].code
  872. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = selection[0].name
  873. }
  874. if(this.referConditionMx.title == '选择收货地址') {
  875. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = selection[0].name
  876. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = selection[0].code
  877. this.basicForm.puDemandItemList[this.tableIndex].contacts = selection[0].contactsName
  878. this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = selection[0].contactsPhone
  879. this.basicForm.puDemandItemList[this.tableIndex].address = selection[0].address
  880. }
  881. },
  882. // 明细行选择物料编码带出数据
  883. chooseMaterial(index) {
  884. console.log("🚀 ~ file: add.vue:790 ~ chooseMaterial ~ index:", index)
  885. this.tableIndex = index
  886. // 传0只展示同步NC了的物料
  887. this.$refs.materialRefer.init(0)
  888. },
  889. selectMaterial(selection) {
  890. console.log('选中的物料', selection)
  891. // 选择新物料时先清空行内其他信息
  892. this.basicForm.puDemandItemList[this.tableIndex].reservedProportion = null
  893. this.basicForm.puDemandItemList[this.tableIndex].reservedPeriod = null
  894. this.basicForm.puDemandItemList[this.tableIndex].reservedQty = null
  895. this.basicForm.puDemandItemList[this.tableIndex].qty = null
  896. this.basicForm.puDemandItemList[this.tableIndex].deliveryDate = null
  897. this.basicForm.puDemandItemList[this.tableIndex].remark = null
  898. this.basicForm.puDemandItemList[this.tableIndex].resDemandQty = null
  899. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouse = null
  900. this.basicForm.puDemandItemList[this.tableIndex].deliveryWarehouseName = null
  901. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocation = null
  902. this.basicForm.puDemandItemList[this.tableIndex].deliveryAllocationName = null
  903. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplier = null
  904. this.basicForm.puDemandItemList[this.tableIndex].additionalSupplierName = null
  905. this.basicForm.puDemandItemList[this.tableIndex].periodUnit = null
  906. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddressName = null
  907. this.basicForm.puDemandItemList[this.tableIndex].deliveryAddress = null
  908. this.basicForm.puDemandItemList[this.tableIndex].contacts = null
  909. this.basicForm.puDemandItemList[this.tableIndex].contactsPhone = null
  910. this.basicForm.puDemandItemList[this.tableIndex].address = null
  911. this.basicForm.puDemandItemList[this.tableIndex].priceType = null
  912. this.basicForm.puDemandItemList[this.tableIndex].lastWarehouseName = null
  913. this.basicForm.puDemandItemList[this.tableIndex].lastWarehouse = null
  914. this.basicForm.puDemandItemList[this.tableIndex].lastAllocation = null
  915. this.basicForm.puDemandItemList[this.tableIndex].lastAllocationName = null
  916. // 通过选择物料查询采购员
  917. queryMan(selection[0].id).then(res => {
  918. if(res.code === 200 && res.rows.length !== 0) {
  919. this.basicForm.puDemandItemList[this.tableIndex].buyer = res.rows[0].buyer
  920. this.basicForm.puDemandItemList[this.tableIndex].buyerName = res.rows[0].buyerName
  921. }
  922. })
  923. this.basicForm.puDemandItemList[this.tableIndex].businessDept = selection[0].businessDepartment
  924. this.basicForm.puDemandItemList[this.tableIndex].businessDeptName = selection[0].businessDepartmentName
  925. this.basicForm.puDemandItemList[this.tableIndex].materialCode = selection[0].code
  926. this.basicForm.puDemandItemList[this.tableIndex].material = selection[0].id
  927. this.basicForm.puDemandItemList[this.tableIndex].materialName = selection[0].name
  928. this.basicForm.puDemandItemList[this.tableIndex].classifyId = selection[0].classifyId
  929. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyOneName = selection[0].oneClass
  930. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyTwoName = selection[0].twoClass
  931. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyThreeName = selection[0].threeClass
  932. this.basicForm.puDemandItemList[this.tableIndex].materialClassifyFourName = selection[0].fourClass
  933. this.basicForm.puDemandItemList[this.tableIndex].specification = selection[0].specification
  934. this.basicForm.puDemandItemList[this.tableIndex].model = selection[0].model
  935. this.basicForm.puDemandItemList[this.tableIndex].unit = selection[0].unitId
  936. this.basicForm.puDemandItemList[this.tableIndex].unitName = selection[0].unitIdName
  937. this.basicForm.puDemandItemList[this.tableIndex].registrant = selection[0].registrant
  938. this.basicForm.puDemandItemList[this.tableIndex].manufacturerName = selection[0].manufacturerIdName
  939. this.basicForm.puDemandItemList[this.tableIndex].puPeriod = selection[0].deliveryPeriod
  940. this.basicForm.puDemandItemList[this.tableIndex].expiry = selection[0].usefulLife
  941. this.basicForm.puDemandItemList[this.tableIndex].expiryUnit = selection[0].expiryUnitIdName
  942. // this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].usefulLife
  943. this.basicForm.puDemandItemList[this.tableIndex].minPackage = selection[0].minPackQty
  944. this.basicForm.puDemandItemList[this.tableIndex].minOrderQty = selection[0].minOrderQty
  945. this.basicForm.puDemandItemList[this.tableIndex].minBatch = selection[0].minBatchQty
  946. this.basicForm.puDemandItemList[this.tableIndex].safeStock = selection[0].safeStock
  947. this.basicForm.puDemandItemList[this.tableIndex].purOrgName = selection[0].purchasingOrganizationName
  948. this.basicForm.puDemandItemList[this.tableIndex].puOrg = selection[0].purchasingOrganization
  949. // 物料存储条件和运输条件
  950. this.basicForm.puDemandItemList[this.tableIndex].transportationCondition = selection[0].transportationCondition
  951. this.basicForm.puDemandItemList[this.tableIndex].storageCondition = selection[0].storageCondition
  952. },
  953. // 明细行选择业务部门参照带出业务部门数据
  954. chooseDept(index, type, isPage, title) {
  955. this.tableIndex = index
  956. this.referConditionMx.type = type
  957. this.referConditionMx.isPage = isPage
  958. this.referConditionMx.title = title
  959. this.$refs.refer.init(this.referConditionMx)
  960. },
  961. // 明细行选择业务部门参照带出业务部门数据
  962. choosehuoWei(index, type, isPage, title, stordocId) {
  963. this.tableIndex = index
  964. this.referConditionMx.type = type
  965. this.referConditionMx.isPage = isPage
  966. this.referConditionMx.title = title
  967. // 选择收货货位前先选择收货仓库
  968. if(stordocId) {
  969. this.referConditionMx.stordocId = stordocId
  970. this.$refs.refer.init(this.referConditionMx)
  971. } else {
  972. this.$modal.msgWarning("请先选择收货仓库");
  973. }
  974. },
  975. // 明细行清空收货仓库,货位,收货地址档案等
  976. clearHang(index, title) {
  977. if (title == '选择收货仓库') {
  978. this.basicForm.puDemandItemList[index].deliveryWarehouseName = null
  979. this.basicForm.puDemandItemList[index].deliveryWarehouse = null
  980. this.basicForm.puDemandItemList[index].deliveryAllocationName = null
  981. this.basicForm.puDemandItemList[index].deliveryAllocation = null
  982. }
  983. if (title == '选择收货货位') {
  984. this.basicForm.puDemandItemList[index].deliveryAllocationName = null
  985. this.basicForm.puDemandItemList[index].deliveryAllocation = null
  986. }
  987. if (title == '选择收货地址') {
  988. this.basicForm.puDemandItemList[index].deliveryAddressName = null
  989. this.basicForm.puDemandItemList[index].deliveryAddress = null
  990. this.basicForm.puDemandItemList[index].contacts = null
  991. this.basicForm.puDemandItemList[index].contactsPhone = null
  992. this.basicForm.puDemandItemList[index].address = null
  993. }
  994. if (title == '选择补单供应商') {
  995. this.basicForm.puDemandItemList[index].additionalSupplierName = null
  996. this.basicForm.puDemandItemList[index].additionalSupplier = null
  997. }
  998. },
  999. // 清除需求客户将明细行内也清空
  1000. cleanCustomer() {
  1001. this.basicForm.customer = ''
  1002. this.basicForm.customerName = ''
  1003. if (this.basicForm.puDemandItemList.length !== 0) {
  1004. this.basicForm.puDemandItemList.forEach(item => {
  1005. item.demandCustomerName = ''
  1006. item.demandCustomer = ''
  1007. })
  1008. }
  1009. },
  1010. }
  1011. }
  1012. </script>
  1013. <style lang="scss" scoped>
  1014. .btn_group {
  1015. width: 100%;
  1016. margin: 20px 0;
  1017. display: flex;
  1018. justify-content: center;
  1019. }
  1020. .btn_grooup {
  1021. margin-bottom: 10px;
  1022. display: flex;
  1023. justify-content: flex-end;
  1024. }
  1025. .hang {
  1026. margin: auto;
  1027. }
  1028. .hang ::v-deep .el-form-item__content{
  1029. margin-left: 0px !important;
  1030. }
  1031. </style>