tranManagementWarehouseInOutTaskAdd.vue 54 KB

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