|
@@ -67,28 +67,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<!-- <div class="col-xs-12">-->
|
|
|
-<!-- <div class="form-group">-->
|
|
|
-<!-- <label class="col-sm-3 control-label is-required">商品库存:</label>-->
|
|
|
-<!-- <div class="col-sm-8">-->
|
|
|
-<!-- <input name="goodsInventory" class="form-control" type="text" required>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- <div class="col-xs-12">-->
|
|
|
-<!-- <div class="form-group">-->
|
|
|
-<!-- <label class="col-sm-3 control-label is-required">库存成本:</label>-->
|
|
|
-<!-- <div class="col-sm-8">-->
|
|
|
-<!-- <input name="inventoryCost" class="form-control" type="text" required>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
-<!-- </div>-->
|
|
|
<div class="col-xs-12">
|
|
|
<div class="form-group">
|
|
|
<label class="col-sm-3 control-label">商品状态:</label>
|
|
|
<div class="col-sm-8">
|
|
|
- <select name="goodsState" class="form-control" th:with="type=${@dict.getType('sys_normal_disable')}">
|
|
|
- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
+ <select name="goodsState" class="form-control" th:with="type=${@dict.getType('goods_state')}" disabled>
|
|
|
+ <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:attr="selected=${dict.dictValue == '1'}"></option>
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -99,7 +83,8 @@
|
|
|
<div class="col-sm-8">
|
|
|
<input type="hidden" name="goodsImg">
|
|
|
<div class="file-loading">
|
|
|
- <input class="form-control file-upload" id="goodsImg" name="file" type="file">
|
|
|
+<!-- <input class="form-control file-upload" id="goodsImg" name="file" type="file" multiple accept=".png, .jpg" onchange="validateFiles(this)">-->
|
|
|
+ <input class="form-control file-upload" id="goodsImg" name="file" type="file" multiple >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -138,13 +123,32 @@
|
|
|
|
|
|
$(".file-upload").fileinput({
|
|
|
uploadUrl: ctx + 'common/upload',
|
|
|
- maxFileCount: 1,
|
|
|
- autoReplace: true
|
|
|
+ maxFileCount: 5,
|
|
|
+ allowedFileExtensions:['jpg','png'],
|
|
|
+ maxFileSize: 10240,
|
|
|
+ multiple: true,
|
|
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
|
|
- $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
|
|
|
+ var inputName = event.currentTarget.id;
|
|
|
+ var existingValue = $("input[name='" + inputName + "']").val();
|
|
|
+ var newValue = data.response.url;
|
|
|
+
|
|
|
+ // 如果已经存在值,则在后面加上逗号分隔的新值
|
|
|
+ if (existingValue) {
|
|
|
+ $("input[name='" + inputName + "']").val(existingValue + ',' + newValue);
|
|
|
+ } else {
|
|
|
+ $("input[name='" + inputName + "']").val(newValue);
|
|
|
+ }
|
|
|
}).on('fileremoved', function (event, id, index) {
|
|
|
- $("input[name='" + event.currentTarget.id + "']").val('')
|
|
|
- })
|
|
|
+ var inputName = event.currentTarget.id;
|
|
|
+ var existingValue = $("input[name='" + inputName + "']").val();
|
|
|
+ var fileUrls = existingValue.split(',');
|
|
|
+
|
|
|
+ // 移除对应的文件路径
|
|
|
+ fileUrls.splice(index, 1);
|
|
|
+
|
|
|
+ // 重新拼接文件路径
|
|
|
+ $("input[name='" + inputName + "']").val(fileUrls.join(','));
|
|
|
+ });
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|