Browse Source

新厂钢材入厂边库

xiaosonghong 6 tháng trước cách đây
mục cha
commit
e6ce776d62
1 tập tin đã thay đổi với 336 bổ sung1 xóa
  1. 336 1
      src/views/OYE/components/oYeRealTimeInventory.vue

+ 336 - 1
src/views/OYE/components/oYeRealTimeInventory.vue

@@ -51,6 +51,14 @@
           v-privilege="activeMenu + 'addEditTime'"
           >划分库存重量
         </el-button>
+
+        <el-button
+          type="primary"
+          @click="newFactoryPutStorage"
+          v-privilege="activeMenu + 'addEditTime'"
+          >新厂钢材入库
+        </el-button>
+
         <el-form-item></el-form-item>
       </el-form>
     </div>
@@ -422,6 +430,191 @@
       </el-dialog>
     </div>
 
+    <!--新厂钢材入库-->
+    <div class="updateInsertForm">
+      <el-dialog :visible.sync="newFactoryAddView" 
+      width="80%"
+      fullscreen>
+      <div style="display: grid; place-items: center; height: 100%;">
+        <div style="color: #000000;font-size: 24px;font-weight: 700;">
+          新增新厂钢材入库数据:
+        </div>
+        <el-form label-position="left">
+          <el-form-item prop="consigneeName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >客户:</span>
+            <el-autocomplete
+              class="inline-input"
+              v-model="newFactoryPutForm.consigneeName"
+              :fetch-suggestions="querySearchConsignee"
+              :trigger-on-focus="false"
+              @select="handleSelectConsignee"
+              style="width: 250px;"
+              placeholder="请输入客户名称"
+              clearable
+            >
+              <template slot-scope="{ item }">
+                <div class="name">{{ item.consigneeCompanyName }}</div>
+              </template>
+            </el-autocomplete>
+          </el-form-item>
+
+          <el-form-item prop="qsaleArea">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >片区:</span
+            >
+            <el-input
+              v-model="newFactoryPutForm.saleArea"
+              style="width: 250px;"
+              clearable
+            ></el-input>
+          </el-form-item>
+
+          <el-form-item prop="inboundWarehouse">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >仓库:</span
+            >
+            <el-select
+              v-model="newFactoryPutForm.inboundWarehouse"
+              style="width: 250px;"
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in inboundWarehouseList"
+                :key="item.label"
+                :label="item.label"
+                :value="item.label"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" @click="addMaterial">选择物资</el-button>
+          </el-form-item>
+          <el-form-item prop="materialName">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >物资信息:</span
+            >
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >{{ newFactoryPutForm.materialNameView }}</span>
+          </el-form-item>
+
+          <el-form-item prop="materialMeter" v-if="isDisabledMeter">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >米数:</span>
+            <el-input-number 
+              v-model="newFactoryPutForm.meter"
+              style="width:250px"
+              :min="0" :max="30"
+            ></el-input-number>
+          </el-form-item>
+          
+          <el-form-item prop="materialNumberEdit">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >入库件数:</span>
+            <el-input-number
+              v-model="newFactoryPutForm.materialNumber"
+              style="width:250px"
+              :min="0" :max="10000"
+            ></el-input-number>
+          </el-form-item>
+
+          <el-form-item prop="singleWeightEdit" v-if="isDisabledsingleWeight">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >单件理重:</span>
+            <el-input-number
+              v-model="newFactoryPutForm.singleWeight"
+              style="width:250px"
+              :precision="3" :step="0.001" :min="0" :max="100"
+            ></el-input-number>
+          </el-form-item>
+
+          <el-form-item prop="theoryWeightEdit" v-if="false">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >入库理重:</span>
+            <el-input-number
+              v-model="newFactoryPutForm.theoryWeight"
+              style="width:250px"
+              disabled
+              :precision="3" :step="0.001" :min="0" :max="100000"
+            ></el-input-number>
+          </el-form-item>
+
+          <el-form-item prop="netWeightEdit">
+            <span style="color: #000000;font-size: 16px;font-weight: 500;"
+              >入库净重:</span>
+            <el-input-number
+              v-model="newFactoryPutForm.netWeight"
+              style="width:250px"
+              :precision="3" :step="0.001" :min="0" :max="100000"
+            ></el-input-number>
+          </el-form-item>
+        </el-form>
+        <div style="display: flex;justify-content: center;align-items: center;">
+          <el-button
+            type="primary"
+            @click="putNewFactory"
+            style="margin-right: 20px;"
+            >保存</el-button
+          >
+          <el-button @click="newFactoryAddView = false">取消</el-button>
+        </div>
+      </div>
+      </el-dialog>
+      <!-- 物资选择模态框 -->
+      <el-drawer
+      title="选择物资信息"
+      :visible.sync="materialTable"
+      size="80%"
+      :show-close="true"
+      >
+      <el-form :inline="true" style="margin-top: 0.5rem;">
+        <el-form-item>
+          <label class="el-form-item__label" style="width: auto;"
+            >物资名称/型号</label
+          >
+        </el-form-item>
+        <el-form-item>
+          <el-input
+            placeholder="请输入物资名称或型号"
+            v-model="materialNameText"
+            clearable
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <label class="el-form-item__label" style="width: auto;">规格</label>
+        </el-form-item>
+        <el-form-item>
+          <el-input
+            placeholder="请输入内容"
+            v-model="materialSpecificationText"
+            clearable
+            ><template slot="prepend">Φ</template></el-input
+          >
+        </el-form-item>
+        <el-button
+          type="primary"
+          class="btn"
+          @click="onclick"
+          style="margin-left: 4px;"
+          ><i class="el-icon-search"></i>查询</el-button
+        >
+        <el-button type="primary" @click="makeSureMaterial"
+          ><i class="el-icon-check"></i>确定</el-button
+        >
+      </el-form>
+      <div class="tablecls">
+        <!-- 查询所有的物资 -->
+        <dilTable
+          v-bind.sync="option2"
+          @radio-change="selectionChange"
+        >
+        </dilTable>
+      </div>
+    </el-drawer>
+    </div>
+    <!--新厂钢材入库end-->
+
     <div class="exportExcelBefore">
       <el-dialog title="下载点前Excel" :visible.sync="exportExcelBeforeVisible">
         <el-date-picker
@@ -534,6 +727,36 @@ export default {
         requestQuery: {},
         selectionType: 'radio'
       },
+      newFactoryAddView: false,
+      newFactoryPutForm:{
+
+      },
+      inboundWarehouseList: [
+        {
+          value: 111,
+          label: '欧冶巨昌中心库新厂入库'
+        },
+        {
+          value: 222,
+          label: '欧冶鑫宏中心库新厂入库'
+        }
+      ],
+      materialTable: false,
+      materialNameText:"",
+      materialSpecificationText:"",
+      option2: {
+        // 表格请求数据的地址
+        requestUrl: '/api/v1/uc/getSteelMaterial?apiId=244',
+        // 控制显示多选列
+        selectionType: 'radio'
+      },
+      isDisabledMeter: false,
+      isDisabledtheoryWeight: false,
+      isDisabledsingleWeight: false,
+      newFactoryPutFormmaterialNumber:null,
+      newFactoryPutFormsingleWeight:null,
+      newFactoryPutFormtheoryWeight:null,
+      newFactoryPutFormnetWeight:null,
     }
   },
   computed: {
@@ -574,7 +797,7 @@ export default {
         }
         this.selectedRowData2 = {}
       }
-    }
+    },
   },
   created() {
     this.getInfo()
@@ -745,6 +968,10 @@ export default {
       this.updateWeightForm.netWeightEdit = 0
       this.updateWeightVisible = true
     },
+    //新厂钢材入库
+    newFactoryPutStorage(){
+      this.newFactoryAddView = true
+    },
     radioChange(row) {
       this.selectedRowData = row
     },
@@ -847,6 +1074,114 @@ export default {
             }
           })
       })
+    },
+    //以下是发货单位边输边查搜索
+    querySearchConsignee(queryString, cb) {
+      this.axios
+        .post('/api/v1/uc/getConsigneeByLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            console.log(res)
+            var restaurantsConsignee = res.data.data
+            var results = queryString
+              ? restaurantsConsignee.filter(
+                  this.createFilterConsignee(queryString)
+                )
+              : restaurantsConsignee
+            // 调用 callback 返回建议列表的数据
+            cb(results)
+          }
+        })
+    },
+    //收货单位弹出层
+    handleSelectConsignee(item) {
+      this.newFactoryPutForm.consigneeId = item.consigneeId
+      item.consigneeCompanyName = this.newFactoryPutForm.consigneeCompanyName
+    },
+    createFilterConsignee(queryString) {
+      return restaurantsConsignee => {
+        return (
+          restaurantsConsignee.value
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        )
+      }
+    },
+    addMaterial() {
+      this.option2.requestUrl =
+        '/api/v1/uc/getSteelMaterial?apiId=244&i=' + new Date()
+      this.materialNameText = null
+      this.materialSpecificationText = null
+      this.materialTable = true
+    },
+    //物资模态框查询
+    onclick() { 
+      this.option2.requestUrl =
+        '/api/v1/uc/getSteelMaterial?apiId=244&materialNameText=' +
+        this.materialNameText +
+        '&materialSpecificationText=' +
+        this.materialSpecificationText
+    },
+    makeSureMaterial(){
+      if(!this.newFactoryPutForm.materialId || this.newFactoryPutForm.materialId == null || this.newFactoryPutForm.materialId == ''){
+        this.$message({
+                type: 'error',
+                message: '请选择物资!'
+              })
+      } else {
+        this.materialTable = false
+      }
+    },
+    selectionChange(row){
+      this.newFactoryPutForm.materialId = row.materialId
+      this.newFactoryPutForm.materialName = row.materialName
+      this.newFactoryPutForm.materialSpecification = row.materialSpecification
+      this.newFactoryPutForm.materialModel = row.materialModel
+      this.newFactoryPutForm.materialCode = row.materialCode
+      this.newFactoryPutForm.materialNameView = ''
+      if(this.newFactoryPutForm.materialId && this.newFactoryPutForm.materialId != null && this.newFactoryPutForm.materialId != ''){
+        this.newFactoryPutForm.materialNameView = this.newFactoryPutForm.materialName + this.newFactoryPutForm.materialSpecification +
+          '(' + this.newFactoryPutForm.materialModel + ')';
+        this.newFactoryPutForm.materialNumber = null;
+        this.newFactoryPutForm.singleWeight = null;
+        this.newFactoryPutForm.theoryWeight = null;
+        this.newFactoryPutForm.netWeight = null;
+      }
+      if(this.newFactoryPutForm.materialName != null && this.newFactoryPutForm.materialName.indexOf("定尺") > 0){
+        this.isDisabledMeter = true;
+        this.isDisabledsingleWeight = true;
+      } else {
+        this.isDisabledMeter = false;
+        this.isDisabledsingleWeight = false;
+      }
+    },
+    putNewFactory(){
+      this.$confirm('确定保存入库吗?', '提示', {
+        type: 'warning'
+      }).then(() => {
+        this.newFactoryPutForm.userId = getCookie('userId')
+        //this.newFactoryPutForm.materialNumber = this.newFactoryPutFormmaterialNumber
+        //this.newFactoryPutForm.singleWeight = this.newFactoryPutFormsingleWeight
+        //this.newFactoryPutForm.theoryWeight = this.newFactoryPutFormtheoryWeight
+        //this.newFactoryPutForm.netWeight = this.newFactoryPutFormnetWeight
+        this.axios
+          .post('/api/v1/wms/putNewFactory', this.newFactoryPutForm)
+          .then(res => {
+            if (res.data.status == 'succeed') {
+              this.$message({
+                type: 'success',
+                message: '保存成功'
+              })
+              this.newFactoryAddView = false
+              this.getRequestUrl()
+            } else if (res.data.status == 'failed') {
+              this.$message({
+                type: 'error',
+                message: res.data.data
+              })
+            }
+          })
+      })
     }
   }
 }