tranManagementWarehouseInOutTaskAdd.vue 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865
  1. // 创建出入库任务
  2. <template>
  3. <div class="container">
  4. <el-row>
  5. <el-col :span="12">
  6. <h2 class="bg-left title">创建出入库任务</h2>
  7. </el-col>
  8. <el-col :span="12" class="bg-right">
  9. <el-button class="bg-bottom" type="primary" size="small" @click="returnsales()">
  10. <img width="6" height="10" style="vertical-align: bottom; margin-right: 3px"
  11. src="../../../public/img/lujing.png" alt />返回
  12. </el-button>
  13. </el-col>
  14. </el-row>
  15. <div class="basicInformation">
  16. <div class="annu">
  17. <el-radio-group @change="tasktypechange" v-model="dataList.taskTypeKey">
  18. <el-radio label="1" class="a">出库</el-radio>
  19. <el-radio label="2" class="a">入库</el-radio>
  20. <el-radio label="3" class="a">移库</el-radio>
  21. <el-radio label="4" class="a">退库并出库</el-radio>
  22. </el-radio-group>
  23. </div>
  24. <div class="ding"></div>
  25. <div v-if="dataList.taskTypeKey != 2 && dataList.taskTypeKey != 4" class="center1">
  26. <img style="position: relative; top: 40px; left: 300px" width="19" height="19"
  27. src="../../../public/img/cangku.png" alt />
  28. <!--出库=-->
  29. <div class="small-title">
  30. <h3>出库任务({{ inOutTaskNo }})</h3>
  31. </div>
  32. <el-form ref="dataList" :model="dataList" label-width="140px" input-width="300px">
  33. <!-- 仓库名 -->
  34. <el-form-item label="仓库名">
  35. <el-select v-model="dataList.warehouseName" placeholder="请选择仓库名" class="typeselect"
  36. @change="selectwarehouseName">
  37. <el-option v-for="item in warehouseNameList" :key="item.constKey"
  38. :label="item.warehouseName" :value="item.id" />
  39. </el-select>
  40. </el-form-item>
  41. <!-- 出库类型 -->
  42. <el-form-item label="出库类型">
  43. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  44. v-model="dataList.inOutType" placeholder="请选择出库类型" class="typeselect"
  45. @change="selectstorageType">
  46. <el-option v-for="item in storageType" :key="item.constKey" v-if="
  47. (dataList.taskTypeKey == 1 &&
  48. item.constValue != '移库出库') ||
  49. (dataList.taskTypeKey == 3 &&
  50. item.constValue == '移库出库') ||
  51. (dataList.taskTypeKey == 4 && item.constValue == '销售出库')
  52. " :label="item.constValue" :value="item.constValue" />
  53. </el-select>
  54. </el-form-item>
  55. <!-- 合同编号 -->
  56. <el-form-item v-if="dataList.taskTypeKey != 3" label="合同编号">
  57. <el-select @change="changecontract" v-model="dataList.contractNo" placeholder="请输入合同编号"
  58. class="typeselect">
  59. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  60. :value="item.contractNo"></el-option>
  61. </el-select>
  62. </el-form-item>
  63. <el-form-item v-if="dataList.taskTypeKey == 3" label="移库任务编号">
  64. <el-input @input="selectTaskNo" v-model="dataList.moveTaskNo" placeholder="请输入移库任务编号"
  65. class="typeselect">
  66. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  67. :value="item.contractNo"></el-option>
  68. </el-input>
  69. </el-form-item>
  70. <!-- 货名 -->
  71. <el-form-item label="货名" class="huom">
  72. <el-select :disabled="dataList.taskTypeKey != 3" v-model="dataList.goodsName" placeholder="货名"
  73. class="huom" @change="selectgoodsName">
  74. <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  75. :value="item.constValue"></el-option>
  76. </el-select>
  77. </el-form-item>
  78. <!--重量(吨)-->
  79. <el-form-item label="重量(吨)">
  80. <el-input @input="weightchange1" v-model="dataList.weight" placeholder="请输入重量(吨)"
  81. maxlength="120" size="small" class="huom" />
  82. </el-form-item>
  83. <!-- 品级 -->
  84. <el-form-item label="品级">
  85. <el-select :disabled='gradestatus' v-model="dataList.grade" placeholder class="typeselect"
  86. @change="selectpackingMethod">
  87. <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  88. :value="item.constValue" />
  89. </el-select>
  90. </el-form-item>
  91. <!--容重(克/升)>=-->
  92. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="容重(克/升)>=" span="1">
  93. <el-input disabled @input="bulkDensitychange" v-model="dataList.bulkDensity" placeholder="请输入容重"
  94. maxlength="120" size="small" class="huom" />
  95. </el-form-item>
  96. <!--水分(%)<=-->
  97. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="水分(%)<=">
  98. <el-input disabled @input="waterContentchange" v-model="dataList.waterContent"
  99. placeholder="请输入水分占比" maxlength="120" size="small" class="huom" />
  100. </el-form-item>
  101. <!--单价(元/吨)-->
  102. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="单价(元/吨)" v-show="Pricetype">
  103. <el-input disabled @input="unitPricechange" v-model="dataList.unitPrice" placeholder="请输入单价"
  104. maxlength="120" size="small" class="huom" />
  105. </el-form-item>
  106. <!--预计出库日期-->
  107. <el-form-item label="预计出库日期" span="1" prop="predictDate" class="deliverydate">
  108. <el-date-picker v-model="dataList.predictDate" type="date" placeholder="请选择预计出库日期"
  109. value-format="yyyy-MM-dd" />
  110. </el-form-item>
  111. <!--预估运费(元/吨)-->
  112. <el-form-item label="预估运费(元/吨)" span="1">
  113. <el-input v-model="dataList.estimatedFreight" placeholder="请输入预估运费"
  114. maxlength="20" size="small" />
  115. </el-form-item>
  116. <!--经办人-->
  117. <el-form-item label="发货人">
  118. <el-select v-model="dataList.agent" placeholder="请选择发货人" filterable
  119. @change="selectstaff">
  120. <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
  121. </el-select>
  122. </el-form-item>
  123. <!--业务描述=-->
  124. <el-form-item v-if="dataList.taskTypeKey != 3" label="业务描述" span="20">
  125. <el-input v-model="dataList.businessDescribe" placeholder="请输入业务描述(运输方式),不超过150字"
  126. maxlength="150" size="large" />
  127. </el-form-item>
  128. </el-form>
  129. </div>
  130. <div v-show="dataList.taskTypeKey != 1" class="center1">
  131. <img style="position: relative; top: 40px; left: 300px" width="19" height="19"
  132. src="../../../public/img/cangku.png" alt />
  133. <div class="small-title">
  134. <h3>入库任务({{ inOutTaskNo1 }} )</h3>
  135. </div>
  136. <el-form v-if="!deletetask" ref="form" :model="form" label-width="140px">
  137. <!-- 仓库名 -->
  138. <el-form-item label="仓库名">
  139. <el-select v-model="dataList1.warehouseName" placeholder="请选择仓库名" class="typeselect"
  140. @change="selectwarehouseName1">
  141. <el-option v-for="item in warehouseNameList" :key="item.constKey"
  142. :label="item.warehouseName" :value="item.id" />
  143. </el-select>
  144. </el-form-item>
  145. <!-- 入库类型 -->
  146. <el-form-item label="入库类型">
  147. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  148. v-model="dataList1.inOutType" placeholder="请选择入库类型" class="typeselect"
  149. @change="selectstorageType1">
  150. <el-option v-for="item in storageType1" :key="item.constKey" v-if="
  151. (dataList1.taskTypeKey == 2 &&
  152. item.constValue != '移库入库') ||
  153. (dataList1.taskTypeKey == 3 &&
  154. item.constValue == '移库入库') ||
  155. (dataList1.taskTypeKey == 4 && item.constValue == '退库')
  156. " :label="item.constValue" :value="item.constValue" />
  157. </el-select>
  158. </el-form-item>
  159. <!-- 合同编号 -->
  160. <el-form-item v-if="dataList1.taskTypeKey != 3" label="合同编号">
  161. <el-select @change="changecontract1" v-model="dataList1.contractNo" placeholder="请输入合同编号"
  162. class="typeselect">
  163. <el-option v-for="item in contractNoList1" :key="item.constKey" :label="item.contractNo"
  164. :value="item.contractNo"></el-option>
  165. </el-select>
  166. </el-form-item>
  167. <el-form-item v-if="dataList1.taskTypeKey == 3" label="移库任务编号">
  168. <el-input disabled v-model="dataList1.moveTaskNo" placeholder="请输入移库任务编号" class="typeselect">
  169. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  170. :value="item.contractNo"></el-option>
  171. </el-input>
  172. </el-form-item>
  173. <!-- 货名 -->
  174. <el-form-item label="货名" class="huom">
  175. <el-select :disabled="dataList.taskTypeKey != 3 || dataList.taskTypeKey == 3"
  176. v-model="dataList.goodsName" placeholder="货名" class="huom" @change="selectgoodsName1">
  177. <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  178. :value="item.constValue"></el-option>
  179. </el-select>
  180. </el-form-item>
  181. <!--重量(吨)-->
  182. <el-form-item label="重量(吨)">
  183. <el-input @input="weightchange" v-model="dataList1.weight" placeholder="请输入重量(吨)"
  184. maxlength="120" size="small" class="huom" />
  185. </el-form-item>
  186. <!-- 品级 -->
  187. <el-form-item label="品级">
  188. <el-select :disabled="dataList.taskTypeKey == 3" v-model="dataList1.grade" placeholder
  189. class="typeselect" @change="selectpackingMethod1">
  190. <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  191. :value="item.constValue" />
  192. </el-select>
  193. </el-form-item>
  194. <!--容重(克/升)>=-->
  195. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="容重(克/升)>=">
  196. <el-input @input="bulkDensitychange" :disabled="dataList.taskTypeKey == 3"
  197. v-model="dataList1.bulkDensity" placeholder="请输入容重" maxlength="120" size="small"
  198. class="huom" />
  199. </el-form-item>
  200. <!--水分(%)<=-->
  201. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="水分(%)<=">
  202. <el-input @input="waterContentchange" :disabled="dataList.taskTypeKey == 3"
  203. v-model="dataList1.waterContent" placeholder="请输入水分占比" maxlength="120" size="small"
  204. class="huom" />
  205. </el-form-item>
  206. <!--单价(元/吨)-->
  207. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="单价(元/吨)" >
  208. <el-input @input="unitPricechange" :disabled="dataList.taskTypeKey == 3"
  209. v-model="dataList1.unitPrice" placeholder="请输入单价" maxlength="120" size="small"
  210. class="huom" />
  211. </el-form-item>
  212. <!--预计出库日期-->
  213. <el-form-item label="预计入库日期" span="1" prop="predictDate" class="deliverydate">
  214. <el-date-picker v-model="dataList1.predictDate" type="date" placeholder="请选择预计入库日期"
  215. value-format="yyyy-MM-dd" />
  216. </el-form-item>
  217. <!--预估运费(元/吨)-->
  218. <el-form-item label="预估运费(元/吨)" span="1" >
  219. <el-input v-model="dataList1.estimatedFreight" placeholder="请输入预估运费"
  220. maxlength="20" size="small" />
  221. </el-form-item>
  222. <!-- 经办人-->
  223. <el-form-item label="收货人">
  224. <el-select v-model="dataList1.agent" placeholder="请选择收货人" filterable :filter-method="dataFilter1"
  225. @change="selectstaff1">
  226. <el-option v-for="item in options1" :key="item.value" :label="item.staffName" :value="item.staffName" />
  227. </el-select>
  228. </el-form-item>
  229. <!--业务描述=-->
  230. <el-form-item v-if="dataList.taskTypeKey != 4" label="业务描述">
  231. <el-input v-model="dataList1.businessDescribe" placeholder="请输入业务描述(运输方式),不超过150字"
  232. maxlength="150" size="large" />
  233. </el-form-item>
  234. </el-form>
  235. </div>
  236. <div v-if="dataList.taskTypeKey == 4" class="center1">
  237. <!--出库=-->
  238. <div class="small-title">
  239. <img style="position: relative; top: 40px; left: -22px" width="19" height="19"
  240. src="../../../public/img/cangku.png" alt />
  241. <h3>出库任务({{ inOutTaskNo }})</h3>
  242. </div>
  243. <el-form ref="dataList" :model="dataList" label-width="140px">
  244. <!-- 仓库名 -->
  245. <el-form-item label="仓库名">
  246. <el-select v-model="dataList.warehouseName" placeholder="请选择仓库名" class="typeselect"
  247. @change="selectwarehouseName">
  248. <el-option v-for="item in warehouseNameList" :key="item.constKey"
  249. :label="item.warehouseName" :value="item.id" />
  250. </el-select>
  251. </el-form-item>
  252. <!-- 出库类型 -->
  253. <el-form-item label="出库类型">
  254. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  255. v-model="dataList.inOutType" placeholder="请选择出库类型" class="typeselect"
  256. @change="selectstorageType1">
  257. <el-option v-for="item in storageType" :key="item.constKey" v-if="
  258. (dataList.taskTypeKey == 1 &&
  259. item.constValue != '移库出库') ||
  260. (dataList.taskTypeKey == 3 &&
  261. item.constValue == '移库出库') ||
  262. (dataList.taskTypeKey == 4 && item.constValue == '销售出库')
  263. " :label="item.constValue" :value="item.constValue" />
  264. </el-select>
  265. </el-form-item>
  266. <!-- 合同编号 -->
  267. <el-form-item v-if="dataList.taskTypeKey != 3" label="合同编号">
  268. <el-select @change="changecontract" v-model="dataList.contractNo" placeholder="请输入合同编号"
  269. class="typeselect">
  270. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  271. :value="item.contractNo"></el-option>
  272. </el-select>
  273. </el-form-item>
  274. <el-form-item v-if="dataList.taskTypeKey == 3" label="移库任务编号">
  275. <el-select @change="selectTaskNo" v-model="dataList.moveTaskNo" placeholder="请输入移库任务编号"
  276. class="typeselect">
  277. <el-option v-for="item in contractNoList" :key="item.constKey" :label="item.contractNo"
  278. :value="item.contractNo"></el-option>
  279. </el-select>
  280. </el-form-item>
  281. <!-- 货名 -->
  282. <el-form-item label="货名" class="huom">
  283. <el-select :disabled="dataList.taskTypeKey != 3" v-model="dataList.goodsName" placeholder="货名"
  284. class="huom" @change="selectgoodsName">
  285. <el-option v-for="item in goodnameList" :key="item.constKey" :label="item.constValue"
  286. :value="item.constValue"></el-option>
  287. </el-select>
  288. </el-form-item>
  289. <!--重量(吨)-->
  290. <el-form-item label="重量(吨)">
  291. <el-input :disabled="dataList.taskTypeKey == 4" v-model="dataList.weight" placeholder="请输入重量(吨)"
  292. maxlength="120" size="small" class="huom" />
  293. </el-form-item>
  294. <!-- 品级 -->
  295. <el-form-item label="品级">
  296. <el-select :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  297. v-model="dataList.grade" placeholder class="typeselect" @change="selectpackingMethod">
  298. <el-option v-for="item in gradeList" :key="item.constKey" :label="item.constValue"
  299. :value="item.constValue" />
  300. </el-select>
  301. </el-form-item>
  302. <!--容重(克/升)>=-->
  303. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="容重(克/升)>=">
  304. <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  305. v-model="dataList.bulkDensity" placeholder="请输入容重" maxlength="120" size="small"
  306. class="huom" />
  307. </el-form-item>
  308. <!--水分(%)<=-->
  309. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="水分(%)<=">
  310. <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  311. v-model="dataList.waterContent" placeholder="请输入水分占比" maxlength="120" size="small"
  312. class="huom" />
  313. </el-form-item>
  314. <!--单价(元/吨)-->
  315. <el-form-item v-if='dataList.taskTypeKey != 3||dataList1.taskTypeKey != 3' label="单价(元/吨)" v-show="Pricetype">
  316. <el-input :disabled="dataList.taskTypeKey == 3 || dataList.taskTypeKey == 4"
  317. v-model="dataList.unitPrice" placeholder="请输入单价" maxlength="120" size="small"
  318. class="huom" />
  319. </el-form-item>
  320. <!--预计出库日期-->
  321. <el-form-item label="预计出库日期" span="1" prop="predictDate" class="deliverydate">
  322. <el-date-picker v-model="dataList.predictDate" type="date" placeholder="请选择预计出库日期"
  323. value-format="yyyy-MM-dd" />
  324. </el-form-item>
  325. <!--预估运费(元/吨)-->
  326. <el-form-item label="预估运费(元/吨)" span="1" >
  327. <el-input v-model="dataList.estimatedFreight" placeholder="请输入预估运费"
  328. maxlength="20" size="small" />
  329. </el-form-item>
  330. <!--发货人-->
  331. <el-form-item label="发货人">
  332. <el-select v-model="dataList.agent" placeholder="请选择发货人" filterable
  333. @change="selectstaff">
  334. <el-option v-for="item in options" :key="item.value" :label="item.staffName" :value="item.staffName" />
  335. </el-select>
  336. </el-form-item>
  337. <!--业务描述=-->
  338. <el-form-item label="业务描述">
  339. <el-input v-model="dataList.businessDescribe" placeholder="请输入业务描述(运输方式),不超过150字"
  340. maxlength="150" size="large" />
  341. </el-form-item>
  342. </el-form>
  343. </div>
  344. </div>
  345. <!-- 提交 -->
  346. <div style="text-align: right; padding: 10px" class="center">
  347. <el-button class="bg-bottom" type="primary" size="small" @click="submit()">提交</el-button>
  348. </div>
  349. </div>
  350. </template>
  351. <script>
  352. import {
  353. getwarehousename,
  354. xialaNo,
  355. addoreditoutput,
  356. getGoodsName
  357. } from '@/model/tasksport/index'
  358. import {
  359. mapGetters
  360. } from 'vuex'
  361. import {
  362. pullDown,
  363. getstaff
  364. } from '@/model/warehouse/index'
  365. import Pagination from '@/components/Pagination'
  366. import WsUpload from '@/components/WsUpload'
  367. // import { dayjs, fmoney, EventBus } from 'base-core-lib'
  368. import {
  369. dayjs,
  370. EventBus
  371. } from 'base-core-lib'
  372. export default {
  373. name: 'viewSpareMoney',
  374. components: {
  375. WsUpload,
  376. Pagination
  377. },
  378. watch: {
  379. // vesselId(val) {
  380. // this.getList()
  381. // },
  382. isShow(val) {
  383. this.showType = val
  384. },
  385. flag(val) {
  386. xialaNo({
  387. compId: this.compId,
  388. flag: val
  389. })
  390. .toPromise()
  391. .then(response => {
  392. if (
  393. this.dataList1.taskTypeKey == 2 ||
  394. this.dataList1.taskTypeKey == 4
  395. ) {
  396. this.contractNoList1 = response
  397. if (this.dataList1.taskTypeKey == 2) {
  398. this.contractNoList = response
  399. }
  400. } else {
  401. this.contractNoList = response
  402. }
  403. })
  404. }
  405. },
  406. computed: {
  407. ...mapGetters(['deptBudgetList'])
  408. },
  409. data() {
  410. return {
  411. gradestatus:true,
  412. flag: 1,
  413. //弹出框
  414. dialogViewSpareMoney: false,
  415. dialogApproveFormVisible: false,
  416. // 船舶类型
  417. monetaryKey: null,
  418. // 表格显示数据
  419. tableDate: [],
  420. // 是否显示
  421. showType: true,
  422. disabled: false,
  423. // 年
  424. year: '',
  425. contractNoList: [],
  426. contractNoList1: [],
  427. deptBudgetTotal: 0,
  428. readonly: true,
  429. currentPage: 1,
  430. pageSize: 10,
  431. searchType: 1,
  432. searchKeyWord: '',
  433. radio: '1',
  434. contractType: 2,
  435. startDate: null,
  436. endDate: null,
  437. goodnameList: [],
  438. checked: true,
  439. form: {},
  440. staffList: [],
  441. staffList1: [],
  442. options: [],
  443. options1: [],
  444. storageType: [],
  445. storageType1: [],
  446. outContractNo: [],
  447. // 提交类型
  448. submitType: true,
  449. status: [],
  450. warehouseNameList: [],
  451. warehouseNameList1: [],
  452. appendixIdsAdd: '',
  453. uploadSuccess: {},
  454. deletetask: false,
  455. warehouseInOutDetail: {},
  456. onChange: {},
  457. deptBudgetList1: [],
  458. gradeList: [],
  459. rules: {
  460. netWeight: [{
  461. required: true,
  462. type: 'number',
  463. message: '请输入活动名称',
  464. trigger: 'blur'
  465. }]
  466. },
  467. size: 10,
  468. compId: localStorage.getItem('ws-pf_compId'),
  469. deptCircularPage: {},
  470. packtypeList: {},
  471. date: {
  472. year: dayjs().format('YYYY'),
  473. month: dayjs().format('MM')
  474. },
  475. contractList: [],
  476. inOutTaskNo: '',
  477. inOutTaskNo1: '',
  478. dataList: {
  479. taskTypeKey: '1'
  480. },
  481. dataList1: {
  482. taskTypeKey: '1',
  483. inOutType: ''
  484. },
  485. historyList: [],
  486. pickerBeginDateBefore: {
  487. disabledDate: time => {
  488. return time.getTime() > Date.now()
  489. }
  490. },
  491. accessoryTFs: false,
  492. Pricetype:true,//价格类型为随行就市隐藏单价
  493. }
  494. },
  495. activated() {
  496. this.getList()
  497. },
  498. methods: {
  499. //返回按钮
  500. revert() {
  501. this.$router.go(-1)
  502. },
  503. returnsales() {
  504. this.$router.push({
  505. path: 'tranManagementWarehouseInOuttask'
  506. })
  507. },
  508. // 获取当前年月日
  509. getdate() {
  510. var date = new Date()
  511. var year = date.getFullYear() //获取完整的年份(4位)
  512. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  513. var datetime = date.getDate() //获取当前日(1-31)
  514. var hour = date.getHours()
  515. var minutes = date.getMinutes()
  516. var seconds = date.getSeconds()
  517. if (mouth < 10) {
  518. mouth = '0' + mouth
  519. }
  520. if (datetime < 10) {
  521. datetime = '0' + datetime
  522. }
  523. if (hour < 10) {
  524. hour = '0' + hour
  525. }
  526. if (minutes < 10) {
  527. minutes = '0' + minutes
  528. }
  529. if (seconds < 10) {
  530. seconds = '0' + seconds
  531. }
  532. return year + '' + mouth + datetime + hour + minutes + seconds
  533. },
  534. // 随机验证码
  535. verifyinit() {
  536. var arr = []
  537. for (var i = 48; i < 57; i++) {
  538. arr.push(String.fromCharCode(i))
  539. }
  540. arr.sort(function() {
  541. return Math.random() - 0.5
  542. })
  543. arr.length = 4
  544. return arr.join('')
  545. },
  546. MathRand() {
  547. var Num = ''
  548. for (var i = 0; i < 4; i++) {
  549. Num += Math.floor(Math.random() * 10)
  550. }
  551. return Num
  552. },
  553. selectTaskNo(e) {
  554. if (this.dataList.taskTypeKey == 3) {
  555. this.$set(this.dataList1, 'moveTaskNo', e)
  556. }
  557. },
  558. dataFilter(val) {
  559. // console.log(val,"名")
  560. this.deptBudgetList.staffList = val
  561. if (val) {
  562. //val存在
  563. this.options = this.staffList.filter(item => {
  564. if (
  565. !!~item.staffName.indexOf(val) ||
  566. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  567. ) {
  568. return true
  569. }
  570. })
  571. } else {
  572. //val为空时,还原数组
  573. this.options = this.staffList
  574. }
  575. },
  576. dataFilter1(val) {
  577. // console.log(val,"名")
  578. this.deptBudgetList.staffList1 = val
  579. if (val) {
  580. //val存在
  581. this.options = this.staffList1.filter(item => {
  582. if (
  583. !!~item.staffName.indexOf(val) ||
  584. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  585. ) {
  586. return true
  587. }
  588. })
  589. } else {
  590. //val为空时,还原数组
  591. this.options1 = this.staffList1
  592. }
  593. },
  594. weightchange(e) {
  595. if (this.dataList.taskTypeKey == 4) {
  596. this.$set(this.dataList, 'weight', e)
  597. }
  598. },
  599. weightchange1(e) {
  600. if (this.dataList.taskTypeKey == 3) {
  601. this.$set(this.dataList1, 'weight', e)
  602. }
  603. },
  604. bulkDensitychange(e) {
  605. if (this.dataList.taskTypeKey == 4) {
  606. this.$set(this.dataList, 'bulkDensity', e)
  607. } else if (this.dataList1.taskTypeKey == 3) {
  608. this.$set(this.dataList1, 'bulkDensity', e)
  609. }
  610. },
  611. waterContentchange(e) {
  612. if (this.dataList.taskTypeKey == 4) {
  613. this.$set(this.dataList, 'waterContent', e)
  614. } else if (this.dataList1.taskTypeKey == 3) {
  615. this.$set(this.dataList1, 'waterContent', e)
  616. }
  617. },
  618. unitPricechange(e) {
  619. if (this.dataList.taskTypeKey == 4) {
  620. this.$set(this.dataList, 'unitPrice', e)
  621. } else if (this.dataList1.taskTypeKey == 3) {
  622. this.$set(this.dataList1, 'unitPrice', e)
  623. }
  624. },
  625. changecontract(e) {
  626. if (this.dataList.taskTypeKey != 3) {
  627. for (let i = 0; i < this.contractNoList.length; i++) {
  628. if (this.contractNoList[i].contractNo == e) {
  629. if(this.contractNoList[i].priceType == "随行就市"){
  630. this.Pricetype = false
  631. }else{
  632. this.Pricetype = true
  633. }
  634. getGoodsName({
  635. contractId: this.contractNoList[i].id,
  636. contractNo: this.contractNoList[i].contractNo
  637. })
  638. .toPromise()
  639. .then(response => {
  640. this.$set(this.dataList, 'goodsName', response.goodsName)
  641. this.$set(this.dataList, 'goodsNameKey', response.goodsNameKey)
  642. this.$set(this.dataList, 'grade', response.grade)
  643. this.$set(this.dataList, 'gradeKey', response.gradeKey)
  644. this.$set(this.dataList, 'waterContent', response.waterContent)
  645. this.$set(this.dataList, 'bulkDensity', response.bulkDensity)
  646. // this.$set(this.dataList, 'weight', response.weight)
  647. this.$set(
  648. this.dataList,
  649. 'unitPrice',
  650. response.unitContractPrice
  651. )
  652. })
  653. }
  654. }
  655. }
  656. },
  657. selectwarehouseName(e) {
  658. for (var i = 0; i < this.warehouseNameList.length; i++) {
  659. if (this.warehouseNameList[i].id == e) {
  660. this.dataList.warehouseName = this.warehouseNameList[i].warehouseName
  661. if(this.dataList.taskTypeKey==3||this.dataList1.taskTypeKey==3){
  662. if(this.warehouseNameList[i].warehouseType==2){
  663. this.$set(this.dataList, 'goodsName', this.warehouseNameList[i].goodsName)
  664. this.$set(this.dataList, 'grade', this.warehouseNameList[i].grade)
  665. this.$set(this.dataList1, 'goodsName', this.warehouseNameList[i].goodsName)
  666. this.$set(this.dataList1, 'grade', this.warehouseNameList[i].grade)
  667. this.gradestatus=true
  668. }else{
  669. this.gradestatus=false
  670. }
  671. }
  672. console.log(this.warehouseNameList[i])
  673. //经办人
  674. getstaff({
  675. compId: localStorage.getItem('ws-pf_compId'),
  676. warehouseId: e
  677. })
  678. .toPromise()
  679. .then(response => {
  680. this.options = response
  681. this.staffList = response
  682. // this.agent = response
  683. })
  684. }
  685. }
  686. },
  687. selectwarehouseName1(e) {
  688. for (var i = 0; i < this.warehouseNameList.length; i++) {
  689. if (this.warehouseNameList[i].id == e) {
  690. this.dataList1.warehouseName = this.warehouseNameList[i].warehouseName
  691. //经办人
  692. getstaff({
  693. compId: localStorage.getItem('ws-pf_compId'),
  694. warehouseId: e
  695. })
  696. .toPromise()
  697. .then(response => {
  698. this.options1 = response
  699. this.staffList1 = response
  700. // this.agent = response
  701. })
  702. }
  703. }
  704. },
  705. changecontract1(e) {
  706. if (this.dataList1.taskTypeKey != 3) {
  707. for (let i = 0; i < this.contractNoList.length; i++) {
  708. if (this.contractNoList[i].contractNo == e) {
  709. getGoodsName({
  710. contractId: this.contractNoList[i].id,
  711. contractNo: this.contractNoList[i].contractNo
  712. })
  713. .toPromise()
  714. .then(response => {
  715. this.$set(this.dataList1, 'goodsName', response.goodsName)
  716. this.$set(this.dataList1, 'goodsNameKey', response.goodsNameKey)
  717. this.$set(this.dataList1, 'grade', response.grade)
  718. this.$set(this.dataList1, 'gradeKey', response.gradeKey)
  719. this.$set(this.dataList1, 'waterContent', response.waterContent)
  720. this.$set(this.dataList1, 'bulkDensity', response.bulkDensity)
  721. this.$set(this.dataList1, 'weight', response.weight)
  722. this.$set(
  723. this.dataList1,
  724. 'unitPrice',
  725. response.unitContractPrice
  726. )
  727. })
  728. }
  729. }
  730. }
  731. },
  732. selectstaff(e) {
  733. for (var i = 0; i < this.staffList.length; i++) {
  734. if (this.staffList[i].staffName == e) {
  735. this.dataList.agentKey = this.staffList[i].staffId
  736. }
  737. }
  738. },
  739. selectstaff1(e) {
  740. for (var i = 0; i < this.staffList.length; i++) {
  741. if (this.staffList[i].staffName == e) {
  742. this.dataList1.agentKey = this.staffList[i].staffId
  743. }
  744. }
  745. },
  746. requestadd(list, status) {
  747. list.compId = localStorage.getItem('ws-pf_compId')
  748. list.publisher =
  749. localStorage.getItem('ws-pf_roleName') +
  750. localStorage.getItem('ws-pf_staffName')
  751. addoreditoutput(list)
  752. .toPromise()
  753. .then(response => {
  754. var that = this
  755. this.$message.success('添加成功')
  756. setTimeout(function() {
  757. that.dataList = {
  758. taskTypeKey: 1
  759. }
  760. that.dataList1 = {}
  761. that.$router.push({
  762. path: 'tranManagementWarehouseInOuttask'
  763. })
  764. }, 2000)
  765. })
  766. },
  767. //提交按钮
  768. submit() {
  769. if (this.dataList.taskTypeKey == 1) {
  770. if (!this.dataList.warehouseName) {
  771. this.$message({
  772. message: '仓库名不能为空!',
  773. type: 'warning'
  774. })
  775. return
  776. }
  777. if (!this.dataList.contractNo) {
  778. this.$message({
  779. message: '合同编号不能为空!',
  780. type: 'warning'
  781. })
  782. return
  783. }
  784. if (!this.dataList.weight) {
  785. this.$message({
  786. message: '重量(吨)不能为空!',
  787. type: 'warning'
  788. })
  789. return
  790. }
  791. if (
  792. isNaN(this.dataList.weight) ||
  793. (String(this.dataList.weight).indexOf('.') != -1 &&
  794. String(this.dataList.weight).length -
  795. (String(this.dataList.weight).indexOf('.') + 1) >
  796. 2) ||
  797. this.dataList.weight < 0 ||
  798. this.dataList.weight > 200000
  799. ) {
  800. this.$message({
  801. message: '重量(吨)输入有误!',
  802. type: 'warning'
  803. })
  804. return
  805. }
  806. if (!this.dataList.bulkDensity) {
  807. this.$message({
  808. message: '容重不能为空!',
  809. type: 'warning'
  810. })
  811. return
  812. }
  813. if (
  814. this.dataList.bulkDensity < 0 ||
  815. this.dataList.bulkDensity > 1000
  816. ) {
  817. this.$message({
  818. message: '容重输入错误',
  819. type: 'warning'
  820. })
  821. return
  822. }
  823. if (
  824. String(this.dataList.bulkDensity).indexOf('.') != -1 &&
  825. String(this.dataList.bulkDensity).length -
  826. (String(this.dataList.bulkDensity).indexOf('.') + 1) >
  827. 0
  828. ) {
  829. this.$message({
  830. message: '容重需输入整数',
  831. type: 'warning'
  832. })
  833. return
  834. }
  835. if (!this.dataList.waterContent) {
  836. this.$message({
  837. message: '水分不能为空!',
  838. type: 'warning'
  839. })
  840. return
  841. }
  842. if (this.dataList.waterContent < 0 || this.dataList.waterContent > 40) {
  843. this.$message({
  844. message: '水分输入错误',
  845. type: 'warning'
  846. })
  847. return
  848. }
  849. if (
  850. String(this.dataList.waterContent).indexOf('.') != -1 &&
  851. String(this.dataList.waterContent).length -
  852. (String(this.dataList.waterContent).indexOf('.') + 1) >
  853. 1
  854. ) {
  855. this.$message({
  856. message: '水分输入错误',
  857. type: 'warning'
  858. })
  859. return
  860. }
  861. if(this.Pricetype){
  862. if (!this.dataList.unitPrice) {
  863. this.$message({
  864. message: '单价不能为空!',
  865. type: 'warning'
  866. })
  867. return
  868. }
  869. if (
  870. (this.dataList.unitPrice &&
  871. String(this.dataList.unitPrice).indexOf('.') != -1 &&
  872. String(this.dataList.unitPrice).length -
  873. (String(this.dataList.unitPrice).indexOf('.') + 1) >
  874. 2) ||
  875. this.dataList.unitPrice > 100000 ||
  876. this.dataList.unitPrice < 1
  877. ) {
  878. this.$message({
  879. message: '单价输入错误',
  880. type: 'warning'
  881. })
  882. return
  883. }
  884. }
  885. if (!this.dataList.predictDate) {
  886. this.$message({
  887. message: '预计出库日期不能为空!',
  888. type: 'warning'
  889. })
  890. return
  891. }
  892. if (isNaN(this.dataList.estimatedFreight)) {
  893. this.$message({
  894. message: '预估运费输入错误!',
  895. type: 'warning'
  896. })
  897. return
  898. }
  899. // if (!this.dataList.agent) {
  900. // this.$message({
  901. // message: '出库经办人不能为空!',
  902. // type: 'warning'
  903. // })
  904. // return
  905. // }
  906. if (!this.dataList.businessDescribe) {
  907. this.$message({
  908. message: '业务描述不能为空!',
  909. type: 'warning'
  910. })
  911. return
  912. }
  913. }
  914. if (this.dataList.taskTypeKey == 2) {
  915. if (!this.dataList1.warehouseName) {
  916. this.$message({
  917. message: '仓库名不能为空!',
  918. type: 'warning'
  919. })
  920. return
  921. }
  922. if (!this.dataList1.contractNo) {
  923. this.$message({
  924. message: '合同编号不能为空!',
  925. type: 'warning'
  926. })
  927. return
  928. }
  929. if (!this.dataList1.weight) {
  930. this.$message({
  931. message: '重量(吨)不能为空!',
  932. type: 'warning'
  933. })
  934. return
  935. }
  936. if (
  937. isNaN(this.dataList1.weight) ||
  938. (String(this.dataList1.weight).indexOf('.') != -1 &&
  939. String(this.dataList1.weight).length -
  940. (String(this.dataList1.weight).indexOf('.') + 1) >
  941. 2) ||
  942. this.dataList1.weight < 0 ||
  943. this.dataList1.weight > 200000
  944. ) {
  945. this.$message({
  946. message: '重量(吨)输入有误!',
  947. type: 'warning'
  948. })
  949. return
  950. }
  951. if (!this.dataList1.bulkDensity) {
  952. this.$message({
  953. message: '容重不能为空!',
  954. type: 'warning'
  955. })
  956. return
  957. }
  958. if (
  959. this.dataList1.bulkDensity < 500 ||
  960. this.dataList1.bulkDensity > 1000
  961. ) {
  962. this.$message({
  963. message: '容重输入错误',
  964. type: 'warning'
  965. })
  966. return
  967. }
  968. if (
  969. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  970. String(this.dataList1.bulkDensity).length -
  971. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  972. 0
  973. ) {
  974. this.$message({
  975. message: '容重需输入整数',
  976. type: 'warning'
  977. })
  978. return
  979. }
  980. if (!this.dataList1.waterContent) {
  981. this.$message({
  982. message: '水分不能为空!',
  983. type: 'warning'
  984. })
  985. return
  986. }
  987. if (
  988. this.dataList1.waterContent < 0 ||
  989. this.dataList1.waterContent > 40
  990. ) {
  991. this.$message({
  992. message: '水分输入错误',
  993. type: 'warning'
  994. })
  995. return
  996. }
  997. if (
  998. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  999. String(this.dataList1.waterContent).length -
  1000. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  1001. 1
  1002. ) {
  1003. this.$message({
  1004. message: '水分输入错误',
  1005. type: 'warning'
  1006. })
  1007. return
  1008. }
  1009. if(this.Pricetype){
  1010. if (!this.dataList1.unitPrice) {
  1011. this.$message({
  1012. message: '单价不能为空!',
  1013. type: 'warning'
  1014. })
  1015. return
  1016. }
  1017. if (
  1018. (this.dataList1.unitPrice &&
  1019. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  1020. String(this.dataList1.unitPrice).length -
  1021. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  1022. 2) ||
  1023. this.dataList1.unitPrice > 100000 ||
  1024. this.dataList1.unitPrice < 1
  1025. ) {
  1026. this.$message({
  1027. message: '单价输入错误',
  1028. type: 'warning'
  1029. })
  1030. return
  1031. }
  1032. }
  1033. if (!this.dataList1.predictDate) {
  1034. this.$message({
  1035. message: '预计入库日期不能为空!',
  1036. type: 'warning'
  1037. })
  1038. return
  1039. }
  1040. if (isNaN(this.dataList1.estimatedFreight)) {
  1041. this.$message({
  1042. message: '预估运费输入错误!',
  1043. type: 'warning'
  1044. })
  1045. return
  1046. }
  1047. // if (!this.dataList1.agent) {
  1048. // this.$message({
  1049. // message: '入库经办人不能为空!',
  1050. // type: 'warning'
  1051. // })
  1052. // return
  1053. // }
  1054. if (!this.dataList1.businessDescribe) {
  1055. this.$message({
  1056. message: '业务描述不能为空!',
  1057. type: 'warning'
  1058. })
  1059. return
  1060. }
  1061. }
  1062. if (this.dataList.taskTypeKey == 3) {
  1063. if (!this.dataList.warehouseName) {
  1064. this.$message({
  1065. message: '出库仓库名不能为空!',
  1066. type: 'warning'
  1067. })
  1068. return
  1069. }
  1070. if (!this.dataList1.warehouseName) {
  1071. this.$message({
  1072. message: '入库仓库名不能为空!',
  1073. type: 'warning'
  1074. })
  1075. return
  1076. }
  1077. if (!this.dataList1.moveTaskNo) {
  1078. this.$message({
  1079. message: '移库任务编号不能为空!',
  1080. type: 'warning'
  1081. })
  1082. return
  1083. }
  1084. if (!this.dataList1.weight) {
  1085. this.$message({
  1086. message: '重量(吨)不能为空!',
  1087. type: 'warning'
  1088. })
  1089. return
  1090. }
  1091. if (
  1092. isNaN(this.dataList1.weight) ||
  1093. (String(this.dataList1.weight).indexOf('.') != -1 &&
  1094. String(this.dataList1.weight).length -
  1095. (String(this.dataList1.weight).indexOf('.') + 1) >
  1096. 2) ||
  1097. this.dataList1.weight < 0 ||
  1098. this.dataList1.weight > 200000
  1099. ) {
  1100. this.$message({
  1101. message: '重量(吨)输入有误!',
  1102. type: 'warning'
  1103. })
  1104. return
  1105. }
  1106. if (!this.dataList.predictDate) {
  1107. this.$message({
  1108. message: '预计出库日期不能为空!',
  1109. type: 'warning'
  1110. })
  1111. return
  1112. }
  1113. if (isNaN(this.dataList1.estimatedFreight)) {
  1114. this.$message({
  1115. message: '预估运费输入错误!',
  1116. type: 'warning'
  1117. })
  1118. return
  1119. }
  1120. if (!this.dataList1.predictDate) {
  1121. this.$message({
  1122. message: '预计入库日期不能为空!',
  1123. type: 'warning'
  1124. })
  1125. return
  1126. }
  1127. // if (!this.dataList.agent) {
  1128. // this.$message({
  1129. // message: '出库经办人不能为空!',
  1130. // type: 'warning'
  1131. // })
  1132. // return
  1133. // }
  1134. // if (!this.dataList1.agent) {
  1135. // this.$message({
  1136. // message: '入库经办人不能为空!',
  1137. // type: 'warning'
  1138. // })
  1139. // return
  1140. // }
  1141. if (!this.dataList1.businessDescribe) {
  1142. this.$message({
  1143. message: '业务描述不能为空!',
  1144. type: 'warning'
  1145. })
  1146. return
  1147. }
  1148. }
  1149. if (this.dataList1.taskTypeKey == 4) {
  1150. if (!this.dataList.warehouseName) {
  1151. this.$message({
  1152. message: '出库仓库名不能为空!',
  1153. type: 'warning'
  1154. })
  1155. return
  1156. }
  1157. if (!this.dataList1.warehouseName) {
  1158. this.$message({
  1159. message: '入库仓库名不能为空!',
  1160. type: 'warning'
  1161. })
  1162. return
  1163. }
  1164. if (!this.dataList1.contractNo) {
  1165. this.$message({
  1166. message: '合同编号不能为空!',
  1167. type: 'warning'
  1168. })
  1169. return
  1170. }
  1171. if (!this.dataList.contractNo) {
  1172. this.$message({
  1173. message: '合同编号不能为空!',
  1174. type: 'warning'
  1175. })
  1176. return
  1177. }
  1178. if (!this.dataList1.weight) {
  1179. this.$message({
  1180. message: '重量(吨)不能为空!',
  1181. type: 'warning'
  1182. })
  1183. return
  1184. }
  1185. if (
  1186. isNaN(this.dataList1.weight) ||
  1187. (String(this.dataList1.weight).indexOf('.') != -1 &&
  1188. String(this.dataList1.weight).length -
  1189. (String(this.dataList1.weight).indexOf('.') + 1) >
  1190. 2) ||
  1191. this.dataList1.weight < 0 ||
  1192. this.dataList1.weight > 200000
  1193. ) {
  1194. this.$message({
  1195. message: '重量(吨)输入有误!',
  1196. type: 'warning'
  1197. })
  1198. return
  1199. }
  1200. if (!this.dataList1.bulkDensity) {
  1201. this.$message({
  1202. message: '容重不能为空!',
  1203. type: 'warning'
  1204. })
  1205. return
  1206. }
  1207. if (
  1208. this.dataList1.bulkDensity < 500 ||
  1209. this.dataList1.bulkDensity > 1000
  1210. ) {
  1211. this.$message({
  1212. message: '容重输入错误',
  1213. type: 'warning'
  1214. })
  1215. return
  1216. }
  1217. if (
  1218. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  1219. String(this.dataList1.bulkDensity).length -
  1220. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  1221. 0
  1222. ) {
  1223. this.$message({
  1224. message: '容重需输入整数',
  1225. type: 'warning'
  1226. })
  1227. return
  1228. }
  1229. if (!this.dataList1.waterContent) {
  1230. this.$message({
  1231. message: '水分不能为空!',
  1232. type: 'warning'
  1233. })
  1234. return
  1235. }
  1236. if (
  1237. this.dataList1.waterContent < 0 ||
  1238. this.dataList1.waterContent > 40
  1239. ) {
  1240. this.$message({
  1241. message: '水分输入错误',
  1242. type: 'warning'
  1243. })
  1244. return
  1245. }
  1246. if (
  1247. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  1248. String(this.dataList1.waterContent).length -
  1249. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  1250. 1
  1251. ) {
  1252. this.$message({
  1253. message: '水分输入错误',
  1254. type: 'warning'
  1255. })
  1256. return
  1257. }
  1258. if(this.Pricetype){
  1259. if (!this.dataList1.unitPrice) {
  1260. this.$message({
  1261. message: '单价不能为空!',
  1262. type: 'warning'
  1263. })
  1264. return
  1265. }
  1266. if (
  1267. (this.dataList1.unitPrice &&
  1268. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  1269. String(this.dataList1.unitPrice).length -
  1270. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  1271. 2) ||
  1272. this.dataList1.unitPrice > 100000 ||
  1273. this.dataList1.unitPrice < 1
  1274. ) {
  1275. this.$message({
  1276. message: '单价输入错误',
  1277. type: 'warning'
  1278. })
  1279. return
  1280. }
  1281. }
  1282. if (!this.dataList.predictDate) {
  1283. this.$message({
  1284. message: '预计出库日期不能为空!',
  1285. type: 'warning'
  1286. })
  1287. return
  1288. }
  1289. if (!this.dataList1.predictDate) {
  1290. this.$message({
  1291. message: '预计入库日期不能为空!',
  1292. type: 'warning'
  1293. })
  1294. return
  1295. }
  1296. if (isNaN(this.dataList1.estimatedFreight)) {
  1297. this.$message({
  1298. message: '预估运费输入错误!',
  1299. type: 'warning'
  1300. })
  1301. return
  1302. }
  1303. // if (!this.dataList.agent) {
  1304. // this.$message({
  1305. // message: '出库经办人不能为空!',
  1306. // type: 'warning'
  1307. // })
  1308. // return
  1309. // }
  1310. // if (!this.dataList1.agent) {
  1311. // this.$message({
  1312. // message: '入库经办人不能为空!',
  1313. // type: 'warning'
  1314. // })
  1315. // return
  1316. // }
  1317. if (!this.dataList.businessDescribe) {
  1318. this.$message({
  1319. message: '业务描述不能为空!',
  1320. type: 'warning'
  1321. })
  1322. return
  1323. }
  1324. }
  1325. // this.dataList.goodsNameKey =
  1326. // this.dataList.positionId =
  1327. // this.dataList.baseId =
  1328. this.dataList.inOutFlag = 1
  1329. this.dataList1.inOutFlag = 2
  1330. if (this.dataList.taskTypeKey == 1) {
  1331. this.dataList.inOutTaskNo = this.inOutTaskNo
  1332. this.requestadd(this.dataList)
  1333. } else if (this.dataList1.taskTypeKey == 2) {
  1334. this.dataList1.inOutTaskNo = this.inOutTaskNo1
  1335. this.requestadd(this.dataList1)
  1336. } else if (
  1337. this.dataList.taskTypeKey == 3 ||
  1338. this.dataList.taskTypeKey == 4
  1339. ) {
  1340. this.dataList.inOutTaskNo = this.inOutTaskNo
  1341. this.dataList.relevanceId = this.GetRandomNum(100000, 999999)
  1342. if (this.dataList.taskTypeKey == 3) {
  1343. this.dataList.businessDescribe = this.dataList1.businessDescribe
  1344. } else {
  1345. this.dataList1.businessDescribe = this.dataList.businessDescribe
  1346. }
  1347. this.requestadd(this.dataList, 'repetition')
  1348. this.dataList1.inOutTaskNo = this.inOutTaskNo1
  1349. this.dataList1.relevanceId = this.dataList.relevanceId
  1350. this.dataList1.goodsName = this.dataList.goodsName
  1351. this.requestadd(this.dataList1, 'repetition')
  1352. }
  1353. },
  1354. tarechange(e) {
  1355. if (this.dataList.grossWeight && this.dataList.tare) {
  1356. this.dataList.netWeight = Number(
  1357. this.dataList.grossWeight - this.dataList.tare
  1358. )
  1359. }
  1360. },
  1361. grossWeightchange(e) {
  1362. if (this.dataList.grossWeight && this.dataList.tare) {
  1363. this.dataList.netWeight = Number(
  1364. this.dataList.grossWeight - this.dataList.tare
  1365. )
  1366. }
  1367. },
  1368. selectgoodsName(e) {
  1369. for (var i = 0; i < this.goodnameList.length; i++) {
  1370. if (this.goodnameList[i].constValue == e) {
  1371. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1372. }
  1373. }
  1374. },
  1375. selectgoodsName1(e) {
  1376. for (var i = 0; i < this.goodnameList.length; i++) {
  1377. if (this.goodnameList[i].constValue == e) {
  1378. this.dataList1.goodsNameKey = this.goodnameList[i].constKey
  1379. }
  1380. }
  1381. },
  1382. selectpackingMethod(e) {
  1383. for (var i = 0; i < this.gradeList.length; i++) {
  1384. if (this.gradeList[i].constValue == e) {
  1385. this.dataList.gradeKey = this.gradeList[i].constKey
  1386. if (this.dataList.taskTypeKey == 3) {
  1387. this.$set(this.dataList1, 'grade', e)
  1388. this.$set(this.dataList1, 'gradeKey', this.gradeList[i].constKey)
  1389. }
  1390. }
  1391. }
  1392. },
  1393. selectpackingMethod1(e) {
  1394. for (var i = 0; i < this.gradeList.length; i++) {
  1395. if (this.gradeList[i].constValue == e) {
  1396. this.dataList1.packingMethodKey = this.gradeList[i].constKey
  1397. if (this.dataList1.taskTypeKey == 4) {
  1398. this.$set(this.dataList, 'grade', e)
  1399. this.$set(this.dataList, 'gradeKey', this.gradeList[i].constKey)
  1400. }
  1401. }
  1402. }
  1403. },
  1404. selectstorageType(e) {
  1405. switch (e) {
  1406. case '采购出库':
  1407. this.flag = 0
  1408. break
  1409. case '销售出库':
  1410. this.flag = 1
  1411. break
  1412. }
  1413. for (var i = 0; i < this.storageType.length; i++) {
  1414. if (this.storageType[i].constValue == e) {
  1415. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1416. }
  1417. }
  1418. },
  1419. selectstorageType1(e) {
  1420. switch (e) {
  1421. case '采购入库':
  1422. this.flag = 0
  1423. break
  1424. case '暂存入库':
  1425. this.flag = 0
  1426. break
  1427. case '贸易服务入库':
  1428. this.flag = 0
  1429. break
  1430. case '退库':
  1431. this.flag = 2
  1432. break
  1433. }
  1434. for (var i = 0; i < this.storageType1.length; i++) {
  1435. if (this.storageType1[i].constValue == e) {
  1436. this.dataList1.inOutTypeKey = this.storageType1[i].constKey
  1437. }
  1438. }
  1439. },
  1440. handleClose() {
  1441. this.accessoryTFs = false
  1442. },
  1443. handleSizeChange(val) {
  1444. console.log(`每页 ${val} 条`)
  1445. this.pageSize = val
  1446. this.getList()
  1447. },
  1448. businessDescriptionchange(e) {
  1449. console.log(e)
  1450. },
  1451. handleCurrentChange(val) {
  1452. this.currentPage = val
  1453. console.log(`当前页: ${val}`)
  1454. this.getList()
  1455. },
  1456. tasknumber() {
  1457. if (this.dataList.taskTypeKey == 1) {
  1458. this.inOutTaskNo = 'CK' + this.getdate() + this.MathRand()
  1459. } else if (this.dataList.taskTypeKey == 2) {
  1460. this.inOutTaskNo1 = 'RK' + this.getdate() + this.MathRand()
  1461. } else if (this.dataList.taskTypeKey == 3) {
  1462. var random = this.getdate() + this.MathRand()
  1463. this.inOutTaskNo = 'YKC' + random
  1464. this.inOutTaskNo1 = 'YKR' + random
  1465. // this.dataList.moveTaskNo = 'YKRW' + random
  1466. // this.dataList1.moveTaskNo = 'YKRW' + random
  1467. } else if (this.dataList.taskTypeKey == 4) {
  1468. var random = this.getdate() + this.MathRand()
  1469. this.inOutTaskNo = 'TCC' + random
  1470. this.inOutTaskNo1 = 'TCR' + random
  1471. }
  1472. },
  1473. tasktypechange(e) {
  1474. if (!this.$route.query.relevanceId) {
  1475. this.tasknumber()
  1476. }
  1477. this.dataList1.taskTypeKey = e
  1478. if (this.dataList.taskTypeKey == 1) {
  1479. this.dataList.inOutType = '销售出库'
  1480. this.dataList.inOutTypeKey = '1'
  1481. this.flag = 1
  1482. }
  1483. if (this.dataList1.taskTypeKey == 2) {
  1484. this.dataList1.inOutType = '采购入库'
  1485. this.dataList1.inOutTypeKey = '1'
  1486. this.flag = 0
  1487. } else if (this.dataList1.taskTypeKey == 3) {
  1488. this.disabled = true
  1489. this.dataList1.inOutType = '移库入库'
  1490. this.dataList1.inOutTypeKey = '3'
  1491. this.dataList.inOutType = '移库出库'
  1492. this.dataList.inOutTypeKey = '3'
  1493. } else if (this.dataList1.taskTypeKey == 4) {
  1494. this.disabled = true
  1495. this.dataList1.inOutType = '退库'
  1496. this.dataList1.inOutTypeKey = '6'
  1497. this.dataList.inOutType = '销售出库'
  1498. this.flag = 2
  1499. this.dataList.inOutTypeKey = '1'
  1500. }
  1501. },
  1502. GetRandomNum(Min, Max) {
  1503. var Range = Max - Min
  1504. var Rand = Math.random()
  1505. return Min + Math.round(Rand * Range)
  1506. },
  1507. getList() {
  1508. this.tasknumber()
  1509. this.$set(this.dataList, 'inOutType', '销售出库')
  1510. this.$set(this.dataList, 'inOutTypeKey', '1')
  1511. this.$set(this.dataList, 'goodsName', '玉米')
  1512. this.$set(this.dataList, 'goodsNameKey', '1')
  1513. this.$set(this.dataList, 'grade', '一等品')
  1514. this.$set(this.dataList, 'gradeKey', '1')
  1515. this.$set(this.dataList1, 'goodsName', '玉米')
  1516. this.$set(this.dataList1, 'goodsNameKey', '1')
  1517. this.$set(this.dataList1, 'grade', '一等品')
  1518. this.$set(this.dataList1, 'gradeKey', '1')
  1519. // 货名
  1520. pullDown({
  1521. constId: 'CON2'
  1522. })
  1523. .toPromise()
  1524. .then(response => {
  1525. this.goodnameList = response
  1526. })
  1527. // 品级
  1528. pullDown({
  1529. constId: 'CON3'
  1530. })
  1531. .toPromise()
  1532. .then(response => {
  1533. this.gradeList = response
  1534. })
  1535. pullDown({
  1536. constId: 'CON6'
  1537. })
  1538. .toPromise()
  1539. .then(response => {
  1540. this.storageType = response
  1541. })
  1542. pullDown({
  1543. constId: 'CON5'
  1544. })
  1545. .toPromise()
  1546. .then(response => {
  1547. this.storageType1 = response
  1548. })
  1549. xialaNo({
  1550. compId: this.compId,
  1551. flag: this.flag
  1552. })
  1553. .toPromise()
  1554. .then(response => {
  1555. this.contractNoList = response
  1556. // this.contractNoList1 = response
  1557. })
  1558. // //临时仓库入库类型
  1559. // pullDown({ constId: 'WARE1' })
  1560. // .toPromise()
  1561. // .then((response) => {
  1562. // this.storageType = respons
  1563. // })
  1564. // //临时仓库出库类型
  1565. // pullDown({ constId: 'WARE2' })
  1566. // .toPromise()
  1567. // .then((response) => {
  1568. // this.deliveryType = response
  1569. // })
  1570. //仓库名
  1571. getwarehousename({
  1572. compId: this.compId,
  1573. warehouseType: 1
  1574. })
  1575. .toPromise()
  1576. .then(response => {
  1577. this.warehouseNameList = response
  1578. getwarehousename({
  1579. compId: this.compId,
  1580. warehouseType: 2
  1581. })
  1582. .toPromise()
  1583. .then(response => {
  1584. console.log("查仓库sss",response)
  1585. for (var i = 0; i < response.length; i++) {
  1586. this.warehouseNameList.push(response[i])
  1587. }
  1588. })
  1589. })
  1590. },
  1591. selecttaskType(e) {
  1592. for (var i = 0; i < this.taskTypeList.length; i++) {
  1593. if (this.taskTypeList[i].value == e) {
  1594. this.searchType = this.taskTypeList[i].type
  1595. }
  1596. }
  1597. },
  1598. fujian(row) {
  1599. if (
  1600. row.receiveAttachmentPath === null ||
  1601. row.receiveAttachmentPath === ''
  1602. ) {
  1603. EventBus.$emit(
  1604. 'warning',
  1605. this.$t('system.noticeCircular.NoInformation')
  1606. )
  1607. } else {
  1608. this.accessoryTFs = true
  1609. }
  1610. this.appendixIdss = row.receiveAttachmentPath
  1611. },
  1612. handleExamine(row) {
  1613. this.$router.push({
  1614. name: 'salesContractExamine',
  1615. query: {
  1616. id: row.id
  1617. }
  1618. })
  1619. },
  1620. // 关闭 dialog时 处理文件url 初始化upload组件
  1621. handleCloe() {
  1622. this.dialogViewSpareMoney = false
  1623. },
  1624. history(row) {
  1625. console.log(row)
  1626. billoperatehis({
  1627. id: row.id
  1628. })
  1629. .toPromise()
  1630. .then(response => {
  1631. this.historyList = response
  1632. })
  1633. }
  1634. }
  1635. }
  1636. </script>
  1637. <style lang="scss" scoped>
  1638. /deep/.basicInformation {
  1639. .el-info-table {
  1640. border: none;
  1641. position: relative;
  1642. }
  1643. .el-form-item {
  1644. width: 33.3333%;
  1645. border: none;
  1646. margin: 0;
  1647. .el-form-item__label {
  1648. text-align: left;
  1649. font-size: 14px;
  1650. font-family: PingFangSC-Regular, PingFang SC;
  1651. font-weight: 400;
  1652. color: #8890b1;
  1653. }
  1654. .el-form-item__content {
  1655. padding-left: 0px;
  1656. padding-right: 10px;
  1657. // background: #fff;
  1658. white-space: nowrap;
  1659. height: 40px;
  1660. display: flex;
  1661. -webkit-box-align: center;
  1662. align-items: center;
  1663. text-align: left;
  1664. overflow: hidden;
  1665. }
  1666. }
  1667. }
  1668. /deep/.el-radio {
  1669. color: #606266;
  1670. font-weight: 500;
  1671. line-height: 1;
  1672. cursor: pointer;
  1673. white-space: nowrap;
  1674. outline: 0;
  1675. margin-right: 30px;
  1676. margin-top: 15px;
  1677. }
  1678. /deep/.el-radio__inner {
  1679. border: 1px solid #dcdfe6;
  1680. border-radius: 100%;
  1681. width: 14px;
  1682. height: 14px;
  1683. background-color: #fff;
  1684. cursor: pointer;
  1685. -webkit-box-sizing: border-box;
  1686. box-sizing: border-box;
  1687. margin-left: 100px;
  1688. }
  1689. /deep/.el-radio__input {
  1690. white-space: nowrap;
  1691. cursor: pointer;
  1692. outline: 0;
  1693. line-height: 1;
  1694. vertical-align: middle;
  1695. margin-top: -1px;
  1696. }
  1697. .title {
  1698. position: relative;
  1699. padding-left: 10px;
  1700. }
  1701. .title::before {
  1702. content: '';
  1703. display: inline-block;
  1704. width: 5px;
  1705. height: 30px;
  1706. background: #5473e8;
  1707. position: absolute;
  1708. left: 0;
  1709. }
  1710. .el-form {
  1711. padding: 0 15%;
  1712. display: flex;
  1713. flex-wrap: wrap;
  1714. margin-left: -50px;
  1715. margin-top: 15px;
  1716. width: 110%;
  1717. }
  1718. .el-button--primary {
  1719. background-color: #5878e8;
  1720. border-color: #5878e8;
  1721. }
  1722. .el-col {
  1723. background: #f6f7fc;
  1724. }
  1725. .bg-right {
  1726. text-align: right;
  1727. padding: 16px 20px;
  1728. }
  1729. .center {
  1730. position: relative;
  1731. top: 50px;
  1732. width: 40%;
  1733. margin: 0 auto;
  1734. margin-right: 180px;
  1735. }
  1736. /deep/.el-form-item__label {
  1737. width: 160px;
  1738. }
  1739. .inspector {
  1740. width: 50%;
  1741. }
  1742. /deep/.el-form-item--small .el-form-item__label,
  1743. .el-form-item--small .el-form-item__content {
  1744. text-align: left;
  1745. }
  1746. /deep/.el-input--small {
  1747. font-size: 13px;
  1748. position: relative;
  1749. display: inline-block;
  1750. }
  1751. .center1 .small-title {
  1752. margin-left: 323px;
  1753. }
  1754. .center1 {
  1755. width: 90%;
  1756. margin: 0 auto;
  1757. margin-left: 10px;
  1758. margin-top: 25px;
  1759. }
  1760. /deep/.el-input--small .el-input__inner {
  1761. height: 32px;
  1762. line-height: 32px;
  1763. }
  1764. /deep/.el-select {
  1765. display: inline-block;
  1766. position: relative;
  1767. width: 100%;
  1768. }
  1769. .annu {
  1770. height: 81px;
  1771. background: #ffffff;
  1772. border-radius: 4px;
  1773. }
  1774. .basicInformation .el-form-item {
  1775. width: 50.3333%;
  1776. border: none;
  1777. margin: 0;
  1778. }
  1779. .huom {
  1780. width: 100%;
  1781. }
  1782. .el-form {
  1783. font-size: 14px;
  1784. font-family: PingFangSC-Regular, PingFang SC;
  1785. font-weight: 400;
  1786. color: #8890b1;
  1787. line-height: 16px;
  1788. }
  1789. .a {
  1790. margin-left: -32px;
  1791. }
  1792. .el-radio-group {
  1793. margin-left: 251px;
  1794. }
  1795. .ding {
  1796. height: 23px;
  1797. background: #e8ecf6;
  1798. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  1799. }
  1800. .winseaview-view {
  1801. padding: 0 0 20px;
  1802. }
  1803. .container {
  1804. overflow: scroll;
  1805. height: 93vh;
  1806. }
  1807. .el-radio-group {
  1808. font-size: 0;
  1809. margin-top: 20px;
  1810. }
  1811. /deep/.el-form {
  1812. padding: 0 15%;
  1813. display: -webkit-box;
  1814. display: -ms-flexbox;
  1815. display: flex;
  1816. -ms-flex-wrap: wrap;
  1817. flex-wrap: wrap;
  1818. margin-left: 130px;
  1819. margin-top: 15px;
  1820. width: 110%;
  1821. }
  1822. </style>