tranManagementWarehouseInOutTaskAdd.vue 70 KB

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