tranManagementWarehouseInOutTaskAdd.vue 53 KB

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