tranManagementWarehouseInOutTaskAdd.vue 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886
  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 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 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 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 label="单价(元/吨)">
  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 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 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 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 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 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 label="单价(元/吨)">
  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="dataList1.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. flag: 1,
  412. //弹出框
  413. dialogViewSpareMoney: false,
  414. dialogApproveFormVisible: false,
  415. // 船舶类型
  416. monetaryKey: null,
  417. // 表格显示数据
  418. tableDate: [],
  419. // 是否显示
  420. showType: true,
  421. disabled: false,
  422. // 年
  423. year: '',
  424. contractNoList: [],
  425. contractNoList1: [],
  426. deptBudgetTotal: 0,
  427. readonly: true,
  428. currentPage: 1,
  429. pageSize: 10,
  430. searchType: 1,
  431. searchKeyWord: '',
  432. radio: '1',
  433. contractType: 2,
  434. startDate: null,
  435. endDate: null,
  436. goodnameList: [],
  437. checked: true,
  438. form: {},
  439. staffList: [],
  440. staffList1: [],
  441. options: [],
  442. options1: [],
  443. storageType: [],
  444. storageType1: [],
  445. outContractNo: [],
  446. // 提交类型
  447. submitType: true,
  448. status: [],
  449. warehouseNameList: [],
  450. warehouseNameList1: [],
  451. appendixIdsAdd: '',
  452. uploadSuccess: {},
  453. deletetask: false,
  454. warehouseInOutDetail: {},
  455. onChange: {},
  456. deptBudgetList1: [],
  457. gradeList: [],
  458. rules: {
  459. netWeight: [{
  460. required: true,
  461. type: 'number',
  462. message: '请输入活动名称',
  463. trigger: 'blur'
  464. }]
  465. },
  466. size: 10,
  467. compId: sessionStorage.getItem('ws-pf_compId'),
  468. deptCircularPage: {},
  469. packtypeList: {},
  470. date: {
  471. year: dayjs().format('YYYY'),
  472. month: dayjs().format('MM')
  473. },
  474. contractList: [],
  475. inOutTaskNo: '',
  476. inOutTaskNo1: '',
  477. dataList: {
  478. taskTypeKey: '1'
  479. },
  480. dataList1: {
  481. taskTypeKey: '1',
  482. inOutType: ''
  483. },
  484. historyList: [],
  485. pickerBeginDateBefore: {
  486. disabledDate: time => {
  487. return time.getTime() > Date.now()
  488. }
  489. },
  490. accessoryTFs: false
  491. }
  492. },
  493. activated() {
  494. this.getList()
  495. },
  496. methods: {
  497. //返回按钮
  498. revert() {
  499. this.$router.go(-1)
  500. },
  501. returnsales() {
  502. this.$router.push({
  503. path: 'tranManagementWarehouseInOuttask'
  504. })
  505. },
  506. // 获取当前年月日
  507. getdate() {
  508. var date = new Date()
  509. var year = date.getFullYear() //获取完整的年份(4位)
  510. var mouth = date.getMonth() + 1 //获取当前月份(0-11,0代表1月)
  511. var datetime = date.getDate() //获取当前日(1-31)
  512. var hour = date.getHours()
  513. var minutes = date.getMinutes()
  514. var seconds = date.getSeconds()
  515. if (mouth < 10) {
  516. mouth = '0' + mouth
  517. }
  518. if (datetime < 10) {
  519. datetime = '0' + datetime
  520. }
  521. if (hour < 10) {
  522. hour = '0' + hour
  523. }
  524. if (minutes < 10) {
  525. minutes = '0' + minutes
  526. }
  527. if (seconds < 10) {
  528. seconds = '0' + seconds
  529. }
  530. return year + '' + mouth + datetime + hour + minutes + seconds
  531. },
  532. // 随机验证码
  533. verifyinit() {
  534. var arr = []
  535. for (var i = 48; i < 57; i++) {
  536. arr.push(String.fromCharCode(i))
  537. }
  538. arr.sort(function() {
  539. return Math.random() - 0.5
  540. })
  541. arr.length = 4
  542. return arr.join('')
  543. },
  544. MathRand() {
  545. var Num = ''
  546. for (var i = 0; i < 4; i++) {
  547. Num += Math.floor(Math.random() * 10)
  548. }
  549. return Num
  550. },
  551. selectTaskNo(e) {
  552. if (this.dataList.taskTypeKey == 3) {
  553. this.$set(this.dataList1, 'moveTaskNo', e)
  554. }
  555. },
  556. dataFilter(val) {
  557. // console.log(val,"名")
  558. this.deptBudgetList.staffList = val
  559. if (val) {
  560. //val存在
  561. this.options = this.staffList.filter(item => {
  562. if (
  563. !!~item.staffName.indexOf(val) ||
  564. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  565. ) {
  566. return true
  567. }
  568. })
  569. } else {
  570. //val为空时,还原数组
  571. this.options = this.staffList
  572. }
  573. },
  574. dataFilter1(val) {
  575. // console.log(val,"名")
  576. this.deptBudgetList.staffList1 = val
  577. if (val) {
  578. //val存在
  579. this.options = this.staffList1.filter(item => {
  580. if (
  581. !!~item.staffName.indexOf(val) ||
  582. !!~item.staffName.toUpperCase().indexOf(val.toUpperCase())
  583. ) {
  584. return true
  585. }
  586. })
  587. } else {
  588. //val为空时,还原数组
  589. this.options1 = this.staffList1
  590. }
  591. },
  592. weightchange(e) {
  593. if (this.dataList.taskTypeKey == 4) {
  594. this.$set(this.dataList, 'weight', e)
  595. }
  596. },
  597. weightchange1(e) {
  598. if (this.dataList.taskTypeKey == 3) {
  599. this.$set(this.dataList1, 'weight', e)
  600. }
  601. },
  602. bulkDensitychange(e) {
  603. if (this.dataList.taskTypeKey == 4) {
  604. this.$set(this.dataList, 'bulkDensity', e)
  605. } else if (this.dataList1.taskTypeKey == 3) {
  606. this.$set(this.dataList1, 'bulkDensity', e)
  607. }
  608. },
  609. waterContentchange(e) {
  610. if (this.dataList.taskTypeKey == 4) {
  611. this.$set(this.dataList, 'waterContent', e)
  612. } else if (this.dataList1.taskTypeKey == 3) {
  613. this.$set(this.dataList1, 'waterContent', e)
  614. }
  615. },
  616. unitPricechange(e) {
  617. if (this.dataList.taskTypeKey == 4) {
  618. this.$set(this.dataList, 'unitPrice', e)
  619. } else if (this.dataList1.taskTypeKey == 3) {
  620. this.$set(this.dataList1, 'unitPrice', e)
  621. }
  622. },
  623. changecontract(e) {
  624. if (this.dataList.taskTypeKey != 3) {
  625. for (let i = 0; i < this.contractNoList.length; i++) {
  626. if (this.contractNoList[i].contractNo == e) {
  627. getGoodsName({
  628. contractId: this.contractNoList[i].id,
  629. contractNo: this.contractNoList[i].contractNo
  630. })
  631. .toPromise()
  632. .then(response => {
  633. this.$set(this.dataList, 'goodsName', response.goodsName)
  634. this.$set(this.dataList, 'goodsNameKey', response.goodsNameKey)
  635. this.$set(this.dataList, 'grade', response.grade)
  636. this.$set(this.dataList, 'gradeKey', response.gradeKey)
  637. this.$set(this.dataList, 'waterContent', response.waterContent)
  638. this.$set(this.dataList, 'bulkDensity', response.bulkDensity)
  639. // this.$set(this.dataList, 'weight', response.weight)
  640. this.$set(
  641. this.dataList,
  642. 'unitPrice',
  643. response.unitContractPrice
  644. )
  645. })
  646. }
  647. }
  648. }
  649. },
  650. selectwarehouseName(e) {
  651. for (var i = 0; i < this.warehouseNameList.length; i++) {
  652. if (this.warehouseNameList[i].id == e) {
  653. this.dataList.warehouseName = this.warehouseNameList[i].warehouseName
  654. //经办人
  655. getstaff({
  656. compId: sessionStorage.getItem('ws-pf_compId'),
  657. warehouseId: e
  658. })
  659. .toPromise()
  660. .then(response => {
  661. this.options = response
  662. this.staffList = response
  663. // this.agent = response
  664. })
  665. }
  666. }
  667. },
  668. selectwarehouseName1(e) {
  669. for (var i = 0; i < this.warehouseNameList.length; i++) {
  670. if (this.warehouseNameList[i].id == e) {
  671. this.dataList1.warehouseName = this.warehouseNameList[i].warehouseName
  672. //经办人
  673. getstaff({
  674. compId: sessionStorage.getItem('ws-pf_compId'),
  675. warehouseId: e
  676. })
  677. .toPromise()
  678. .then(response => {
  679. this.options1 = response
  680. this.staffList1 = response
  681. // this.agent = response
  682. })
  683. }
  684. }
  685. },
  686. changecontract1(e) {
  687. if (this.dataList1.taskTypeKey != 3) {
  688. for (let i = 0; i < this.contractNoList.length; i++) {
  689. if (this.contractNoList[i].contractNo == e) {
  690. getGoodsName({
  691. contractId: this.contractNoList[i].id,
  692. contractNo: this.contractNoList[i].contractNo
  693. })
  694. .toPromise()
  695. .then(response => {
  696. this.$set(this.dataList1, 'goodsName', response.goodsName)
  697. this.$set(this.dataList1, 'goodsNameKey', response.goodsNameKey)
  698. this.$set(this.dataList1, 'grade', response.grade)
  699. this.$set(this.dataList1, 'gradeKey', response.gradeKey)
  700. this.$set(this.dataList1, 'waterContent', response.waterContent)
  701. this.$set(this.dataList1, 'bulkDensity', response.bulkDensity)
  702. this.$set(this.dataList1, 'weight', response.weight)
  703. this.$set(
  704. this.dataList1,
  705. 'unitPrice',
  706. response.unitContractPrice
  707. )
  708. })
  709. }
  710. }
  711. }
  712. },
  713. selectstaff(e) {
  714. for (var i = 0; i < this.staffList.length; i++) {
  715. if (this.staffList[i].staffName == e) {
  716. this.dataList.agentKey = this.staffList[i].staffId
  717. }
  718. }
  719. },
  720. selectstaff1(e) {
  721. for (var i = 0; i < this.staffList.length; i++) {
  722. if (this.staffList[i].staffName == e) {
  723. this.dataList1.agentKey = this.staffList[i].staffId
  724. }
  725. }
  726. },
  727. requestadd(list, status) {
  728. list.compId = sessionStorage.getItem('ws-pf_compId')
  729. list.publisher =
  730. sessionStorage.getItem('ws-pf_roleName') +
  731. sessionStorage.getItem('ws-pf_staffName')
  732. addoreditoutput(list)
  733. .toPromise()
  734. .then(response => {
  735. var that = this
  736. this.$message.success('添加成功')
  737. setTimeout(function() {
  738. that.dataList = {
  739. taskTypeKey: 1
  740. }
  741. that.dataList1 = {}
  742. that.$router.push({
  743. path: 'tranManagementWarehouseInOuttask'
  744. })
  745. }, 2000)
  746. })
  747. },
  748. //提交按钮
  749. submit() {
  750. if (this.dataList.taskTypeKey == 1) {
  751. if (!this.dataList.warehouseName) {
  752. this.$message({
  753. message: '仓库名不能为空!',
  754. type: 'warning'
  755. })
  756. return
  757. }
  758. if (!this.dataList.contractNo) {
  759. this.$message({
  760. message: '合同编号不能为空!',
  761. type: 'warning'
  762. })
  763. return
  764. }
  765. if (!this.dataList.weight) {
  766. this.$message({
  767. message: '重量(吨)不能为空!',
  768. type: 'warning'
  769. })
  770. return
  771. }
  772. if (
  773. isNaN(this.dataList.weight) ||
  774. (String(this.dataList.weight).indexOf('.') != -1 &&
  775. String(this.dataList.weight).length -
  776. (String(this.dataList.weight).indexOf('.') + 1) >
  777. 2) ||
  778. this.dataList.weight < 0 ||
  779. this.dataList.weight > 200000
  780. ) {
  781. this.$message({
  782. message: '重量(吨)输入有误!',
  783. type: 'warning'
  784. })
  785. return
  786. }
  787. if (!this.dataList.bulkDensity) {
  788. this.$message({
  789. message: '容重不能为空!',
  790. type: 'warning'
  791. })
  792. return
  793. }
  794. if (
  795. this.dataList.bulkDensity < 500 ||
  796. this.dataList.bulkDensity > 1000
  797. ) {
  798. this.$message({
  799. message: '容重输入错误',
  800. type: 'warning'
  801. })
  802. return
  803. }
  804. if (
  805. String(this.dataList.bulkDensity).indexOf('.') != -1 &&
  806. String(this.dataList.bulkDensity).length -
  807. (String(this.dataList.bulkDensity).indexOf('.') + 1) >
  808. 0
  809. ) {
  810. this.$message({
  811. message: '容重需输入整数',
  812. type: 'warning'
  813. })
  814. return
  815. }
  816. if (!this.dataList.waterContent) {
  817. this.$message({
  818. message: '水分不能为空!',
  819. type: 'warning'
  820. })
  821. return
  822. }
  823. if (this.dataList.waterContent < 0 || this.dataList.waterContent > 40) {
  824. this.$message({
  825. message: '水分输入错误',
  826. type: 'warning'
  827. })
  828. return
  829. }
  830. if (
  831. String(this.dataList.waterContent).indexOf('.') != -1 &&
  832. String(this.dataList.waterContent).length -
  833. (String(this.dataList.waterContent).indexOf('.') + 1) >
  834. 1
  835. ) {
  836. this.$message({
  837. message: '水分输入错误',
  838. type: 'warning'
  839. })
  840. return
  841. }
  842. if (!this.dataList.unitPrice) {
  843. this.$message({
  844. message: '单价不能为空!',
  845. type: 'warning'
  846. })
  847. return
  848. }
  849. if (
  850. (this.dataList.unitPrice &&
  851. String(this.dataList.unitPrice).indexOf('.') != -1 &&
  852. String(this.dataList.unitPrice).length -
  853. (String(this.dataList.unitPrice).indexOf('.') + 1) >
  854. 2) ||
  855. this.dataList.unitPrice > 100000 ||
  856. this.dataList.unitPrice < 1
  857. ) {
  858. this.$message({
  859. message: '单价输入错误',
  860. type: 'warning'
  861. })
  862. return
  863. }
  864. if (!this.dataList.predictDate) {
  865. this.$message({
  866. message: '预计出库日期不能为空!',
  867. type: 'warning'
  868. })
  869. return
  870. }
  871. // if (!this.dataList.agent) {
  872. // this.$message({
  873. // message: '出库经办人不能为空!',
  874. // type: 'warning'
  875. // })
  876. // return
  877. // }
  878. if (!this.dataList.businessDescribe) {
  879. this.$message({
  880. message: '业务描述不能为空!',
  881. type: 'warning'
  882. })
  883. return
  884. }
  885. }
  886. if (this.dataList.taskTypeKey == 2) {
  887. if (!this.dataList1.warehouseName) {
  888. this.$message({
  889. message: '仓库名不能为空!',
  890. type: 'warning'
  891. })
  892. return
  893. }
  894. if (!this.dataList1.contractNo) {
  895. this.$message({
  896. message: '合同编号不能为空!',
  897. type: 'warning'
  898. })
  899. return
  900. }
  901. if (!this.dataList1.weight) {
  902. this.$message({
  903. message: '重量(吨)不能为空!',
  904. type: 'warning'
  905. })
  906. return
  907. }
  908. if (
  909. isNaN(this.dataList1.weight) ||
  910. (String(this.dataList1.weight).indexOf('.') != -1 &&
  911. String(this.dataList1.weight).length -
  912. (String(this.dataList1.weight).indexOf('.') + 1) >
  913. 2) ||
  914. this.dataList1.weight < 0 ||
  915. this.dataList1.weight > 200000
  916. ) {
  917. this.$message({
  918. message: '重量(吨)输入有误!',
  919. type: 'warning'
  920. })
  921. return
  922. }
  923. if (!this.dataList1.bulkDensity) {
  924. this.$message({
  925. message: '容重不能为空!',
  926. type: 'warning'
  927. })
  928. return
  929. }
  930. if (
  931. this.dataList1.bulkDensity < 500 ||
  932. this.dataList1.bulkDensity > 1000
  933. ) {
  934. this.$message({
  935. message: '容重输入错误',
  936. type: 'warning'
  937. })
  938. return
  939. }
  940. if (
  941. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  942. String(this.dataList1.bulkDensity).length -
  943. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  944. 0
  945. ) {
  946. this.$message({
  947. message: '容重需输入整数',
  948. type: 'warning'
  949. })
  950. return
  951. }
  952. if (!this.dataList1.waterContent) {
  953. this.$message({
  954. message: '水分不能为空!',
  955. type: 'warning'
  956. })
  957. return
  958. }
  959. if (
  960. this.dataList1.waterContent < 0 ||
  961. this.dataList1.waterContent > 40
  962. ) {
  963. this.$message({
  964. message: '水分输入错误',
  965. type: 'warning'
  966. })
  967. return
  968. }
  969. if (
  970. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  971. String(this.dataList1.waterContent).length -
  972. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  973. 1
  974. ) {
  975. this.$message({
  976. message: '水分输入错误',
  977. type: 'warning'
  978. })
  979. return
  980. }
  981. if (!this.dataList1.unitPrice) {
  982. this.$message({
  983. message: '单价不能为空!',
  984. type: 'warning'
  985. })
  986. return
  987. }
  988. if (
  989. (this.dataList1.unitPrice &&
  990. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  991. String(this.dataList1.unitPrice).length -
  992. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  993. 2) ||
  994. this.dataList1.unitPrice > 100000 ||
  995. this.dataList1.unitPrice < 1
  996. ) {
  997. this.$message({
  998. message: '单价输入错误',
  999. type: 'warning'
  1000. })
  1001. return
  1002. }
  1003. if (!this.dataList1.predictDate) {
  1004. this.$message({
  1005. message: '预计入库日期不能为空!',
  1006. type: 'warning'
  1007. })
  1008. return
  1009. }
  1010. // if (!this.dataList1.agent) {
  1011. // this.$message({
  1012. // message: '入库经办人不能为空!',
  1013. // type: 'warning'
  1014. // })
  1015. // return
  1016. // }
  1017. if (!this.dataList1.businessDescribe) {
  1018. this.$message({
  1019. message: '业务描述不能为空!',
  1020. type: 'warning'
  1021. })
  1022. return
  1023. }
  1024. }
  1025. if (this.dataList.taskTypeKey == 3) {
  1026. if (!this.dataList.warehouseName) {
  1027. this.$message({
  1028. message: '出库仓库名不能为空!',
  1029. type: 'warning'
  1030. })
  1031. return
  1032. }
  1033. if (!this.dataList1.warehouseName) {
  1034. this.$message({
  1035. message: '入库仓库名不能为空!',
  1036. type: 'warning'
  1037. })
  1038. return
  1039. }
  1040. if (!this.dataList1.moveTaskNo) {
  1041. this.$message({
  1042. message: '移库任务编号不能为空!',
  1043. type: 'warning'
  1044. })
  1045. return
  1046. }
  1047. if (!this.dataList1.weight) {
  1048. this.$message({
  1049. message: '重量(吨)不能为空!',
  1050. type: 'warning'
  1051. })
  1052. return
  1053. }
  1054. if (
  1055. isNaN(this.dataList1.weight) ||
  1056. (String(this.dataList1.weight).indexOf('.') != -1 &&
  1057. String(this.dataList1.weight).length -
  1058. (String(this.dataList1.weight).indexOf('.') + 1) >
  1059. 2) ||
  1060. this.dataList1.weight < 0 ||
  1061. this.dataList1.weight > 200000
  1062. ) {
  1063. this.$message({
  1064. message: '重量(吨)输入有误!',
  1065. type: 'warning'
  1066. })
  1067. return
  1068. }
  1069. if (!this.dataList1.bulkDensity) {
  1070. this.$message({
  1071. message: '容重不能为空!',
  1072. type: 'warning'
  1073. })
  1074. return
  1075. }
  1076. if (
  1077. this.dataList1.bulkDensity < 500 ||
  1078. this.dataList1.bulkDensity > 1000
  1079. ) {
  1080. this.$message({
  1081. message: '容重输入错误',
  1082. type: 'warning'
  1083. })
  1084. return
  1085. }
  1086. if (
  1087. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  1088. String(this.dataList1.bulkDensity).length -
  1089. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  1090. 0
  1091. ) {
  1092. this.$message({
  1093. message: '容重需输入整数',
  1094. type: 'warning'
  1095. })
  1096. return
  1097. }
  1098. if (!this.dataList1.waterContent) {
  1099. this.$message({
  1100. message: '水分不能为空!',
  1101. type: 'warning'
  1102. })
  1103. return
  1104. }
  1105. if (
  1106. this.dataList1.waterContent < 0 ||
  1107. this.dataList1.waterContent > 40
  1108. ) {
  1109. this.$message({
  1110. message: '水分输入错误',
  1111. type: 'warning'
  1112. })
  1113. return
  1114. }
  1115. if (
  1116. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  1117. String(this.dataList1.waterContent).length -
  1118. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  1119. 1
  1120. ) {
  1121. this.$message({
  1122. message: '水分输入错误',
  1123. type: 'warning'
  1124. })
  1125. return
  1126. }
  1127. if (!this.dataList1.unitPrice) {
  1128. this.$message({
  1129. message: '单价不能为空!',
  1130. type: 'warning'
  1131. })
  1132. return
  1133. }
  1134. if (
  1135. (this.dataList1.unitPrice &&
  1136. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  1137. String(this.dataList1.unitPrice).length -
  1138. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  1139. 2) ||
  1140. this.dataList1.unitPrice > 100000 ||
  1141. this.dataList1.unitPrice < 1
  1142. ) {
  1143. this.$message({
  1144. message: '单价输入错误',
  1145. type: 'warning'
  1146. })
  1147. return
  1148. }
  1149. if (!this.dataList.predictDate) {
  1150. this.$message({
  1151. message: '预计出库日期不能为空!',
  1152. type: 'warning'
  1153. })
  1154. return
  1155. }
  1156. if (!this.dataList1.predictDate) {
  1157. this.$message({
  1158. message: '预计入库日期不能为空!',
  1159. type: 'warning'
  1160. })
  1161. return
  1162. }
  1163. // if (!this.dataList.agent) {
  1164. // this.$message({
  1165. // message: '出库经办人不能为空!',
  1166. // type: 'warning'
  1167. // })
  1168. // return
  1169. // }
  1170. // if (!this.dataList1.agent) {
  1171. // this.$message({
  1172. // message: '入库经办人不能为空!',
  1173. // type: 'warning'
  1174. // })
  1175. // return
  1176. // }
  1177. if (!this.dataList1.businessDescribe) {
  1178. this.$message({
  1179. message: '业务描述不能为空!',
  1180. type: 'warning'
  1181. })
  1182. return
  1183. }
  1184. }
  1185. if (this.dataList1.taskTypeKey == 4) {
  1186. if (!this.dataList.warehouseName) {
  1187. this.$message({
  1188. message: '出库仓库名不能为空!',
  1189. type: 'warning'
  1190. })
  1191. return
  1192. }
  1193. if (!this.dataList1.warehouseName) {
  1194. this.$message({
  1195. message: '入库仓库名不能为空!',
  1196. type: 'warning'
  1197. })
  1198. return
  1199. }
  1200. if (!this.dataList1.contractNo) {
  1201. this.$message({
  1202. message: '合同编号不能为空!',
  1203. type: 'warning'
  1204. })
  1205. return
  1206. }
  1207. if (!this.dataList.contractNo) {
  1208. this.$message({
  1209. message: '合同编号不能为空!',
  1210. type: 'warning'
  1211. })
  1212. return
  1213. }
  1214. if (!this.dataList1.weight) {
  1215. this.$message({
  1216. message: '重量(吨)不能为空!',
  1217. type: 'warning'
  1218. })
  1219. return
  1220. }
  1221. if (
  1222. isNaN(this.dataList1.weight) ||
  1223. (String(this.dataList1.weight).indexOf('.') != -1 &&
  1224. String(this.dataList1.weight).length -
  1225. (String(this.dataList1.weight).indexOf('.') + 1) >
  1226. 2) ||
  1227. this.dataList1.weight < 0 ||
  1228. this.dataList1.weight > 200000
  1229. ) {
  1230. this.$message({
  1231. message: '重量(吨)输入有误!',
  1232. type: 'warning'
  1233. })
  1234. return
  1235. }
  1236. if (!this.dataList1.bulkDensity) {
  1237. this.$message({
  1238. message: '容重不能为空!',
  1239. type: 'warning'
  1240. })
  1241. return
  1242. }
  1243. if (
  1244. this.dataList1.bulkDensity < 500 ||
  1245. this.dataList1.bulkDensity > 1000
  1246. ) {
  1247. this.$message({
  1248. message: '容重输入错误',
  1249. type: 'warning'
  1250. })
  1251. return
  1252. }
  1253. if (
  1254. String(this.dataList1.bulkDensity).indexOf('.') != -1 &&
  1255. String(this.dataList1.bulkDensity).length -
  1256. (String(this.dataList1.bulkDensity).indexOf('.') + 1) >
  1257. 0
  1258. ) {
  1259. this.$message({
  1260. message: '容重需输入整数',
  1261. type: 'warning'
  1262. })
  1263. return
  1264. }
  1265. if (!this.dataList1.waterContent) {
  1266. this.$message({
  1267. message: '水分不能为空!',
  1268. type: 'warning'
  1269. })
  1270. return
  1271. }
  1272. if (
  1273. this.dataList1.waterContent < 0 ||
  1274. this.dataList1.waterContent > 40
  1275. ) {
  1276. this.$message({
  1277. message: '水分输入错误',
  1278. type: 'warning'
  1279. })
  1280. return
  1281. }
  1282. if (
  1283. String(this.dataList1.waterContent).indexOf('.') != -1 &&
  1284. String(this.dataList1.waterContent).length -
  1285. (String(this.dataList1.waterContent).indexOf('.') + 1) >
  1286. 1
  1287. ) {
  1288. this.$message({
  1289. message: '水分输入错误',
  1290. type: 'warning'
  1291. })
  1292. return
  1293. }
  1294. if (!this.dataList1.unitPrice) {
  1295. this.$message({
  1296. message: '单价不能为空!',
  1297. type: 'warning'
  1298. })
  1299. return
  1300. }
  1301. if (
  1302. (this.dataList1.unitPrice &&
  1303. String(this.dataList1.unitPrice).indexOf('.') != -1 &&
  1304. String(this.dataList1.unitPrice).length -
  1305. (String(this.dataList1.unitPrice).indexOf('.') + 1) >
  1306. 2) ||
  1307. this.dataList1.unitPrice > 100000 ||
  1308. this.dataList1.unitPrice < 1
  1309. ) {
  1310. this.$message({
  1311. message: '单价输入错误',
  1312. type: 'warning'
  1313. })
  1314. return
  1315. }
  1316. if (!this.dataList.predictDate) {
  1317. this.$message({
  1318. message: '预计出库日期不能为空!',
  1319. type: 'warning'
  1320. })
  1321. return
  1322. }
  1323. if (!this.dataList1.predictDate) {
  1324. this.$message({
  1325. message: '预计入库日期不能为空!',
  1326. type: 'warning'
  1327. })
  1328. return
  1329. }
  1330. // if (!this.dataList.agent) {
  1331. // this.$message({
  1332. // message: '出库经办人不能为空!',
  1333. // type: 'warning'
  1334. // })
  1335. // return
  1336. // }
  1337. // if (!this.dataList1.agent) {
  1338. // this.$message({
  1339. // message: '入库经办人不能为空!',
  1340. // type: 'warning'
  1341. // })
  1342. // return
  1343. // }
  1344. if (!this.dataList.businessDescribe) {
  1345. this.$message({
  1346. message: '业务描述不能为空!',
  1347. type: 'warning'
  1348. })
  1349. return
  1350. }
  1351. }
  1352. // this.dataList.goodsNameKey =
  1353. // this.dataList.positionId =
  1354. // this.dataList.baseId =
  1355. this.dataList.inOutFlag = 1
  1356. this.dataList1.inOutFlag = 2
  1357. if (this.dataList.taskTypeKey == 1) {
  1358. this.dataList.inOutTaskNo = this.inOutTaskNo
  1359. this.requestadd(this.dataList)
  1360. } else if (this.dataList1.taskTypeKey == 2) {
  1361. this.dataList1.inOutTaskNo = this.inOutTaskNo1
  1362. this.requestadd(this.dataList1)
  1363. } else if (
  1364. this.dataList.taskTypeKey == 3 ||
  1365. this.dataList.taskTypeKey == 4
  1366. ) {
  1367. this.dataList.inOutTaskNo = this.inOutTaskNo
  1368. this.dataList.relevanceId = this.GetRandomNum(100000, 999999)
  1369. if (this.dataList.taskTypeKey == 3) {
  1370. this.dataList.businessDescribe = this.dataList1.businessDescribe
  1371. } else {
  1372. this.dataList1.businessDescribe = this.dataList.businessDescribe
  1373. }
  1374. this.requestadd(this.dataList, 'repetition')
  1375. this.dataList1.inOutTaskNo = this.inOutTaskNo1
  1376. this.dataList1.relevanceId = this.dataList.relevanceId
  1377. this.dataList1.goodsName = this.dataList.goodsName
  1378. this.requestadd(this.dataList1, 'repetition')
  1379. }
  1380. },
  1381. tarechange(e) {
  1382. if (this.dataList.grossWeight && this.dataList.tare) {
  1383. this.dataList.netWeight = Number(
  1384. this.dataList.grossWeight - this.dataList.tare
  1385. )
  1386. }
  1387. },
  1388. grossWeightchange(e) {
  1389. if (this.dataList.grossWeight && this.dataList.tare) {
  1390. this.dataList.netWeight = Number(
  1391. this.dataList.grossWeight - this.dataList.tare
  1392. )
  1393. }
  1394. },
  1395. selectgoodsName(e) {
  1396. for (var i = 0; i < this.goodnameList.length; i++) {
  1397. if (this.goodnameList[i].constValue == e) {
  1398. this.dataList.goodsNameKey = this.goodnameList[i].constKey
  1399. }
  1400. }
  1401. },
  1402. selectgoodsName1(e) {
  1403. for (var i = 0; i < this.goodnameList.length; i++) {
  1404. if (this.goodnameList[i].constValue == e) {
  1405. this.dataList1.goodsNameKey = this.goodnameList[i].constKey
  1406. }
  1407. }
  1408. },
  1409. selectpackingMethod(e) {
  1410. for (var i = 0; i < this.gradeList.length; i++) {
  1411. if (this.gradeList[i].constValue == e) {
  1412. this.dataList.gradeKey = this.gradeList[i].constKey
  1413. if (this.dataList.taskTypeKey == 3) {
  1414. this.$set(this.dataList1, 'grade', e)
  1415. this.$set(this.dataList1, 'gradeKey', this.gradeList[i].constKey)
  1416. }
  1417. }
  1418. }
  1419. },
  1420. selectpackingMethod1(e) {
  1421. for (var i = 0; i < this.gradeList.length; i++) {
  1422. if (this.gradeList[i].constValue == e) {
  1423. this.dataList1.packingMethodKey = this.gradeList[i].constKey
  1424. if (this.dataList1.taskTypeKey == 4) {
  1425. this.$set(this.dataList, 'grade', e)
  1426. this.$set(this.dataList, 'gradeKey', this.gradeList[i].constKey)
  1427. }
  1428. }
  1429. }
  1430. },
  1431. selectstorageType(e) {
  1432. switch (e) {
  1433. case '采购出库':
  1434. this.flag = 0
  1435. break
  1436. case '销售出库':
  1437. this.flag = 1
  1438. break
  1439. }
  1440. for (var i = 0; i < this.storageType.length; i++) {
  1441. if (this.storageType[i].constValue == e) {
  1442. this.dataList.inOutTypeKey = this.storageType[i].constKey
  1443. }
  1444. }
  1445. },
  1446. selectstorageType1(e) {
  1447. switch (e) {
  1448. case '采购入库':
  1449. this.flag = 0
  1450. break
  1451. case '暂存入库':
  1452. this.flag = 0
  1453. break
  1454. case '贸易服务入库':
  1455. this.flag = 0
  1456. break
  1457. case '退库':
  1458. this.flag = 2
  1459. break
  1460. }
  1461. for (var i = 0; i < this.storageType1.length; i++) {
  1462. if (this.storageType1[i].constValue == e) {
  1463. this.dataList1.inOutTypeKey = this.storageType1[i].constKey
  1464. }
  1465. }
  1466. },
  1467. handleClose() {
  1468. this.accessoryTFs = false
  1469. },
  1470. handleSizeChange(val) {
  1471. console.log(`每页 ${val} 条`)
  1472. this.pageSize = val
  1473. this.getList()
  1474. },
  1475. businessDescriptionchange(e) {
  1476. console.log(e)
  1477. },
  1478. handleCurrentChange(val) {
  1479. this.currentPage = val
  1480. console.log(`当前页: ${val}`)
  1481. this.getList()
  1482. },
  1483. tasknumber() {
  1484. if (this.dataList.taskTypeKey == 1) {
  1485. this.inOutTaskNo = 'CK' + this.getdate() + this.MathRand()
  1486. } else if (this.dataList.taskTypeKey == 2) {
  1487. this.inOutTaskNo1 = 'RK' + this.getdate() + this.MathRand()
  1488. } else if (this.dataList.taskTypeKey == 3) {
  1489. var random = this.getdate() + this.MathRand()
  1490. this.inOutTaskNo = 'YKC' + random
  1491. this.inOutTaskNo1 = 'YKR' + random
  1492. this.dataList.moveTaskNo = 'YKRW' + random
  1493. } else if (this.dataList.taskTypeKey == 4) {
  1494. var random = this.getdate() + this.MathRand()
  1495. this.inOutTaskNo = 'TCC' + random
  1496. this.inOutTaskNo1 = 'TCR' + random
  1497. }
  1498. },
  1499. tasktypechange(e) {
  1500. if (!this.$route.query.relevanceId) {
  1501. this.tasknumber()
  1502. }
  1503. this.dataList1.taskTypeKey = e
  1504. if (this.dataList.taskTypeKey == 1) {
  1505. this.dataList.inOutType = '销售出库'
  1506. this.dataList.inOutTypeKey = '1'
  1507. this.flag = 1
  1508. }
  1509. if (this.dataList1.taskTypeKey == 2) {
  1510. this.dataList1.inOutType = '采购入库'
  1511. this.dataList1.inOutTypeKey = '1'
  1512. this.flag = 0
  1513. } else if (this.dataList1.taskTypeKey == 3) {
  1514. this.disabled = true
  1515. this.dataList1.inOutType = '移库入库'
  1516. this.dataList1.inOutTypeKey = '3'
  1517. this.dataList.inOutType = '移库出库'
  1518. this.dataList.inOutTypeKey = '3'
  1519. } else if (this.dataList1.taskTypeKey == 4) {
  1520. this.disabled = true
  1521. this.dataList1.inOutType = '退库'
  1522. this.dataList1.inOutTypeKey = '6'
  1523. this.dataList.inOutType = '销售出库'
  1524. this.flag = 2
  1525. this.dataList.inOutTypeKey = '1'
  1526. }
  1527. },
  1528. GetRandomNum(Min, Max) {
  1529. var Range = Max - Min
  1530. var Rand = Math.random()
  1531. return Min + Math.round(Rand * Range)
  1532. },
  1533. getList() {
  1534. this.tasknumber()
  1535. this.$set(this.dataList, 'inOutType', '销售出库')
  1536. this.$set(this.dataList, 'inOutTypeKey', '1')
  1537. this.$set(this.dataList, 'goodsName', '玉米')
  1538. this.$set(this.dataList, 'goodsNameKey', '1')
  1539. this.$set(this.dataList, 'grade', '一等品')
  1540. this.$set(this.dataList, 'gradeKey', '1')
  1541. this.$set(this.dataList1, 'goodsName', '玉米')
  1542. this.$set(this.dataList1, 'goodsNameKey', '1')
  1543. this.$set(this.dataList1, 'grade', '一等品')
  1544. this.$set(this.dataList1, 'gradeKey', '1')
  1545. // 货名
  1546. pullDown({
  1547. constId: 'CON2'
  1548. })
  1549. .toPromise()
  1550. .then(response => {
  1551. this.goodnameList = response
  1552. })
  1553. // 品级
  1554. pullDown({
  1555. constId: 'CON3'
  1556. })
  1557. .toPromise()
  1558. .then(response => {
  1559. this.gradeList = response
  1560. })
  1561. pullDown({
  1562. constId: 'CON6'
  1563. })
  1564. .toPromise()
  1565. .then(response => {
  1566. this.storageType = response
  1567. })
  1568. pullDown({
  1569. constId: 'CON5'
  1570. })
  1571. .toPromise()
  1572. .then(response => {
  1573. this.storageType1 = response
  1574. })
  1575. xialaNo({
  1576. compId: this.compId,
  1577. flag: this.flag
  1578. })
  1579. .toPromise()
  1580. .then(response => {
  1581. this.contractNoList = response
  1582. // this.contractNoList1 = response
  1583. })
  1584. // //临时仓库入库类型
  1585. // pullDown({ constId: 'WARE1' })
  1586. // .toPromise()
  1587. // .then((response) => {
  1588. // this.storageType = respons
  1589. // })
  1590. // //临时仓库出库类型
  1591. // pullDown({ constId: 'WARE2' })
  1592. // .toPromise()
  1593. // .then((response) => {
  1594. // this.deliveryType = response
  1595. // })
  1596. //仓库名
  1597. getwarehousename({
  1598. compId: this.compId,
  1599. warehouseType: 1
  1600. })
  1601. .toPromise()
  1602. .then(response => {
  1603. this.warehouseNameList = response
  1604. getwarehousename({
  1605. compId: this.compId,
  1606. warehouseType: 2
  1607. })
  1608. .toPromise()
  1609. .then(response => {
  1610. console.log("查仓库sss",response)
  1611. for (var i = 0; i < response.length; i++) {
  1612. this.warehouseNameList.push(response[i])
  1613. }
  1614. })
  1615. })
  1616. },
  1617. selecttaskType(e) {
  1618. for (var i = 0; i < this.taskTypeList.length; i++) {
  1619. if (this.taskTypeList[i].value == e) {
  1620. this.searchType = this.taskTypeList[i].type
  1621. }
  1622. }
  1623. },
  1624. fujian(row) {
  1625. if (
  1626. row.receiveAttachmentPath === null ||
  1627. row.receiveAttachmentPath === ''
  1628. ) {
  1629. EventBus.$emit(
  1630. 'warning',
  1631. this.$t('system.noticeCircular.NoInformation')
  1632. )
  1633. } else {
  1634. this.accessoryTFs = true
  1635. }
  1636. this.appendixIdss = row.receiveAttachmentPath
  1637. },
  1638. handleExamine(row) {
  1639. this.$router.push({
  1640. name: 'salesContractExamine',
  1641. query: {
  1642. id: row.id
  1643. }
  1644. })
  1645. },
  1646. // 关闭 dialog时 处理文件url 初始化upload组件
  1647. handleCloe() {
  1648. this.dialogViewSpareMoney = false
  1649. },
  1650. history(row) {
  1651. console.log(row)
  1652. billoperatehis({
  1653. id: row.id
  1654. })
  1655. .toPromise()
  1656. .then(response => {
  1657. this.historyList = response
  1658. })
  1659. }
  1660. }
  1661. }
  1662. </script>
  1663. <style lang="scss" scoped>
  1664. /deep/.basicInformation {
  1665. .el-info-table {
  1666. border: none;
  1667. position: relative;
  1668. }
  1669. .el-form-item {
  1670. width: 33.3333%;
  1671. border: none;
  1672. margin: 0;
  1673. .el-form-item__label {
  1674. text-align: left;
  1675. font-size: 14px;
  1676. font-family: PingFangSC-Regular, PingFang SC;
  1677. font-weight: 400;
  1678. color: #8890b1;
  1679. }
  1680. .el-form-item__content {
  1681. padding-left: 0px;
  1682. padding-right: 10px;
  1683. // background: #fff;
  1684. white-space: nowrap;
  1685. height: 40px;
  1686. display: flex;
  1687. -webkit-box-align: center;
  1688. align-items: center;
  1689. text-align: left;
  1690. overflow: hidden;
  1691. }
  1692. }
  1693. }
  1694. /deep/.el-radio {
  1695. color: #606266;
  1696. font-weight: 500;
  1697. line-height: 1;
  1698. cursor: pointer;
  1699. white-space: nowrap;
  1700. outline: 0;
  1701. margin-right: 30px;
  1702. margin-top: 15px;
  1703. }
  1704. /deep/.el-radio__inner {
  1705. border: 1px solid #dcdfe6;
  1706. border-radius: 100%;
  1707. width: 14px;
  1708. height: 14px;
  1709. background-color: #fff;
  1710. cursor: pointer;
  1711. -webkit-box-sizing: border-box;
  1712. box-sizing: border-box;
  1713. margin-left: 100px;
  1714. }
  1715. /deep/.el-radio__input {
  1716. white-space: nowrap;
  1717. cursor: pointer;
  1718. outline: 0;
  1719. line-height: 1;
  1720. vertical-align: middle;
  1721. margin-top: -1px;
  1722. }
  1723. .title {
  1724. position: relative;
  1725. padding-left: 10px;
  1726. }
  1727. .title::before {
  1728. content: '';
  1729. display: inline-block;
  1730. width: 5px;
  1731. height: 30px;
  1732. background: #5473e8;
  1733. position: absolute;
  1734. left: 0;
  1735. }
  1736. .el-form {
  1737. padding: 0 15%;
  1738. display: flex;
  1739. flex-wrap: wrap;
  1740. margin-left: -50px;
  1741. margin-top: 15px;
  1742. width: 110%;
  1743. }
  1744. .el-button--primary {
  1745. background-color: #5878e8;
  1746. border-color: #5878e8;
  1747. }
  1748. .el-col {
  1749. background: #f6f7fc;
  1750. }
  1751. .bg-right {
  1752. text-align: right;
  1753. padding: 16px 20px;
  1754. }
  1755. .center {
  1756. position: relative;
  1757. top: 50px;
  1758. width: 40%;
  1759. height: 2000px;
  1760. margin: 0 auto;
  1761. margin-right: 180px;
  1762. }
  1763. /deep/.el-form-item__label {
  1764. width: 160px;
  1765. }
  1766. .inspector {
  1767. width: 50%;
  1768. }
  1769. /deep/.el-form-item--small .el-form-item__label,
  1770. .el-form-item--small .el-form-item__content {
  1771. text-align: left;
  1772. }
  1773. /deep/.el-input--small {
  1774. font-size: 13px;
  1775. position: relative;
  1776. display: inline-block;
  1777. }
  1778. .center1 .small-title {
  1779. margin-left: 323px;
  1780. }
  1781. .center1 {
  1782. width: 90%;
  1783. margin: 0 auto;
  1784. margin-left: 10px;
  1785. margin-top: 25px;
  1786. }
  1787. /deep/.el-input--small .el-input__inner {
  1788. height: 32px;
  1789. line-height: 32px;
  1790. }
  1791. /deep/.el-select {
  1792. display: inline-block;
  1793. position: relative;
  1794. width: 100%;
  1795. }
  1796. .annu {
  1797. height: 81px;
  1798. background: #ffffff;
  1799. border-radius: 4px;
  1800. }
  1801. .basicInformation .el-form-item {
  1802. width: 50.3333%;
  1803. border: none;
  1804. margin: 0;
  1805. }
  1806. .huom {
  1807. width: 100%;
  1808. }
  1809. .el-form {
  1810. font-size: 14px;
  1811. font-family: PingFangSC-Regular, PingFang SC;
  1812. font-weight: 400;
  1813. color: #8890b1;
  1814. line-height: 16px;
  1815. }
  1816. .a {
  1817. margin-left: -32px;
  1818. }
  1819. .el-radio-group {
  1820. margin-left: 251px;
  1821. }
  1822. .ding {
  1823. height: 23px;
  1824. background: #e8ecf6;
  1825. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  1826. }
  1827. .winseaview-view {
  1828. padding: 0 0 20px;
  1829. }
  1830. .container {
  1831. overflow: scroll;
  1832. height: 93vh;
  1833. }
  1834. .el-radio-group {
  1835. font-size: 0;
  1836. margin-top: 20px;
  1837. }
  1838. /deep/.el-form {
  1839. padding: 0 15%;
  1840. display: -webkit-box;
  1841. display: -ms-flexbox;
  1842. display: flex;
  1843. -ms-flex-wrap: wrap;
  1844. flex-wrap: wrap;
  1845. margin-left: 130px;
  1846. margin-top: 15px;
  1847. width: 110%;
  1848. }
  1849. </style>