tranManagementWarehouseInOutTaskAdd.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849
  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 = 0
  1498. } else if (this.dataList1.taskTypeKey == 3) {
  1499. this.disabled = true
  1500. this.dataList1.inOutType = '移库入库'
  1501. this.dataList1.inOutTypeKey = '3'
  1502. this.dataList.inOutType = '移库出库'
  1503. this.dataList.inOutTypeKey = '3'
  1504. } else if (this.dataList1.taskTypeKey == 4) {
  1505. this.disabled = true
  1506. this.dataList1.inOutType = '退库'
  1507. this.dataList1.inOutTypeKey = '6'
  1508. this.dataList.inOutType = '销售出库'
  1509. this.flag = 2
  1510. this.dataList.inOutTypeKey = '1'
  1511. }
  1512. },
  1513. GetRandomNum(Min, Max) {
  1514. var Range = Max - Min
  1515. var Rand = Math.random()
  1516. return Min + Math.round(Rand * Range)
  1517. },
  1518. getList() {
  1519. this.tasknumber()
  1520. this.$set(this.dataList, 'inOutType', '销售出库')
  1521. this.$set(this.dataList, 'inOutTypeKey', '1')
  1522. this.$set(this.dataList, 'goodsName', '玉米')
  1523. this.$set(this.dataList, 'goodsNameKey', '1')
  1524. this.$set(this.dataList, 'grade', '一等品')
  1525. this.$set(this.dataList, 'gradeKey', '1')
  1526. this.$set(this.dataList1, 'goodsName', '玉米')
  1527. this.$set(this.dataList1, 'goodsNameKey', '1')
  1528. this.$set(this.dataList1, 'grade', '一等品')
  1529. this.$set(this.dataList1, 'gradeKey', '1')
  1530. // 货名
  1531. pullDown({
  1532. constId: 'CON2'
  1533. })
  1534. .toPromise()
  1535. .then(response => {
  1536. this.goodnameList = response
  1537. })
  1538. // 品级
  1539. pullDown({
  1540. constId: 'CON3'
  1541. })
  1542. .toPromise()
  1543. .then(response => {
  1544. this.gradeList = response
  1545. })
  1546. pullDown({
  1547. constId: 'CON6'
  1548. })
  1549. .toPromise()
  1550. .then(response => {
  1551. this.storageType = response
  1552. })
  1553. pullDown({
  1554. constId: 'CON5'
  1555. })
  1556. .toPromise()
  1557. .then(response => {
  1558. this.storageType1 = response
  1559. })
  1560. xialaNo({
  1561. compId: this.compId,
  1562. flag: this.flag
  1563. })
  1564. .toPromise()
  1565. .then(response => {
  1566. this.contractNoList = response
  1567. // this.contractNoList1 = response
  1568. })
  1569. // //临时仓库入库类型
  1570. // pullDown({ constId: 'WARE1' })
  1571. // .toPromise()
  1572. // .then((response) => {
  1573. // this.storageType = respons
  1574. // })
  1575. // //临时仓库出库类型
  1576. // pullDown({ constId: 'WARE2' })
  1577. // .toPromise()
  1578. // .then((response) => {
  1579. // this.deliveryType = response
  1580. // })
  1581. //仓库名
  1582. getwarehousename({
  1583. compId: this.compId,
  1584. warehouseType: 1
  1585. })
  1586. .toPromise()
  1587. .then(response => {
  1588. this.warehouseNameList = response
  1589. getwarehousename({
  1590. compId: this.compId,
  1591. warehouseType: 2
  1592. })
  1593. .toPromise()
  1594. .then(response => {
  1595. console.log("查仓库sss",response)
  1596. for (var i = 0; i < response.length; i++) {
  1597. this.warehouseNameList.push(response[i])
  1598. }
  1599. })
  1600. })
  1601. },
  1602. selecttaskType(e) {
  1603. for (var i = 0; i < this.taskTypeList.length; i++) {
  1604. if (this.taskTypeList[i].value == e) {
  1605. this.searchType = this.taskTypeList[i].type
  1606. }
  1607. }
  1608. },
  1609. fujian(row) {
  1610. if (
  1611. row.receiveAttachmentPath === null ||
  1612. row.receiveAttachmentPath === ''
  1613. ) {
  1614. EventBus.$emit(
  1615. 'warning',
  1616. this.$t('system.noticeCircular.NoInformation')
  1617. )
  1618. } else {
  1619. this.accessoryTFs = true
  1620. }
  1621. this.appendixIdss = row.receiveAttachmentPath
  1622. },
  1623. handleExamine(row) {
  1624. this.$router.push({
  1625. name: 'salesContractExamine',
  1626. query: {
  1627. id: row.id
  1628. }
  1629. })
  1630. },
  1631. // 关闭 dialog时 处理文件url 初始化upload组件
  1632. handleCloe() {
  1633. this.dialogViewSpareMoney = false
  1634. },
  1635. history(row) {
  1636. console.log(row)
  1637. billoperatehis({
  1638. id: row.id
  1639. })
  1640. .toPromise()
  1641. .then(response => {
  1642. this.historyList = response
  1643. })
  1644. }
  1645. }
  1646. }
  1647. </script>
  1648. <style lang="scss" scoped>
  1649. /deep/.basicInformation {
  1650. .el-info-table {
  1651. border: none;
  1652. position: relative;
  1653. }
  1654. .el-form-item {
  1655. width: 33.3333%;
  1656. border: none;
  1657. margin: 0;
  1658. .el-form-item__label {
  1659. text-align: left;
  1660. font-size: 14px;
  1661. font-family: PingFangSC-Regular, PingFang SC;
  1662. font-weight: 400;
  1663. color: #8890b1;
  1664. }
  1665. .el-form-item__content {
  1666. padding-left: 0px;
  1667. padding-right: 10px;
  1668. // background: #fff;
  1669. white-space: nowrap;
  1670. height: 40px;
  1671. display: flex;
  1672. -webkit-box-align: center;
  1673. align-items: center;
  1674. text-align: left;
  1675. overflow: hidden;
  1676. }
  1677. }
  1678. }
  1679. /deep/.el-radio {
  1680. color: #606266;
  1681. font-weight: 500;
  1682. line-height: 1;
  1683. cursor: pointer;
  1684. white-space: nowrap;
  1685. outline: 0;
  1686. margin-right: 30px;
  1687. margin-top: 15px;
  1688. }
  1689. /deep/.el-radio__inner {
  1690. border: 1px solid #dcdfe6;
  1691. border-radius: 100%;
  1692. width: 14px;
  1693. height: 14px;
  1694. background-color: #fff;
  1695. cursor: pointer;
  1696. -webkit-box-sizing: border-box;
  1697. box-sizing: border-box;
  1698. margin-left: 100px;
  1699. }
  1700. /deep/.el-radio__input {
  1701. white-space: nowrap;
  1702. cursor: pointer;
  1703. outline: 0;
  1704. line-height: 1;
  1705. vertical-align: middle;
  1706. margin-top: -1px;
  1707. }
  1708. .title {
  1709. position: relative;
  1710. padding-left: 10px;
  1711. }
  1712. .title::before {
  1713. content: '';
  1714. display: inline-block;
  1715. width: 5px;
  1716. height: 30px;
  1717. background: #5473e8;
  1718. position: absolute;
  1719. left: 0;
  1720. }
  1721. .el-button--primary {
  1722. background-color: #5878e8;
  1723. border-color: #5878e8;
  1724. }
  1725. .el-col {
  1726. background: #f6f7fc;
  1727. }
  1728. .bg-right {
  1729. text-align: right;
  1730. padding: 16px 20px;
  1731. }
  1732. .center {
  1733. position: relative;
  1734. top: 50px;
  1735. width: 40%;
  1736. margin: 0 auto;
  1737. margin-right: 180px;
  1738. }
  1739. /deep/.el-form-item__label {
  1740. width: 160px;
  1741. }
  1742. .inspector {
  1743. width: 50%;
  1744. }
  1745. /deep/.el-form-item--small .el-form-item__label,
  1746. .el-form-item--small .el-form-item__content {
  1747. text-align: left;
  1748. }
  1749. /deep/.el-input--small {
  1750. font-size: 13px;
  1751. position: relative;
  1752. display: inline-block;
  1753. }
  1754. .center1 .small-title {
  1755. margin-left: 323px;
  1756. }
  1757. .center1 {
  1758. width: 90%;
  1759. margin: 0 auto;
  1760. margin-left: 10px;
  1761. margin-top: 25px;
  1762. }
  1763. /deep/.el-input--small .el-input__inner {
  1764. height: 32px;
  1765. line-height: 32px;
  1766. }
  1767. /deep/.el-select {
  1768. display: inline-block;
  1769. position: relative;
  1770. width: 100%;
  1771. }
  1772. .annu {
  1773. height: 81px;
  1774. background: #ffffff;
  1775. border-radius: 4px;
  1776. }
  1777. .basicInformation .el-form-item {
  1778. width: 50.3333%;
  1779. border: none;
  1780. margin: 0;
  1781. }
  1782. .huom {
  1783. width: 100%;
  1784. }
  1785. .a {
  1786. margin-left: -32px;
  1787. }
  1788. .ding {
  1789. height: 23px;
  1790. background: #e8ecf6;
  1791. box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
  1792. }
  1793. .el-radio-group {
  1794. font-size: 0;
  1795. margin-top: 20px;
  1796. margin-left: 251px;
  1797. }
  1798. /deep/.el-form {
  1799. padding: 0 15%;
  1800. display: -webkit-box;
  1801. display: -ms-flexbox;
  1802. display: flex;
  1803. -ms-flex-wrap: wrap;
  1804. flex-wrap: wrap;
  1805. margin-left: 130px;
  1806. margin-top: 15px;
  1807. width: 100%;
  1808. font-size: 14px;
  1809. font-family: PingFangSC-Regular, PingFang SC;
  1810. font-weight: 400;
  1811. color: #8890b1;
  1812. line-height: 16px;
  1813. }
  1814. </style>