tranManagementWarehouseInOutTaskAdd.vue 69 KB

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