tranManagementWarehouseInOutTaskAdd.vue 61 KB

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