tranManagementWarehouseInOutTaskAdd.vue 55 KB

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