tranManagementWarehouseInOutTaskAdd.vue 54 KB

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