init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)

这个提交包含在:
Developer
2026-10-30 10:18:50 +08:00
当前提交 1f3e0ce2f6
共有 9291 个文件被更改,包括 1776674 次插入 和 0 次删除

查看文件

@@ -0,0 +1,701 @@
<!DOCTYPE html>
<html>
<!--[1.8.93]-->
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>新增盘点单</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
<link rel="stylesheet" href="/Public/css/component-serial.css?v=1.0.0">
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Retail/common/js/select-goods-category.js"></script>
<style>
.header-title {
font-size: 20px;
padding-right: 30px;
}
.must-edit {
color: red;
}
.form-textarea {
margin: 20px 0;
}
.form-button {
display: flex;
justify-content: flex-end;
}
.form-textarea-title {
margin-bottom: 20px;
}
.form-table {
width: calc(100vw - 50px);
margin: 0 auto;
}
.form-table-total {
margin: 10px 0;
}
.table-total {
text-align: right;
padding: 15px;
background: #f5f7fa;
color: #606266;
border: 1px solid #ebeef5;
border-top: none;
}
.table-total > span {
color: #409EFF;
}
.el-input-remote {
width: 140px;
}
.size-details {
display: flex;
align-items: center;
flex-wrap: wrap;
justify-content: space-between;
padding-bottom: 20px;
border-bottom: 1px solid #ebeef5;
margin-bottom: 20px;
}
.size-details-list {
box-sizing: border-box;
width: 45%;
display: flex;
align-items: center;
justify-content: space-between;
}
.size-input {
width: 120px;
}
.size-title {
padding: 10px;
background: #f5f7fa;
color: #606266;
border: 1px solid #ebeef5;
margin-bottom: 20px;
}
.size-footer {
display: flex;
align-items: center;
justify-content: space-between;
}
.size-all {
display: flex;
align-items: center;
}
.size-all-input {
width: 60px;
}
[v-cloak] {
display: none;
}
.el-dialog {
width: 90%;
}
.mini-input .el-input__inner {
padding-right: 4px;
}
.el-form-cell-center {
margin-bottom: 0;
}
#goods .serial span.num {
display: block;
}
</style>
</head>
<body>
<div class="app" id="goods" v-cloak>
<div class="text item" id="loading_examine">
<div style="margin: 5px 18px">
<template>
<if condition="$authArr['goodsChoice'] eq true">
<el-button size="small" @click="goodsChoice" type="primary">选择商品</el-button>
</if>
</template>
</div>
<div class="form-table">
<el-table :data="goodsList" size="small"
:header-cell-style="{background:'#F5F7FA',color:'#606266'}"
border show-summary v-loading="loading" :summary-method="getSummaries"
style="width: 100%; margin-top: 20px">
<el-table-column label="序号" type="index" width="80"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" size="mini"
@click="deleteTable(scope.$index,scope.row.inventory_goods_id)">删除
</el-button>
</template>
</el-table-column>
<el-table-column prop="goods_name" label="商品"></el-table-column>
<el-table-column prop="sku_name" label="规格"></el-table-column>
<el-table-column label="货号">
<template slot-scope="scope">
<span v-if="scope.row.attribute_state == 1">{{scope.row.goods_number}}</span>
<span v-if="scope.row.attribute_state == 2">{{scope.row.sku_goods_number}}</span>
</template>
</el-table-column>
<el-table-column prop="sku_goods_number" label="条码">
<template slot-scope="scope">
<span v-if="scope.row.attribute_state == 1">{{scope.row.goods_code}}</span>
<span v-if="scope.row.attribute_state == 2">{{scope.row.sku_code}}</span>
</template>
</el-table-column>
<el-table-column prop="company" label="单位"></el-table-column>
<el-table-column prop="cost_price" label="成本价"></el-table-column>
<el-table-column v-if="showSystemNum" prop="goods_num" label="库存">
<template slot-scope="scope">
<el-button type="text" size="mini" @click="detailsSerial(scope.$index)"
v-if="scope.row.serial_number_state == 1 && scope.row.goods_num > 0">
{{scope.row.goods_num}}
</el-button>
<span v-else>{{scope.row.goods_num}}</span>
</template>
</el-table-column>
<el-table-column label="盘点数量">
<template slot-scope="scope">
<div class="el-form-item el-form-cell-center" :class="color1?'':'is-error'"
v-if="scope.row.serial_number_state != 1">
<el-input size="mini" v-model="scope.row.inventory_num"
@input="numVerification(scope.row.inventory_num ,scope.row.goods_num,scope.row.pricing_method,scope.row.cost_price,scope.$index)">
</el-input>
</div>
<div class="serial" v-else>
<span class="num">{{scope.row.inventory_num}}</span>
<el-button type="text" size="mini" @click="insertSerial(scope.$index)">录入串码</el-button>
</div>
</template>
</el-table-column>
<el-table-column v-if="showSystemNum" prop="subtotal" label="盈亏"></el-table-column>
<el-table-column prop="remarks" label="备注">
<template slot-scope="scope">
<el-input type="textarea" v-model="scope.row.remarks"></el-input>
</template>
</el-table-column>
</el-table>
</div>
<div class="form-textarea">
<div class="form-textarea-title">订单备注</div>
<el-input type="textarea" :rows="2" placeholder="订单备注" v-model="remarks">
</el-input>
</div>
<div class="form-button">
<el-button @click="cancel">取消</el-button>
<if condition="$authArr['onSubmit'] eq true">
<el-button type="primary" @click="onSubmit(2)">保存草稿箱</el-button>
<el-button type="primary" @click="onSubmit(1)">确定</el-button>
</if>
</div>
</div>
<!--/弹出框/-->
<el-dialog title="选择商品" size="small" top="5vh" :header-cell-style="{background:'#F5F7FA',color:'#606266'}"
:modal-append-to-body="false" :visible.sync="outerVisible">
<div class="dialog-details-first">
<template>
<div style="display: flex;">
<el-input style="margin-right: 20px;width: 200px" size="small" class="el-input-remote" clearable
@keydown.enter.exact.native.prevent="searchGoods"
v-model="searchText" placeholder="名称/货号/条码">
</el-input>
<select-goods-category :user-type="1"
:category-id1.sync="goodsClassId1"
:category-id2.sync="goodsClassId2"
:category-id3.sync="goodsClassId3"></select-goods-category>
<el-button type="primary" plain @click="searchGoods" size="small">搜索</el-button>
</div>
</template>
</div>
<template>
<el-table v-loading="loading" size="small"
:header-cell-style="{background:'#F5F7FA',color:'#606266'}"
:data="goodsArr" border @selection-change="handleSelectionChange"
style="width: 100%; margin-top: 20px">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="index" label="序号"></el-table-column>
<el-table-column prop="goods_name" label="商品名称"></el-table-column>
<el-table-column prop="sku_name" label="规格"></el-table-column>
<el-table-column label="货号">
<template slot-scope="scope">
<span v-if="scope.row.attribute_state == 1">{{scope.row.goods_number}}</span>
<span v-if="scope.row.attribute_state == 2">{{scope.row.sku_goods_number}}</span>
</template>
</el-table-column>
<el-table-column prop="sku_goods_number" label="条码">
<template slot-scope="scope">
<span v-if="scope.row.attribute_state == 1">{{scope.row.goods_code}}</span>
<span v-if="scope.row.attribute_state == 2">{{scope.row.sku_code}}</span>
</template>
</el-table-column>
<el-table-column prop="company" label="单位"></el-table-column>
<el-table-column prop="cost_price" label="成本价"></el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="currentPage" :page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
:page-size="100" layout="total, sizes, prev, pager, next, jumper" :total="currentLen">
</el-pagination>
</template>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="goodsSub(1)">提交</el-button>
<el-button @click="goodsSub(2)">提交并关闭</el-button>
</div>
</el-dialog>
<component-serial :visible.sync="serialVisible" :dialog-type="dialogType" :parent-index="serialGoodsIndex"
:parent-data="serialGoodsData" :data="serialData" :get-data-type="serialDataType"
:insert-validate="dialogType == 'insert' ? 'inventory' : ''" @serial-change="serialChange">
</component-serial>
</div>
</body>
<script src="/Public/js/component-serial.js?v=1.0.1"></script>
<script src="/Public/js/common.js"></script>
<script>
new Vue({
el: "#goods",
data: {
showSystemNum: "{$showSystemNum}" == 1 ? true : false,
inventory_id: "{$inventory_id}",
color: true,
searchText: "",
goodsClassId1: "",
goodsClassId2: "",
goodsClassId3: "",
goodsArr: [], //商品档案信息
currentPage: 1,
currentLimit: 10,
currentLen: 0,
color1: true,
color2: true,
remarks: '',
num: 1,
size: true,
outerVisible: false,
innerVisible: false, //规格弹框
goodsList: [], //盘点商品明细
goodsSelection: [], //选中的商品
loading: false,
serialVisible: false, //串号录入窗口开关
serialGoodsIndex: 0, //串号录入当前商品索引
serialGoodsData: {}, //串号录入当前商品数据对象
serialData: [], //串号容器
dialogType: '', //串号弹出层类型
serialDataType: '' //串号数据类型
},
methods: {
//仓库选择
warehouse_operation: function () {
this.currentPage = 1;
this.goodsClassId1 = "";
this.goodsClassId2 = "";
this.goodsClassId3 = "";
},
//选择商品
goodsChoice: function () {
var that = this;
that.getData();
that.outerVisible = true;
},
//盘点商品搜索
searchGoods: function () {
this.currentPage = 1;
this.getData();
},
//盘点商品
getData: function () {
this.loading = true;
var goodsList = this.goodsList;
var exists_id_arr = [];
if (goodsList.length > 0) {
for (var i = 0; i < goodsList.length; i++) {
exists_id_arr.push(goodsList[i].id);
}
}
$.ajax({
url: "{:U(goodsList)}",
type: 'POST',
data: {
page: this.currentPage,
limit: this.currentLimit,
exists_id_arr: exists_id_arr,
search_info: this.searchText,
person1: this.goodsClassId1,
person2: this.goodsClassId2,
person3: this.goodsClassId3,
},
success: (res) => {
if (res.status == 1) {
this.loading = false;
this.goodsArr = [];
this.goodsArr = res.data.list;
this.$nextTick(function () {
this.currentLen = parseInt(res.data.count);
})
} else {
this.$confirm(res.msg, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
}).catch(() => {
});
}
}
});
},
//分页
handleSizeChange(val) {
this.currentLimit = val;
this.currentPage = 1;
this.getData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData();
},
//选中的盘点商品
handleSelectionChange: function (data) {
var that = this;
that.goodsSelection = data;
},
//商品提交
goodsSub: function (type) {
var that = this;
var goodsSelection = JSON.parse(JSON.stringify(that.goodsSelection));
var goodsList = that.goodsList;
if (!goodsSelection || goodsSelection.length == 0) {
that.$message({type: "error", message: "请选择盘点的商品", duration: 1000})
return;
}
for (var i = 0; i < goodsSelection.length; i++) {
goodsSelection[i].subtotal = "";
goodsSelection[i].remarks = "";
goodsList.push(goodsSelection[i]);
}
that.goodsList = [];
that.goodsList = goodsList;
if (goodsList.length >= 400) {
that.$message({
type: "warning",
message: "盘点的商品种数已达上限建议立即提交",
duration: 2000
})
}
if (type == 2) {
that.outerVisible = false
} else {
that.searchGoods();
}
},
//数量
numVerification: function (num, goods_num, pricing_method, price, index) {
if (pricing_method == 2) {
var reg = /^[0-9]+(.[0-9]{1,3})?$/;
} else {
var reg = /^\+?[0-9][0-9]*$/;
}
if (!reg.test(num)) {
this.subtotalCalculation(price, num, goods_num, index);
this.color1 = false;
} else {
this.subtotalCalculation(price, num, goods_num, index);
this.color1 = true;
}
},
//计算单个商品的小计
subtotalCalculation: function (price, num, goods_num, index) {
var that = this;
var reg = /^[0-9]+.?[0-9]*$/;
if (!reg.test(price) || !reg.test(num)) {
that.goodsList[index].subtotal = "";
return;
}
var subtotal = ((num - goods_num) * price * 1);
that.goodsList[index].subtotal = subtotal.toFixed(2);
},
deleteTable: function (index, inventory_goods_id) {
var that = this;
if (inventory_goods_id > 0 && that.inventory_id > 0) {
$.ajax({
url: "{:U('removeGoods')}",
type: "post",
data: {
inventory_goods_id: inventory_goods_id,
inventory_id: that.inventory_id
},
success: function (res) {
if (res.status == 1) {
that.goodsList.splice(index, 1);
} else {
that.$message.error("请求超时,请重试");
}
}
})
} else {
that.goodsList.splice(index, 1);
}
},
cancel: function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
},
onSubmit: function (status) {
var that = this;
var goods_id = [];
var type = that.type;
var goodsList = that.goodsList;
var remarks = that.remarks;
var reg2 = /^[0-9]+(.[0-9]{1,3})?$/;
var reg3 = /^\+?[0-9][0-9]*$/;
var inventory_id = that.inventory_id;
if (inventory_id == '' && (!goodsList || goodsList.length == 0)) {
that.$message({type: "error", message: "请选择盘点商品", duration: 1000})
return;
}
for (var i = 0; i < goodsList.length; i++) {
if (!goodsList[i].cost_price) {
that.$message({
type: "error",
message: goodsList[i].goods_name + goodsList[i].sku_name + "成本价有误",
duration: 1000
})
return;
}
if (goodsList[i].inventory_num === "") {
that.$message({
type: "error",
message: goodsList[i].goods_name + goodsList[i].sku_name + "请输入正确数量",
duration: 1000
})
return;
}
if (goodsList[i].attribute_state == 1) {
//无规格
if (goodsList[i].pricing_method == 1) {
if (!reg3.test(goodsList[i].inventory_num)) {
that.$message({
type: "error",
message: goodsList[i].goods_name + "请输入正确数量",
duration: 1000
})
return;
}
} else {
if (!reg2.test(goodsList[i].inventory_num)) {
that.$message({
type: "error",
message: goodsList[i].goods_name + "请输入正确数量",
duration: 1000
})
return;
}
}
} else if (goodsList[i].attribute_state == 2) {
if (!reg3.test(goodsList[i].inventory_num)) {
that.$message({
type: "error",
message: goodsList[i].goods_name + goodsList[i].sku_name + "规格商品数量为整数",
duration: 1000
})
return;
}
}
if (goods_id.includes(goodsList[i].id)) {
that.$message({
type: "error",
message: goodsList[i].goods_name + goodsList[i].sku_name + "存在重复",
duration: 1000
})
return;
}
goods_id.push(goodsList[i].id);
}
that.$confirm('请确认盘点商品信息无误,提交后无法修改,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading_examine = that.$loading({
target: "#loading_examine",
lock: true,
text: '保存中,请等待',
spinner: 'el-icon-loading',
background: 'rgba(255, 255, 255, 0.7)'
});
goodsList = JSON.stringify(goodsList);
$.ajax({
url: "{:U('InventoryOperation')}",
type: "post",
data: {goodsList: goodsList, remarks: remarks, status: status, inventory_id: inventory_id},
success: function (res) {
if (res.status == 1) {
that.$message({
type: "success",
message: res.message,
duration: 1000,
onClose: function () {
loading_examine.close();
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
}
})
} else {
that.$message({
type: "error",
message: res.message,
duration: 3000,
onClose: function () {
loading_examine.close();
}
})
}
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
},
getSummaries: function (param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (index === 2) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = param.data.length + ' 种';
}
if (index === 10) {
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return parseFloat((prev + curr).toFixed(2));
} else {
return prev;
}
}, 0);
sums[index] += ' 元';
} else {
sums[index] = '';
}
}
});
return sums;
},
//继续盘点获取列表记录
getRecord: function () {
if (this.inventory_id) {
$.ajax({
url: "{:U('draftsList')}",
type: "post",
data: {inventory_order_id: this.inventory_id},
success: (res) => {
if (res.status == 1) {
this.goodsList = res.data;
}
}
})
}
},
/**
* @description: 打开串号选择窗口
* @param {Number} index: 当前商品索引
*/
insertSerial(index) {
this.dialogType = 'insert'
this.serialDataType = ''
this.serialVisible = true
this.serialGoodsIndex = index
this.serialGoodsData = this.goodsList[index]
this.serialData = []
const serialList = this.goodsList[index].serial_list
if (serialList && typeof serialList == 'object' && serialList.length > 0) {
serialList.forEach(serial => {
this.serialData.push({
mainSerial: serial.main_serial_number,
assistSerial1: serial.auxiliary_serial_number_one,
assistSerial2: serial.auxiliary_serial_number_two
})
})
}
},
/**
* @description: 打开串号详情窗口
* @param {Number} index: 当前商品索引
*/
detailsSerial(index) {
this.serialData = []
this.dialogType = 'details'
this.serialDataType = 'supplyInventory'
this.serialVisible = true
this.serialGoodsData = this.goodsList[index]
},
/**
* @description: 串号子组件通道
* @param {Array} datas: 串号数据
* @param {Number} goodsIndex: 当前采购的商品索引
*/
serialChange(datas, goodsIndex) {
const serialList = []
datas.forEach(data => {
serialList.push({
main_serial_number: data.mainSerial,
auxiliary_serial_number_one: data.assistSerial1,
auxiliary_serial_number_two: data.assistSerial2
})
})
const goods = this.goodsList[goodsIndex]
goods.serial_list = serialList
this.$set(goods, 'inventory_num', serialList.length)
this.numVerification(goods.inventory_num, goods.goods_num, goods.pricing_method, goods.cost_price, goodsIndex)
}
},
created() {
this.getRecord();
}
})
</script>
</html>

查看文件

@@ -0,0 +1,299 @@
<!doctype html>
<html>
<!--[1.7.90]-->
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
<link rel="stylesheet" href="/Public/css/component-serial.css?v=1.0.0">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/layui-v2.4.3/layui/layui.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
body {
padding: 20px;
}
[v-cloak] {
display: none;
}
th {
background-color: #f5f7fa !important;
}
th>.cell {
white-space: nowrap !important;
text-align: center;
}
th,
td {
text-align: center;
line-height: 30px;
padding: 0;
}
th>.cell,
td>.cell {
text-align: center;
}
.el-pagination {
padding: 8px;
}
.el-input {
width: 200px;
}
.el-table__row>td:last-child>.cell {
white-space: nowrap;
}
.center-content {
margin: 20px 0;
display: flex;
justify-content: space-between;
align-items: center;
}
.center-content .el-input__inner {
padding: 0 15px;
text-align: left;
}
.small-dialog-content {
margin-left: calc(7% + 40px);
}
.goods_title {
padding: 10px 0;
}
.el-input {
margin-bottom: 10px;
}
.details-all {
padding: 10px;
background: #f5f7fa;
color: #606266;
border: 1px solid #ebeef5;
border-top: none;
margin-bottom: 20px;
}
.details-all-lists {
font-size: 14px;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
width: 100%;
}
.details-all-list {
width: 33%;
}
.form-textarea {
margin-bottom: 20px;
}
.form-textarea-title {
margin-bottom: 20px;
}
.form-button {
display: flex;
justify-content: flex-end;
}
.el-textarea.is-disabled .el-textarea__inner {
background-color: #f5f7fa;
border-color: #e4e7ed;
cursor: not-allowed;
}
</style>
</head>
<body>
<div id="details" v-cloak>
<div style="text-align: left;margin-bottom: 10px;">
<if condition="$print_type neq 1">
<div>
<el-select v-model="status" placeholder="盈亏数量" clearable>
<el-option value="1" label="盘盈数量"></el-option>
<el-option value="2" label="盘亏数量"></el-option>
<el-option value="0" label="无盈亏"></el-option>
</el-select>
<el-button type="primary" plain @click="search" size="small">搜索</el-button>
<if condition="$authArr['exportOperation'] eq true">
<el-button type="primary" plain @click="exportOperation" size="small">导出</el-button>
<el-button type="primary" plain @click="print" size="small">打印</el-button>
</if>
</div>
</if>
</div>
<div class="details-all">
<div class="details-all-lists">
<div class="details-all-list">
盘点单号:<span>{{order_number}}</span>
</div>
<div class="details-all-list">
盘点仓库:<span>{{warehouse}}</span>
</div>
<div class="details-all-list">
盘点时间:<span>{{add_time}}</span>
</div>
<div class="details-all-list">
合计:<span>{{goods_species}}种</span>
</div>
<div class="details-all-list">
盈亏数量:<span>{{quantity}}</span>
</div>
<div class="details-all-list">
盈亏金额:<span>{{amount}}</span>
</div>
<div class="details-all-list">
状态:<span>{{type_name}}</span>
</div>
</div>
</div>
<div style="border: 1px solid rgb(230, 230, 230);">
<el-table border :data="detailsList" style="width:calc(100% - 1px); box-sizing: border-box; border: none;"
size="mini" max-height="500" v-loading="loading" element-loading-text="数据获取中"
element-loading-spinner="el-icon-loading">
<el-table-column prop="index" label="序号" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_name" label="商品名称" show-overflow-tooltip></el-table-column>
<el-table-column prop="sku_name" label="规格" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_number" label="货号" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_code" label="条码" show-overflow-tooltip></el-table-column>
<el-table-column prop="company" label="单位" show-overflow-tooltip></el-table-column>
<el-table-column prop="sku_num" label="规格基数" show-overflow-tooltip></el-table-column>
<el-table-column prop="cost_price" label="成本价" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_num" label="原库存" show-overflow-tooltip></el-table-column>
<el-table-column prop="inventory_num" label="盘点数量" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" size="mini" @click="detailsSerial(scope.$index)"
v-if="scope.row.serial_number_state == 1 && scope.row.inventory_num > 0">
{{scope.row.inventory_num}}
</el-button>
<span v-else>{{scope.row.inventory_num}}</span>
</template>
</el-table-column>
<el-table-column prop="num" label="盈亏数量" show-overflow-tooltip></el-table-column>
<el-table-column prop="subtotal" label="盈亏小计" show-overflow-tooltip></el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
</el-table>
</div>
<div class="form-textarea" style="margin-top: 10px;">
<div class="form-textarea-title">订单备注</div>
<el-input type="textarea" :rows="2" :disabled="true" v-model="remarks">
</el-input>
</div>
<component-serial :visible.sync="serialVisible" :parent-data="serialGoodsData" get-data-type="inventoryDetails">
</component-serial>
</div>
</body>
<script src="/Public/js/component-serial.js?v=1.0.0"></script>
<script src="/Public/js/common.js"></script>
<script type="text/javascript">
layui.use('layer', function () {
var details = new Vue({
el: "#details",
data: function () {
return {
id: "{$id}",
detailsList: [],
warehouse: "{$warehouse}",
add_time: "{$info['add_time']}",
order_number: "{$info['order_number']}",
goods_species: "{$info['goods_species']}",
quantity: "{$info['quantity']}",
amount: "{$info['amount']}",
remarks: "{$info['remarks']}",
type_name: "{$info['type_name']}",
loading: true,
status: "{$status}",
serialVisible: false, //串号录入窗口开关
serialGoodsData: {}, //串号录入当前商品数据对象
}
},
methods: {
//打印
print: function () {
var that = this;
layer.open({
type: 2,
content: "{:U('WebPrint/PurchaseSale')}?id={$id}&type=3&warehouse={$warehouse}&add_time={$info['add_time']}&order_number={$info['order_number']}&goods_species={$info['goods_species']}&quantity={$info['quantity']}&amount={$info['amount']}&remarks={$info['remarks']}&operator={$operator}",
title: "打印",
area: ['100%', '100%'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: function () {
that.getData();
}
})
},
//导出
exportOperation: function () {
var id = this.id;
var status = this.status;
window.location.href = "{:U('detailsExport')}?id=" + id + '&status=' + status;
},
//搜索
search: function () {
this.getData();
},
//查询
getData: function () {
var that = this;
that.loading = true;
var id = that.id;
var status = that.status;
$.ajax({
url: "{:U('detailsList')}",
type: "post",
data: {
id: id,
status: status
},
success: function (res) {
that.loading = false;
that.detailsList = res.data.list;
that.goods_species = res.data.goods_species;
that.quantity = res.data.quantity;
that.amount = res.data.amount;
}
})
},
/**
* @description: 打开串号详情窗口
* @param {Number} index: 当前商品索引
*/
detailsSerial(index) {
this.serialVisible = true
this.serialGoodsData = this.detailsList[index]
},
},
created: function () {
this.getData();
}
})
})
</script>
</html>

查看文件

@@ -0,0 +1,207 @@
<!--[1.7.90]-->
<style>
th {
background-color: #f5f7fa !important;
}
th > .cell {
white-space: nowrap !important;
text-align: center;
}
th, td {
text-align: center;
line-height: 30px;
padding: 0;
}
th > .cell, td > .cell {
text-align: center;
}
.el-pagination {
padding: 8px;
}
.el-table__row > td:last-child > .cell {
white-space: nowrap;
}
.center-content {
margin: 0 0 20px;
display: flex;
justify-content: space-between;
align-items: center;
}
.center-content .el-input__inner {
padding: 0 15px;
text-align: left;
}
.el-input {
margin-bottom: 10px;
}
.el-range-editor--small .el-range-separator {
line-height: 32px;
}
</style>
<div class="purchaseBox" id="purchase" v-cloak>
<div class="center-content">
<div>
<el-input placeholder="盘点单号"
style="width: 200px"
type="text"
size="small"
clearable
@keydown.enter.exact.native.prevent="search"
v-model="order_number"></el-input>
<date-picker-range :date-time.sync="add_time"></date-picker-range>
<el-button type="primary" @click="search" size="small">搜索</el-button>
<if condition="$authArr['addInventoryOrder'] eq true">
<el-button type="primary" plain @click="addInventoryOrder(0)" size="small">新增</el-button>
</if>
<el-button @click="exportOperation" size="small">导出</el-button>
</div>
</div>
<div style="border: 1px solid #e6e6e6;max-width: calc(100vw - 208px);">
<el-table border :data="InventoryList" style="width: calc(100vw - 208px);border: none;"
size="mini"
max-height="500"
v-loading="loading"
element-loading-text="数据获取中"
element-loading-spinner="el-icon-loading">
<el-table-column prop="index" label="序号" show-overflow-tooltip></el-table-column>
<el-table-column prop="order_number" label="盘点单号" show-overflow-tooltip></el-table-column>
<el-table-column prop="warehouse_name" label="盘点仓库" show-overflow-tooltip></el-table-column>
<el-table-column prop="operator" label="操作人" show-overflow-tooltip></el-table-column>
<el-table-column prop="add_time" label="盘点时间" show-overflow-tooltip></el-table-column>
<el-table-column prop="goods_species" label="商品总种类" show-overflow-tooltip></el-table-column>
<el-table-column prop="quantity" label="盈亏数量" show-overflow-tooltip></el-table-column>
<el-table-column prop="amount" label="盈亏金额" show-overflow-tooltip></el-table-column>
<el-table-column prop="remarks" label="备注" show-overflow-tooltip></el-table-column>
<el-table-column prop="status_name" label="状态" show-overflow-tooltip></el-table-column>
<el-table-column fixed="right" label="操作" width="150px" style="border-right: none;">
<template slot-scope="scope">
<if condition="$authArr['OrderInfo'] eq true">
<el-button @click="OrderInfo(scope.row.id,scope.row.operator)" type="text" size="small">盘点详情
</el-button>
</if>
<if condition="$authArr['addInventoryOrder'] eq true">
<el-button @click="addInventoryOrder(scope.row.id)" type="text" size="small"
v-if="scope.row.status == 2">继续盘点
</el-button>
</if>
</template>
</el-table-column>
</el-table>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
:page-size="100"
layout="total, sizes, prev, pager, next, jumper"
:total="currentLen">
</el-pagination>
</div>
</div>
<script type="text/javascript">
var purchase = new Vue({
el: "#purchase",
data: function () {
return {
order_number: "",
add_time: "",
InventoryList: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
loading: true,
}
},
methods: {
handleSizeChange: function (val) {
this.currentLimit = val;//切换每页数量
this.currentPage = 1;
this.getData();
},
handleCurrentChange: function (val) {
this.currentPage = val;
this.getData();//切换页数
},
//搜索
search: function () {
this.currentPage = 1;
this.getData();
},
//查询
getData: function () {
var that = this;
that.loading = true;
var page = that.currentPage;
var limit = that.currentLimit;
var order_number = that.order_number;
var add_time = that.add_time;
$.ajax({
url: "{:U('InventoryList')}",
type: "post",
data: {
page: page,
limit: limit,
order_number: order_number,
add_time: add_time,
},
success: function (res) {
that.InventoryList = res.data;
that.loading = false;
that.$nextTick(function () {
that.currentLen = parseInt(res.count);
})
}
})
},
addInventoryOrder: function (inventory_id) {
var that = this;
layer.open({
type: 2,
content: "{:U('addInventory')}?inventory_id=" + inventory_id,
title: "盘点单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
end: function () {
that.getData();
}
})
},
//详情
OrderInfo: function (id, operator) {
var that = this;
layer.open({
type: 2,
content: "{:U('details')}?id=" + id + '&operator=' + operator,
title: "详情",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
offset: 'rb',
shade: 0,
btnAlign: 'c',
})
},
//导出
exportOperation: function () {
var that = this;
var order_number = that.order_number;
var add_time = that.add_time;
window.location.href = "{:U('export')}?order_number=" + order_number + "&add_time=" + add_time
}
},
created: function () {
this.getData();
}
})
</script>