|
@@ -35,17 +35,157 @@
|
|
|
<el-input v-model="con1" style="width:200px" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
<el-button type="primary" @click="search">查询</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="addEditTime"
|
|
|
+ v-privilege="activeMenu + 'addEditTime'"
|
|
|
+ >划分实时库存</el-button
|
|
|
+ >
|
|
|
<el-form-item></el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
- <dilTable v-bind.sync="options"></dilTable>
|
|
|
+ <dilTable
|
|
|
+ v-bind.sync="options"
|
|
|
+ @radio-change="radioChange"
|
|
|
+ :showSummaryList="showSummaryList"
|
|
|
+ :isshowSummary="true"
|
|
|
+ :showIndex="false"
|
|
|
+ :row-style="{ height: '30px' }"
|
|
|
+ :cell-style="returnClassName"
|
|
|
+ ></dilTable>
|
|
|
+ </div>
|
|
|
+ <div class="updateInsertForm">
|
|
|
+ <el-dialog :visible.sync="updateInsertVisible">
|
|
|
+ <div style="color: #000000;font-size: 16px;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
|
|
|
+ >
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
|
|
|
+ selectedRowData.consigneeName
|
|
|
+ }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="saleArea">
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;"
|
|
|
+ >片区</span
|
|
|
+ >
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
|
|
|
+ selectedRowData.saleArea
|
|
|
+ }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="inboundWarehouse">
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;"
|
|
|
+ >仓库</span
|
|
|
+ >
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
|
|
|
+ selectedRowData.inboundWarehouse
|
|
|
+ }}</span>
|
|
|
+ </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;"
|
|
|
+ >{{ selectedRowData.materialName }}-{{
|
|
|
+ selectedRowData.materialSpe
|
|
|
+ }}-{{ selectedRowData.materialModel }};</span
|
|
|
+ ><span style="color:red;font-size: 16px;font-weight: 500;"
|
|
|
+ >物资单重为{{ selectedRowData.singleWeight }}t,{{
|
|
|
+ selectedRowData.materialNumber
|
|
|
+ }}件,理重为{{ selectedRowData.theoryWeight }}t,净重为{{
|
|
|
+ selectedRowData.netWeight
|
|
|
+ }}t</span
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div style="color: #000000;font-size: 16px;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
|
|
|
+ >
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
|
|
|
+ selectedRowData.consigneeName
|
|
|
+ }}</span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="saleArea">
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;"
|
|
|
+ >片区</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="updateInsertForm.saleArea"
|
|
|
+ style="width: 250px;"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="inboundWarehouse">
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;"
|
|
|
+ >仓库</span
|
|
|
+ >
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;">{{
|
|
|
+ updateInsertForm.inboundWarehouse
|
|
|
+ }}</span>
|
|
|
+ </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;"
|
|
|
+ >{{ selectedRowData.materialName }}-{{
|
|
|
+ selectedRowData.materialSpe
|
|
|
+ }}-{{ selectedRowData.materialModel }};</span
|
|
|
+ ><span style="color:red;font-size: 16px;font-weight: 500;"
|
|
|
+ >物资单重为{{ selectedRowData.singleWeight }}t</span
|
|
|
+ >
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="materialNumber">
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;"
|
|
|
+ >物资件数</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model.number="updateInsertForm.materialNumber"
|
|
|
+ type="number"
|
|
|
+ style="width: 250px;"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item prop="theoryWeight">
|
|
|
+ <span style="color: #000000;font-size: 16px;font-weight: 500;"
|
|
|
+ >物资理重</span
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="updateInsertForm.theoryWeight"
|
|
|
+ disabled
|
|
|
+ style="width:250px"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div style="display: flex;justify-content: center;align-items: center;">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="makeSureMaterial"
|
|
|
+ style="margin-right: 20px;"
|
|
|
+ >保存</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="updateInsertVisible = false">取消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import { getCookie, formatDate } from '@/utils/util.js'
|
|
|
-
|
|
|
+import {
|
|
|
+ getCookie,
|
|
|
+ formatDate,
|
|
|
+ accAdd,
|
|
|
+ accMul,
|
|
|
+ accSub,
|
|
|
+ accDiv
|
|
|
+} from '@/utils/util.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
const generateStartDate = _ => {
|
|
@@ -63,9 +203,11 @@ export default {
|
|
|
return endTime.getTime()
|
|
|
}
|
|
|
return {
|
|
|
+ activeMenu: window.top.localStorage.getItem('activeMenu'),
|
|
|
options: {
|
|
|
requestUrl: '',
|
|
|
- requestQuery: {}
|
|
|
+ requestQuery: {},
|
|
|
+ selectionType: 'radio'
|
|
|
},
|
|
|
selectOptions: [
|
|
|
{
|
|
@@ -101,7 +243,31 @@ export default {
|
|
|
endTime: generateEndDate(),
|
|
|
apiId: '531',
|
|
|
orgCode: null,
|
|
|
- loginName: null
|
|
|
+ loginName: null,
|
|
|
+ selectedRowData: {},
|
|
|
+ updateInsertVisible: false,
|
|
|
+ updateInsertForm: {},
|
|
|
+ showSummaryList: ['materialNumber', 'netWeight', 'theoryWeight']
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ materialNumber() {
|
|
|
+ return this.updateInsertForm.materialNumber
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ materialNumber(val) {
|
|
|
+ this.updateInsertForm.theoryWeight = accMul(
|
|
|
+ val,
|
|
|
+ this.updateInsertForm.singleWeight
|
|
|
+ )
|
|
|
+ this.updateInsertForm.netWeight = accMul(
|
|
|
+ accDiv(
|
|
|
+ this.selectedRowData.netWeight,
|
|
|
+ this.selectedRowData.materialNumber
|
|
|
+ ),
|
|
|
+ val
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -109,9 +275,41 @@ export default {
|
|
|
this.getRequestUrl()
|
|
|
},
|
|
|
methods: {
|
|
|
+ returnClassName({ row, column, rowIndex, columnIndex }) {
|
|
|
+ return {
|
|
|
+ fontWeight: '500 !important',
|
|
|
+ fontSize: '14px !important'
|
|
|
+ // backgroundColor: '#FFFF01'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addEditTime() {
|
|
|
+ if (Object.keys(this.selectedRowData).length == 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'error',
|
|
|
+ message: '请选择实时库存数据'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.updateInsertForm.consigneeName = this.selectedRowData.consigneeName
|
|
|
+ this.updateInsertForm.oldSaleArea = this.selectedRowData.saleArea
|
|
|
+ this.updateInsertForm.inboundWarehouse = this.selectedRowData.inboundWarehouse
|
|
|
+ this.updateInsertForm.consigneeId = this.selectedRowData.consigneeId
|
|
|
+ this.updateInsertForm.materialId = this.selectedRowData.materialId
|
|
|
+ this.updateInsertForm.materialName = this.selectedRowData.materialName
|
|
|
+ this.updateInsertForm.materialSpe = this.selectedRowData.materialSpe
|
|
|
+ this.updateInsertForm.materialModel = this.selectedRowData.materialModel
|
|
|
+ this.updateInsertForm.inventoryId = this.selectedRowData.inventoryId
|
|
|
+ this.updateInsertForm.singleWeight = this.selectedRowData.singleWeight
|
|
|
+ this.updateInsertForm.meter = this.selectedRowData.meter
|
|
|
+ this.updateInsertForm.inboundArea = '欧冶库'
|
|
|
+ this.updateInsertVisible = true
|
|
|
+ },
|
|
|
+ radioChange(row) {
|
|
|
+ this.selectedRowData = row
|
|
|
+ },
|
|
|
getInfo() {
|
|
|
this.orgCode = getCookie('orgCode')
|
|
|
- if (this.orgCode == 'shouhuokehu') {
|
|
|
+ if (this.orgCode == 'shouhuokehu' || this.orgCode == 'chengyunshang') {
|
|
|
this.apiId = 534
|
|
|
this.loginName = getCookie('loginName')
|
|
|
} else if (this.orgCode == 'ouyechangwaiku') {
|
|
@@ -134,12 +332,36 @@ export default {
|
|
|
let queryMap = {}
|
|
|
queryMap[this.screen] = this.con
|
|
|
queryMap[this.screen1] = this.con1
|
|
|
- queryMap['consigneeName'] = this.loginName
|
|
|
- queryMap['inboundWarehouse'] = this.inboundWarehouse
|
|
|
+ if (this.loginName != null) {
|
|
|
+ queryMap['consigneeName'] = this.loginName
|
|
|
+ }
|
|
|
this.options.requestQuery = JSON.parse(JSON.stringify(queryMap))
|
|
|
},
|
|
|
search() {
|
|
|
this.getRequestUrl()
|
|
|
+ },
|
|
|
+ makeSureMaterial() {
|
|
|
+ this.updateInsertForm.saleArea = this.updateInsertForm.saleArea.replace(
|
|
|
+ ',',
|
|
|
+ ','
|
|
|
+ )
|
|
|
+ console.log(this.updateInsertForm, 'this.updateInsertForm')
|
|
|
+ this.$confirm('确定保存吗?', '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.axios
|
|
|
+ .post('/api/v1/wms/updateInsertRealTime', this.updateInsertForm)
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.status == 'succeed') {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '保存成功'
|
|
|
+ })
|
|
|
+ this.updateInsertVisible = false
|
|
|
+ this.getRequestUrl()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -154,5 +376,9 @@ export default {
|
|
|
margin-left: 10px;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
+ /deep/ .el-table__footer-wrapper {
|
|
|
+ font-weight: 700 !important;
|
|
|
+ font-size: 16px !important;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|